mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 16:37:45 +00:00
Byte Map
This commit is contained in:
1 parent
38f5089af9
commit
9ce10778e3
1 file changed
+24
@@ -113,6 +113,30 @@ public class NBTTags {
|
||||
return list;
|
||||
}
|
||||
|
||||
public static HashMap<Integer, Byte> getIntegerByteMap(
|
||||
NBTTagList tagList) {
|
||||
HashMap<Integer, Byte> list = new HashMap<Integer, Byte>();
|
||||
for(int i = 0; i < tagList.tagCount(); i++)
|
||||
{
|
||||
NBTTagCompound nbttagcompound = tagList.getCompoundTagAt(i);
|
||||
list.put(nbttagcompound.getInteger("Slot"), nbttagcompound.getByte("Byte"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static NBTTagList nbtIntegerByteMap(Map<Integer, Byte> lines) {
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
if(lines == null)
|
||||
return nbttaglist;
|
||||
for (int slot : lines.keySet()) {
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
nbttagcompound.setInteger("Slot", slot);
|
||||
nbttagcompound.setByte("Byte", lines.get(slot));
|
||||
nbttaglist.appendTag(nbttagcompound);
|
||||
}
|
||||
return nbttaglist;
|
||||
}
|
||||
|
||||
public static NBTTagList nbtStringSet(HashSet<String> collection) {
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
if(collection == null)
|
||||
|
||||
Reference in new issue
Block a user