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
{
// FOR REFERENCE, LOOK AT net.minecraft.server.BlockChest
EntityPlayer player = ((CraftPlayer) event.getPlayer()).getHandle();
World world = player.world;
// If block on top
if (world.e(x, y + 1, z))
if (world.s(x, y + 1, z))
anychest = true;
// 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;
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;
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;
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;
}
catch (Exception e)
@ -131,15 +135,15 @@ public class OpenInvPlayerListener implements Listener
if (!anychest)
{
if (world.e(x, y + 1, z))
if (world.s(x, y + 1, z))
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;
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;
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;
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;
}

View file

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

View file

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