summaryrefslogtreecommitdiffstats
path: root/nms-patches/ItemTrident.patch
blob: 7de03dd63322f734c7689dfd83d9479f590a2d02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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);