diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 04ef3a3..4430e38 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1 +1 @@ -Port to 1.11.2 +Fixed a silly bug in the last release causing nether ores for vanilla mats not to generate diff --git a/src/main/java/com/mcmoddev/nethermetals/init/NetherBlocks.java b/src/main/java/com/mcmoddev/nethermetals/init/NetherBlocks.java index 03b7d95..f427e1e 100644 --- a/src/main/java/com/mcmoddev/nethermetals/init/NetherBlocks.java +++ b/src/main/java/com/mcmoddev/nethermetals/init/NetherBlocks.java @@ -1,9 +1,14 @@ package com.mcmoddev.nethermetals.init; +import com.mcmoddev.lib.block.*; import com.mcmoddev.lib.data.Names; +import com.mcmoddev.lib.data.SharedStrings; import com.mcmoddev.lib.init.Materials; +import com.mcmoddev.lib.material.MMDMaterial; import com.mcmoddev.lib.util.ConfigBase.Options; +import com.mcmoddev.lib.util.Oredicts; +import net.minecraft.block.Block; import net.minecraftforge.fml.common.Loader; /** @@ -26,14 +31,14 @@ public static void init() { Materials.init(); ItemGroups.init(); - - createNetherOreWrapper("coal"); - createNetherOreWrapper("diamond"); - createNetherOreWrapper("emerald"); - createNetherOreWrapper("gold"); - createNetherOreWrapper("iron"); - createNetherOreWrapper("lapis"); - createNetherOreWrapper("redstone"); + + createVanillaNetherOreWrapper("coal"); + createVanillaNetherOreWrapper("diamond"); + createVanillaNetherOreWrapper("emerald"); + createVanillaNetherOreWrapper("gold"); + createVanillaNetherOreWrapper("iron"); + createVanillaNetherOreWrapper("lapis"); + createVanillaNetherOreWrapper("redstone"); if (Loader.isModLoaded("basemetals")) { createNetherOreWrapper("antimony"); @@ -68,6 +73,16 @@ public static void init() { initDone = true; } + private static void createVanillaNetherOreWrapper(String materialName) { + final MMDMaterial material = Materials.getMaterialByName(materialName); + material.addNewBlock(Names.NETHERORE, addBlock(new BlockMMDNetherOre(material), Names.NETHERORE.toString(), material, ItemGroups.getTab(SharedStrings.TAB_BLOCKS))); + final Block b = material.getBlock(Names.NETHERORE); + final String oredict = getOredictFromName(Names.NETHERORE); + if ((oredict != null) && (b != null)) { + Oredicts.registerOre(oredict + material.getCapitalizedName(), b); + } + } + private static void createNetherOreWrapper(String materialName ) { if (Materials.hasMaterial(materialName)) { // create(Names.NETHERORE, Materials.getMaterialByName(materialName));