Merge remote-tracking branch 'origin/mc1.17/dev' into mc1.18/dev

# Conflicts:
#	src/main/java/com/simibubi/create/foundation/tileEntity/SmartTileEntity.java
This commit is contained in:
reidbhuntley 2021-12-21 16:40:14 -05:00
commit 75d4295118
11 changed files with 247 additions and 27 deletions

View file

@ -2125,7 +2125,7 @@ d080b1b25e5bc8baf5aee68691b08c7f12ece3b0 assets/create/models/item/windmill_bear
a80fb25a0b655e76be986b5b49fcb0f03461a1ab assets/create/models/item/zinc_nugget.json a80fb25a0b655e76be986b5b49fcb0f03461a1ab assets/create/models/item/zinc_nugget.json
b1689617190c05ef34bd18456b0c7ae09bb3210f assets/create/models/item/zinc_ore.json b1689617190c05ef34bd18456b0c7ae09bb3210f assets/create/models/item/zinc_ore.json
5049f72c327a88f175f6f9425909e098fc711100 assets/create/sounds.json 5049f72c327a88f175f6f9425909e098fc711100 assets/create/sounds.json
5d0cc4c0255dc241e61c173b31ddca70c88d08e4 data/create/advancements/aesthetics.json 0f1b4b980afba9bf2caf583b88e261bba8b10313 data/create/advancements/aesthetics.json
613e64b44bed959da899fdd54c1cacb227fb33f2 data/create/advancements/andesite_alloy.json 613e64b44bed959da899fdd54c1cacb227fb33f2 data/create/advancements/andesite_alloy.json
81885c6bfb85792c88aaa7c9b70f58832945d31f data/create/advancements/andesite_casing.json 81885c6bfb85792c88aaa7c9b70f58832945d31f data/create/advancements/andesite_casing.json
83c046bd200623933545c9e4326f782fb02c87fa data/create/advancements/arm_blaze_burner.json 83c046bd200623933545c9e4326f782fb02c87fa data/create/advancements/arm_blaze_burner.json
@ -5210,7 +5210,7 @@ ff1900963bc4cd8ceffa78d58ef1952ceacb2fb7 data/forge/tags/items/storage_blocks/br
9f7a428085b1aac66da32a43e9d51c7efc1f0d81 data/minecraft/tags/blocks/beacon_base_blocks.json 9f7a428085b1aac66da32a43e9d51c7efc1f0d81 data/minecraft/tags/blocks/beacon_base_blocks.json
69f596fcb065e26b02ce246760432b5174191b76 data/minecraft/tags/blocks/impermeable.json 69f596fcb065e26b02ce246760432b5174191b76 data/minecraft/tags/blocks/impermeable.json
59681910c06f8b7385c6641a409d352056235506 data/minecraft/tags/blocks/mineable/axe.json 59681910c06f8b7385c6641a409d352056235506 data/minecraft/tags/blocks/mineable/axe.json
7d948c24605906ac26e44258f8eac04aa1ddfac4 data/minecraft/tags/blocks/mineable/pickaxe.json f8c66b3808efb61d2d928748783bb7eb8a1357f9 data/minecraft/tags/blocks/mineable/pickaxe.json
e157c1d3af30e409e34bbefbe15a037e6e1c8daa data/minecraft/tags/blocks/needs_iron_tool.json e157c1d3af30e409e34bbefbe15a037e6e1c8daa data/minecraft/tags/blocks/needs_iron_tool.json
a08f67865337f62601c5e333b4011382d10020e4 data/minecraft/tags/blocks/needs_stone_tool.json a08f67865337f62601c5e333b4011382d10020e4 data/minecraft/tags/blocks/needs_stone_tool.json
6bcabbc1c0479caa80a0ebc676bb34ce0052efb0 data/minecraft/tags/blocks/rails.json 6bcabbc1c0479caa80a0ebc676bb34ce0052efb0 data/minecraft/tags/blocks/rails.json

