Random things
This commit is contained in:
@@ -47,6 +47,4 @@ public class UnsafeUtil {
|
||||
public static void memcpy(short[] src, long dst) {
|
||||
UNSAFE.copyMemory(src, SHORT_ARRAY_BASE_OFFSET, null, dst, (long) src.length <<1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -41,17 +41,17 @@ public class WorldEngine {
|
||||
|
||||
public final @Nullable VoxyInstance instanceIn;
|
||||
|
||||
public WorldEngine(SectionStorage storage, int cacheCount) {
|
||||
this(storage, cacheCount, null);
|
||||
public WorldEngine(SectionStorage storage) {
|
||||
this(storage, null);
|
||||
}
|
||||
|
||||
public WorldEngine(SectionStorage storage, int cacheCount, @Nullable VoxyInstance instance) {
|
||||
public WorldEngine(SectionStorage storage, @Nullable VoxyInstance instance) {
|
||||
this.instanceIn = instance;
|
||||
|
||||
this.storage = storage;
|
||||
this.mapper = new Mapper(this.storage);
|
||||
//5 cache size bits means that the section tracker has 32 separate maps that it uses
|
||||
this.sectionTracker = new ActiveSectionTracker(10, storage::loadSection, cacheCount, this);
|
||||
this.sectionTracker = new ActiveSectionTracker(10, storage::loadSection, 2048, this);
|
||||
}
|
||||
|
||||
public WorldSection acquireIfExists(int lvl, int x, int y, int z) {
|
||||
|
||||
@@ -67,6 +67,7 @@ public class VoxyInstance {
|
||||
if (!this.activeWorlds.isEmpty()) {
|
||||
throw new IllegalStateException("Not all worlds shutdown");
|
||||
}
|
||||
Logger.info("Instance shutdown");
|
||||
}
|
||||
|
||||
public ServiceThreadPool getThreadPool() {
|
||||
@@ -99,7 +100,7 @@ public class VoxyInstance {
|
||||
}
|
||||
|
||||
protected WorldEngine createWorld(SectionStorage storage) {
|
||||
var world = new WorldEngine(storage, 2048, this);
|
||||
var world = new WorldEngine(storage, this);
|
||||
world.setSaveCallback(this.savingService::enqueueSave);
|
||||
this.activeWorlds.add(world);
|
||||
return world;
|
||||
|
||||
Reference in New Issue
Block a user