Fixed incorrect mode selection, updated TODO
This commit is contained in:
@@ -144,4 +144,11 @@ public class NetEvents {
|
||||
packet.itemid = (byte)item.id;
|
||||
Net.send(packet, SendMode.udp);
|
||||
}
|
||||
|
||||
public static void handleOffload(Tile tile, Item item){
|
||||
ItemOffloadPacket packet = new ItemOffloadPacket();
|
||||
packet.position = tile.packedPosition();
|
||||
packet.itemid = (byte)item.id;
|
||||
Net.send(packet, SendMode.udp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -523,7 +523,24 @@ public class Packets {
|
||||
}
|
||||
}
|
||||
|
||||
public static class ItemAddPacket implements Packet{
|
||||
public static class ItemAddPacket implements Packet, UnimportantPacket{
|
||||
public int position;
|
||||
public byte itemid;
|
||||
|
||||
@Override
|
||||
public void write(ByteBuffer buffer) {
|
||||
buffer.putInt(position);
|
||||
buffer.put(itemid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(ByteBuffer buffer) {
|
||||
position = buffer.getInt();
|
||||
itemid = buffer.get();
|
||||
}
|
||||
}
|
||||
|
||||
public static class ItemOffloadPacket implements Packet{
|
||||
public int position;
|
||||
public byte itemid;
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ public class Registrator {
|
||||
EntitySpawnPacket.class,
|
||||
ItemTransferPacket.class,
|
||||
ItemAddPacket.class,
|
||||
ItemOffloadPacket.class
|
||||
};
|
||||
private static ObjectIntMap<Class<?>> ids = new ObjectIntMap<>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user