mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-30 20:39:21 +00:00
Works, but somehow i broke parallax
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package com.volmit.iris.scaffold;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.manager.IrisDataManager;
|
||||
import com.volmit.iris.object.IrisDimension;
|
||||
import com.volmit.iris.scaffold.engine.EngineCompositeGenerator;
|
||||
import org.bukkit.World;
|
||||
@@ -71,7 +71,7 @@ public class IrisWorldCreator
|
||||
return World.Environment.NORMAL;
|
||||
}
|
||||
|
||||
IrisDimension dim = Iris.globaldata.getDimensionLoader().load(dimensionName);
|
||||
IrisDimension dim = IrisDataManager.loadAnyDimension(dimensionName);
|
||||
|
||||
if(dim != null)
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
|
||||
public void hotload()
|
||||
{
|
||||
Iris.globaldata.dump();
|
||||
getData().dump();
|
||||
initialized.lazySet(false);
|
||||
}
|
||||
|
||||
@@ -78,7 +78,8 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
for (File j : i.listFiles()) {
|
||||
if (j.isFile() && j.getName().endsWith(".json")) {
|
||||
hint = j.getName().replaceAll("\\Q.json\\E", "");
|
||||
break searching;
|
||||
Iris.error("Found v1 install. Please create a new world, this will cause chunks to change in your existing iris worlds!");
|
||||
throw new RuntimeException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -97,14 +98,14 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
throw new RuntimeException("Cannot find iris dimension data for world: " + world.getName() + "! FAILED");
|
||||
}
|
||||
|
||||
dim = Iris.globaldata.preferFolder(hint).getDimensionLoader().load(hint);
|
||||
dim = IrisDataManager.loadAnyDimension(hint);
|
||||
|
||||
if (dim == null) {
|
||||
throw new RuntimeException("Cannot find dimension: " + hint);
|
||||
}
|
||||
|
||||
if (production) {
|
||||
dim = new IrisDataManager(getDataFolder(world), true).preferFolder(dim.getLoadKey()).getDimensionLoader().load(dim.getLoadKey());
|
||||
dim = new IrisDataManager(getDataFolder(world)).getDimensionLoader().load(dim.getLoadKey());
|
||||
|
||||
if (dim == null) {
|
||||
throw new RuntimeException("Cannot find dimension: " + hint);
|
||||
@@ -119,9 +120,8 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
return;
|
||||
}
|
||||
|
||||
IrisDataManager data = production ? new IrisDataManager(getDataFolder(world)) : Iris.globaldata.copy();
|
||||
IrisDimension dim = getDimension(world);
|
||||
data.preferFolder(dim.getLoadKey());
|
||||
IrisDataManager data = production ? new IrisDataManager(getDataFolder(world)) : dim.getLoader().copy();
|
||||
compound = new IrisEngineCompound(world, dim, data, Iris.getThreadCount());
|
||||
initialized.set(true);
|
||||
populators.clear();
|
||||
|
||||
@@ -137,7 +137,7 @@ public interface IrisAccess extends Hotloadable, DataProvider {
|
||||
|
||||
public default Location lookForRegion(IrisRegion reg, long timeout, Consumer<Integer> triesc)
|
||||
{
|
||||
ChronoLatch cl = new ChronoLatch(250, false);
|
||||
ChronoLatch cl = new ChronoLatch(3000, false);
|
||||
long s = M.ms();
|
||||
int cpus = 2+(Runtime.getRuntime().availableProcessors()/2);
|
||||
KList<Engine> engines = new KList<>();
|
||||
|
||||
@@ -1,16 +1,37 @@
|
||||
package com.volmit.iris.scaffold.parallel;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
|
||||
public class MultiBurst
|
||||
{
|
||||
public static MultiBurst burst = new MultiBurst(Runtime.getRuntime().availableProcessors());
|
||||
private ExecutorService service;
|
||||
private int tid;
|
||||
|
||||
public MultiBurst(int tc)
|
||||
{
|
||||
service = Executors.newWorkStealingPool(tc);
|
||||
service = Executors.newFixedThreadPool(tc, new ThreadFactory()
|
||||
{
|
||||
@Override
|
||||
public Thread newThread(Runnable r)
|
||||
{
|
||||
tid++;
|
||||
Thread t = new Thread(r);
|
||||
t.setName("Iris Generator " + tid);
|
||||
t.setPriority(Thread.MAX_PRIORITY);
|
||||
t.setUncaughtExceptionHandler((et, e) ->
|
||||
{
|
||||
Iris.info("Exception encountered in " + et.getName());
|
||||
e.printStackTrace();
|
||||
});
|
||||
|
||||
return t;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void burst(Runnable... r)
|
||||
|
||||
Reference in New Issue
Block a user