diff options
author | GJ <gjmcferrin@gmail.com> | 2014-03-20 12:59:10 -0400 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2014-04-18 09:42:02 -0500 |
commit | 81e560621fd0d8f8a7fb08a1eef627c83b7f5938 (patch) | |
tree | 53ff3d3f38695f591d9098311ab3c65855ff64e6 /src/main/java | |
parent | 729df1a734053f61459f7abdcc92a892f7eb3aad (diff) | |
download | craftbukkit-81e560621fd0d8f8a7fb08a1eef627c83b7f5938.tar craftbukkit-81e560621fd0d8f8a7fb08a1eef627c83b7f5938.tar.gz craftbukkit-81e560621fd0d8f8a7fb08a1eef627c83b7f5938.tar.lz craftbukkit-81e560621fd0d8f8a7fb08a1eef627c83b7f5938.tar.xz craftbukkit-81e560621fd0d8f8a7fb08a1eef627c83b7f5938.zip |
[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.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/net/minecraft/server/PortalCreator.java | 12 |
1 files changed, 9 insertions, 3 deletions
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<org.bukkit.block.Block> blocks; // CraftBukkit - add field + java.util.Collection<org.bukkit.block.Block> blocks = new java.util.HashSet<org.bukkit.block.Block>(); // 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<org.bukkit.block.Block>(); // 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)); } } |