Sort of Working

This commit is contained in:
KAMKEEL committed 2023-03-22 22:03:01 -04:00
1 parent 9d68a5e079
commit c4b9a5ca21
3 files changed
+16 -7

No files matched your search

@@ -16,16 +16,18 @@ import noppes.npcs.client.gui.util.*;
import noppes.npcs.constants.EnumPacketServer;
import noppes.npcs.controllers.data.Tag;
import noppes.npcs.controllers.data.TagMap;
import org.lwjgl.Sys;
import java.lang.reflect.Modifier;
import java.util.*;
public class GuiNpcMobSpawner extends GuiNPCInterface implements IGuiData {
public static HashMap<String, UUID> tagNames = new HashMap<>();
public static HashMap<UUID, Tag> tags = new HashMap<>();
public static HashSet<String> tagFilters = new HashSet<>();
public byte displayTags = 0;
public static byte displayTags = 0;
public TagMap tagMap;
public HashMap<UUID, Tag> tags = new HashMap<>();
private final GuiCustomScrollCloner scroll = new GuiCustomScrollCloner(this,0);
private final GuiCustomScroll filterScroll = new GuiCustomScroll(this,1);
@@ -149,14 +151,16 @@ public class GuiNpcMobSpawner extends GuiNPCInterface implements IGuiData {
scroll.setList(getSearchList());
}
private void showClones() {
Client.sendData(EnumPacketServer.CloneTagList, activeTab);
if(showingClones == 2){
Client.sendData(EnumPacketServer.CloneTagList, activeTab);
Client.sendData(EnumPacketServer.CloneList, activeTab);
return;
}
ArrayList<String> list = new ArrayList<String>();
this.list = ClientCloneController.Instance.getClones(activeTab);
this.tagMap = ClientTagMapController.Instance.getTagMap(activeTab);
System.out.println("Client Tag Map");
System.out.println(this.tagMap);
scroll.setList(getSearchList());
}
public void keyTyped(char c, int i)
@@ -344,9 +348,9 @@ public class GuiNpcMobSpawner extends GuiNPCInterface implements IGuiData {
@Override
public void setGuiData(NBTTagCompound compound) {
if (compound.hasKey("CloneTags")) {
tagMap = new TagMap(activeTab);
this.tagMap = new TagMap(activeTab);
NBTTagCompound cloneTags = compound.getCompoundTag("CloneTags");
tagMap.readNBT(cloneTags);
this.tagMap.readNBT(cloneTags);
}
else if (compound.hasKey("AllTags")) {
NBTTagList validTags = compound.getTagList("AllTags", 10);
@@ -57,12 +57,16 @@ public class GuiCustomScrollCloner extends GuiCustomScroll {
if((this.parent.getShowingClones() == 0 || this.parent.getShowingClones() == 2) && this.parent.tagMap != null){
int tagStartX = j + fontRendererObj.getStringWidth(displayString) + 5;
if(this.parent.displayTags == 0 || this.parent.displayTags == 2){
if(GuiNpcMobSpawner.displayTags == 0 || GuiNpcMobSpawner.displayTags == 2){
if (this.parent.tagMap.hasClone(list.get(i))) {
System.out.println("BRUH 2");
for (UUID tagUUID : this.parent.tagMap.getUUIDs(list.get(i))){
Tag tag = this.parent.tags.get(tagUUID);
System.out.println("BRUH 2.5");
if(tag != null){
if(this.parent.displayTags == 2){
System.out.println("-- BRUH 3 --");
System.out.println(GuiNpcMobSpawner.displayTags);
if(GuiNpcMobSpawner.displayTags == 2){
fontRendererObj.drawString("[" + tag.name + "]", tagStartX, k, tag.color);
tagStartX += fontRendererObj.getStringWidth("[" + tag.name + "]") + 2;
}
@@ -16,6 +16,7 @@ public class TagMap {
}
public void readNBT(NBTTagCompound compound){
this.tagMap = new HashMap<String, HashSet<UUID>>();
NBTTagList list = compound.getTagList("TagMap", 10);
if(list != null){
for(int i = 0; i < list.tagCount(); i++)