mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 10:49:07 +00:00
Remove ScrollGroup Packet
This commit is contained in:
1 parent
f5ee7451f5
commit
9d288e9d09
44 files changed
+169
-203
No files matched your search
@@ -19,6 +19,7 @@ import noppes.npcs.client.gui.player.GuiDialogInteract;
|
||||
import noppes.npcs.client.gui.player.GuiQuestCompletion;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
import noppes.npcs.constants.EnumScrollData;
|
||||
import noppes.npcs.controllers.data.Dialog;
|
||||
import noppes.npcs.controllers.data.Quest;
|
||||
import noppes.npcs.controllers.data.SkinOverlay;
|
||||
@@ -138,6 +139,8 @@ public class NoppesUtil {
|
||||
Vector<String> data = new Vector<String>();
|
||||
String line;
|
||||
|
||||
EnumScrollData dataType = EnumScrollData.values()[buffer.readInt()];
|
||||
|
||||
try {
|
||||
int size = buffer.readInt();
|
||||
for(int i = 0; i < size; i++){
|
||||
@@ -147,24 +150,12 @@ public class NoppesUtil {
|
||||
|
||||
}
|
||||
|
||||
((IScrollData)gui).setData(data,null);
|
||||
((IScrollData)gui).setData(data,null, dataType);
|
||||
}
|
||||
|
||||
private static HashMap<String,Integer> data = new HashMap<String,Integer>();
|
||||
private static HashMap<String,Integer> group = new HashMap<String,Integer>();
|
||||
|
||||
public static void addScrollGroup(ByteBuf buffer) {
|
||||
try {
|
||||
int size = buffer.readInt();
|
||||
for(int i = 0; i < size; i++){
|
||||
int id = buffer.readInt();
|
||||
String name = ByteBufUtils.readString(buffer);
|
||||
group.put(name, id);
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
public static void setScrollGroup(ByteBuf buffer) {
|
||||
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
|
||||
if(gui == null)
|
||||
@@ -193,6 +184,8 @@ public class NoppesUtil {
|
||||
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
|
||||
if(gui == null)
|
||||
return;
|
||||
|
||||
EnumScrollData dataType = EnumScrollData.values()[buffer.readInt()];
|
||||
try {
|
||||
int size = buffer.readInt();
|
||||
for(int i = 0; i < size; i++){
|
||||
@@ -209,7 +202,7 @@ public class NoppesUtil {
|
||||
gui = (GuiScreen) ((GuiContainerNPCInterface)gui).getSubGui();
|
||||
}
|
||||
if(gui instanceof IScrollData)
|
||||
((IScrollData)gui).setData(new Vector<String>(data.keySet()), data);
|
||||
((IScrollData)gui).setData(new Vector<String>(data.keySet()), data, dataType);
|
||||
data = new HashMap<String,Integer>();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user