Make EntityCreatePortalEvent block list Unmodifiable.

This commit is contained in:
feildmaster 2012-04-02 15:44:19 -05:00
parent 470d9f9e1d
commit bad3979b8f

View File

@ -574,8 +574,7 @@ public class EntityEnderDragon extends EntityComplex {
byte b1 = 4;
// CraftBukkit start - Replace any "this.world" in the following with just "world"!
org.bukkit.event.entity.EntityCreatePortalEvent event = new org.bukkit.event.entity.EntityCreatePortalEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), new ArrayList<BlockState>(), org.bukkit.PortalType.ENDER);
org.bukkit.craftbukkit.util.BlockStateListPopulator world = new org.bukkit.craftbukkit.util.BlockStateListPopulator(this.world.getWorld(), event.getBlocks());
org.bukkit.craftbukkit.util.BlockStateListPopulator world = new org.bukkit.craftbukkit.util.BlockStateListPopulator(this.world.getWorld());
for (int k = b0 - 1; k <= b0 + 32; ++k) {
for (int l = i - b1; l <= i + b1; ++l) {
@ -611,6 +610,7 @@ public class EntityEnderDragon extends EntityComplex {
world.setTypeId(i, b0 + 3, j, Block.BEDROCK.id);
world.setTypeId(i, b0 + 4, j, Block.DRAGON_EGG.id);
org.bukkit.event.entity.EntityCreatePortalEvent event = new org.bukkit.event.entity.EntityCreatePortalEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), java.util.Collections.unmodifiableList(world.getList()), org.bukkit.PortalType.ENDER);
this.world.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {