summaryrefslogtreecommitdiffstats
path: root/nms-patches/ItemTrident.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-09-15 15:31:39 +1000
committermd_5 <git@md-5.net>2018-09-15 15:31:39 +1000
commit97315374fb5a017352f12858ad93c701dd4b11d7 (patch)
treee3fc95cbe824923139f1f9658bf76a0c2db6483a /nms-patches/ItemTrident.patch
parentbf1c82731c020d62302a71d07f8b27c8639eb686 (diff)
downloadcraftbukkit-97315374fb5a017352f12858ad93c701dd4b11d7.tar
craftbukkit-97315374fb5a017352f12858ad93c701dd4b11d7.tar.gz
craftbukkit-97315374fb5a017352f12858ad93c701dd4b11d7.tar.lz
craftbukkit-97315374fb5a017352f12858ad93c701dd4b11d7.tar.xz
craftbukkit-97315374fb5a017352f12858ad93c701dd4b11d7.zip
SPIGOT-4369: Handle cancelled trident event
Diffstat (limited to 'nms-patches/ItemTrident.patch')
-rw-r--r--nms-patches/ItemTrident.patch19
1 files changed, 18 insertions, 1 deletions
diff --git a/nms-patches/ItemTrident.patch b/nms-patches/ItemTrident.patch
index 7de03dd6..f4b26b00 100644
--- a/nms-patches/ItemTrident.patch
+++ b/nms-patches/ItemTrident.patch
@@ -14,7 +14,24 @@
}
public boolean a(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman) {
-@@ -53,6 +57,10 @@
+@@ -42,7 +46,15 @@
+ entitythrowntrident.fromPlayer = EntityArrow.PickupStatus.CREATIVE_ONLY;
+ }
+
+- world.addEntity(entitythrowntrident);
++ // CraftBukkit start
++ if (!world.addEntity(entitythrowntrident)) {
++ if (entityhuman instanceof EntityPlayer) {
++ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
++ }
++ return;
++ }
++ // CraftBukkit end
++
+ if (!entityhuman.abilities.canInstantlyBuild) {
+ entityhuman.inventory.f(itemstack);
+ }
+@@ -53,6 +65,10 @@
SoundEffect soundeffect = SoundEffects.ITEM_TRIDENT_THROW;
if (k > 0) {