From 81e560621fd0d8f8a7fb08a1eef627c83b7f5938 Mon Sep 17 00:00:00 2001 From: GJ Date: Thu, 20 Mar 2014 12:59:10 -0400 Subject: [Bleeding] Add all blocks needed to PortalCreateEvent. Fixes BUKKIT-5464 Due to changes in how portals were created in Minecraft 1.7, the code that was previously used to find the blocks involved in the PortalCreateEvent no longer detected all blocks. Additionally, in the process of updating to 1.7.2, a missed diff resulted in some blocks that were found not being properly added to the blocklist. This commit corrects that missed diff, while also adding a check to ensure that the top and bottom of the portal frame are included in the blocklist. --- src/main/java/net/minecraft/server/PortalCreator.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/java/net/minecraft/server/PortalCreator.java b/src/main/java/net/minecraft/server/PortalCreator.java index 70dda39c..309239de 100644 --- a/src/main/java/net/minecraft/server/PortalCreator.java +++ b/src/main/java/net/minecraft/server/PortalCreator.java @@ -12,7 +12,7 @@ public class PortalCreator { private ChunkCoordinates f; private int g; private int h; - java.util.Collection blocks; // CraftBukkit - add field + java.util.Collection blocks = new java.util.HashSet(); // CraftBukkit - add field public PortalCreator(World world, int i, int j, int k, int l) { this.a = world; @@ -65,8 +65,10 @@ public class PortalCreator { } protected int a() { - this.blocks = new java.util.HashSet(); // CraftBukkit + // CraftBukkit start + this.blocks.clear(); org.bukkit.World bworld = this.a.getWorld(); + // CraftBukkit end int i; int j; int k; @@ -118,6 +120,10 @@ public class PortalCreator { if (this.a.getType(j, k, l) != Blocks.OBSIDIAN) { this.g = 0; break; + // CraftBukkit start - add the block to our list + } else { + blocks.add(bworld.getBlockAt(j, k, l)); + // CraftBukkit end } } @@ -151,7 +157,7 @@ public class PortalCreator { for (int l = 0; l < this.g; ++l) { int i1 = this.f.y + l; - bworld.getBlockAt(j, i1, k); + blocks.add(bworld.getBlockAt(j, i1, k)); } } -- cgit v1.2.3