Made server log stop command, partial teleporter fix

This commit is contained in:
Anuken
2018-02-15 17:00:59 -05:00
parent 008889966f
commit d117225877
8 changed files with 21 additions and 18 deletions

View File

@@ -138,10 +138,11 @@ public class NetEvents {
Net.send(packet, SendMode.udp);
}
public static void handleItemAdd(Tile tile, Item item){
ItemAddPacket packet = new ItemAddPacket();
public static void handleItemSet(Tile tile, Item item, byte amount){
ItemSetPacket packet = new ItemSetPacket();
packet.position = tile.packedPosition();
packet.itemid = (byte)item.id;
packet.amount = amount;
Net.send(packet, SendMode.udp);
}

View File

@@ -523,20 +523,22 @@ public class Packets {
}
}
public static class ItemAddPacket implements Packet, UnimportantPacket{
public static class ItemSetPacket implements Packet, UnimportantPacket{
public int position;
public byte itemid;
public byte itemid, amount;
@Override
public void write(ByteBuffer buffer) {
buffer.putInt(position);
buffer.put(itemid);
buffer.put(amount);
}
@Override
public void read(ByteBuffer buffer) {
position = buffer.getInt();
itemid = buffer.get();
amount = buffer.get();
}
}

View File

@@ -39,7 +39,7 @@ public class Registrator {
MapAckPacket.class,
EntitySpawnPacket.class,
ItemTransferPacket.class,
ItemAddPacket.class,
ItemSetPacket.class,
ItemOffloadPacket.class
};
private static ObjectIntMap<Class<?>> ids = new ObjectIntMap<>();