mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 09:59:42 +00:00
ScriptController.globalRevision, Incremented whenever external scripts loaded.
This commit is contained in:
1 parent
41722a37d7
commit
a9bfa6c120
2 files changed
+10
No files matched your search
@@ -67,8 +67,10 @@ public final class ScriptFilesPacket extends AbstractPacket {
|
||||
cont.scripts.put(script.getKey(), script.getValue());
|
||||
}
|
||||
|
||||
//Set client side configs
|
||||
ConfigScript.ScriptingEnabled = compound.getBoolean("ScriptingEnabled");
|
||||
ConfigScript.RunLoadedScriptsFirst = compound.getBoolean("LoadedFirst");
|
||||
ScriptController.Instance.globalRevision = compound.getInteger("GlobalRevision");
|
||||
}
|
||||
|
||||
public NBTTagCompound getScriptsNbt(String lang) {
|
||||
@@ -88,6 +90,7 @@ public final class ScriptFilesPacket extends AbstractPacket {
|
||||
//Send server configs to client
|
||||
compound.setBoolean("ScriptingEnabled", ConfigScript.ScriptingEnabled);
|
||||
compound.setBoolean("LoadedFirst", ConfigScript.RunLoadedScriptsFirst);
|
||||
compound.setInteger("GlobalRevision", ScriptController.Instance.globalRevision);
|
||||
compound.setTag("Scripts", NBTTags.nbtStringStringMap(scriptss));
|
||||
return compound;
|
||||
}
|
||||
|
||||
@@ -64,6 +64,12 @@ public class ScriptController {
|
||||
public GlobalNPCDataScript globalNpcScripts = new GlobalNPCDataScript((EntityNPCInterface) null);
|
||||
public long lastGlobalNpcUpdate = 0L;
|
||||
|
||||
/**
|
||||
* Incremented whenever external scripts loaded.
|
||||
*/
|
||||
public int globalRevision;
|
||||
|
||||
|
||||
public ScriptController() {
|
||||
Instance = this;
|
||||
manager = new ScriptEngineManager();
|
||||
@@ -257,6 +263,7 @@ public class ScriptController {
|
||||
loadDir(scriptDir, "", ext);
|
||||
}
|
||||
lastLoaded = System.currentTimeMillis();
|
||||
globalRevision++;
|
||||
}
|
||||
|
||||
private void loadDir(File dir, String name, String ext) {
|
||||
|
||||
Reference in new issue
Block a user