aboutsummaryrefslogtreecommitdiff
path: root/src/Java/miscutil/enderio/conduit/GregTech/PacketGtLevel.java
blob: 9998d59d20b74c6ad38008bb38dc04aac335a09e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package miscutil.enderio.conduit.GregTech;

import io.netty.buffer.ByteBuf;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import cpw.mods.fml.common.network.ByteBufUtils;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import crazypants.enderio.conduit.gas.IGasConduit;
import crazypants.enderio.network.MessageTileEntity;

public class PacketGtLevel extends MessageTileEntity<TileEntity> implements IMessageHandler<PacketGtLevel, IMessage> {

  public NBTTagCompound tc;

  public PacketGtLevel() {
  }

  public PacketGtLevel(IGasConduit conduit) {
    super(conduit.getBundle().getEntity());
    tc = new NBTTagCompound();
    conduit.writeToNBT(tc);
  }

  @Override
  public void toBytes(ByteBuf buf) {
    super.toBytes(buf);
    ByteBufUtils.writeTag(buf, tc);
  }

  @Override
  public void fromBytes(ByteBuf buf) {
    super.fromBytes(buf);
    tc = ByteBufUtils.readTag(buf);
  }

  @Override
  public IMessage onMessage(PacketGtLevel message, MessageContext ctx) {
    // TODO ClientUtil.doGasLevelUpdate(message.x, message.y, message.z, message);
    return null;
  }
}