Search in sources :

Example 1 with MCRegistry

use of ivorius.ivtoolkit.tools.MCRegistry in project RecurrentComplex by Ivorforce.

the class RCRegistryHandler method load.

public static void load(FMLInitializationEvent event, RecurrentComplex mod) {
    MCRegistry mcRegistry = RecurrentComplex.specialRegistry;
    registerPackets(event);
    CapabilityUpdateRegistry.INSTANCE.register(RCEntityInfo.CAPABILITY_KEY, RCEntityInfo.CAPABILITY);
    CapabilityUpdateRegistry.INSTANCE.register(CapabilitySelection.CAPABILITY_KEY, CapabilitySelection.CAPABILITY);
    RCBiomeDictionary.registerTypes();
    loader.register(StructureSaveHandler.INSTANCE.new Loader());
    loader.register(new FileLoaderRegistryString<>(RCFileSuffix.INVENTORY_GENERATION_COMPONENT, GenericItemCollectionRegistry.INSTANCE, ItemCollectionSaveHandler.INSTANCE::fromJSON));
    loader.register(new FileLoaderRegistryString<>(RCFileSuffix.POEM_THEME, Poem.THEME_REGISTRY, Poem.Theme::fromFile));
    loader.register(new FileLoaderRegistryString<>(RCFileSuffix.NATURAL_CATEGORY, NaturalStructureSelector.CATEGORY_REGISTRY, NaturalStructureSelector.SimpleCategory.class));
    loader.register(BiomeMatcherPresets.instance().loader());
    loader.register(DimensionMatcherPresets.instance().loader());
    loader.register(WeightedBlockStatePresets.instance().loader());
    loader.register(GenericPlacerPresets.instance().loader());
    loader.register(TransfomerPresets.instance().loader());
    saver.register(StructureSaveHandler.INSTANCE.new Saver(RCFileSaver.STRUCTURE));
    saver.register(new FileSaverString<>(RCFileSaver.INVENTORY_GENERATION_COMPONENT, RCFileSuffix.INVENTORY_GENERATION_COMPONENT, GenericItemCollectionRegistry.INSTANCE, ItemCollectionSaveHandler.INSTANCE::toJSON));
    saver.register(new FileSaverString<>(RCFileSaver.NATURAL_GENERATION_CATEGORY, RCFileSuffix.NATURAL_CATEGORY, NaturalStructureSelector.CATEGORY_REGISTRY, NaturalStructureSelector.SimpleCategory.class));
    saver.register(BiomeMatcherPresets.instance().saver(RCFileSaver.BIOME_PRESET));
    saver.register(DimensionMatcherPresets.instance().saver(RCFileSaver.DIMENSION_PRESET));
    saver.register(WeightedBlockStatePresets.instance().saver(RCFileSaver.BLOCK_PRESET));
    saver.register(GenericPlacerPresets.instance().saver(RCFileSaver.PLACER_PRESET));
    saver.register(TransfomerPresets.instance().saver(RCFileSaver.TRANSFORMER_PRESET));
    WorldScriptRegistry worldScriptRegistry = WorldScriptRegistry.INSTANCE;
    worldScriptRegistry.register("multi", WorldScriptMulti.class);
    worldScriptRegistry.register("strucGen", WorldScriptStructureGenerator.class);
    worldScriptRegistry.register("mazeGen", WorldScriptMazeGenerator.class);
    worldScriptRegistry.register("command", WorldScriptCommand.class);
    SerializableStringTypeRegistry<Transformer> transformerRegistry = StructureRegistry.TRANSFORMERS;
    transformerRegistry.registerType("multi", TransformerMulti.class, new TransformerMulti.Serializer());
    transformerRegistry.registerType("worldscript", TransformerWorldScript.class, new TransformerWorldScript.Serializer(mcRegistry));
    transformerRegistry.registerType("villagereplace", TransformerVillageSpecific.class, new TransformerVillageSpecific.Serializer(mcRegistry));
    transformerRegistry.registerType("natural", TransformerNatural.class, new TransformerNatural.Serializer(mcRegistry));
    transformerRegistry.registerType("naturalAir", TransformerNaturalAir.class, new TransformerNaturalAir.Serializer(mcRegistry));
    transformerRegistry.registerType("pillar", TransformerPillar.class, new TransformerPillar.Serializer(mcRegistry));
    transformerRegistry.registerType("replaceAll", TransformerReplaceAll.class, new TransformerReplaceAll.Serializer(mcRegistry));
    transformerRegistry.registerType("replace", TransformerReplace.class, new TransformerReplace.Serializer(mcRegistry));
    transformerRegistry.registerType("ruins", TransformerRuins.class, new TransformerRuins.Serializer(mcRegistry));
    transformerRegistry.registerType("negativeSpace", TransformerNegativeSpace.class, new TransformerNegativeSpace.Serializer(mcRegistry));
    transformerRegistry.registerType("ensureBlocks", TransformerEnsureBlocks.class, new TransformerEnsureBlocks.Serializer(mcRegistry));
    transformerRegistry.registerType("propertyReplace", TransformerProperty.class, new TransformerProperty.Serializer(mcRegistry));
    SerializableStringTypeRegistry<GenerationType> genInfoRegistry = StructureRegistry.GENERATION_TYPES;
    genInfoRegistry.registerType("natural", NaturalGeneration.class, new NaturalGeneration.Serializer());
    genInfoRegistry.registerType("structureList", ListGeneration.class, new ListGeneration.Serializer());
    genInfoRegistry.registerType("mazeComponent", MazeGeneration.class, new MazeGeneration.Serializer());
    genInfoRegistry.registerType("static", StaticGeneration.class, new StaticGeneration.Serializer());
    genInfoRegistry.registerType("vanilla", VanillaGeneration.class, new VanillaGeneration.Serializer());
    genInfoRegistry.registerType("sapling", SaplingGeneration.class, new SaplingGeneration.Serializer());
    genInfoRegistry.registerType("decoration", VanillaDecorationGeneration.class, new VanillaDecorationGeneration.Serializer());
    SerializableStringTypeRegistry<GenericPlacer.Factor> placerFactorRegistry = FactorRegistry.INSTANCE.getTypeRegistry();
    placerFactorRegistry.registerType("limit", FactorLimit.class, new FactorLimit.Serializer());
    placerFactorRegistry.registerType("match", FactorMatch.class, new FactorMatch.Serializer());
    SerializableStringTypeRegistry<FactorLimit.Ray> rayRegistry = FactorLimit.getRayRegistry();
    rayRegistry.registerType("dynpos", RayDynamicPosition.class, null);
    rayRegistry.registerType("move", RayMove.class, null);
    rayRegistry.registerType("matcher", RayMatcher.class, new RayMatcher.Serializer());
    rayRegistry.registerType("average", RayAverageMatcher.class, new RayAverageMatcher.Serializer());
    rayRegistry.registerType("dynmove", RayDynamicMove.class, null);
    MazeRuleRegistry mazeRuleRegistry = MazeRuleRegistry.INSTANCE;
    mazeRuleRegistry.register("connect", MazeRuleConnect.class);
    mazeRuleRegistry.register("connectall", MazeRuleConnectAll.class);
    OperationRegistry.register("multi", OperationMulti.class);
    OperationRegistry.register("strucGen", OperationGenerateStructure.class);
    OperationRegistry.register("schemGen", OperationGenerateSchematic.class);
    OperationRegistry.register("clearArea", OperationClearArea.class);
    //        GameRegistry.registerWorldGenerator(new WorldGenStructures(), 50);
    RCInventoryGenerators.registerVanillaInventoryGenerators();
    //        MapGenStructureIO.func_143031_a(GenericVillagePiece.class, "RcGSP");
    //        VillagerRegistry.instance().registerVillageCreationHandler(new GenericVillageCreationHandler("DesertHut"));
    // So it's placeable in furnaces
    GameRegistry.registerFuelHandler(fuel -> fuel.getItem() instanceof GeneratingItem ? 1 : 0);
}
Also used : FactorLimit(ivorius.reccomplex.world.gen.feature.structure.generic.placement.FactorLimit) Poem(ivorius.reccomplex.random.Poem) FactorMatch(ivorius.reccomplex.world.gen.feature.structure.generic.placement.FactorMatch) MCRegistry(ivorius.ivtoolkit.tools.MCRegistry) RCFileSaver(ivorius.reccomplex.files.RCFileSaver) MazeRuleRegistry(ivorius.reccomplex.world.gen.feature.structure.generic.maze.rules.MazeRuleRegistry) ItemCollectionSaveHandler(ivorius.reccomplex.world.storage.loot.ItemCollectionSaveHandler)

Aggregations

MCRegistry (ivorius.ivtoolkit.tools.MCRegistry)1 RCFileSaver (ivorius.reccomplex.files.RCFileSaver)1 Poem (ivorius.reccomplex.random.Poem)1 MazeRuleRegistry (ivorius.reccomplex.world.gen.feature.structure.generic.maze.rules.MazeRuleRegistry)1 FactorLimit (ivorius.reccomplex.world.gen.feature.structure.generic.placement.FactorLimit)1 FactorMatch (ivorius.reccomplex.world.gen.feature.structure.generic.placement.FactorMatch)1 ItemCollectionSaveHandler (ivorius.reccomplex.world.storage.loot.ItemCollectionSaveHandler)1