9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-26 02:29:14 +00:00

Init engine on world touch / access / checks

This commit is contained in:
cyberpwn
2021-09-10 09:13:06 -04:00
parent 79299112eb
commit 4b3a016d70
4 changed files with 19 additions and 1 deletions

View File

@@ -87,7 +87,13 @@ public class IrisToolbelt {
return false;
}
return world.getGenerator() instanceof PlatformChunkGenerator;
if(world.getGenerator() instanceof PlatformChunkGenerator f)
{
f.touch(world);
return true;
}
return false;
}
public static boolean isIrisStudioWorld(World world) {

View File

@@ -263,6 +263,11 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
});
}
@Override
public void touch(World world) {
getEngine(world);
}
@Override
public @NotNull ChunkData generateChunkData(@NotNull World world, @NotNull Random ignored, int x, int z, @NotNull BiomeGrid biome) {
try {

View File

@@ -153,6 +153,11 @@ public class HeadlessGenerator implements PlatformChunkGenerator {
return false;
}
@Override
public void touch(World world) {
}
public KList<Position2> getChunksInRegion(int x, int z) {
try {
return MCAUtil.sampleChunkPositions(writer.getRegionFile(x, z));

View File

@@ -46,4 +46,6 @@ public interface PlatformChunkGenerator extends Hotloadable, DataProvider {
void close();
boolean isStudio();
void touch(World world);
}