mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 02:37:27 +00:00
NPC's script containers are only saved to NBT if they have code.
This commit is contained in:
1 parent
4046213fa8
commit
a422f041d5
1 file changed
+6
-3
@@ -116,9 +116,12 @@ public class DataScript implements INpcScriptHandler {
|
||||
NBTTagList list = new NBTTagList();
|
||||
for (Map.Entry<EnumScriptType,ScriptContainer> entry : scripts.entrySet()) {
|
||||
NBTTagCompound tagCompound = new NBTTagCompound();
|
||||
tagCompound.setInteger("Type", entry.getKey().ordinal());
|
||||
entry.getValue().writeToNBT(tagCompound);
|
||||
list.appendTag(tagCompound);
|
||||
ScriptContainer container = entry.getValue();
|
||||
if (container.hasCode()) {
|
||||
tagCompound.setInteger("Type", entry.getKey().ordinal());
|
||||
container.writeToNBT(tagCompound);
|
||||
list.appendTag(tagCompound);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user