Formatted code
This commit is contained in:
@@ -56,7 +56,6 @@ public class AppEngPacketHandlerBase
|
||||
{
|
||||
private static final Map<Class<? extends AppEngPacket>, PacketTypes> REVERSE_LOOKUP = new HashMap<Class<? extends AppEngPacket>, AppEngPacketHandlerBase.PacketTypes>();
|
||||
|
||||
|
||||
public enum PacketTypes
|
||||
{
|
||||
PACKET_COMPASS_REQUEST( PacketCompassRequest.class ),
|
||||
|
||||
@@ -268,7 +268,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
}
|
||||
if( ID.type.isTile() )
|
||||
{
|
||||
final TileEntity TE = w.getTileEntity( new BlockPos(x,y,z) );
|
||||
final TileEntity TE = w.getTileEntity( new BlockPos( x, y, z ) );
|
||||
if( TE instanceof IPartHost )
|
||||
{
|
||||
( (IPartHost) TE ).getPart( side );
|
||||
@@ -295,7 +295,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
{
|
||||
if( it.getItem() instanceof IGuiItem )
|
||||
{
|
||||
return ( (IGuiItem) it.getItem() ).getGuiObject( it, w, new BlockPos(x,y,z) );
|
||||
return ( (IGuiItem) it.getItem() ).getGuiObject( it, w, new BlockPos( x, y, z ) );
|
||||
}
|
||||
|
||||
final IWirelessTermHandler wh = AEApi.instance().registries().wireless().getWirelessTerminalHandler( it );
|
||||
@@ -450,7 +450,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
}
|
||||
if( ID.type.isTile() )
|
||||
{
|
||||
final TileEntity TE = w.getTileEntity( new BlockPos(x,y,z) );
|
||||
final TileEntity TE = w.getTileEntity( new BlockPos( x, y, z ) );
|
||||
if( TE instanceof IPartHost )
|
||||
{
|
||||
( (IPartHost) TE ).getPart( side );
|
||||
@@ -499,7 +499,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
public boolean hasPermissions( final TileEntity te, final int x, final int y, final int z, final AEPartLocation side, final EntityPlayer player )
|
||||
{
|
||||
final World w = player.getEntityWorld();
|
||||
final BlockPos pos = new BlockPos(x,y,z);
|
||||
final BlockPos pos = new BlockPos( x, y, z );
|
||||
|
||||
if( Platform.hasPermissions( te != null ? new DimensionalCoord( te ) : new DimensionalCoord( player.worldObj, pos ), player ) )
|
||||
{
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
|
||||
package appeng.core.sync;
|
||||
|
||||
|
||||
public abstract class PacketCallState
|
||||
{
|
||||
|
||||
public abstract void call( AppEngPacket appEngPacket );
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -52,17 +52,17 @@ public class AppEngClientPacketHandler extends AppEngPacketHandlerBase implement
|
||||
final AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream );
|
||||
|
||||
final PacketCallState callState =
|
||||
new PacketCallState(){
|
||||
|
||||
@Override
|
||||
public void call(
|
||||
final AppEngPacket appEngPacket )
|
||||
{
|
||||
appEngPacket.clientPacketData( manager, appEngPacket, Minecraft.getMinecraft().thePlayer );
|
||||
}
|
||||
};
|
||||
|
||||
pack.setCallParam(callState);
|
||||
new PacketCallState(){
|
||||
|
||||
@Override
|
||||
public void call(
|
||||
final AppEngPacket appEngPacket )
|
||||
{
|
||||
appEngPacket.clientPacketData( manager, appEngPacket, Minecraft.getMinecraft().thePlayer );
|
||||
}
|
||||
};
|
||||
|
||||
pack.setCallParam( callState );
|
||||
PacketThreadUtil.checkThreadAndEnqueue( pack, handler, Minecraft.getMinecraft() );
|
||||
callState.call( pack );
|
||||
}
|
||||
|
||||
@@ -46,20 +46,20 @@ public final class AppEngServerPacketHandler extends AppEngPacketHandlerBase imp
|
||||
{
|
||||
final int packetType = stream.readInt();
|
||||
final AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream );
|
||||
|
||||
|
||||
final PacketCallState callState =
|
||||
new PacketCallState(){
|
||||
|
||||
@Override
|
||||
public void call(
|
||||
final AppEngPacket appEngPacket )
|
||||
{
|
||||
appEngPacket.serverPacketData( manager, appEngPacket, player);
|
||||
}
|
||||
};
|
||||
|
||||
pack.setCallParam(callState);
|
||||
PacketThreadUtil.checkThreadAndEnqueue( pack, handler, ((EntityPlayerMP)player).getServerForPlayer() );
|
||||
new PacketCallState(){
|
||||
|
||||
@Override
|
||||
public void call(
|
||||
final AppEngPacket appEngPacket )
|
||||
{
|
||||
appEngPacket.serverPacketData( manager, appEngPacket, player );
|
||||
}
|
||||
};
|
||||
|
||||
pack.setCallParam( callState );
|
||||
PacketThreadUtil.checkThreadAndEnqueue( pack, handler, ( (EntityPlayerMP) player ).getServerForPlayer() );
|
||||
callState.call( pack );
|
||||
}
|
||||
catch( final InstantiationException e )
|
||||
|
||||
@@ -34,6 +34,7 @@ import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.worlddata.WorldData;
|
||||
|
||||
|
||||
public class NetworkHandler
|
||||
{
|
||||
public static NetworkHandler instance;
|
||||
@@ -103,9 +104,9 @@ public class NetworkHandler
|
||||
{
|
||||
this.serveHandler.onPacketData( null, ev.handler, ev.packet, srv.playerEntity );
|
||||
}
|
||||
catch ( final ThreadQuickExitException ignored )
|
||||
catch( final ThreadQuickExitException ignored )
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -119,9 +120,9 @@ public class NetworkHandler
|
||||
{
|
||||
this.clientHandler.onPacketData( null, ev.handler, ev.packet, null );
|
||||
}
|
||||
catch ( final ThreadQuickExitException ignored )
|
||||
catch( final ThreadQuickExitException ignored )
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ public class PacketClick extends AppEngPacket
|
||||
if( is.getItem() instanceof ToolNetworkTool )
|
||||
{
|
||||
final ToolNetworkTool tnt = (ToolNetworkTool) is.getItem();
|
||||
tnt.serverSideToolLogic( is, player, player.worldObj, new BlockPos( this.x, this.y, this.z), EnumFacing.VALUES[ this.side ], this.hitX, this.hitY, this.hitZ );
|
||||
tnt.serverSideToolLogic( is, player, player.worldObj, new BlockPos( this.x, this.y, this.z ), EnumFacing.VALUES[this.side], this.hitX, this.hitY, this.hitZ );
|
||||
}
|
||||
|
||||
else if( maybeMemoryCard.isSameAs( is ) )
|
||||
|
||||
@@ -65,7 +65,7 @@ public final class PacketConfigButton extends AppEngPacket
|
||||
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
|
||||
{
|
||||
final EntityPlayerMP sender = (EntityPlayerMP) player;
|
||||
if ( sender.openContainer instanceof AEBaseContainer )
|
||||
if( sender.openContainer instanceof AEBaseContainer )
|
||||
{
|
||||
final AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer;
|
||||
if( baseContainer.getTarget() instanceof IConfigurableObject )
|
||||
|
||||
Reference in New Issue
Block a user