mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
Read server properties file for proper dpacks folder
This commit is contained in:
parent
24aaefe342
commit
c05f169d54
@ -71,21 +71,24 @@ public class Iris extends VolmitPlugin implements Listener {
|
|||||||
boolean reboot = false;
|
boolean reboot = false;
|
||||||
File packs = new File("plugins/Iris/packs");
|
File packs = new File("plugins/Iris/packs");
|
||||||
File dpacks = null;
|
File dpacks = null;
|
||||||
|
File props = new File("server.properties");
|
||||||
|
|
||||||
look: for(File i : new File(".").listFiles())
|
if(props.exists())
|
||||||
{
|
{
|
||||||
if(i.isDirectory())
|
try {
|
||||||
{
|
KList<String> m = new KList<>(IO.readAll(props).split("\\Q\n\\E"));
|
||||||
for(File j : i.listFiles())
|
|
||||||
{
|
for(String i : m) {
|
||||||
if(j.isDirectory() && j.getName().equals("datapacks"))
|
if (i.trim().startsWith("level-name="))
|
||||||
{
|
{
|
||||||
dpacks = j;
|
dpacks = new File(i.trim().split("\\Q\\E")[1] + "/datapacks");
|
||||||
break look;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} catch (IOException e) {
|
||||||
}
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(dpacks == null)
|
if(dpacks == null)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user