diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java index 007cc7f1c..bb1459491 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java @@ -183,6 +183,8 @@ public class BeltTileEntity extends KineticTileEntity { @Override public LazyOptional getCapability(Capability cap, Direction side) { + if (!isRemoved() && !itemHandler.isPresent()) + initializeItemHandler(); if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { if (side == Direction.UP || BeltBlock.canAccessFromSide(side, getBlockState())) { return itemHandler.cast(); diff --git a/src/main/java/com/simibubi/create/content/curiosities/girder/GirderEncasedShaftBlock.java b/src/main/java/com/simibubi/create/content/curiosities/girder/GirderEncasedShaftBlock.java index ae514be8f..0a74a1a29 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/girder/GirderEncasedShaftBlock.java +++ b/src/main/java/com/simibubi/create/content/curiosities/girder/GirderEncasedShaftBlock.java @@ -8,6 +8,8 @@ import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.HorizontalAxisKineticBlock; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.wrench.IWrenchable; +import com.simibubi.create.content.schematics.ISpecialBlockItemRequirement; +import com.simibubi.create.content.schematics.ItemRequirement; import com.simibubi.create.foundation.block.ITE; import net.minecraft.core.BlockPos; @@ -22,6 +24,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.SimpleWaterloggedBlock; +import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition.Builder; @@ -34,7 +37,7 @@ import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; public class GirderEncasedShaftBlock extends HorizontalAxisKineticBlock - implements ITE, SimpleWaterloggedBlock, IWrenchable { + implements ITE, SimpleWaterloggedBlock, IWrenchable, ISpecialBlockItemRequirement { public static final BooleanProperty TOP = GirderBlock.TOP; public static final BooleanProperty BOTTOM = GirderBlock.BOTTOM; @@ -123,4 +126,10 @@ public class GirderEncasedShaftBlock extends HorizontalAxisKineticBlock return state.setValue(WATERLOGGED, Boolean.valueOf(ifluidstate.getType() == Fluids.WATER)); } + @Override + public ItemRequirement getRequiredItems(BlockState state, BlockEntity te) { + return ItemRequirement.of(AllBlocks.SHAFT.getDefaultState(), te) + .union(ItemRequirement.of(AllBlocks.METAL_GIRDER.getDefaultState(), te)); + } + } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/AllArmInteractionPointTypes.java b/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/AllArmInteractionPointTypes.java index c72e81221..13f92d435 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/AllArmInteractionPointTypes.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/AllArmInteractionPointTypes.java @@ -34,6 +34,7 @@ import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.Vec3i; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.Containers; import net.minecraft.world.InteractionResultHolder; @@ -501,16 +502,17 @@ public class AllArmInteractionPointTypes { @Override protected Vec3 getInteractionPositionVector() { + Direction funnelFacing = FunnelBlock.getFunnelFacing(cachedState); + Vec3i normal = funnelFacing != null ? funnelFacing.getNormal() : Vec3i.ZERO; return VecHelper.getCenterOf(pos) - .add(Vec3.atLowerCornerOf(FunnelBlock.getFunnelFacing(cachedState) - .getNormal()) + .add(Vec3.atLowerCornerOf(normal) .scale(-.15f)); } @Override protected Direction getInteractionDirection() { - return FunnelBlock.getFunnelFacing(cachedState) - .getOpposite(); + Direction funnelFacing = FunnelBlock.getFunnelFacing(cachedState); + return funnelFacing != null ? funnelFacing.getOpposite() : Direction.UP; } @Override