fix(#4527): prevent hand crank from draining hunger using extendo grip (#4539)

This commit is contained in:
Xavier Stouder 2023-03-13 20:31:28 +01:00 committed by GitHub
parent b50b22938b
commit ce955e9fcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,6 +75,7 @@ public class HandCrankBlock extends DirectionalKineticBlock
return InteractionResult.PASS;
withTileEntityDo(worldIn, pos, te -> te.turn(player.isShiftKeyDown()));
if(!player.getItemInHand(handIn).is(AllItems.EXTENDO_GRIP.get()))
player.causeFoodExhaustion(getRotationSpeed() * AllConfigs.SERVER.kinetics.crankHungerMultiplier.getF());
if (player.getFoodData()