Update to 1.3.1 methods.

This commit is contained in:
lishid
2012-08-02 09:50:21 -04:00
parent 5add51bf21
commit e9466b9a4a
3 changed files with 17 additions and 13 deletions

View File

@@ -96,21 +96,25 @@ public class OpenInvPlayerListener implements Listener
{ {
try try
{ {
// FOR REFERENCE, LOOK AT net.minecraft.server.BlockChest // FOR REFERENCE, LOOK AT net.minecraft.server.BlockChest
EntityPlayer player = ((CraftPlayer) event.getPlayer()).getHandle(); EntityPlayer player = ((CraftPlayer) event.getPlayer()).getHandle();
World world = player.world; World world = player.world;
// If block on top // If block on top
if (world.e(x, y + 1, z)) if (world.s(x, y + 1, z))
anychest = true; anychest = true;
// If block next to chest is chest and has a block on top // If block next to chest is chest and has a block on top
if ((world.getTypeId(x - 1, y, z) == Block.CHEST.id) && (world.e(x - 1, y + 1, z))) if ((world.getTypeId(x - 1, y, z) == Block.CHEST.id) && (world.s(x - 1, y + 1, z)))
anychest = true; anychest = true;
if ((world.getTypeId(x + 1, y, z) == Block.CHEST.id) && (world.e(x + 1, y + 1, z))) if ((world.getTypeId(x + 1, y, z) == Block.CHEST.id) && (world.s(x + 1, y + 1, z)))
anychest = true; anychest = true;
if ((world.getTypeId(x, y, z - 1) == Block.CHEST.id) && (world.e(x, y + 1, z - 1))) if ((world.getTypeId(x, y, z - 1) == Block.CHEST.id) && (world.s(x, y + 1, z - 1)))
anychest = true; anychest = true;
if ((world.getTypeId(x, y, z + 1) == Block.CHEST.id) && (world.e(x, y + 1, z + 1))) if ((world.getTypeId(x, y, z + 1) == Block.CHEST.id) && (world.s(x, y + 1, z + 1)))
anychest = true; anychest = true;
} }
catch (Exception e) catch (Exception e)
@@ -131,15 +135,15 @@ public class OpenInvPlayerListener implements Listener
if (!anychest) if (!anychest)
{ {
if (world.e(x, y + 1, z)) if (world.s(x, y + 1, z))
return; return;
if ((world.getTypeId(x - 1, y, z) == Block.CHEST.id) && (world.e(x - 1, y + 1, z))) if ((world.getTypeId(x - 1, y, z) == Block.CHEST.id) && (world.s(x - 1, y + 1, z)))
return; return;
if ((world.getTypeId(x + 1, y, z) == Block.CHEST.id) && (world.e(x + 1, y + 1, z))) if ((world.getTypeId(x + 1, y, z) == Block.CHEST.id) && (world.s(x + 1, y + 1, z)))
return; return;
if ((world.getTypeId(x, y, z - 1) == Block.CHEST.id) && (world.e(x, y + 1, z - 1))) if ((world.getTypeId(x, y, z - 1) == Block.CHEST.id) && (world.s(x, y + 1, z - 1)))
return; return;
if ((world.getTypeId(x, y, z + 1) == Block.CHEST.id) && (world.e(x, y + 1, z + 1))) if ((world.getTypeId(x, y, z + 1) == Block.CHEST.id) && (world.s(x, y + 1, z + 1)))
return; return;
} }

View File

@@ -29,7 +29,7 @@ public class SilentContainerChest extends ContainerChest
super(i1, i2); super(i1, i2);
inv = i2; inv = i2;
// close signal // close signal
inv.g(); inv.f();
} }
@Override @Override
@@ -37,6 +37,6 @@ public class SilentContainerChest extends ContainerChest
{ {
super.a(paramEntityHuman); super.a(paramEntityHuman);
// open signal // open signal
inv.f(); inv.startOpen();
} }
} }

View File

@@ -1,6 +1,6 @@
name: OpenInv name: OpenInv
main: lishid.openinv.OpenInv main: lishid.openinv.OpenInv
version: 1.8.5 version: 1.8.6
author: lishid author: lishid
website: http://forums.bukkit.org/threads/15379/ website: http://forums.bukkit.org/threads/15379/
description: > description: >