Add back in NPC conversation names
The names of the npc conversations were useful for context. Added them back in.
This commit is contained in:
@@ -54,6 +54,7 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public final class PlayerLoggedinHandler extends AbstractMaplePacketHandler {
|
||||
|
||||
@@ -406,15 +407,20 @@ public final class PlayerLoggedinHandler extends AbstractMaplePacketHandler {
|
||||
eim.registerPlayer(player);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Tell the client to use the custom scripts available for the NPCs provided, instead of the WZ entries.
|
||||
if (YamlConfig.config.server.USE_NPCS_SCRIPTABLE) {
|
||||
|
||||
// Create a set to remove duplicate entries if they exist.
|
||||
Set<Integer> npcsIds = new HashSet<>(YamlConfig.config.server.NPCS_SCRIPTABLE);
|
||||
// Create a copy to prevent always adding entries to the server's list.
|
||||
Map<Integer, String> npcsIds = YamlConfig.config.server.NPCS_SCRIPTABLE
|
||||
.entrySet().stream().collect(Collectors.toMap(
|
||||
entry -> Integer.parseInt(entry.getKey()),
|
||||
Entry::getValue
|
||||
));
|
||||
|
||||
// Any npc be specified as the rebirth npc. Allow the npc to use custom scripts explicitly.
|
||||
if (YamlConfig.config.server.USE_REBIRTH_SYSTEM) {
|
||||
npcsIds.add(YamlConfig.config.server.REBIRTH_NPC_ID);
|
||||
npcsIds.put(YamlConfig.config.server.REBIRTH_NPC_ID, "Rebirth");
|
||||
}
|
||||
|
||||
c.announce(MaplePacketCreator.setNPCScriptable(npcsIds));
|
||||
|
||||
Reference in New Issue
Block a user