mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-19 07:11:14 +00:00
feat: add fine-grained biome control to Minestom world builder
Introduced a `doFineGrainedBiomes` flag to allow fine-grained biome control per chunk. This helps mitigate client disconnection issues caused by a Minestom biome encoding bug, with a plan to deprecate once the bug is resolved. Adjusted relevant classes and the example implementation to support this feature.
This commit is contained in:
+4
-1
@@ -6,6 +6,7 @@ import net.minestom.server.command.builder.Command;
|
||||
import net.minestom.server.coordinate.Pos;
|
||||
import net.minestom.server.entity.GameMode;
|
||||
import net.minestom.server.event.player.AsyncPlayerConfigurationEvent;
|
||||
import net.minestom.server.event.player.PlayerDisconnectEvent;
|
||||
import net.minestom.server.event.player.PlayerSpawnEvent;
|
||||
import net.minestom.server.instance.Instance;
|
||||
import net.minestom.server.instance.LightingChunk;
|
||||
@@ -23,6 +24,7 @@ public class TerraMinestomExample {
|
||||
private final MinecraftServer server = MinecraftServer.init();
|
||||
private Instance instance;
|
||||
private TerraMinestomWorld world;
|
||||
private final TerraMinestomPlatform platform = new TerraMinestomPlatform();
|
||||
|
||||
public void createNewInstance() {
|
||||
instance = MinecraftServer.getInstanceManager().createInstanceContainer();
|
||||
@@ -30,9 +32,9 @@ public class TerraMinestomExample {
|
||||
}
|
||||
|
||||
public void attachTerra() {
|
||||
TerraMinestomPlatform platform = new TerraMinestomPlatform();
|
||||
world = platform.worldBuilder(instance)
|
||||
.defaultPack()
|
||||
.doFineGrainedBiomes(false)
|
||||
.attach();
|
||||
}
|
||||
|
||||
@@ -122,6 +124,7 @@ public class TerraMinestomExample {
|
||||
private void regenerate() {
|
||||
instance.sendMessage(Component.text("Regenerating world"));
|
||||
Instance oldInstance = instance;
|
||||
platform.reload();
|
||||
createNewInstance();
|
||||
attachTerra();
|
||||
preloadWorldAndMeasure();
|
||||
|
||||
Reference in New Issue
Block a user