mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 17:39:39 +00:00
TagMap initial commit
This commit is contained in:
1 parent
6e74bc0597
commit
6714daa60a
1 file changed
+47
@@ -0,0 +1,47 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import java.util.*;
|
||||
|
||||
public class TagMap {
|
||||
public int cloneTab;
|
||||
public HashMap<String, Set<UUID>> tagMap;
|
||||
|
||||
public TagMap(int tab){
|
||||
this.cloneTab = tab;
|
||||
this.tagMap = new HashMap<String, Set<UUID>>();
|
||||
}
|
||||
|
||||
public void readNBT(NBTTagCompound compound){
|
||||
NBTTagList list = compound.getTagList(String.valueOf((cloneTab)), 10);
|
||||
if(list != null){
|
||||
for(int i = 0; i < list.tagCount(); i++)
|
||||
{
|
||||
NBTTagCompound nbttagcompound = list.getCompoundTagAt(i);
|
||||
String cloneName = nbttagcompound.getString("Clone");
|
||||
NBTTagList allUUIDs = compound.getTagList("UUIDs", 10);
|
||||
Set<UUID> uuids = new HashSet<UUID>();
|
||||
if(list != allUUIDs){
|
||||
for(int j = 0; j < allUUIDs.tagCount(); j++)
|
||||
{
|
||||
NBTTagCompound uuidCompound = list.getCompoundTagAt(j);
|
||||
String uuid = nbttagcompound.getString("UUID");
|
||||
if(!uuid.isEmpty()){
|
||||
uuids.add(UUID.fromString(uuid));
|
||||
}
|
||||
}
|
||||
}
|
||||
tagMap.put(cloneName, uuids);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void writeNBT(NBTTagCompound compound){
|
||||
|
||||
}
|
||||
|
||||
public int getCloneTab() {
|
||||
return this.cloneTab;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user