mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 10:17:38 +01:00
Trigger EntityBlockChangeEvent for Silverfish. Adds BUKKIT-1560 and BUKKIT-1593
By: feildmaster <admin@feildmaster.com>
This commit is contained in:
parent
b91f0fe488
commit
acc10eabc8
@ -441,6 +441,13 @@ public class CraftEventFactory {
|
||||
return event;
|
||||
}
|
||||
|
||||
public static EntityChangeBlockEvent callEntityChangeBlockEvent(Entity entity, int x, int y, int z, int type) {
|
||||
Block block = entity.world.getWorld().getBlockAt(x, y, z);
|
||||
Material material = Material.getMaterial(type);
|
||||
|
||||
return callEntityChangeBlockEvent(entity, block, material);
|
||||
}
|
||||
|
||||
public static CreeperPowerEvent callCreeperPowerEvent(Entity creeper, Entity lightning, CreeperPowerEvent.PowerCause cause) {
|
||||
CreeperPowerEvent event = new CreeperPowerEvent((Creeper) creeper.getBukkitEntity(), (LightningStrike) lightning.getBukkitEntity(), cause);
|
||||
creeper.getBukkitEntity().getServer().getPluginManager().callEvent(event);
|
||||
|
Loading…
Reference in New Issue
Block a user