Files
CatServer/patches/net/minecraft/item/ItemBoat.java.patch

17 lines
1.1 KiB
Diff

--- ../src-base/minecraft/net/minecraft/item/ItemBoat.java
+++ ../src-work/minecraft/net/minecraft/item/ItemBoat.java
@@ -83,6 +83,13 @@
}
else
{
+ // CraftBukkit start - Boat placement
+ org.bukkit.event.player.PlayerInteractEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(playerIn, org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK, raytraceresult.getBlockPos(), raytraceresult.sideHit, itemStackIn, hand);
+
+ if (event.isCancelled()) {
+ return new ActionResult(EnumActionResult.PASS, itemStackIn);
+ }
+ // CraftBukkit end
Block block = worldIn.getBlockState(raytraceresult.getBlockPos()).getBlock();
boolean flag1 = block == Blocks.WATER || block == Blocks.FLOWING_WATER;
EntityBoat entityboat = new EntityBoat(worldIn, raytraceresult.hitVec.xCoord, flag1 ? raytraceresult.hitVec.yCoord - 0.12D : raytraceresult.hitVec.yCoord, raytraceresult.hitVec.zCoord);