Skip to content

Commit

Permalink
fix(Creators-of-Create#4527): prevent hand crank from draining hunger…
Browse files Browse the repository at this point in the history
… using extendo grip (Creators-of-Create#4539)
  • Loading branch information
Xstoudi authored Mar 13, 2023
1 parent b50b229 commit ce955e9
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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;
Expand Down Expand Up @@ -74,7 +75,8 @@ public InteractionResult use(BlockState state, Level worldIn, BlockPos pos, Play
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)
Expand Down Expand Up @@ -117,14 +119,14 @@ public void neighborChanged(BlockState state, Level worldIn, BlockPos pos, Block
}
}
}

@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);
Expand Down

0 comments on commit ce955e9

Please sign in to comment.