add defaults to more switches
This commit is contained in:
parent
3011b85aee
commit
0b640199ef
@ -92,6 +92,7 @@ public final class LookBehavior extends Behavior implements Helper {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
new Thread().start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -111,6 +112,8 @@ public final class LookBehavior extends Behavior implements Helper {
|
|||||||
this.target = null;
|
this.target = null;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,27 +65,24 @@ public final class MemoryBehavior extends Behavior implements Helper {
|
|||||||
public void onSendPacket(PacketEvent event) {
|
public void onSendPacket(PacketEvent event) {
|
||||||
Packet p = event.getPacket();
|
Packet p = event.getPacket();
|
||||||
|
|
||||||
switch (event.getState()) {
|
if (event.getState() == EventState.PRE) {
|
||||||
case PRE: {
|
if (p instanceof CPacketPlayerTryUseItemOnBlock) {
|
||||||
if (p instanceof CPacketPlayerTryUseItemOnBlock) {
|
CPacketPlayerTryUseItemOnBlock packet = event.cast();
|
||||||
CPacketPlayerTryUseItemOnBlock packet = event.cast();
|
|
||||||
|
|
||||||
TileEntity tileEntity = world().getTileEntity(packet.getPos());
|
TileEntity tileEntity = world().getTileEntity(packet.getPos());
|
||||||
|
|
||||||
// Ensure the TileEntity is a container of some sort
|
// Ensure the TileEntity is a container of some sort
|
||||||
if (tileEntity instanceof TileEntityLockable) {
|
if (tileEntity instanceof TileEntityLockable) {
|
||||||
|
|
||||||
TileEntityLockable lockable = (TileEntityLockable) tileEntity;
|
TileEntityLockable lockable = (TileEntityLockable) tileEntity;
|
||||||
int size = lockable.getSizeInventory();
|
int size = lockable.getSizeInventory();
|
||||||
|
|
||||||
this.futureInventories.add(new FutureInventory(System.nanoTime() / 1000000L, size, lockable.getGuiID(), tileEntity.getPos()));
|
this.futureInventories.add(new FutureInventory(System.nanoTime() / 1000000L, size, lockable.getGuiID(), tileEntity.getPos()));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (p instanceof CPacketCloseWindow) {
|
if (p instanceof CPacketCloseWindow) {
|
||||||
updateInventory();
|
updateInventory();
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user