read and write entire item stack using PacketHandler in TransporterStack
This commit is contained in:
parent
1523b402b3
commit
f284886d5c
1 changed files with 5 additions and 9 deletions
|
@ -1,18 +1,16 @@
|
|||
package mekanism.common.transporter;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.common.ILogisticalTransporter;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.tile.TileEntityLogisticalSorter;
|
||||
import mekanism.common.transporter.TransporterPathfinder.Destination;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.TransporterUtils;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
@ -65,9 +63,7 @@ public class TransporterStack
|
|||
|
||||
getPrev(tileEntity).write(data);
|
||||
|
||||
data.add(MekanismUtils.getID(itemStack));
|
||||
data.add(itemStack.stackSize);
|
||||
data.add(itemStack.getItemDamage());
|
||||
data.add(itemStack);
|
||||
}
|
||||
|
||||
public void read(ByteBuf dataStream)
|
||||
|
@ -93,7 +89,7 @@ public class TransporterStack
|
|||
|
||||
clientPrev = Coord4D.read(dataStream);
|
||||
|
||||
itemStack = new ItemStack(Item.getItemById(dataStream.readInt()), dataStream.readInt(), dataStream.readInt());
|
||||
itemStack = PacketHandler.readStack(dataStream);
|
||||
}
|
||||
|
||||
public void write(NBTTagCompound nbtTags)
|
||||
|
|
Loading…
Reference in a new issue