From ce955e9fcd2e0f27adfb8423312e00937aaf262d Mon Sep 17 00:00:00 2001 From: Xavier Stouder Date: Mon, 13 Mar 2023 20:31:28 +0100 Subject: [PATCH] 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);