Browse Source

Serialization update

combat-2
MagicBot 7 months ago
parent
commit
48f88ec819
  1. 11
      src/engine/net/client/msg/ManageNPCMsg.java

11
src/engine/net/client/msg/ManageNPCMsg.java

@ -27,8 +27,6 @@ import org.pmw.tinylog.Logger;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* Order NPC * Order NPC
@ -436,12 +434,13 @@ public class ManageNPCMsg extends ClientNetMsg {
writer.put((byte) template.modTable);//EffectItemType writer.put((byte) template.modTable);//EffectItemType
} }
List<Item> itemList = ForgeManager.vendorItemLookup.get(npc); // Sanity check.
itemList = itemList.stream().limit(npc.getRank()).collect(Collectors.toList());
writer.putInt(itemList.size()); ForgeManager.vendorItemLookup.computeIfAbsent(npc, k -> new ArrayList<>()); // Forge lookup
for (Item item : itemList) { writer.putInt(ForgeManager.vendorItemLookup.get(npc).size());
for (Item item : ForgeManager.vendorItemLookup.get(npc)) {
writer.put((byte) 0); // ? Unknown45 writer.put((byte) 0); // ? Unknown45
writer.putInt(item.getObjectType().ordinal()); writer.putInt(item.getObjectType().ordinal());

Loading…
Cancel
Save