geforkt von Mirrors/Paper
Update EntityChangeBlockEvent to new BlockData API
Dieser Commit ist enthalten in:
Ursprung
49ac8a7446
Commit
ca1af9368b
@ -24,6 +24,7 @@ import org.bukkit.craftbukkit.CraftStatistic;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.craftbukkit.block.CraftBlock;
|
||||
import org.bukkit.craftbukkit.block.CraftBlockState;
|
||||
import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.entity.CraftLivingEntity;
|
||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
@ -704,9 +705,8 @@ public class CraftEventFactory {
|
||||
|
||||
public static EntityChangeBlockEvent callEntityChangeBlockEvent(Entity entity, BlockPosition position, IBlockData newBlock, boolean cancelled) {
|
||||
Block block = entity.world.getWorld().getBlockAt(position.getX(), position.getY(), position.getZ());
|
||||
Material material = CraftMagicNumbers.getMaterial(newBlock).getItemType();
|
||||
|
||||
EntityChangeBlockEvent event = new EntityChangeBlockEvent(entity.getBukkitEntity(), block, material, (byte) 0);
|
||||
EntityChangeBlockEvent event = new EntityChangeBlockEvent(entity.getBukkitEntity(), block, CraftBlockData.fromData(newBlock));
|
||||
event.setCancelled(cancelled);
|
||||
event.getEntity().getServer().getPluginManager().callEvent(event);
|
||||
return event;
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren