mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 02:20:57 +00:00
Merge pull request #533 from everbuild-org/fix/minestom-platform-fixes
Minestom 1.21.8/9/10 & Metapack support
This commit is contained in:
@@ -96,6 +96,6 @@ object Versions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
object Minestom {
|
object Minestom {
|
||||||
const val minestom = "1_21_6-a40d7115d4"
|
const val minestom = "2025.10.04-1.21.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ dependencies {
|
|||||||
shadedApi("com.github.ben-manes.caffeine", "caffeine", Versions.Libraries.caffeine)
|
shadedApi("com.github.ben-manes.caffeine", "caffeine", Versions.Libraries.caffeine)
|
||||||
shadedImplementation("com.google.guava", "guava", Versions.Libraries.Internal.guava)
|
shadedImplementation("com.google.guava", "guava", Versions.Libraries.Internal.guava)
|
||||||
|
|
||||||
compileOnly("net.minestom", "minestom-snapshots", Versions.Minestom.minestom)
|
compileOnly("net.minestom", "minestom", Versions.Minestom.minestom)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.named("jar") {
|
tasks.named("jar") {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ val javaMainClass = "com.dfsek.terra.minestom.TerraMinestomExample"
|
|||||||
dependencies {
|
dependencies {
|
||||||
shadedApi(project(":platforms:minestom"))
|
shadedApi(project(":platforms:minestom"))
|
||||||
|
|
||||||
implementation("net.minestom", "minestom-snapshots", Versions.Minestom.minestom)
|
implementation("net.minestom", "minestom", Versions.Minestom.minestom)
|
||||||
implementation("org.slf4j", "slf4j-simple", Versions.Libraries.slf4j)
|
implementation("org.slf4j", "slf4j-simple", Versions.Libraries.slf4j)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import net.minestom.server.event.player.AsyncPlayerConfigurationEvent;
|
|||||||
import net.minestom.server.event.player.PlayerSpawnEvent;
|
import net.minestom.server.event.player.PlayerSpawnEvent;
|
||||||
import net.minestom.server.instance.Instance;
|
import net.minestom.server.instance.Instance;
|
||||||
import net.minestom.server.instance.LightingChunk;
|
import net.minestom.server.instance.LightingChunk;
|
||||||
|
import net.minestom.server.world.DimensionType;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@@ -43,7 +44,7 @@ public class TerraMinestomExample {
|
|||||||
|
|
||||||
public void attachTerra() {
|
public void attachTerra() {
|
||||||
world = platform.worldBuilder(instance)
|
world = platform.worldBuilder(instance)
|
||||||
.defaultPack()
|
.packByDefaultMeta(DimensionType.OVERWORLD)
|
||||||
.attach();
|
.attach();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,12 @@ package com.dfsek.terra.minestom;
|
|||||||
|
|
||||||
import com.dfsek.tectonic.api.TypeRegistry;
|
import com.dfsek.tectonic.api.TypeRegistry;
|
||||||
import com.dfsek.tectonic.api.loader.type.TypeLoader;
|
import com.dfsek.tectonic.api.loader.type.TypeLoader;
|
||||||
|
|
||||||
|
import com.dfsek.terra.minestom.api.BiomeFactory;
|
||||||
|
import com.dfsek.terra.minestom.biome.MinestomUserDefinedBiomeFactory;
|
||||||
|
|
||||||
|
import com.dfsek.terra.minestom.biome.MinestomUserDefinedBiomePool;
|
||||||
|
|
||||||
import net.kyori.adventure.key.Key;
|
import net.kyori.adventure.key.Key;
|
||||||
import net.kyori.adventure.util.RGBLike;
|
import net.kyori.adventure.util.RGBLike;
|
||||||
import net.minestom.server.MinecraftServer;
|
import net.minestom.server.MinecraftServer;
|
||||||
@@ -9,6 +15,7 @@ import net.minestom.server.instance.Instance;
|
|||||||
import net.minestom.server.sound.SoundEvent;
|
import net.minestom.server.sound.SoundEvent;
|
||||||
import net.minestom.server.world.biome.BiomeEffects;
|
import net.minestom.server.world.biome.BiomeEffects;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@@ -45,19 +52,22 @@ public final class TerraMinestomPlatform extends AbstractPlatform {
|
|||||||
private final ItemHandle itemHandle;
|
private final ItemHandle itemHandle;
|
||||||
private final TypeLoader<PlatformBiome> biomeTypeLoader;
|
private final TypeLoader<PlatformBiome> biomeTypeLoader;
|
||||||
private final ArrayList<BaseAddon> platformAddons = new ArrayList<>(List.of(new MinestomAddon(this)));
|
private final ArrayList<BaseAddon> platformAddons = new ArrayList<>(List.of(new MinestomAddon(this)));
|
||||||
|
private final MinestomUserDefinedBiomePool biomePool;
|
||||||
|
|
||||||
public TerraMinestomPlatform(WorldHandle worldHandle, ItemHandle itemHandle, TypeLoader<PlatformBiome> biomeTypeLoader,
|
public TerraMinestomPlatform(WorldHandle worldHandle, ItemHandle itemHandle, TypeLoader<PlatformBiome> biomeTypeLoader,
|
||||||
BaseAddon... extraAddons) {
|
BiomeFactory biomeFactory, BaseAddon... extraAddons) {
|
||||||
this.worldHandle = worldHandle;
|
this.worldHandle = worldHandle;
|
||||||
this.itemHandle = itemHandle;
|
this.itemHandle = itemHandle;
|
||||||
this.biomeTypeLoader = biomeTypeLoader;
|
this.biomeTypeLoader = biomeTypeLoader;
|
||||||
|
this.biomePool = new MinestomUserDefinedBiomePool(biomeFactory);
|
||||||
this.platformAddons.addAll(List.of(extraAddons));
|
this.platformAddons.addAll(List.of(extraAddons));
|
||||||
load();
|
load();
|
||||||
getEventManager().callEvent(new PlatformInitializationEvent());
|
getEventManager().callEvent(new PlatformInitializationEvent());
|
||||||
|
initializeRegistry(); // Needs to be called before minecraft server bind
|
||||||
}
|
}
|
||||||
|
|
||||||
public TerraMinestomPlatform() {
|
public TerraMinestomPlatform() {
|
||||||
this(new MinestomWorldHandle(), new MinestomItemHandle(), new MinestomBiomeLoader());
|
this(new MinestomWorldHandle(), new MinestomItemHandle(), new MinestomBiomeLoader(), new MinestomUserDefinedBiomeFactory());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -94,6 +104,10 @@ public final class TerraMinestomPlatform extends AbstractPlatform {
|
|||||||
return succeed;
|
return succeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void initializeRegistry() {
|
||||||
|
getRawConfigRegistry()
|
||||||
|
.forEach(pack -> biomePool.preloadBiomes(pack, pack.getBiomeProvider().getBiomes()));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NotNull WorldHandle getWorldHandle() {
|
public @NotNull WorldHandle getWorldHandle() {
|
||||||
@@ -125,10 +139,62 @@ public final class TerraMinestomPlatform extends AbstractPlatform {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public TerraMinestomWorldBuilder worldBuilder(Instance instance) {
|
public TerraMinestomWorldBuilder worldBuilder(Instance instance) {
|
||||||
return new TerraMinestomWorldBuilder(this, instance);
|
return new TerraMinestomWorldBuilder(this, instance, biomePool);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TerraMinestomWorldBuilder worldBuilder() {
|
public TerraMinestomWorldBuilder worldBuilder() {
|
||||||
return new TerraMinestomWorldBuilder(this, MinecraftServer.getInstanceManager().createInstanceContainer());
|
return worldBuilder(MinecraftServer.getInstanceManager().createInstanceContainer());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Builder builder() {
|
||||||
|
return new Builder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Builder {
|
||||||
|
private @Nullable WorldHandle worldHandle;
|
||||||
|
private @Nullable ItemHandle itemHandle;
|
||||||
|
private @Nullable TypeLoader<PlatformBiome> biomeTypeLoader;
|
||||||
|
private @Nullable BiomeFactory biomeFactory;
|
||||||
|
private final List<BaseAddon> platformAddons = new ArrayList<>();
|
||||||
|
|
||||||
|
public Builder worldHandle(@Nullable WorldHandle worldHandle) {
|
||||||
|
this.worldHandle = worldHandle;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder itemHandle(@Nullable ItemHandle itemHandle) {
|
||||||
|
this.itemHandle = itemHandle;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder biomeTypeLoader(@Nullable TypeLoader<PlatformBiome> biomeTypeLoader) {
|
||||||
|
this.biomeTypeLoader = biomeTypeLoader;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder addPlatformAddon(BaseAddon addon) {
|
||||||
|
this.platformAddons.add(addon);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder biomeFactory(BiomeFactory biomeFactory) {
|
||||||
|
this.biomeFactory = biomeFactory;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TerraMinestomPlatform build() {
|
||||||
|
if(worldHandle == null) worldHandle = new MinestomWorldHandle();
|
||||||
|
if(itemHandle == null) itemHandle = new MinestomItemHandle();
|
||||||
|
if(biomeTypeLoader == null) biomeTypeLoader = new MinestomBiomeLoader();
|
||||||
|
if(biomeFactory == null) biomeFactory = new MinestomUserDefinedBiomeFactory();
|
||||||
|
|
||||||
|
return new TerraMinestomPlatform(
|
||||||
|
worldHandle,
|
||||||
|
itemHandle,
|
||||||
|
biomeTypeLoader,
|
||||||
|
biomeFactory,
|
||||||
|
platformAddons.toArray(new BaseAddon[0])
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.dfsek.terra.minestom.api;
|
package com.dfsek.terra.minestom.api;
|
||||||
|
|
||||||
|
import com.dfsek.terra.minestom.biome.MinestomUserDefinedBiomePool;
|
||||||
|
|
||||||
import net.minestom.server.instance.Instance;
|
import net.minestom.server.instance.Instance;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
@@ -8,25 +10,29 @@ import java.util.function.Function;
|
|||||||
import com.dfsek.terra.api.config.ConfigPack;
|
import com.dfsek.terra.api.config.ConfigPack;
|
||||||
import com.dfsek.terra.api.registry.CheckedRegistry;
|
import com.dfsek.terra.api.registry.CheckedRegistry;
|
||||||
import com.dfsek.terra.minestom.TerraMinestomPlatform;
|
import com.dfsek.terra.minestom.TerraMinestomPlatform;
|
||||||
import com.dfsek.terra.minestom.biome.MinestomUserDefinedBiomeFactory;
|
|
||||||
import com.dfsek.terra.minestom.block.DefaultBlockEntityFactory;
|
import com.dfsek.terra.minestom.block.DefaultBlockEntityFactory;
|
||||||
import com.dfsek.terra.minestom.entity.DefaultEntityFactory;
|
import com.dfsek.terra.minestom.entity.DefaultEntityFactory;
|
||||||
import com.dfsek.terra.minestom.world.TerraMinestomWorld;
|
import com.dfsek.terra.minestom.world.TerraMinestomWorld;
|
||||||
|
|
||||||
|
import net.minestom.server.registry.RegistryKey;
|
||||||
|
import net.minestom.server.world.DimensionType;
|
||||||
|
import org.jspecify.annotations.NonNull;
|
||||||
|
|
||||||
|
|
||||||
public class TerraMinestomWorldBuilder {
|
public class TerraMinestomWorldBuilder {
|
||||||
private final TerraMinestomPlatform platform;
|
private final TerraMinestomPlatform platform;
|
||||||
private final Instance instance;
|
private final Instance instance;
|
||||||
|
private final MinestomUserDefinedBiomePool biomePool;
|
||||||
private ConfigPack pack;
|
private ConfigPack pack;
|
||||||
private long seed = new Random().nextLong();
|
private long seed = new Random().nextLong();
|
||||||
private EntityFactory entityFactory = new DefaultEntityFactory();
|
private EntityFactory entityFactory = new DefaultEntityFactory();
|
||||||
private BlockEntityFactory blockEntityFactory;
|
private BlockEntityFactory blockEntityFactory;
|
||||||
private BiomeFactory biomeFactory = new MinestomUserDefinedBiomeFactory();
|
|
||||||
|
|
||||||
public TerraMinestomWorldBuilder(TerraMinestomPlatform platform, Instance instance) {
|
public TerraMinestomWorldBuilder(TerraMinestomPlatform platform, Instance instance, MinestomUserDefinedBiomePool biomePool) {
|
||||||
this.platform = platform;
|
this.platform = platform;
|
||||||
this.instance = instance;
|
this.instance = instance;
|
||||||
this.blockEntityFactory = new DefaultBlockEntityFactory(instance);
|
this.blockEntityFactory = new DefaultBlockEntityFactory(instance);
|
||||||
|
this.biomePool = biomePool;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TerraMinestomWorldBuilder pack(ConfigPack pack) {
|
public TerraMinestomWorldBuilder pack(ConfigPack pack) {
|
||||||
@@ -36,10 +42,22 @@ public class TerraMinestomWorldBuilder {
|
|||||||
|
|
||||||
public TerraMinestomWorldBuilder packById(String id) {
|
public TerraMinestomWorldBuilder packById(String id) {
|
||||||
this.pack = platform.getConfigRegistry().getByID(id).orElseThrow();
|
this.pack = platform.getConfigRegistry().getByID(id).orElseThrow();
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TerraMinestomWorldBuilder packByMeta(String metaPack, RegistryKey<@NonNull DimensionType> dimensionType) {
|
||||||
|
this.pack = platform.getMetaConfigRegistry()
|
||||||
|
.getByID(metaPack)
|
||||||
|
.orElseThrow(() -> new RuntimeException("MetaPack " + metaPack + " could not be found"))
|
||||||
|
.packs()
|
||||||
|
.get(dimensionType.key().asString());
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TerraMinestomWorldBuilder packByDefaultMeta(RegistryKey<@NonNull DimensionType> dimensionType) {
|
||||||
|
return packByMeta("DEFAULT", dimensionType);
|
||||||
|
}
|
||||||
|
|
||||||
public TerraMinestomWorldBuilder findPack(Function<CheckedRegistry<ConfigPack>, ConfigPack> fn) {
|
public TerraMinestomWorldBuilder findPack(Function<CheckedRegistry<ConfigPack>, ConfigPack> fn) {
|
||||||
this.pack = fn.apply(platform.getConfigRegistry());
|
this.pack = fn.apply(platform.getConfigRegistry());
|
||||||
return this;
|
return this;
|
||||||
@@ -64,12 +82,7 @@ public class TerraMinestomWorldBuilder {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TerraMinestomWorldBuilder biomeFactory(BiomeFactory factory) {
|
|
||||||
this.biomeFactory = factory;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TerraMinestomWorld attach() {
|
public TerraMinestomWorld attach() {
|
||||||
return new TerraMinestomWorld(platform, instance, pack, seed, entityFactory, blockEntityFactory, biomeFactory);
|
return new TerraMinestomWorld(platform, instance, pack, seed, entityFactory, blockEntityFactory, biomePool);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,14 +12,12 @@ public class MinestomUserDefinedBiomePool {
|
|||||||
private final IdentityHashMap<Biome, UserDefinedBiome> biomes = new IdentityHashMap<>();
|
private final IdentityHashMap<Biome, UserDefinedBiome> biomes = new IdentityHashMap<>();
|
||||||
private final HashSet<String> createdBiomes = new HashSet<>();
|
private final HashSet<String> createdBiomes = new HashSet<>();
|
||||||
private final BiomeFactory factory;
|
private final BiomeFactory factory;
|
||||||
private final ConfigPack configPack;
|
|
||||||
|
|
||||||
public MinestomUserDefinedBiomePool(ConfigPack configPack, BiomeFactory factory) {
|
public MinestomUserDefinedBiomePool(BiomeFactory factory) {
|
||||||
this.configPack = configPack;
|
|
||||||
this.factory = factory;
|
this.factory = factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserDefinedBiome getBiome(Biome source) {
|
public UserDefinedBiome getBiome(ConfigPack configPack, Biome source) {
|
||||||
UserDefinedBiome userDefinedBiome = biomes.get(source);
|
UserDefinedBiome userDefinedBiome = biomes.get(source);
|
||||||
if(userDefinedBiome != null) return userDefinedBiome;
|
if(userDefinedBiome != null) return userDefinedBiome;
|
||||||
userDefinedBiome = factory.create(configPack, source);
|
userDefinedBiome = factory.create(configPack, source);
|
||||||
@@ -28,7 +26,7 @@ public class MinestomUserDefinedBiomePool {
|
|||||||
return userDefinedBiome;
|
return userDefinedBiome;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void preloadBiomes(Iterable<Biome> biomesToLoad) {
|
public void preloadBiomes(ConfigPack configPack, Iterable<Biome> biomesToLoad) {
|
||||||
biomesToLoad
|
biomesToLoad
|
||||||
.forEach(biome -> {
|
.forEach(biome -> {
|
||||||
if(!this.createdBiomes.contains(biome.getID())) {
|
if(!this.createdBiomes.contains(biome.getID())) {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import com.dfsek.terra.api.block.state.properties.Property;
|
|||||||
|
|
||||||
public class MinestomBlockState implements BlockState {
|
public class MinestomBlockState implements BlockState {
|
||||||
private final Block block;
|
private final Block block;
|
||||||
|
public static final MinestomBlockState AIR = new MinestomBlockState(Block.AIR);
|
||||||
|
|
||||||
public MinestomBlockState(Block block) {
|
public MinestomBlockState(Block block) {
|
||||||
if(block == null) {
|
if(block == null) {
|
||||||
|
|||||||
@@ -32,7 +32,9 @@ public class CachedChunk implements ProtoChunk {
|
|||||||
public void setBlock(int x, int y, int z, @NotNull BlockState blockState) {
|
public void setBlock(int x, int y, int z, @NotNull BlockState blockState) {
|
||||||
Block block = (Block) blockState.getHandle();
|
Block block = (Block) blockState.getHandle();
|
||||||
if(block == null) return;
|
if(block == null) return;
|
||||||
blocks[getIndex(x, y, z)] = block;
|
int index = getIndex(x, y, z);
|
||||||
|
if (index > blocks.length || index < 0) return;
|
||||||
|
blocks[index] = block;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getIndex(int x, int y, int z) {
|
private int getIndex(int x, int y, int z) {
|
||||||
@@ -42,7 +44,9 @@ public class CachedChunk implements ProtoChunk {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NotNull BlockState getBlock(int x, int y, int z) {
|
public @NotNull BlockState getBlock(int x, int y, int z) {
|
||||||
return new MinestomBlockState(blocks[getIndex(x, y, z)]);
|
int index = getIndex(x, y, z);
|
||||||
|
if (index > blocks.length || index < 0) return MinestomBlockState.AIR;
|
||||||
|
return new MinestomBlockState(blocks[index]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -3,8 +3,18 @@ package com.dfsek.terra.minestom.config;
|
|||||||
import com.dfsek.tectonic.api.config.template.annotations.Default;
|
import com.dfsek.tectonic.api.config.template.annotations.Default;
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
||||||
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
||||||
|
import net.kyori.adventure.nbt.BinaryTagIO;
|
||||||
|
import net.kyori.adventure.nbt.CompoundBinaryTag;
|
||||||
|
import net.kyori.adventure.nbt.TagStringIO;
|
||||||
|
import net.minestom.server.MinecraftServer;
|
||||||
|
import net.minestom.server.command.builder.arguments.Argument;
|
||||||
|
import net.minestom.server.command.builder.arguments.minecraft.registry.ArgumentParticle;
|
||||||
import net.minestom.server.particle.Particle;
|
import net.minestom.server.particle.Particle;
|
||||||
import net.minestom.server.world.biome.BiomeEffects;
|
import net.minestom.server.world.biome.BiomeEffects;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
|
||||||
public class BiomeParticleConfigTemplate implements ObjectTemplate<BiomeEffects.Particle> {
|
public class BiomeParticleConfigTemplate implements ObjectTemplate<BiomeEffects.Particle> {
|
||||||
@@ -22,9 +32,16 @@ public class BiomeParticleConfigTemplate implements ObjectTemplate<BiomeEffects.
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String[] parts = particle.split("\\{");
|
||||||
|
Particle parsedParticle = Particle.fromKey(parts[0]);
|
||||||
|
if (parts.length > 1) {
|
||||||
|
LoggerFactory.getLogger(BiomeParticleConfigTemplate.class).warn("Particle {} has additional data, particle will be ignored.", particle);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return new BiomeEffects.Particle(
|
return new BiomeEffects.Particle(
|
||||||
probability,
|
probability,
|
||||||
Particle.fromKey(particle)
|
parsedParticle
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ public class MinestomChunkGeneratorWrapper implements Generator, GeneratorWrappe
|
|||||||
this.biomePool = biomePool;
|
this.biomePool = biomePool;
|
||||||
this.biomeProvider = pack.getBiomeProvider();
|
this.biomeProvider = pack.getBiomeProvider();
|
||||||
this.cache = new GeneratedChunkCache(world.getDimensionType(), generator, world, biomeProvider);
|
this.cache = new GeneratedChunkCache(world.getDimensionType(), generator, world, biomeProvider);
|
||||||
preloadBiomes();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChunkGenerator getGenerator() {
|
public ChunkGenerator getGenerator() {
|
||||||
@@ -73,6 +72,7 @@ public class MinestomChunkGeneratorWrapper implements Generator, GeneratorWrappe
|
|||||||
|
|
||||||
if(relativeX % 4 == 0 && relativeY % 4 == 0 && relativeZ % 4 == 0) {
|
if(relativeX % 4 == 0 && relativeY % 4 == 0 && relativeZ % 4 == 0) {
|
||||||
UserDefinedBiome userDefinedBiome = biomePool.getBiome(
|
UserDefinedBiome userDefinedBiome = biomePool.getBiome(
|
||||||
|
pack,
|
||||||
biomeProvider.getBiome(absoluteX, absoluteY, absoluteZ, world.getSeed())
|
biomeProvider.getBiome(absoluteX, absoluteY, absoluteZ, world.getSeed())
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -101,11 +101,6 @@ public class MinestomChunkGeneratorWrapper implements Generator, GeneratorWrappe
|
|||||||
this.pack = pack;
|
this.pack = pack;
|
||||||
this.generator = pack.getGeneratorProvider().newInstance(pack);
|
this.generator = pack.getGeneratorProvider().newInstance(pack);
|
||||||
this.biomePool.invalidate();
|
this.biomePool.invalidate();
|
||||||
preloadBiomes();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void preloadBiomes() {
|
|
||||||
this.biomePool.preloadBiomes(world.getBiomeProvider().getBiomes());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void displayStats() {
|
public void displayStats() {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public final class TerraMinestomWorld implements ServerWorld, WorldProperties {
|
|||||||
long seed,
|
long seed,
|
||||||
EntityFactory entityFactory,
|
EntityFactory entityFactory,
|
||||||
BlockEntityFactory blockEntityFactory,
|
BlockEntityFactory blockEntityFactory,
|
||||||
BiomeFactory factory
|
MinestomUserDefinedBiomePool biomePool
|
||||||
) {
|
) {
|
||||||
this.instance = instance;
|
this.instance = instance;
|
||||||
this.pack = pack;
|
this.pack = pack;
|
||||||
@@ -57,7 +57,7 @@ public final class TerraMinestomWorld implements ServerWorld, WorldProperties {
|
|||||||
pack.getGeneratorProvider().newInstance(pack),
|
pack.getGeneratorProvider().newInstance(pack),
|
||||||
this,
|
this,
|
||||||
pack,
|
pack,
|
||||||
new MinestomUserDefinedBiomePool(pack, factory)
|
biomePool
|
||||||
);
|
);
|
||||||
this.entityFactory = entityFactory;
|
this.entityFactory = entityFactory;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user