Files
waila/src/main/java/mcp/mobius/waila/network/Message0x02TENBTData.java
T
Thomas Guimbretiere f9f2c4041e Removed Block & Entity accessor and replaced it with the Common accessor.
Added a split in the line regexp for the icon.
Created a icon renderer.
Old waila Icon nomenclature is now turned into the proper renderer.
Removed some empty methods in Tooltip.
2014-12-29 17:52:53 +01:00

41 lines
1.2 KiB
Java

package mcp.mobius.waila.network;
import mcp.mobius.waila.api.impl.DataAccessorCommon;
import mcp.mobius.waila.utils.WailaExceptionHandler;
import net.minecraft.nbt.NBTTagCompound;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
public class Message0x02TENBTData extends SimpleChannelInboundHandler<Message0x02TENBTData> implements IWailaMessage {
NBTTagCompound tag;
public Message0x02TENBTData(){}
public Message0x02TENBTData(NBTTagCompound tag){
this.tag = tag;
}
@Override
public void encodeInto(ChannelHandlerContext ctx, IWailaMessage msg, ByteBuf target) throws Exception {
WailaPacketHandler.INSTANCE.writeNBT(target, tag);
}
@Override
public void decodeInto(ChannelHandlerContext ctx, ByteBuf dat, IWailaMessage msg) {
try{
this.tag = WailaPacketHandler.INSTANCE.readNBT(dat);
} catch (Exception e){
WailaExceptionHandler.handleErr(e, this.getClass().toString(), null);
}
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, Message0x02TENBTData msg) throws Exception {
DataAccessorCommon.instance.setNBTData(msg.tag);
}
}