diff options
author | feildmaster <admin@feildmaster.com> | 2012-07-29 02:33:13 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2012-08-02 04:58:50 -0500 |
commit | a43d621c0138110d2ec362b2eaa8f938f241bb49 (patch) | |
tree | d2ebc0d7a4a969d3257b1b958236428a24117eb1 /src/main/java/net/minecraft/server/BlockPortal.java | |
parent | 08e2923bd4282579ca0cf7af0e6207cba0591e5c (diff) | |
download | craftbukkit-a43d621c0138110d2ec362b2eaa8f938f241bb49.tar craftbukkit-a43d621c0138110d2ec362b2eaa8f938f241bb49.tar.gz craftbukkit-a43d621c0138110d2ec362b2eaa8f938f241bb49.tar.lz craftbukkit-a43d621c0138110d2ec362b2eaa8f938f241bb49.tar.xz craftbukkit-a43d621c0138110d2ec362b2eaa8f938f241bb49.zip |
Update CraftBukkit to Minecraft 1.3.1
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockPortal.java')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockPortal.java | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/main/java/net/minecraft/server/BlockPortal.java b/src/main/java/net/minecraft/server/BlockPortal.java index 057f526b..c18a9750 100644 --- a/src/main/java/net/minecraft/server/BlockPortal.java +++ b/src/main/java/net/minecraft/server/BlockPortal.java @@ -11,6 +11,22 @@ public class BlockPortal extends BlockHalfTransparant { public BlockPortal(int i, int j) { super(i, j, Material.PORTAL, false); + this.b(true); + } + + public void b(World world, int i, int j, int k, Random random) { + super.b(world, i, j, k, random); + if (world.worldProvider.d() && random.nextInt(2000) < world.difficulty) { + int l; + + for (l = j; !world.t(i, l, k) && l > 0; --l) { + ; + } + + if (l > 0 && !world.s(i, l + 1, k)) { + ItemMonsterEgg.a(world, 57, (double) i + 0.5D, (double) l + 1.1D, (double) k + 0.5D); + } + } } public AxisAlignedBB e(World world, int i, int j, int k) { @@ -32,15 +48,15 @@ public class BlockPortal extends BlockHalfTransparant { } } - public boolean a() { + public boolean d() { return false; } - public boolean b() { + public boolean c() { return false; } - public boolean b_(World world, int i, int j, int k) { + public boolean i_(World world, int i, int j, int k) { byte b0 = 0; byte b1 = 0; @@ -146,8 +162,10 @@ public class BlockPortal extends BlockHalfTransparant { if (flag && flag1) { world.setTypeId(i, j, k, 0); - } else if ((world.getTypeId(i + b0, j, k + b1) != Block.OBSIDIAN.id || world.getTypeId(i - b0, j, k - b1) != this.id) && (world.getTypeId(i - b0, j, k - b1) != Block.OBSIDIAN.id || world.getTypeId(i + b0, j, k + b1) != this.id)) { - world.setTypeId(i, j, k, 0); + } else { + if ((world.getTypeId(i + b0, j, k + b1) != Block.OBSIDIAN.id || world.getTypeId(i - b0, j, k - b1) != this.id) && (world.getTypeId(i - b0, j, k - b1) != Block.OBSIDIAN.id || world.getTypeId(i + b0, j, k + b1) != this.id)) { + world.setTypeId(i, j, k, 0); + } } } else { world.setTypeId(i, j, k, 0); @@ -166,7 +184,7 @@ public class BlockPortal extends BlockHalfTransparant { world.getServer().getPluginManager().callEvent(event); // CraftBukkit end - entity.ad(); + entity.aa(); } } } |