9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-29 20:19:06 +00:00
This commit is contained in:
Daniel Mills
2020-08-09 01:24:58 -04:00
parent e0714637ff
commit d3a4b0451d
11 changed files with 75 additions and 19 deletions

View File

@@ -115,14 +115,14 @@ public class PregenJob
rcz = 0;
mcaX++;
if(mcaX > mca(max() / 16))
if(mcaX > mca(Math.floorDiv(max(), 16)))
{
mcaX = mca(min() / 16);
mcaX = mca(Math.floorDiv(min(), 16));
mcaZ++;
if(mcaZ > mca(max() / 16))
if(mcaZ > mca(Math.floorDiv(max(), 16)))
{
mcaZ = mca(min() / 16);
mcaZ = mca(Math.floorDiv(min(), 16));
completed = true;
stop();
Iris.info("Pregen Completed!");
@@ -136,13 +136,9 @@ public class PregenJob
i.unload(true);
}
world.save();
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "save-all");
onDone.run();
return;
}
world.save();
}
}
}

View File

@@ -20,6 +20,7 @@ public class ResourceLoader<T extends IrisRegistrant>
protected Class<? extends T> objectClass;
protected String cname;
protected IrisLock lock;
protected String preferredFolder = null;
public ResourceLoader(File root, String folderName, String resourceTypeName, Class<? extends T> objectClass)
{
@@ -115,6 +116,18 @@ public class ResourceLoader<T extends IrisRegistrant>
}
}
}
if(preferredFolder != null)
{
for(File i : folderCache.copy())
{
if(i.getParentFile().getName().equals(preferredFolder))
{
folderCache.remove(i);
folderCache.add(0, i);
}
}
}
}
return folderCache;
@@ -171,4 +184,9 @@ public class ResourceLoader<T extends IrisRegistrant>
{
return loadCache.containsKey(next);
}
public void preferFolder(String name)
{
preferredFolder = name;
}
}