summaryrefslogtreecommitdiffstats
path: root/nms-patches/ItemBoat.patch
blob: 364ba0553a8c06caf4d1c438b03ff35ed83e24c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--- a/net/minecraft/server/ItemBoat.java
+++ b/net/minecraft/server/ItemBoat.java
@@ -54,6 +54,14 @@
                 if (movingobjectposition.type == MovingObjectPosition.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();
                     }