From ce955e9fcd2e0f27adfb8423312e00937aaf262d Mon Sep 17 00:00:00 2001 From: Xavier Stouder Date: Mon, 13 Mar 2023 20:31:28 +0100 Subject: [PATCH 1/2] fix(#4527): prevent hand crank from draining hunger using extendo grip (#4539) --- .../contraptions/components/crank/HandCrankBlock.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankBlock.java index 96cb2a8ba..cdf8c260a 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankBlock.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.components.crank; import com.jozufozu.flywheel.core.PartialModel; import com.simibubi.create.AllBlockPartials; +import com.simibubi.create.AllItems; import com.simibubi.create.AllShapes; import com.simibubi.create.AllTileEntities; import com.simibubi.create.content.contraptions.base.DirectionalKineticBlock; @@ -74,7 +75,8 @@ public class HandCrankBlock extends DirectionalKineticBlock return InteractionResult.PASS; withTileEntityDo(worldIn, pos, te -> te.turn(player.isShiftKeyDown())); - player.causeFoodExhaustion(getRotationSpeed() * AllConfigs.SERVER.kinetics.crankHungerMultiplier.getF()); + if(!player.getItemInHand(handIn).is(AllItems.EXTENDO_GRIP.get())) + player.causeFoodExhaustion(getRotationSpeed() * AllConfigs.SERVER.kinetics.crankHungerMultiplier.getF()); if (player.getFoodData() .getFoodLevel() == 0) @@ -117,14 +119,14 @@ public class HandCrankBlock extends DirectionalKineticBlock } } } - + @Override public BlockState updateShape(BlockState pState, Direction pDirection, BlockState pNeighborState, LevelAccessor pLevel, BlockPos pCurrentPos, BlockPos pNeighborPos) { updateWater(pLevel, pState, pCurrentPos); return pState; } - + @Override public FluidState getFluidState(BlockState pState) { return fluidState(pState); From c2977bbffff4c1b1b3cfb2311fdd42e51b05749c Mon Sep 17 00:00:00 2001 From: caelwarner Date: Tue, 14 Mar 2023 14:26:28 -0700 Subject: [PATCH 2/2] Fixed GirderEncasedShaftBlock's default blockstate - GirderEncasedShaftBlock was missing entries for WATERLOGGED, TOP and BOTTOM in its default blockstate - Fixes #4550 --- .../content/curiosities/girder/GirderEncasedShaftBlock.java | 4 ++++ 1 file changed, 4 insertions(+) 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 0a74a1a29..0d507b4a4 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 @@ -44,6 +44,10 @@ public class GirderEncasedShaftBlock extends HorizontalAxisKineticBlock public GirderEncasedShaftBlock(Properties properties) { super(properties); + registerDefaultState(super.defaultBlockState() + .setValue(WATERLOGGED, false) + .setValue(TOP, false) + .setValue(BOTTOM, false)); } @Override