mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 05:45:03 +00:00
Overhaul Dialog GUI
This commit is contained in:
1 parent
327fa061cc
commit
22bc05ddcc
10 files changed
+592
-228
No files matched your search
@@ -571,6 +571,18 @@ public class NoppesUtilServer {
|
||||
Server.sendData(player, EnumPacketClient.SCROLL_DATA, send);
|
||||
}
|
||||
|
||||
public static void sendScrollGroup(EntityPlayerMP player, Map<String,Integer> map){
|
||||
Map<String, Integer> send = new HashMap<String, Integer>();
|
||||
for(String key : map.keySet()){
|
||||
send.put(key, map.get(key));
|
||||
if(send.size() == 100){
|
||||
Server.sendData(player, EnumPacketClient.SCROLL_GROUP_PART, send);
|
||||
send = new HashMap<String, Integer>();
|
||||
}
|
||||
}
|
||||
Server.sendData(player, EnumPacketClient.SCROLL_GROUP, send);
|
||||
}
|
||||
|
||||
public static void sendDialogData(EntityPlayerMP player, DialogCategory category) {
|
||||
if(category == null)
|
||||
return;
|
||||
@@ -581,6 +593,27 @@ public class NoppesUtilServer {
|
||||
sendScrollData(player, map);
|
||||
}
|
||||
|
||||
public static void sendDialogGroup(EntityPlayerMP player, DialogCategory category) {
|
||||
if(category == null)
|
||||
return;
|
||||
HashMap<String,Integer> map = new HashMap<String,Integer>();
|
||||
for(Dialog dialog : category.dialogs.values()){
|
||||
map.put(dialog.title, dialog.id);
|
||||
}
|
||||
|
||||
Map<String, Integer> send = new HashMap<String, Integer>();
|
||||
for(String key : map.keySet()){
|
||||
send.put(key, map.get(key));
|
||||
if(send.size() == 100){
|
||||
Server.sendData(player, EnumPacketClient.SCROLL_GROUP_PART, send);
|
||||
send = new HashMap<String, Integer>();
|
||||
}
|
||||
}
|
||||
Server.sendData(player, EnumPacketClient.SCROLL_GROUP, send);
|
||||
|
||||
sendScrollGroup(player, map);
|
||||
}
|
||||
|
||||
public static void sendQuestData(EntityPlayerMP player, QuestCategory category) {
|
||||
if(category == null)
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user