Attempt a packet log check

This commit is contained in:
aidancbrady 2015-06-17 15:30:52 -04:00
parent ace9dec4df
commit 6bdbb41b2d

View file

@ -1,18 +1,20 @@
package mekanism.common.network; package mekanism.common.network;
import io.netty.buffer.ByteBuf;
import java.util.ArrayList; import java.util.ArrayList;
import mekanism.api.Coord4D; import mekanism.api.Coord4D;
import mekanism.common.PacketHandler; import mekanism.common.PacketHandler;
import mekanism.common.base.ITileNetwork; import mekanism.common.base.ITileNetwork;
import mekanism.common.network.PacketTileEntity.TileEntityMessage; import mekanism.common.network.PacketTileEntity.TileEntityMessage;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext; import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import cpw.mods.fml.relauncher.Side;
import io.netty.buffer.ByteBuf;
public class PacketTileEntity implements IMessageHandler<TileEntityMessage, IMessage> public class PacketTileEntity implements IMessageHandler<TileEntityMessage, IMessage>
{ {
@ -59,7 +61,11 @@ public class PacketTileEntity implements IMessageHandler<TileEntityMessage, IMes
dataStream.writeInt(coord4D.zCoord); dataStream.writeInt(coord4D.zCoord);
dataStream.writeInt(coord4D.dimensionId); dataStream.writeInt(coord4D.dimensionId);
PacketHandler.log("Sending TileEntity packet from coordinate " + coord4D); if(FMLCommonHandler.instance().getSide() == Side.SERVER)
{
World world = FMLCommonHandler.instance().getMinecraftServerInstance().worldServerForDimension(coord4D.dimensionId);
PacketHandler.log("Sending TileEntity packet from coordinate " + coord4D + " (" + coord4D.getTileEntity(world) + ")");
}
PacketHandler.encode(new Object[] {parameters}, dataStream); PacketHandler.encode(new Object[] {parameters}, dataStream);
} }