fix some seedoverlay bugs

This commit is contained in:
TudbuT 2024-05-29 19:19:24 +02:00
parent fb554d71cf
commit 8b8473ffa2
3 changed files with 21 additions and 13 deletions

View file

@ -55,11 +55,11 @@ public class AutoTotem extends Feature {
/// GATES END
@Config("Render totem amount in HUD")
@Description("Renders the Totem Count Above the Offhand.")
@Description("Renders the Totem Count above the Offhand.")
public boolean renderTotemCountHud = false;
@Config("Render totem amount in ModuleList")
@Description("Renders the Totem Count in the HUD as metadata.")
@Config("Show totem amount in ModuleList")
@Description("Shows the Totem Count in the HUD as status.")
public boolean renderTotemCountModuleList = true;
@Config("Mode")

View file

@ -130,7 +130,7 @@ public class SeedOverlay extends Feature {
backBuffer[x][0][z] = 0x800000ff;
}
}
GlobalUtil.LOGGER.info("Filled buffer with test state.");
GlobalUtil.LOGGER.info("Filled buffer with unloaded state.");
BaseBand.notify("Render buffer created. Starting...");
setEnabled(true);
}, this + " init").start();
@ -160,8 +160,6 @@ public class SeedOverlay extends Feature {
generator.stop();
}
canSetRD = true;
genOverworld.destroy();
genNether.destroy();
genEnd.destroy();
@ -171,6 +169,9 @@ public class SeedOverlay extends Feature {
bufferPosition = null;
frontBuffer = null;
backBuffer = null;
canSetRD = true;
GlobalUtil.LOGGER.info("SeedOverlay completely disabled.");
}, this + " stopper").start();
}
@ -278,7 +279,7 @@ public class SeedOverlay extends Feature {
backBuffer[x][0][z] = 0x800000ff;
continue;
}
if(rc.isEmpty() || !rc.isTerrainPopulated())
if(rc.isEmpty())
continue;
for (int y = 0; y < backBuffer[x].length; y++) {
Block oBlock = c.getBlockState(x, y, z).getBlock();

View file

@ -16,6 +16,7 @@ import net.minecraft.world.DimensionType;
import net.minecraft.world.World;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.EmptyChunk;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.ChunkGeneratorEnd;
import net.minecraft.world.gen.ChunkGeneratorHell;
@ -88,13 +89,19 @@ public class SimpleWorldGenerator implements IChunkProvider {
}
public synchronized Chunk gen(int x, int z) {
Chunk chunk = generator.generateChunk(x, z);
loaded.put(chunk.getPos(), chunk);
chunk.onLoad();
chunk.populate(this, generator);
chunk.onTick(true);
try {
Chunk chunk = generator.generateChunk(x, z);
loaded.put(chunk.getPos(), chunk);
try {
chunk.onLoad();
chunk.populate(this, generator);
chunk.onTick(true);
} catch(Exception ignored) {}
return chunk;
return chunk;
} catch(Exception e) {
return new EmptyChunk(world, x, z);
}
}