mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-03 16:35:50 +00:00
remove single biome provider from main repo
This commit is contained in:
parent
445b87f1fa
commit
f1bcd5fd79
@ -1,4 +0,0 @@
|
|||||||
# biome-provider-single
|
|
||||||
|
|
||||||
Registers and configures the `SINGLE` biome provider, a biome provider which
|
|
||||||
accepts a single biome to generate continuously.
|
|
@ -1,2 +0,0 @@
|
|||||||
dependencies {
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.single;
|
|
||||||
|
|
||||||
import com.dfsek.terra.api.world.biome.TerraBiome;
|
|
||||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
|
||||||
|
|
||||||
|
|
||||||
public class SingleBiomeProvider implements BiomeProvider {
|
|
||||||
private final TerraBiome biome;
|
|
||||||
|
|
||||||
public SingleBiomeProvider(TerraBiome biome) {
|
|
||||||
this.biome = biome;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TerraBiome getBiome(int x, int z, long seed) {
|
|
||||||
return biome;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.single;
|
|
||||||
|
|
||||||
import com.dfsek.tectonic.loading.object.ObjectTemplate;
|
|
||||||
|
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
import com.dfsek.terra.api.Platform;
|
|
||||||
import com.dfsek.terra.api.addon.TerraAddon;
|
|
||||||
import com.dfsek.terra.api.addon.annotations.Addon;
|
|
||||||
import com.dfsek.terra.api.addon.annotations.Author;
|
|
||||||
import com.dfsek.terra.api.addon.annotations.Version;
|
|
||||||
import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent;
|
|
||||||
import com.dfsek.terra.api.event.functional.FunctionalEventHandler;
|
|
||||||
import com.dfsek.terra.api.inject.annotations.Inject;
|
|
||||||
import com.dfsek.terra.api.registry.CheckedRegistry;
|
|
||||||
import com.dfsek.terra.api.util.reflection.TypeKey;
|
|
||||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
|
||||||
|
|
||||||
|
|
||||||
@Addon("biome-provider-single")
|
|
||||||
@Author("Terra")
|
|
||||||
@Version("1.0.0")
|
|
||||||
public class SingleBiomeProviderAddon extends TerraAddon {
|
|
||||||
public static final TypeKey<Supplier<ObjectTemplate<BiomeProvider>>> PROVIDER_REGISTRY_KEY = new TypeKey<>() {
|
|
||||||
};
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
private Platform platform;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initialize() {
|
|
||||||
platform.getEventManager()
|
|
||||||
.getHandler(FunctionalEventHandler.class)
|
|
||||||
.register(this, ConfigPackPreLoadEvent.class)
|
|
||||||
.then(event -> {
|
|
||||||
CheckedRegistry<Supplier<ObjectTemplate<BiomeProvider>>> providerRegistry = event.getPack().getOrCreateRegistry(
|
|
||||||
PROVIDER_REGISTRY_KEY);
|
|
||||||
providerRegistry.register("SINGLE", SingleBiomeProviderTemplate::new);
|
|
||||||
})
|
|
||||||
.failThrough();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.single;
|
|
||||||
|
|
||||||
import com.dfsek.tectonic.annotations.Value;
|
|
||||||
import com.dfsek.tectonic.loading.object.ObjectTemplate;
|
|
||||||
|
|
||||||
import com.dfsek.terra.api.config.meta.Meta;
|
|
||||||
import com.dfsek.terra.api.world.biome.TerraBiome;
|
|
||||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
|
||||||
|
|
||||||
|
|
||||||
public class SingleBiomeProviderTemplate implements ObjectTemplate<BiomeProvider> {
|
|
||||||
@Value("biome")
|
|
||||||
private @Meta TerraBiome biome;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BiomeProvider get() {
|
|
||||||
return new SingleBiomeProvider(biome);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user