mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-28 07:56:01 +00:00
pull in extra heart stuffs from 1.6 warning: probably will fail serverside
This commit is contained in:
1 parent
58bf2934be
commit
d6372a79ae
13 files changed
+284
-113
No files matched your search
@@ -0,0 +1,62 @@
|
||||
package tconstruct.util.network.packet;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.client.TProxyClient;
|
||||
import tconstruct.common.TProxyCommon;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public class PacketArmorSync extends AbstractPacket
|
||||
{
|
||||
ByteBuf b;
|
||||
|
||||
@Override
|
||||
public void encodeInto (ChannelHandlerContext ctx, ByteBuf buffer)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decodeInto (ChannelHandlerContext ctx, ByteBuf buffer)
|
||||
{
|
||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER)
|
||||
{
|
||||
try
|
||||
{
|
||||
byte packetID = buffer.readByte();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
TConstruct.logger.warn("Failed at reading server packet for TConstruct.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
try
|
||||
{
|
||||
TProxyClient.armorExtended.readInventoryFromStream(buffer);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleClientSide (EntityPlayer player)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleServerSide (EntityPlayer player)
|
||||
{
|
||||
TProxyClient.armorExtended.recalculateHealth(player, TConstruct.playerTracker.getPlayerStats(player.getDisplayName()));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -141,6 +141,7 @@ public class PacketPipeline extends MessageToMessageCodec<FMLProxyPacket, Abstra
|
||||
registerPacket(PacketSmeltery.class);
|
||||
registerPacket(PacketStencilTable.class);
|
||||
registerPacket(PacketToolStation.class);
|
||||
registerPacket(PacketArmorSync.class);
|
||||
}
|
||||
|
||||
// Method to call from FMLPostInitializationEvent
|
||||
|
||||
Reference in new issue
Block a user