mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-04 00:45:57 +00:00
cleanup
This commit is contained in:
parent
34e78ab55e
commit
95e6479505
@ -2,6 +2,7 @@ package com.dfsek.terra.addons.biome;
|
|||||||
|
|
||||||
import com.dfsek.terra.addons.biome.holder.PaletteHolder;
|
import com.dfsek.terra.addons.biome.holder.PaletteHolder;
|
||||||
import com.dfsek.terra.addons.biome.holder.PaletteHolderLoader;
|
import com.dfsek.terra.addons.biome.holder.PaletteHolderLoader;
|
||||||
|
import com.dfsek.terra.addons.biome.slant.SlantHolder;
|
||||||
import com.dfsek.terra.api.TerraPlugin;
|
import com.dfsek.terra.api.TerraPlugin;
|
||||||
import com.dfsek.terra.api.addon.TerraAddon;
|
import com.dfsek.terra.api.addon.TerraAddon;
|
||||||
import com.dfsek.terra.api.addon.annotations.Addon;
|
import com.dfsek.terra.api.addon.annotations.Addon;
|
||||||
@ -21,7 +22,8 @@ public class BiomeConfigAddon extends TerraAddon implements EventListener {
|
|||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
main.getEventManager().registerListener(this, this);
|
main.getEventManager().registerListener(this, this);
|
||||||
main.applyLoader(PaletteHolder.class, new PaletteHolderLoader());
|
main.applyLoader(PaletteHolder.class, new PaletteHolderLoader())
|
||||||
|
.applyLoader(SlantHolder.class, (t, o, l) -> null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onPackLoad(ConfigPackPreLoadEvent event) {
|
public void onPackLoad(ConfigPackPreLoadEvent event) {
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
package com.dfsek.terra.addons.structure;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.TerraPlugin;
|
||||||
|
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.EventListener;
|
||||||
|
import com.dfsek.terra.api.event.events.config.ConfigPackPreLoadEvent;
|
||||||
|
import com.dfsek.terra.api.injection.annotations.Inject;
|
||||||
|
import com.dfsek.terra.api.structure.ConfiguredStructure;
|
||||||
|
|
||||||
|
@Addon("config-structure")
|
||||||
|
@Version("1.0.0")
|
||||||
|
@Author("Terra")
|
||||||
|
public class StructureAddon extends TerraAddon implements EventListener {
|
||||||
|
@Inject
|
||||||
|
private TerraPlugin main;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initialize() {
|
||||||
|
main.getEventManager().registerListener(this, this);
|
||||||
|
main.applyLoader(ConfiguredStructure.class, (t, o, l) -> null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onConfigLoad(ConfigPackPreLoadEvent event) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -36,8 +36,12 @@ public class OpenRegistryImpl<T> implements OpenRegistry<T> {
|
|||||||
@Override
|
@Override
|
||||||
public T load(AnnotatedType type, Object o, ConfigLoader configLoader) throws LoadException {
|
public T load(AnnotatedType type, Object o, ConfigLoader configLoader) throws LoadException {
|
||||||
T obj = get((String) o);
|
T obj = get((String) o);
|
||||||
|
StringBuilder keys = new StringBuilder("[");
|
||||||
|
|
||||||
|
objects.keySet().forEach(key -> keys.append(key + ", "));
|
||||||
|
|
||||||
if(obj == null)
|
if(obj == null)
|
||||||
throw new LoadException("No such " + type.getType().getTypeName() + " matching \"" + o + "\" was found in this registry.");
|
throw new LoadException("No such " + type.getType().getTypeName() + " matching \"" + o + "\" was found in this registry. Registry contains items: " + keys.substring(0, keys.length()-2) + "]");
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package com.dfsek.terra;
|
package com.dfsek.terra;
|
||||||
|
|
||||||
|
import com.dfsek.tectonic.loading.TypeLoader;
|
||||||
import com.dfsek.tectonic.loading.TypeRegistry;
|
import com.dfsek.tectonic.loading.TypeRegistry;
|
||||||
|
import com.dfsek.tectonic.loading.object.ObjectTemplate;
|
||||||
import com.dfsek.terra.api.TerraPlugin;
|
import com.dfsek.terra.api.TerraPlugin;
|
||||||
import com.dfsek.terra.api.addon.TerraAddon;
|
import com.dfsek.terra.api.addon.TerraAddon;
|
||||||
import com.dfsek.terra.api.block.state.BlockState;
|
import com.dfsek.terra.api.block.state.BlockState;
|
||||||
@ -13,6 +15,7 @@ import com.dfsek.terra.api.lang.Language;
|
|||||||
import com.dfsek.terra.api.profiler.Profiler;
|
import com.dfsek.terra.api.profiler.Profiler;
|
||||||
import com.dfsek.terra.api.registry.CheckedRegistry;
|
import com.dfsek.terra.api.registry.CheckedRegistry;
|
||||||
import com.dfsek.terra.api.registry.Registry;
|
import com.dfsek.terra.api.registry.Registry;
|
||||||
|
import com.dfsek.terra.api.tectonic.LoaderHolder;
|
||||||
import com.dfsek.terra.api.world.TerraWorld;
|
import com.dfsek.terra.api.world.TerraWorld;
|
||||||
import com.dfsek.terra.api.world.World;
|
import com.dfsek.terra.api.world.World;
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
import com.dfsek.terra.api.world.biome.Biome;
|
||||||
@ -34,6 +37,8 @@ import com.dfsek.terra.world.TerraWorldImpl;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.function.Supplier;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
public class StandalonePlugin implements TerraPlugin {
|
public class StandalonePlugin implements TerraPlugin {
|
||||||
@ -156,4 +161,14 @@ public class StandalonePlugin implements TerraPlugin {
|
|||||||
public Profiler getProfiler() {
|
public Profiler getProfiler() {
|
||||||
return profiler;
|
return profiler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> LoaderHolder applyLoader(Type type, TypeLoader<T> loader) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> LoaderHolder applyLoader(Type type, Supplier<ObjectTemplate<T>> loader) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,11 @@ public class RawWorldHandle implements WorldHandle {
|
|||||||
return new State(data);
|
return new State(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockState air() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EntityType getEntity(String id) {
|
public EntityType getEntity(String id) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -2,6 +2,7 @@ package com.dfsek.terra.platform;
|
|||||||
|
|
||||||
import com.dfsek.terra.api.block.BlockType;
|
import com.dfsek.terra.api.block.BlockType;
|
||||||
import com.dfsek.terra.api.block.state.BlockState;
|
import com.dfsek.terra.api.block.state.BlockState;
|
||||||
|
import com.dfsek.terra.api.block.state.properties.Property;
|
||||||
import net.querz.nbt.tag.CompoundTag;
|
import net.querz.nbt.tag.CompoundTag;
|
||||||
|
|
||||||
public class State implements BlockState, BlockType {
|
public class State implements BlockState, BlockType {
|
||||||
@ -57,6 +58,21 @@ public class State implements BlockState, BlockType {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> boolean has(Property<T> property) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> T get(Property<T> property) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> BlockState set(Property<T> property, T value) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState clone() {
|
public BlockState clone() {
|
||||||
|
@ -5,10 +5,6 @@ import com.dfsek.terra.api.world.generator.TerraChunkGenerator;
|
|||||||
import com.dfsek.terra.platform.DirectChunkData;
|
import com.dfsek.terra.platform.DirectChunkData;
|
||||||
import com.dfsek.terra.platform.DirectWorld;
|
import com.dfsek.terra.platform.DirectWorld;
|
||||||
import com.dfsek.terra.platform.GenWrapper;
|
import com.dfsek.terra.platform.GenWrapper;
|
||||||
import com.dfsek.terra.world.population.FloraPopulator;
|
|
||||||
import com.dfsek.terra.world.population.OrePopulator;
|
|
||||||
import com.dfsek.terra.world.population.StructurePopulator;
|
|
||||||
import com.dfsek.terra.world.population.TreePopulator;
|
|
||||||
import net.querz.mca.MCAFile;
|
import net.querz.mca.MCAFile;
|
||||||
import net.querz.mca.MCAUtil;
|
import net.querz.mca.MCAUtil;
|
||||||
|
|
||||||
@ -18,18 +14,10 @@ import java.util.Map;
|
|||||||
|
|
||||||
public class Generator {
|
public class Generator {
|
||||||
private final long seed;
|
private final long seed;
|
||||||
FloraPopulator floraPopulator;
|
|
||||||
StructurePopulator structurePopulator;
|
|
||||||
TreePopulator treePopulator;
|
|
||||||
OrePopulator orePopulator;
|
|
||||||
TerraChunkGenerator generator;
|
TerraChunkGenerator generator;
|
||||||
|
|
||||||
public Generator(long seed, StandalonePlugin plugin) {
|
public Generator(long seed, StandalonePlugin plugin) {
|
||||||
plugin.load();
|
plugin.load();
|
||||||
floraPopulator = new FloraPopulator(plugin);
|
|
||||||
structurePopulator = new StructurePopulator(plugin);
|
|
||||||
treePopulator = new TreePopulator(plugin);
|
|
||||||
orePopulator = new OrePopulator(plugin);
|
|
||||||
//generator = new DefaultChunkGenerator3D(plugin.getConfigRegistry().get("DEFAULT"), plugin);
|
//generator = new DefaultChunkGenerator3D(plugin.getConfigRegistry().get("DEFAULT"), plugin);
|
||||||
this.seed = seed;
|
this.seed = seed;
|
||||||
}
|
}
|
||||||
@ -51,10 +39,6 @@ public class Generator {
|
|||||||
DirectChunkData chunkData = (DirectChunkData) world.getChunkAt(cx, cz);
|
DirectChunkData chunkData = (DirectChunkData) world.getChunkAt(cx, cz);
|
||||||
generator.generateChunkData(world, null, cx, cz, chunkData);
|
generator.generateChunkData(world, null, cx, cz, chunkData);
|
||||||
|
|
||||||
structurePopulator.populate(world, chunkData);
|
|
||||||
orePopulator.populate(world, chunkData);
|
|
||||||
floraPopulator.populate(world, chunkData);
|
|
||||||
treePopulator.populate(world, chunkData);
|
|
||||||
count++;
|
count++;
|
||||||
|
|
||||||
if(count % 200 == 0) {
|
if(count % 200 == 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user