mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 03:47:27 +00:00
HasCode() now checks for if loaded scripts are applied
This commit is contained in:
1 parent
9bf31db55c
commit
fa6a061e20
2 files changed
+3
-1
No files matched your search
@@ -228,6 +228,8 @@ public class ScriptContainer {
|
||||
}
|
||||
|
||||
public boolean hasCode() {
|
||||
if(!scripts.isEmpty())
|
||||
return true;
|
||||
return !this.getFullCode().isEmpty();
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ public class DataScript implements INpcScriptHandler {
|
||||
for (Map.Entry<EnumScriptType,ScriptContainer> entry : scripts.entrySet()) {
|
||||
NBTTagCompound tagCompound = new NBTTagCompound();
|
||||
ScriptContainer container = entry.getValue();
|
||||
if (container.hasCode() || !container.scripts.isEmpty()) {
|
||||
if (container.hasCode()) {
|
||||
tagCompound.setInteger("Type", entry.getKey().ordinal());
|
||||
container.writeToNBT(tagCompound);
|
||||
list.appendTag(tagCompound);
|
||||
|
||||
Reference in new issue
Block a user