Display Tags Alphabetically in Cloner

This commit is contained in:
Kam committed 2023-05-06 15:59:45 -04:00
1 parent 2c6fb0d15b
commit 867a8a3d82
2 files changed
+12 -1

No files matched your search

@@ -59,7 +59,7 @@ public class GuiCustomScrollCloner extends GuiCustomScroll {
int tagStartX = j + fontRendererObj.getStringWidth(displayString) + 5;
if(GuiNpcMobSpawner.displayTags == 0 || GuiNpcMobSpawner.displayTags == 1){
if (this.parent.tagMap.hasClone(list.get(i))) {
for (UUID tagUUID : this.parent.tagMap.getUUIDs(list.get(i))){
for (UUID tagUUID : this.parent.tagMap.getUUIDsList(list.get(i))){
Tag tag = this.parent.tags.get(tagUUID);
if(tag != null){
if(GuiNpcMobSpawner.displayTags == 1 || !tag.getIsHidden()){
@@ -72,6 +72,17 @@ public class TagMap {
return null;
}
public List<UUID> getUUIDsList(String cloneName) {
HashSet<UUID> uuids = getUUIDs(cloneName);
if(uuids != null){
List<UUID> tagUUIDS = new ArrayList<>(uuids);
Collections.sort(tagUUIDS);
return tagUUIDS;
}
return null;
}
public boolean removeClone(String cloneName) {
return tagMap.remove(cloneName) != null;
}