File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
src/main/java/mekanism/common/item/gear Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 88import mekanism .common .registration .impl .CreativeTabDeferredRegister .ICustomCreativeTabContents ;
99import mekanism .common .registries .MekanismFluids ;
1010import mekanism .common .util .FluidUtils ;
11+ import mekanism .common .util .MekanismUtils ;
1112import mekanism .common .util .StorageUtils ;
1213import net .minecraft .network .chat .Component ;
1314import net .minecraft .world .InteractionHand ;
@@ -95,10 +96,15 @@ private FluidStack getFluid(ItemStack stack) {
9596
9697 @ NotNull
9798 @ Override
98- public InteractionResultHolder <ItemStack > use (@ NotNull Level worldIn , Player playerIn , @ NotNull InteractionHand handIn ) {
99- if (!playerIn .isCreative () && playerIn .canEat (false ) && getFluid (playerIn .getItemInHand (handIn )).getAmount () >= 50 ) {
100- playerIn .startUsingItem (handIn );
99+ public InteractionResultHolder <ItemStack > use (@ NotNull Level worldIn , Player player , @ NotNull InteractionHand hand ) {
100+ ItemStack item = player .getItemInHand (hand );
101+ if (!MekanismUtils .isPlayingMode (player )) {
102+ return InteractionResultHolder .pass (item );
101103 }
102- return InteractionResultHolder .success (playerIn .getItemInHand (handIn ));
104+ if (player .canEat (false ) && getFluid (item ).getAmount () >= 50 ) {
105+ player .startUsingItem (hand );
106+ return InteractionResultHolder .consume (item );
107+ }
108+ return InteractionResultHolder .fail (item );
103109 }
104110}
You can’t perform that action at this time.
0 commit comments