2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/ItemBoat.java
|
|
|
|
+++ b/net/minecraft/server/ItemBoat.java
|
2020-06-25 02:00:00 +02:00
|
|
|
@@ -41,6 +41,13 @@
|
2019-04-23 04:00:00 +02:00
|
|
|
}
|
|
|
|
|
2020-06-25 02:00:00 +02:00
|
|
|
if (movingobjectpositionblock.getType() == MovingObjectPosition.EnumMovingObjectType.BLOCK) {
|
2016-02-29 22:32:46 +01:00
|
|
|
+ // CraftBukkit start - Boat placement
|
2019-04-23 04:00:00 +02:00
|
|
|
+ org.bukkit.event.player.PlayerInteractEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(entityhuman, org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK, movingobjectpositionblock.getBlockPosition(), movingobjectpositionblock.getDirection(), 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
|
2020-06-25 02:00:00 +02:00
|
|
|
EntityBoat entityboat = new EntityBoat(world, movingobjectpositionblock.getPos().x, movingobjectpositionblock.getPos().y, movingobjectpositionblock.getPos().z);
|
2019-04-23 04:00:00 +02:00
|
|
|
|
|
|
|
entityboat.setType(this.b);
|
2020-06-25 02:00:00 +02:00
|
|
|
@@ -49,7 +56,15 @@
|
2020-01-21 22:00:00 +01:00
|
|
|
return InteractionResultWrapper.fail(itemstack);
|
2017-03-21 23:03:20 +01:00
|
|
|
} else {
|
|
|
|
if (!world.isClientSide) {
|
|
|
|
- world.addEntity(entityboat);
|
2019-12-19 02:53:27 +01:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPlaceEvent(world, movingobjectpositionblock.getBlockPosition(), movingobjectpositionblock.getDirection(), entityhuman, entityboat).isCancelled()) {
|
2020-01-21 22:00:00 +01:00
|
|
|
+ return InteractionResultWrapper.fail(itemstack);
|
2019-12-19 02:53:27 +01:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!world.addEntity(entityboat)) {
|
|
|
|
+ return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack);
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2019-12-10 23:00:00 +01:00
|
|
|
if (!entityhuman.abilities.canInstantlyBuild) {
|
|
|
|
itemstack.subtract(1);
|
|
|
|
}
|