diff options
author | Tomasz Kramkowski <tomasz@kramkow.ski> | 2024-08-30 23:07:09 +0100 |
---|---|---|
committer | Tomasz Kramkowski <tomasz@kramkow.ski> | 2024-08-30 23:07:09 +0100 |
commit | 31a4648b42b8b34b9656e73e01cf6d2329e35a04 (patch) | |
tree | 1d36ff666941e0a3de8fd3b10645132a4cb5186e /src | |
parent | ff3a64543897f028d0b3ceffaf2ca70b96699b99 (diff) | |
download | eye-of-nether-31a4648b42b8b34b9656e73e01cf6d2329e35a04.tar.gz eye-of-nether-31a4648b42b8b34b9656e73e01cf6d2329e35a04.tar.xz eye-of-nether-31a4648b42b8b34b9656e73e01cf6d2329e35a04.zip |
Decrement stack after spawning the eye
Otherwise the last thrown eye will become a normal eye. Doh.
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/ski/kramkow/mcmod/eyeofnether/EyeOfNetherItem.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/ski/kramkow/mcmod/eyeofnether/EyeOfNetherItem.java b/src/main/java/ski/kramkow/mcmod/eyeofnether/EyeOfNetherItem.java index 233205a..ceac6eb 100644 --- a/src/main/java/ski/kramkow/mcmod/eyeofnether/EyeOfNetherItem.java +++ b/src/main/java/ski/kramkow/mcmod/eyeofnether/EyeOfNetherItem.java @@ -58,9 +58,6 @@ public class EyeOfNetherItem extends Item { } if (pos_pair != null) { user.swingHand(hand, true); - if (!user.getAbilities().creativeMode) { - stack.decrement(1); - } // Worth changing this and the sound/event if/when that gets replaced with a // custom entity. @@ -90,6 +87,10 @@ public class EyeOfNetherItem extends Item { GameEvent.Emitter.of(user)); user.incrementStat(Stats.USED.getOrCreateStat(this)); + if (!user.getAbilities().creativeMode) { + stack.decrement(1); + } + return TypedActionResult.success(stack); } } |