mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-08-27 04:37:47 +00:00
Full audit fixpass: 93 defect fixes, 14 perf wins, vestigial cleanup
This commit is contained in:
@@ -103,6 +103,36 @@ public interface IrisPlatform {
|
||||
*/
|
||||
File dataFile(String... path);
|
||||
|
||||
/**
|
||||
* Root under which installed packs live, resolved against optional sub-segments and created if
|
||||
* missing. Defaults to {@code dataFolder("packs")}; platforms whose packs live outside the data
|
||||
* folder (mod loaders) override this. Never null.
|
||||
*/
|
||||
default File packsFolder(String... sub) {
|
||||
if (sub == null || sub.length == 0) {
|
||||
return dataFolder("packs");
|
||||
}
|
||||
|
||||
String[] path = new String[sub.length + 1];
|
||||
path[0] = "packs";
|
||||
System.arraycopy(sub, 0, path, 1, sub.length);
|
||||
return dataFolder(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Same resolution as {@link #packsFolder(String...)} without creating anything on disk. Never null.
|
||||
*/
|
||||
default File packsFolderNoCreate(String... sub) {
|
||||
if (sub == null || sub.length == 0) {
|
||||
return dataFolderNoCreate("packs");
|
||||
}
|
||||
|
||||
String[] path = new String[sub.length + 1];
|
||||
path[0] = "packs";
|
||||
System.arraycopy(sub, 0, path, 1, sub.length);
|
||||
return dataFolderNoCreate(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* The Iris artifact this runtime was loaded from: the plugin jar on Bukkit, the mod jar on a mod
|
||||
* loader. The Bukkit-flavoured name is retained for source compatibility. Never null; adapters that
|
||||
|
||||
Reference in New Issue
Block a user