View file

@ -28,8 +28,8 @@
"trigger": "create:bracket_apply", "trigger": "create:bracket_apply",
"conditions": { "conditions": {
"accepted_entries": [ "accepted_entries": [
"create:large_cogwheel", "create:cogwheel",
"create:cogwheel" "create:large_cogwheel"
] ]
} }
}, },

View file

@ -189,94 +189,262 @@
"create:waxed_weathered_copper_tile_stairs", "create:waxed_weathered_copper_tile_stairs",
"create:waxed_oxidized_copper_tile_stairs", "create:waxed_oxidized_copper_tile_stairs",
"create:cut_granite", "create:cut_granite",
"create:cut_granite_stairs",
"create:cut_granite_slab",
"create:cut_granite_wall",
"create:polished_cut_granite", "create:polished_cut_granite",
"create:polished_cut_granite_stairs",
"create:polished_cut_granite_slab",
"create:polished_cut_granite_wall",
"create:cut_granite_bricks", "create:cut_granite_bricks",
"create:cut_granite_brick_stairs",
"create:cut_granite_brick_slab",
"create:cut_granite_brick_wall",
"create:small_granite_bricks", "create:small_granite_bricks",
"create:small_granite_brick_stairs",
"create:small_granite_brick_slab",
"create:small_granite_brick_wall",
"create:layered_granite", "create:layered_granite",
"create:granite_pillar", "create:granite_pillar",
"create:cut_diorite", "create:cut_diorite",
"create:cut_diorite_stairs",
"create:cut_diorite_slab",
"create:cut_diorite_wall",
"create:polished_cut_diorite", "create:polished_cut_diorite",
"create:polished_cut_diorite_stairs",
"create:polished_cut_diorite_slab",
"create:polished_cut_diorite_wall",
"create:cut_diorite_bricks", "create:cut_diorite_bricks",
"create:cut_diorite_brick_stairs",
"create:cut_diorite_brick_slab",
"create:cut_diorite_brick_wall",
"create:small_diorite_bricks", "create:small_diorite_bricks",
"create:small_diorite_brick_stairs",
"create:small_diorite_brick_slab",
"create:small_diorite_brick_wall",
"create:layered_diorite", "create:layered_diorite",
"create:diorite_pillar", "create:diorite_pillar",
"create:cut_andesite", "create:cut_andesite",
"create:cut_andesite_stairs",
"create:cut_andesite_slab",
"create:cut_andesite_wall",
"create:polished_cut_andesite", "create:polished_cut_andesite",
"create:polished_cut_andesite_stairs",
"create:polished_cut_andesite_slab",
"create:polished_cut_andesite_wall",
"create:cut_andesite_bricks", "create:cut_andesite_bricks",
"create:cut_andesite_brick_stairs",
"create:cut_andesite_brick_slab",
"create:cut_andesite_brick_wall",
"create:small_andesite_bricks", "create:small_andesite_bricks",
"create:small_andesite_brick_stairs",
"create:small_andesite_brick_slab",
"create:small_andesite_brick_wall",
"create:layered_andesite", "create:layered_andesite",
"create:andesite_pillar", "create:andesite_pillar",
"create:cut_calcite", "create:cut_calcite",
"create:cut_calcite_stairs",
"create:cut_calcite_slab",
"create:cut_calcite_wall",
"create:polished_cut_calcite", "create:polished_cut_calcite",
"create:polished_cut_calcite_stairs",
"create:polished_cut_calcite_slab",
"create:polished_cut_calcite_wall",
"create:cut_calcite_bricks", "create:cut_calcite_bricks",
"create:cut_calcite_brick_stairs",
"create:cut_calcite_brick_slab",
"create:cut_calcite_brick_wall",
"create:small_calcite_bricks", "create:small_calcite_bricks",
"create:small_calcite_brick_stairs",
"create:small_calcite_brick_slab",
"create:small_calcite_brick_wall",
"create:layered_calcite", "create:layered_calcite",
"create:calcite_pillar", "create:calcite_pillar",
"create:cut_dripstone", "create:cut_dripstone",
"create:cut_dripstone_stairs",
"create:cut_dripstone_slab",
"create:cut_dripstone_wall",
"create:polished_cut_dripstone", "create:polished_cut_dripstone",
"create:polished_cut_dripstone_stairs",
"create:polished_cut_dripstone_slab",
"create:polished_cut_dripstone_wall",
"create:cut_dripstone_bricks", "create:cut_dripstone_bricks",
"create:cut_dripstone_brick_stairs",
"create:cut_dripstone_brick_slab",
"create:cut_dripstone_brick_wall",
"create:small_dripstone_bricks", "create:small_dripstone_bricks",
"create:small_dripstone_brick_stairs",
"create:small_dripstone_brick_slab",
"create:small_dripstone_brick_wall",
"create:layered_dripstone", "create:layered_dripstone",
"create:dripstone_pillar", "create:dripstone_pillar",
"create:cut_deepslate", "create:cut_deepslate",
"create:cut_deepslate_stairs",
"create:cut_deepslate_slab",
"create:cut_deepslate_wall",
"create:polished_cut_deepslate", "create:polished_cut_deepslate",
"create:polished_cut_deepslate_stairs",
"create:polished_cut_deepslate_slab",
"create:polished_cut_deepslate_wall",
"create:cut_deepslate_bricks", "create:cut_deepslate_bricks",
"create:cut_deepslate_brick_stairs",
"create:cut_deepslate_brick_slab",
"create:cut_deepslate_brick_wall",
"create:small_deepslate_bricks", "create:small_deepslate_bricks",
"create:small_deepslate_brick_stairs",
"create:small_deepslate_brick_slab",
"create:small_deepslate_brick_wall",
"create:layered_deepslate", "create:layered_deepslate",
"create:deepslate_pillar", "create:deepslate_pillar",
"create:cut_tuff", "create:cut_tuff",
"create:cut_tuff_stairs",
"create:cut_tuff_slab",
"create:cut_tuff_wall",
"create:polished_cut_tuff", "create:polished_cut_tuff",
"create:polished_cut_tuff_stairs",
"create:polished_cut_tuff_slab",
"create:polished_cut_tuff_wall",
"create:cut_tuff_bricks", "create:cut_tuff_bricks",
"create:cut_tuff_brick_stairs",
"create:cut_tuff_brick_slab",
"create:cut_tuff_brick_wall",
"create:small_tuff_bricks", "create:small_tuff_bricks",
"create:small_tuff_brick_stairs",
"create:small_tuff_brick_slab",
"create:small_tuff_brick_wall",
"create:layered_tuff", "create:layered_tuff",
"create:tuff_pillar", "create:tuff_pillar",
"create:asurine", "create:asurine",
"create:cut_asurine", "create:cut_asurine",
"create:cut_asurine_stairs",
"create:cut_asurine_slab",
"create:cut_asurine_wall",
"create:polished_cut_asurine", "create:polished_cut_asurine",
"create:polished_cut_asurine_stairs",
"create:polished_cut_asurine_slab",
"create:polished_cut_asurine_wall",
"create:cut_asurine_bricks", "create:cut_asurine_bricks",
"create:cut_asurine_brick_stairs",
"create:cut_asurine_brick_slab",
"create:cut_asurine_brick_wall",
"create:small_asurine_bricks", "create:small_asurine_bricks",
"create:small_asurine_brick_stairs",
"create:small_asurine_brick_slab",
"create:small_asurine_brick_wall",
"create:layered_asurine", "create:layered_asurine",
"create:asurine_pillar", "create:asurine_pillar",
"create:crimsite", "create:crimsite",
"create:cut_crimsite", "create:cut_crimsite",
"create:cut_crimsite_stairs",
"create:cut_crimsite_slab",
"create:cut_crimsite_wall",
"create:polished_cut_crimsite", "create:polished_cut_crimsite",
"create:polished_cut_crimsite_stairs",
"create:polished_cut_crimsite_slab",
"create:polished_cut_crimsite_wall",
"create:cut_crimsite_bricks", "create:cut_crimsite_bricks",
"create:cut_crimsite_brick_stairs",
"create:cut_crimsite_brick_slab",
"create:cut_crimsite_brick_wall",
"create:small_crimsite_bricks", "create:small_crimsite_bricks",
"create:small_crimsite_brick_stairs",
"create:small_crimsite_brick_slab",
"create:small_crimsite_brick_wall",
"create:layered_crimsite", "create:layered_crimsite",
"create:crimsite_pillar", "create:crimsite_pillar",
"create:limestone", "create:limestone",
"create:cut_limestone", "create:cut_limestone",
"create:cut_limestone_stairs",
"create:cut_limestone_slab",
"create:cut_limestone_wall",
"create:polished_cut_limestone", "create:polished_cut_limestone",
"create:polished_cut_limestone_stairs",
"create:polished_cut_limestone_slab",
"create:polished_cut_limestone_wall",
"create:cut_limestone_bricks", "create:cut_limestone_bricks",
"create:cut_limestone_brick_stairs",
"create:cut_limestone_brick_slab",
"create:cut_limestone_brick_wall",
"create:small_limestone_bricks", "create:small_limestone_bricks",
"create:small_limestone_brick_stairs",
"create:small_limestone_brick_slab",
"create:small_limestone_brick_wall",
"create:layered_limestone", "create:layered_limestone",
"create:limestone_pillar", "create:limestone_pillar",
"create:ochrum", "create:ochrum",
"create:cut_ochrum", "create:cut_ochrum",
"create:cut_ochrum_stairs",
"create:cut_ochrum_slab",
"create:cut_ochrum_wall",
"create:polished_cut_ochrum", "create:polished_cut_ochrum",
"create:polished_cut_ochrum_stairs",
"create:polished_cut_ochrum_slab",
"create:polished_cut_ochrum_wall",
"create:cut_ochrum_bricks", "create:cut_ochrum_bricks",
"create:cut_ochrum_brick_stairs",
"create:cut_ochrum_brick_slab",
"create:cut_ochrum_brick_wall",
"create:small_ochrum_bricks", "create:small_ochrum_bricks",
"create:small_ochrum_brick_stairs",
"create:small_ochrum_brick_slab",
"create:small_ochrum_brick_wall",
"create:layered_ochrum", "create:layered_ochrum",
"create:ochrum_pillar", "create:ochrum_pillar",
"create:scoria", "create:scoria",
"create:cut_scoria", "create:cut_scoria",
"create:cut_scoria_stairs",
"create:cut_scoria_slab",
"create:cut_scoria_wall",
"create:polished_cut_scoria", "create:polished_cut_scoria",
"create:polished_cut_scoria_stairs",
"create:polished_cut_scoria_slab",
"create:polished_cut_scoria_wall",
"create:cut_scoria_bricks", "create:cut_scoria_bricks",
"create:cut_scoria_brick_stairs",
"create:cut_scoria_brick_slab",
"create:cut_scoria_brick_wall",
"create:small_scoria_bricks", "create:small_scoria_bricks",
"create:small_scoria_brick_stairs",
"create:small_scoria_brick_slab",
"create:small_scoria_brick_wall",
"create:layered_scoria", "create:layered_scoria",
"create:scoria_pillar", "create:scoria_pillar",
"create:scorchia", "create:scorchia",
"create:cut_scorchia", "create:cut_scorchia",
"create:cut_scorchia_stairs",
"create:cut_scorchia_slab",
"create:cut_scorchia_wall",
"create:polished_cut_scorchia", "create:polished_cut_scorchia",
"create:polished_cut_scorchia_stairs",
"create:polished_cut_scorchia_slab",
"create:polished_cut_scorchia_wall",
"create:cut_scorchia_bricks", "create:cut_scorchia_bricks",
"create:cut_scorchia_brick_stairs",
"create:cut_scorchia_brick_slab",
"create:cut_scorchia_brick_wall",
"create:small_scorchia_bricks", "create:small_scorchia_bricks",
"create:small_scorchia_brick_stairs",
"create:small_scorchia_brick_slab",
"create:small_scorchia_brick_wall",
"create:layered_scorchia", "create:layered_scorchia",
"create:scorchia_pillar", "create:scorchia_pillar",
"create:veridium", "create:veridium",
"create:cut_veridium", "create:cut_veridium",
"create:cut_veridium_stairs",
"create:cut_veridium_slab",
"create:cut_veridium_wall",
"create:polished_cut_veridium", "create:polished_cut_veridium",
"create:polished_cut_veridium_stairs",
"create:polished_cut_veridium_slab",
"create:polished_cut_veridium_wall",
"create:cut_veridium_bricks", "create:cut_veridium_bricks",
"create:cut_veridium_brick_stairs",
"create:cut_veridium_brick_slab",
"create:cut_veridium_brick_wall",
"create:small_veridium_bricks", "create:small_veridium_bricks",
"create:small_veridium_brick_stairs",
"create:small_veridium_brick_slab",
"create:small_veridium_brick_wall",
"create:layered_veridium", "create:layered_veridium",
"create:veridium_pillar" "create:veridium_pillar"
] ]

