remove redundant openregistry implementations

This commit is contained in:
dfsek 2021-06-24 06:59:59 -07:00
parent 9838a4ce0b
commit c26f4dfc2f
10 changed files with 8 additions and 67 deletions

View File

@ -42,10 +42,7 @@ import com.dfsek.terra.config.prototype.ProtoConfig;
import com.dfsek.terra.registry.CheckedRegistryImpl;
import com.dfsek.terra.registry.OpenRegistryImpl;
import com.dfsek.terra.registry.config.ConfigTypeRegistry;
import com.dfsek.terra.registry.config.FunctionRegistry;
import com.dfsek.terra.registry.config.LootRegistry;
import com.dfsek.terra.registry.config.NoiseRegistry;
import com.dfsek.terra.registry.config.ScriptRegistry;
import com.dfsek.terra.world.TerraWorldImpl;
import com.dfsek.terra.world.population.items.TerraStructure;
import org.apache.commons.io.IOUtils;
@ -194,9 +191,9 @@ public class ConfigPackImpl implements ConfigPack {
};
putPair(map, NoiseProvider.class, new NoiseRegistry());
putPair(map, FunctionBuilder.class, (OpenRegistry<FunctionBuilder>) (Object) new FunctionRegistry());
putPair(map, LootTable.class, new LootRegistry());
putPair(map, Structure.class, new ScriptRegistry());
putPair(map, FunctionBuilder.class, new OpenRegistryImpl<>());
putPair(map, LootTable.class, new OpenRegistryImpl<>());
putPair(map, Structure.class, new OpenRegistryImpl<>());
return map;
}

View File

@ -1,7 +0,0 @@
package com.dfsek.terra.registry.config;
import com.dfsek.terra.carving.UserDefinedCarver;
import com.dfsek.terra.registry.OpenRegistryImpl;
public class CarverRegistry extends OpenRegistryImpl<UserDefinedCarver> {
}

View File

@ -43,11 +43,11 @@ public class ConfigTypeRegistry extends OpenRegistryImpl<ConfigType<?, ?>> {
super(new LinkedHashMap<>()); // Ordered
this.callback = callback;
add("PALETTE", new ConfigBuilder<>(new PaletteFactory(), PaletteTemplate::new, Palette.class, () -> new PaletteRegistry(main)));
add("ORE", new ConfigBuilder<>(new OreFactory(), OreTemplate::new, Ore.class, OreRegistry::new));
add("FLORA", new ConfigBuilder<>(new FloraFactory(), FloraTemplate::new, Flora.class, FloraRegistry::new));
add("CARVER", new ConfigBuilder<>(new CarverFactory(pack), CarverTemplate::new, UserDefinedCarver.class, CarverRegistry::new));
add("STRUCTURE", new ConfigBuilder<>(new StructureFactory(), StructureTemplate::new, TerraStructure.class, StructureRegistry::new));
add("TREE", new ConfigBuilder<>(new TreeFactory(), TreeTemplate::new, Tree.class, TreeRegistry::new));
add("ORE", new ConfigBuilder<>(new OreFactory(), OreTemplate::new, Ore.class, OpenRegistryImpl::new));
add("FLORA", new ConfigBuilder<>(new FloraFactory(), FloraTemplate::new, Flora.class, OpenRegistryImpl::new));
add("CARVER", new ConfigBuilder<>(new CarverFactory(pack), CarverTemplate::new, UserDefinedCarver.class, OpenRegistryImpl::new));
add("STRUCTURE", new ConfigBuilder<>(new StructureFactory(), StructureTemplate::new, TerraStructure.class, OpenRegistryImpl::new));
add("TREE", new ConfigBuilder<>(new TreeFactory(), TreeTemplate::new, Tree.class, OpenRegistryImpl::new));
add("BIOME", new ConfigBuilder<>(new BiomeFactory(pack), () -> new BiomeTemplate(pack, main), BiomeBuilder.class, BiomeRegistry::new));
add("PACK", new PackBuilder());
}

View File

@ -1,7 +0,0 @@
package com.dfsek.terra.registry.config;
import com.dfsek.terra.api.world.Flora;
import com.dfsek.terra.registry.OpenRegistryImpl;
public class FloraRegistry extends OpenRegistryImpl<Flora> {
}

View File

@ -1,7 +0,0 @@
package com.dfsek.terra.registry.config;
import com.dfsek.terra.api.structures.parser.lang.functions.FunctionBuilder;
import com.dfsek.terra.registry.OpenRegistryImpl;
public class FunctionRegistry extends OpenRegistryImpl<FunctionBuilder<?>> {
}

View File

@ -1,7 +0,0 @@
package com.dfsek.terra.registry.config;
import com.dfsek.terra.api.structure.LootTable;
import com.dfsek.terra.registry.OpenRegistryImpl;
public class LootRegistry extends OpenRegistryImpl<LootTable> {
}

View File

@ -1,7 +0,0 @@
package com.dfsek.terra.registry.config;
import com.dfsek.terra.registry.OpenRegistryImpl;
import com.dfsek.terra.world.population.items.ores.Ore;
public class OreRegistry extends OpenRegistryImpl<Ore> {
}

View File

@ -1,7 +0,0 @@
package com.dfsek.terra.registry.config;
import com.dfsek.terra.api.structure.Structure;
import com.dfsek.terra.registry.OpenRegistryImpl;
public class ScriptRegistry extends OpenRegistryImpl<Structure> {
}

View File

@ -1,7 +0,0 @@
package com.dfsek.terra.registry.config;
import com.dfsek.terra.registry.OpenRegistryImpl;
import com.dfsek.terra.world.population.items.TerraStructure;
public class StructureRegistry extends OpenRegistryImpl<TerraStructure> {
}

View File

@ -1,7 +0,0 @@
package com.dfsek.terra.registry.config;
import com.dfsek.terra.api.world.Tree;
import com.dfsek.terra.registry.OpenRegistryImpl;
public class TreeRegistry extends OpenRegistryImpl<Tree> {
}