SPIGOT-3215: Call BlockPhysicsEvent for tall plants

By: BlackHole <black-hole@live.com>
This commit is contained in:
CraftBukkit/Spigot
2017-05-01 01:21:20 +02:00
parent de05a02353
commit 8803cfc46a
3 changed files with 24 additions and 18 deletions

View File

@@ -1039,6 +1039,13 @@ public class CraftEventFactory {
return event;
}
public static BlockPhysicsEvent callBlockPhysicsEvent(World world, BlockPosition blockposition) {
org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
BlockPhysicsEvent event = new BlockPhysicsEvent(block, block.getTypeId());
world.getServer().getPluginManager().callEvent(event);
return event;
}
public static boolean handleBlockFormEvent(World world, BlockPosition pos, net.minecraft.server.Block block, @Nullable Entity entity) {
BlockState blockState = world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()).getState();
blockState.setType(CraftMagicNumbers.getMaterial(block));