diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperItem.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperItem.java index 952e42022..90f7e067b 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperItem.java @@ -5,6 +5,7 @@ import java.util.List; import com.simibubi.create.AllSoundEvents; import com.simibubi.create.foundation.item.ItemDescription; import com.simibubi.create.foundation.networking.AllPackets; +import com.simibubi.create.foundation.utility.BlockHelper; import com.simibubi.create.foundation.utility.Lang; import net.minecraft.block.BlockState; @@ -147,6 +148,7 @@ public abstract class ZapperItem extends Item { BlockState stateToUse = Blocks.AIR.getDefaultState(); if (nbt.contains("BlockUsed")) stateToUse = NBTUtil.readBlockState(nbt.getCompound("BlockUsed")); + stateToUse = BlockHelper.setZeroAge(stateToUse); // Raytrace - Find the target Vec3d start = player.getPositionVec() diff --git a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonTileEntity.java b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonTileEntity.java index d80dcea62..62733cd75 100644 --- a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonTileEntity.java +++ b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonTileEntity.java @@ -23,6 +23,7 @@ import com.simibubi.create.foundation.item.ItemHelper.ExtractionCountMode; import com.simibubi.create.foundation.tileEntity.SmartTileEntity; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; +import com.simibubi.create.foundation.utility.BlockHelper; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.PistonHeadBlock; @@ -402,7 +403,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC .get(printingEntityIndex)); } else { - blockState = blockReader.getBlockState(target); + blockState = BlockHelper.setZeroAge(blockReader.getBlockState(target)); requirement = ItemRequirement.of(blockState); shouldSkip = !shouldPlace(target, blockState); } diff --git a/src/main/java/com/simibubi/create/foundation/utility/BlockHelper.java b/src/main/java/com/simibubi/create/foundation/utility/BlockHelper.java index 9c1abc718..713875454 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/BlockHelper.java +++ b/src/main/java/com/simibubi/create/foundation/utility/BlockHelper.java @@ -64,6 +64,30 @@ public class BlockHelper { }); } + public static BlockState setZeroAge(BlockState blockState) { + if(blockState.has(BlockStateProperties.AGE_0_1)) + return blockState.with(BlockStateProperties.AGE_0_1, 0); + if(blockState.has(BlockStateProperties.AGE_0_2)) + return blockState.with(BlockStateProperties.AGE_0_2, 0); + if(blockState.has(BlockStateProperties.AGE_0_3)) + return blockState.with(BlockStateProperties.AGE_0_3, 0); + if(blockState.has(BlockStateProperties.AGE_0_5)) + return blockState.with(BlockStateProperties.AGE_0_5, 0); + if(blockState.has(BlockStateProperties.AGE_0_7)) + return blockState.with(BlockStateProperties.AGE_0_7, 0); + if(blockState.has(BlockStateProperties.AGE_0_15)) + return blockState.with(BlockStateProperties.AGE_0_15, 0); + if(blockState.has(BlockStateProperties.AGE_0_25)) + return blockState.with(BlockStateProperties.AGE_0_25, 0); + if(blockState.has(BlockStateProperties.HONEY_LEVEL)) + return blockState.with(BlockStateProperties.HONEY_LEVEL, 0); + if(blockState.has(BlockStateProperties.HATCH_0_2)) + return blockState.with(BlockStateProperties.HATCH_0_2, 0); + if(blockState.has(BlockStateProperties.STAGE_0_1)) + return blockState.with(BlockStateProperties.STAGE_0_1, 0); + return blockState; + } + public static int findAndRemoveInInventory(BlockState block, PlayerEntity player, int amount) { int amountFound = 0; Item required = getRequiredItem(block).getItem();