summaryrefslogtreecommitdiffstats
path: root/nms-patches/ItemBoat.patch
blob: 620564b23b860d617d23ca772374fb4faa5063a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--- ../work/decompile-8eb82bde//net/minecraft/server/ItemBoat.java	2014-11-28 17:43:43.217707432 +0000
+++ src/main/java/net/minecraft/server/ItemBoat.java	2014-11-28 17:38:21.000000000 +0000
@@ -53,6 +53,14 @@
             } else {
                 if (movingobjectposition.type == EnumMovingObjectType.BLOCK) {
                     BlockPosition blockposition = movingobjectposition.a();
+ 
+                    // CraftBukkit start - Boat placement
+                    org.bukkit.event.player.PlayerInteractEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(entityhuman, org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK, blockposition, movingobjectposition.direction, itemstack);
+
+                    if (event.isCancelled()) {
+                        return itemstack;
+                    }
+                    // CraftBukkit end
 
                     if (world.getType(blockposition).getBlock() == Blocks.SNOW_LAYER) {
                         blockposition = blockposition.down();