Skip to content

Commit

Permalink
Fixed missing ores
Browse files Browse the repository at this point in the history
  • Loading branch information
jriwanek committed Feb 23, 2018
1 parent 242bb23 commit 0b9f94f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Port to 1.11.2
Fixed a silly bug in the last release causing nether ores for vanilla mats not to generate
31 changes: 23 additions & 8 deletions src/main/java/com/mcmoddev/nethermetals/init/NetherBlocks.java
Original file line number Diff line number Diff line change
@@ -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;

/**
Expand All @@ -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");
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 0b9f94f

Please sign in to comment.