@@ -15,16 +15,16 @@
|
||||
d3 = 0.0D;
|
||||
}
|
||||
|
||||
- EntityBoat entityboat = new EntityBoat(world, d0, d1 + d3, d2);
|
||||
+ // EntityBoat entityboat = new EntityBoat(world, d0, d1 + d3, d2);
|
||||
- EntityBoat entityboat = new EntityBoat(worldserver, d0, d1 + d3, d2);
|
||||
+ // EntityBoat entityboat = new EntityBoat(worldserver, d0, d1 + d3, d2);
|
||||
+ // CraftBukkit start
|
||||
+ ItemStack itemstack1 = itemstack.cloneAndSubtract(1);
|
||||
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ());
|
||||
+ org.bukkit.block.Block block = worldserver.getWorld().getBlockAt(isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ());
|
||||
+ CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1);
|
||||
+
|
||||
+ BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(d0, d1 + d3, d2));
|
||||
+ if (!BlockDispenser.eventFired) {
|
||||
+ world.getServer().getPluginManager().callEvent(event);
|
||||
+ worldserver.getServer().getPluginManager().callEvent(event);
|
||||
+ }
|
||||
+
|
||||
+ if (event.isCancelled()) {
|
||||
@@ -43,14 +43,14 @@
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ EntityBoat entityboat = new EntityBoat(world, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ());
|
||||
+ EntityBoat entityboat = new EntityBoat(worldserver, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ());
|
||||
+ // CraftBukkit end
|
||||
|
||||
entityboat.setType(this.c);
|
||||
entityboat.yaw = enumdirection.o();
|
||||
- world.addEntity(entityboat);
|
||||
- worldserver.addEntity(entityboat);
|
||||
- itemstack.subtract(1);
|
||||
+ if (!world.addEntity(entityboat)) itemstack.add(1); // CraftBukkit
|
||||
+ if (!worldserver.addEntity(entityboat)) itemstack.add(1); // CraftBukkit
|
||||
+ // itemstack.subtract(1); // CraftBukkit - handled during event processing
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user