summaryrefslogtreecommitdiffstats
path: root/nms-patches/ItemTrident.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-08-02 09:38:52 +1000
committermd_5 <git@md-5.net>2018-08-02 09:38:52 +1000
commit272426acd7cfb50978f478f49d835c8541da2a4e (patch)
tree0cea34a7b66a53ea1424b2730a7f4d0f91b30905 /nms-patches/ItemTrident.patch
parentab5599e8f305163757fae22626969e1a7cd2bfa6 (diff)
downloadcraftbukkit-272426acd7cfb50978f478f49d835c8541da2a4e.tar
craftbukkit-272426acd7cfb50978f478f49d835c8541da2a4e.tar.gz
craftbukkit-272426acd7cfb50978f478f49d835c8541da2a4e.tar.lz
craftbukkit-272426acd7cfb50978f478f49d835c8541da2a4e.tar.xz
craftbukkit-272426acd7cfb50978f478f49d835c8541da2a4e.zip
SPIGOT-4199: Riptide related APIs
Diffstat (limited to 'nms-patches/ItemTrident.patch')
-rw-r--r--nms-patches/ItemTrident.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/nms-patches/ItemTrident.patch b/nms-patches/ItemTrident.patch
new file mode 100644
index 00000000..7de03dd6
--- /dev/null
+++ b/nms-patches/ItemTrident.patch
@@ -0,0 +1,27 @@
+--- a/net/minecraft/server/ItemTrident.java
++++ b/net/minecraft/server/ItemTrident.java
+@@ -6,9 +6,13 @@
+
+ public ItemTrident(Item.Info item_info) {
+ super(item_info);
++ // CraftBukkit start - obfuscator went a little crazy
++ /*
+ this.a(new MinecraftKey("throwing"), (itemstack, world, entityliving) -> {
+ return entityliving != null && entityliving.isHandRaised() && entityliving.cW() == itemstack ? 1.0F : 0.0F;
+ });
++ */
++ // CraftBukkit end
+ }
+
+ public boolean a(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman) {
+@@ -53,6 +57,10 @@
+ SoundEffect soundeffect = SoundEffects.ITEM_TRIDENT_THROW;
+
+ if (k > 0) {
++ // CraftBukkit start
++ org.bukkit.event.player.PlayerRiptideEvent event = new org.bukkit.event.player.PlayerRiptideEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack));
++ event.getPlayer().getServer().getPluginManager().callEvent(event);
++ // CraftBukkit end
+ float f = entityhuman.yaw;
+ float f1 = entityhuman.pitch;
+ float f2 = -MathHelper.sin(f * 0.017453292F) * MathHelper.cos(f1 * 0.017453292F);