Search in sources :

Example 1 with Names

use of com.mcmoddev.lib.data.Names in project BaseMetals by MinecraftModDevelopmentMods.

the class VanillaBlocks method registerVanilla.

@SubscribeEvent
public static void registerVanilla(MMDLibRegisterBlocks ev) {
    // Vanilla Materials get their Ore and Block always
    final MMDMaterial charcoal = Materials.getMaterialByName(MaterialNames.CHARCOAL);
    final MMDMaterial gold = Materials.getMaterialByName(MaterialNames.GOLD);
    final MMDMaterial iron = Materials.getMaterialByName(MaterialNames.IRON);
    final MMDMaterial quartz = Materials.getMaterialByName(MaterialNames.QUARTZ);
    if (Materials.hasMaterial(MaterialNames.CHARCOAL)) {
        create(Names.BLOCK, charcoal);
    }
    Arrays.stream(new String[] { MaterialNames.DIAMOND, MaterialNames.EMERALD, MaterialNames.GOLD, MaterialNames.OBSIDIAN }).filter(n -> Options.isMaterialEnabled(n.toString())).filter(Materials::hasMaterial).map(Materials::getMaterialByName).forEach(mat -> {
        Arrays.stream(new Names[] { Names.BARS, Names.DOOR, Names.TRAPDOOR, Names.BUTTON, Names.SLAB, Names.DOUBLE_SLAB, Names.LEVER, Names.PRESSURE_PLATE, Names.STAIRS, Names.WALL }).forEach(n -> create(n, mat));
    });
    if (Materials.hasMaterial(MaterialNames.GOLD) && Options.isMaterialEnabled(MaterialNames.GOLD)) {
        create(Names.PLATE, gold);
    }
    if (Materials.hasMaterial(MaterialNames.IRON) && Options.isMaterialEnabled(MaterialNames.IRON)) {
        create(Names.PLATE, iron);
        create(Names.BUTTON, iron);
        create(Names.SLAB, iron);
        create(Names.DOUBLE_SLAB, iron);
        create(Names.LEVER, iron);
        create(Names.PRESSURE_PLATE, iron);
        create(Names.STAIRS, iron);
        create(Names.WALL, iron);
    }
    if (Materials.hasMaterial(MaterialNames.QUARTZ) && Options.isMaterialEnabled(MaterialNames.QUARTZ)) {
        create(Names.BARS, quartz);
        create(Names.DOOR, quartz);
        create(Names.TRAPDOOR, quartz);
        create(Names.BUTTON, quartz);
        create(Names.LEVER, quartz);
        create(Names.PRESSURE_PLATE, quartz);
        create(Names.WALL, quartz);
    }
}
Also used : Arrays(java.util.Arrays) BaseMetals(com.mcmoddev.basemetals.BaseMetals) Options(com.mcmoddev.lib.util.Config.Options) Materials(com.mcmoddev.lib.init.Materials) MaterialNames(com.mcmoddev.lib.data.MaterialNames) MMDLibRegisterBlocks(com.mcmoddev.lib.events.MMDLibRegisterBlocks) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) Blocks(com.mcmoddev.lib.init.Blocks) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) Mod(net.minecraftforge.fml.common.Mod) Names(com.mcmoddev.lib.data.Names) MaterialNames(com.mcmoddev.lib.data.MaterialNames) Names(com.mcmoddev.lib.data.Names) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) Materials(com.mcmoddev.lib.init.Materials) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

BaseMetals (com.mcmoddev.basemetals.BaseMetals)1 MaterialNames (com.mcmoddev.lib.data.MaterialNames)1 Names (com.mcmoddev.lib.data.Names)1 MMDLibRegisterBlocks (com.mcmoddev.lib.events.MMDLibRegisterBlocks)1 Blocks (com.mcmoddev.lib.init.Blocks)1 Materials (com.mcmoddev.lib.init.Materials)1 MMDMaterial (com.mcmoddev.lib.material.MMDMaterial)1 Options (com.mcmoddev.lib.util.Config.Options)1 Arrays (java.util.Arrays)1 Mod (net.minecraftforge.fml.common.Mod)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1