add defaults to more switches

This commit is contained in:
Leijurv 2018-09-16 19:56:33 -07:00
parent 3011b85aee
commit 0b640199ef
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 15 additions and 15 deletions

View File

@ -92,6 +92,7 @@ public final class LookBehavior extends Behavior implements Helper {
default:
break;
}
new Thread().start();
}
@Override
@ -111,6 +112,8 @@ public final class LookBehavior extends Behavior implements Helper {
this.target = null;
}
break;
default:
break;
}
}
}

View File

@ -65,27 +65,24 @@ public final class MemoryBehavior extends Behavior implements Helper {
public void onSendPacket(PacketEvent event) {
Packet p = event.getPacket();
switch (event.getState()) {
case PRE: {
if (p instanceof CPacketPlayerTryUseItemOnBlock) {
CPacketPlayerTryUseItemOnBlock packet = event.cast();
if (event.getState() == EventState.PRE) {
if (p instanceof CPacketPlayerTryUseItemOnBlock) {
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
if (tileEntity instanceof TileEntityLockable) {
// Ensure the TileEntity is a container of some sort
if (tileEntity instanceof TileEntityLockable) {
TileEntityLockable lockable = (TileEntityLockable) tileEntity;
int size = lockable.getSizeInventory();
TileEntityLockable lockable = (TileEntityLockable) tileEntity;
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) {
updateInventory();
}
break;
if (p instanceof CPacketCloseWindow) {
updateInventory();
}
}
}