mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 01:29:05 +00:00
Implemented scripted timers for players and NPCs.
This commit is contained in:
1 parent
a993c8feff
commit
4de969f6c9
15 files changed
+327
-16
No files matched your search
@@ -315,6 +315,32 @@ public class CustomNpcs {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static File getWorldSaveDirectory(String s) {
|
||||
try {
|
||||
File dir = new File(".");
|
||||
if (getServer() != null) {
|
||||
if (!getServer().isDedicatedServer()) {
|
||||
dir = new File(Minecraft.getMinecraft().mcDataDir, "saves");
|
||||
}
|
||||
|
||||
dir = new File(new File(dir, getServer().getFolderName()), "customnpcs");
|
||||
}
|
||||
|
||||
if (s != null) {
|
||||
dir = new File(dir, s);
|
||||
}
|
||||
|
||||
if (!dir.exists()) {
|
||||
dir.mkdirs();
|
||||
}
|
||||
|
||||
return dir;
|
||||
} catch (Exception var2) {
|
||||
LogWriter.error("Error getting worldsave", var2);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static MinecraftServer getServer(){
|
||||
return MinecraftServer.getServer();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user