View file

@ -185,12 +185,17 @@ public class KineticTileEntity extends SmartTileEntity
@Override @Override
public void setRemoved() { public void setRemoved() {
super.setRemoved();
}
@Override
protected void setRemovedNotDueToChunkUnload() {
if (!level.isClientSide) { if (!level.isClientSide) {
if (hasNetwork()) if (hasNetwork())
getOrCreateNetwork().remove(this); getOrCreateNetwork().remove(this);
detachKinetics(); detachKinetics();
} }
super.setRemoved(); super.setRemovedNotDueToChunkUnload();
} }
@Override @Override

View file

@ -86,10 +86,15 @@ public class EngineTileEntity extends SmartTileEntity implements FlywheelRendere
@Override @Override
public void setRemoved() { public void setRemoved() {
detachWheel();
super.setRemoved(); super.setRemoved();
} }
@Override
protected void setRemovedNotDueToChunkUnload() {
detachWheel();
super.setRemovedNotDueToChunkUnload();
}
protected void refreshWheelSpeed() { protected void refreshWheelSpeed() {
if (poweredWheel == null) if (poweredWheel == null)
return; return;

View file

@ -362,9 +362,14 @@ public class ClockworkBearingTileEntity extends KineticTileEntity
@Override @Override
public void setRemoved() { public void setRemoved() {
super.setRemoved();
}
@Override
protected void setRemovedNotDueToChunkUnload() {
if (!level.isClientSide) if (!level.isClientSide)
disassemble(); disassemble();
super.setRemoved(); super.setRemovedNotDueToChunkUnload();
} }
@Override @Override

View file

@ -59,9 +59,14 @@ public class MechanicalBearingTileEntity extends GeneratingKineticTileEntity
@Override @Override
public void setRemoved() { public void setRemoved() {
super.setRemoved();
}
@Override
protected void setRemovedNotDueToChunkUnload() {
if (!level.isClientSide) if (!level.isClientSide)
disassemble(); disassemble();
super.setRemoved(); super.setRemovedNotDueToChunkUnload();
} }
@Override @Override

View file

@ -173,10 +173,15 @@ public abstract class LinearActuatorTileEntity extends KineticTileEntity
@Override @Override
public void setRemoved() { public void setRemoved() {
super.setRemoved();
}
@Override
protected void setRemovedNotDueToChunkUnload() {
this.remove = true; this.remove = true;
if (!level.isClientSide) if (!level.isClientSide)
disassemble(); disassemble();
super.setRemoved(); super.setRemovedNotDueToChunkUnload();
} }
@Override @Override

View file

@ -197,12 +197,17 @@ public class BasinTileEntity extends SmartTileEntity implements IHaveGoggleInfor
@Override @Override
public void setRemoved() { public void setRemoved() {
onEmptied();
itemCapability.invalidate(); itemCapability.invalidate();
fluidCapability.invalidate(); fluidCapability.invalidate();
super.setRemoved(); super.setRemoved();
} }
@Override
protected void setRemovedNotDueToChunkUnload() {
onEmptied();
super.setRemovedNotDueToChunkUnload();
}
@Nonnull @Nonnull
@Override @Override
public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, Direction side) { public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, Direction side) {

View file

@ -31,6 +31,8 @@ import net.minecraft.world.level.block.WallBlock;
import net.minecraft.world.level.block.state.BlockBehaviour.Properties; import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
import net.minecraftforge.client.model.generators.ModelFile; import net.minecraftforge.client.model.generators.ModelFile;
import static com.simibubi.create.AllTags.pickaxeOnly;
public abstract class PaletteBlockPartial<B extends Block> { public abstract class PaletteBlockPartial<B extends Block> {
public static final PaletteBlockPartial<StairBlock> STAIR = new Stairs(); public static final PaletteBlockPartial<StairBlock> STAIR = new Stairs();
@ -74,7 +76,7 @@ public abstract class PaletteBlockPartial<B extends Block> {
protected BlockBuilder<B, CreateRegistrate> transformBlock(BlockBuilder<B, CreateRegistrate> builder, protected BlockBuilder<B, CreateRegistrate> transformBlock(BlockBuilder<B, CreateRegistrate> builder,
String variantName, PaletteBlockPattern pattern) { String variantName, PaletteBlockPattern pattern) {
getBlockTags().forEach(builder::tag); getBlockTags().forEach(builder::tag);
return builder; return builder.transform(pickaxeOnly());
} }
protected ItemBuilder<BlockItem, BlockBuilder<B, CreateRegistrate>> transformItem( protected ItemBuilder<BlockItem, BlockBuilder<B, CreateRegistrate>> transformItem(

View file

@ -116,6 +116,32 @@ public abstract class SmartTileEntity extends SyncedTileEntity implements IParti
read(tag, false); read(tag, false);
} }
/* TODO: Remove this hack once this issue is resolved: https://github.com/MinecraftForge/MinecraftForge/issues/8302
Once the PR linked in the issue is accepted, we should use the new method for determining whether setRemoved was
called due to a chunk unload or not, and remove this volatile workaround
*/
private boolean unloaded;
@Override
public void onChunkUnloaded() {
super.onChunkUnloaded();
unloaded = true;
}
protected void setRemovedNotDueToChunkUnload() {
}
@Override
public void setRemoved() {
forEachBehaviour(TileEntityBehaviour::remove);
super.setRemoved();
if (!unloaded) {
setRemovedNotDueToChunkUnload();
}
}
@Override @Override
public final void saveAdditional(CompoundTag tag) { public final void saveAdditional(CompoundTag tag) {
write(tag, false); write(tag, false);
@ -158,12 +184,6 @@ public abstract class SmartTileEntity extends SyncedTileEntity implements IParti
} }
} }
@Override
public void setRemoved() {
forEachBehaviour(TileEntityBehaviour::remove);
super.setRemoved();
}
public void setLazyTickRate(int slowTickRate) { public void setLazyTickRate(int slowTickRate) {
this.lazyTickRate = slowTickRate; this.lazyTickRate = slowTickRate;
this.lazyTickCounter = slowTickRate; this.lazyTickCounter = slowTickRate;