2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/ItemBoat.java
|
|
|
|
+++ b/net/minecraft/server/ItemBoat.java
|
2016-11-17 02:41:03 +01:00
|
|
|
@@ -56,6 +56,13 @@
|
2016-02-29 22:32:46 +01:00
|
|
|
} else if (movingobjectposition.type != MovingObjectPosition.EnumMovingObjectType.BLOCK) {
|
|
|
|
return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack);
|
|
|
|
} else {
|
|
|
|
+ // CraftBukkit start - Boat placement
|
2016-03-04 05:24:51 +01:00
|
|
|
+ org.bukkit.event.player.PlayerInteractEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(entityhuman, org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK, movingobjectposition.a(), movingobjectposition.direction, itemstack, enumhand);
|
2014-11-25 22:32:16 +01:00
|
|
|
+
|
2016-02-29 22:32:46 +01:00
|
|
|
+ if (event.isCancelled()) {
|
|
|
|
+ return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack);
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
Block block = world.getType(movingobjectposition.a()).getBlock();
|
|
|
|
boolean flag1 = block == Blocks.WATER || block == Blocks.FLOWING_WATER;
|
|
|
|
EntityBoat entityboat = new EntityBoat(world, movingobjectposition.pos.x, flag1 ? movingobjectposition.pos.y - 0.12D : movingobjectposition.pos.y, movingobjectposition.pos.z);
|
2017-03-21 23:03:20 +01:00
|
|
|
@@ -66,7 +73,7 @@
|
|
|
|
return new InteractionResultWrapper(EnumInteractionResult.FAIL, itemstack);
|
|
|
|
} else {
|
|
|
|
if (!world.isClientSide) {
|
|
|
|
- world.addEntity(entityboat);
|
|
|
|
+ if (!world.addEntity(entityboat)) return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack); // CraftBukkit
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!entityhuman.abilities.canInstantlyBuild) {
|