mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 13:09:11 +00:00
All external scripts of type "Java" are now synced to client on login/script reload
This commit is contained in:
1 parent
8a2ba6ae4e
commit
a8b3c0b8d4
4 files changed
+49
-27
No files matched your search
@@ -3,7 +3,9 @@ package noppes.npcs.controllers;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import jdk.nashorn.api.scripting.ClassFilter;
|
||||
import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
|
||||
import kamkeel.npcs.network.packets.request.script.ScriptFilesPacket;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
@@ -230,6 +232,14 @@ public class ScriptController {
|
||||
customNPCThread.execute(this::saveGlobalNpcScripts);
|
||||
}
|
||||
|
||||
public void syncClientScripts(EntityPlayerMP player) {
|
||||
if (player != null) {
|
||||
ScriptFilesPacket.sendToPlayer(player, "Java");
|
||||
} else {
|
||||
ScriptFilesPacket.sendToAll("Java");
|
||||
}
|
||||
}
|
||||
|
||||
public void loadCategories() {
|
||||
dir = new File(CustomNpcs.getWorldSaveDirectory(), "scripts");
|
||||
if (!dir.exists())
|
||||
|
||||
Reference in new issue
Block a user