mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 14:52:58 +00:00
Java 7 and 8 cleanup
Diamond operator <> Lambdas and method references
This commit is contained in:
1 parent
3db03edbc9
commit
b72d6efab3
234 files changed
+1614
-2253
No files matched your search
@@ -25,34 +25,31 @@ public class PacketSecurityMode implements IMessageHandler<SecurityModeMessage,
|
||||
{
|
||||
EntityPlayer player = PacketHandler.getPlayer(context);
|
||||
|
||||
PacketHandler.handlePacket(new Runnable() {
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if(message.packetType == SecurityPacketType.BLOCK)
|
||||
{
|
||||
TileEntity tileEntity = message.coord4D.getTileEntity(player.world);
|
||||
|
||||
if(tileEntity instanceof ISecurityTile)
|
||||
{
|
||||
UUID owner = ((ISecurityTile)tileEntity).getSecurity().getOwnerUUID();
|
||||
|
||||
if(owner != null && player.getUniqueID().equals(owner))
|
||||
{
|
||||
((ISecurityTile)tileEntity).getSecurity().setMode(message.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
ItemStack stack = player.getHeldItem(message.currentHand);
|
||||
|
||||
if(stack.getItem() instanceof ISecurityItem)
|
||||
{
|
||||
((ISecurityItem)stack.getItem()).setSecurity(stack, message.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, player);
|
||||
PacketHandler.handlePacket(() ->
|
||||
{
|
||||
if(message.packetType == SecurityPacketType.BLOCK)
|
||||
{
|
||||
TileEntity tileEntity = message.coord4D.getTileEntity(player.world);
|
||||
|
||||
if(tileEntity instanceof ISecurityTile)
|
||||
{
|
||||
UUID owner = ((ISecurityTile)tileEntity).getSecurity().getOwnerUUID();
|
||||
|
||||
if(owner != null && player.getUniqueID().equals(owner))
|
||||
{
|
||||
((ISecurityTile)tileEntity).getSecurity().setMode(message.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
ItemStack stack = player.getHeldItem(message.currentHand);
|
||||
|
||||
if(stack.getItem() instanceof ISecurityItem)
|
||||
{
|
||||
((ISecurityItem)stack.getItem()).setSecurity(stack, message.value);
|
||||
}
|
||||
}
|
||||
}, player);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user