mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 20:44:08 +00:00
.d.ts API asset files are now reloaded on mc resource reload
This commit is contained in:
1 parent
fa38f93677
commit
5c53b7e768
2 files changed
+8
No files matched your search
@@ -9,6 +9,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.LogWriter;
|
||||
import noppes.npcs.client.gui.util.script.interpreter.js_parser.JSTypeRegistry;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.Graphics;
|
||||
@@ -30,6 +31,11 @@ public class CustomNpcResourceListener implements
|
||||
|
||||
FolderResourcePack pack = new FolderResourcePack(CustomNpcs.Dir);
|
||||
simplemanager.reloadResourcePack(pack);
|
||||
|
||||
// Reload scripting .d.ts files
|
||||
JSTypeRegistry registry = JSTypeRegistry.getInstance();
|
||||
registry.clear();
|
||||
registry.initializeFromResources();
|
||||
|
||||
try {
|
||||
DefaultTextColor = Integer.parseInt(StatCollector.translateToLocal("customnpcs.defaultTextColor"), 16);
|
||||
|
||||
+2
@@ -842,6 +842,8 @@ public class JSTypeRegistry {
|
||||
globalEngineObjects.clear();
|
||||
DtsJavaBridge.clearCache();
|
||||
initialized = false;
|
||||
initializationAttempted = false;
|
||||
currentSource = null;
|
||||
}
|
||||
|
||||
private void setCurrentSource(String source) {
|
||||
|
||||
Reference in new issue
Block a user