@@ -15,12 +15,20 @@
|
||||
EntityBoat entityboat = new EntityBoat(world, movingobjectposition.getPos().x, movingobjectposition.getPos().y, movingobjectposition.getPos().z);
|
||||
|
||||
entityboat.setType(this.b);
|
||||
@@ -49,7 +57,7 @@
|
||||
@@ -49,7 +57,15 @@
|
||||
return InteractionResultWrapper.d(itemstack);
|
||||
} else {
|
||||
if (!world.isClientSide) {
|
||||
- world.addEntity(entityboat);
|
||||
+ if (!world.addEntity(entityboat)) return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack); // CraftBukkit
|
||||
+ // CraftBukkit start
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPlaceEvent(world, movingobjectpositionblock.getBlockPosition(), movingobjectpositionblock.getDirection(), entityhuman, entityboat).isCancelled()) {
|
||||
+ return InteractionResultWrapper.d(itemstack);
|
||||
+ }
|
||||
+
|
||||
+ if (!world.addEntity(entityboat)) {
|
||||
+ return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
itemstack.subtract(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user