mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-28 05:35:38 +00:00
Send Valid Tags to Client that correlate with UUIDs found on the Server. No longer needs the Clones Data
This commit is contained in:
1 parent
0943299384
commit
41c4fc66d0
5 files changed
+80
-24
No files matched your search
@@ -8,6 +8,7 @@ import noppes.npcs.LogWriter;
|
||||
import noppes.npcs.api.handler.ITagHandler;
|
||||
import noppes.npcs.api.handler.data.ITag;
|
||||
import noppes.npcs.controllers.data.Tag;
|
||||
import noppes.npcs.controllers.data.TagMap;
|
||||
import scala.Int;
|
||||
|
||||
import java.io.*;
|
||||
@@ -246,4 +247,15 @@ public class TagController implements ITagHandler {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public HashSet<Tag> getValidTags(TagMap tagMap){
|
||||
HashSet<Tag> tags = new HashSet<Tag>();
|
||||
for(UUID tagUUID : tagMap.getAllUUIDs()){
|
||||
Tag foundTag = get(tagUUID);
|
||||
if(foundTag != null){
|
||||
tags.add(foundTag);
|
||||
}
|
||||
}
|
||||
return tags;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,9 @@ package noppes.npcs.controllers.data;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import noppes.npcs.controllers.ServerCloneController;
|
||||
import noppes.npcs.controllers.TagController;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class TagMap {
|
||||
@@ -84,4 +87,12 @@ public class TagMap {
|
||||
return uuids.contains(tag);
|
||||
}
|
||||
|
||||
public HashSet<UUID> getAllUUIDs() {
|
||||
HashSet<UUID> uuids = new HashSet<UUID>();
|
||||
for(HashSet<UUID> uuids1 : tagMap.values()){
|
||||
uuids.addAll(uuids1);
|
||||
}
|
||||
return uuids;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user