The worm is no longer consumed when using the item in creative mode

This commit is contained in:
Sollace 2024-10-30 20:28:36 +00:00
parent ff18b2d4f0
commit b3a46b0035
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -36,12 +36,14 @@ public class BaitedFishingRodItem extends FishingRodItem {
world.spawnEntity(bobber); world.spawnEntity(bobber);
} }
if (oldFishHook != null if (!user.isCreative()) {
&& oldFishHook.getHookedEntity() == null if (oldFishHook != null
&& oldFishHook.getDataTracker().get(FishingBobberEntity.CAUGHT_FISH) && oldFishHook.getHookedEntity() == null
&& result.getValue().isOf(this)) { && oldFishHook.getDataTracker().get(FishingBobberEntity.CAUGHT_FISH)
ItemStack stack = result.getValue().withItem(Items.FISHING_ROD); && result.getValue().isOf(this)) {
return TypedActionResult.success(stack, world.isClient()); ItemStack stack = result.getValue().withItem(Items.FISHING_ROD);
return TypedActionResult.success(stack, world.isClient());
}
} }
} }
return result; return result;