Archiviert
13
0

Made stepping on Redstone Ore fire PlayerInteract events for players, EntityInteract events for other entities. Fixes BUKKIT-1163 and fixes BUKKIT-1182

Note: the client seems to predict redstone ore interacting, so you may see
ore lighting up when it shouldn't be. However, cancelled events should
function as expected.
Dieser Commit ist enthalten in:
EvilSeph 2012-03-14 23:15:22 -04:00
Ursprung 16c6cbe5eb
Commit 5a6878b9b1

Datei anzeigen

@ -25,8 +25,22 @@ public class BlockRedstoneOre extends Block {
}
public void b(World world, int i, int j, int k, Entity entity) {
this.g(world, i, j, k);
super.b(world, i, j, k, entity);
// CraftBukkit start
if (entity instanceof EntityHuman) {
org.bukkit.event.player.PlayerInteractEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, org.bukkit.event.block.Action.PHYSICAL, i, j, k, -1, null);
if (!event.isCancelled()) {
this.g(world, i, j, k);
super.b(world, i, j, k, entity);
}
} else {
org.bukkit.event.entity.EntityInteractEvent event = new org.bukkit.event.entity.EntityInteractEvent(entity.getBukkitEntity(), world.getWorld().getBlockAt(i, j, k));
world.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {
this.g(world, i, j, k);
super.b(world, i, j, k, entity);
}
}
// CraftBukkit end
}
public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) {