Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .settings/org.eclipse.jdt.core.prefs

This file was deleted.

75 changes: 0 additions & 75 deletions src/main/java/com/mcmoddev/nethermetals/init/Blocks.java

This file was deleted.

130 changes: 130 additions & 0 deletions src/main/java/com/mcmoddev/nethermetals/init/NetherBlocks.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
package com.mcmoddev.nethermetals.init;

import com.mcmoddev.lib.data.Names;
import com.mcmoddev.lib.init.Materials;
import com.mcmoddev.lib.material.MMDMaterial;
import com.mcmoddev.nethermetals.NetherMetals;
import com.mcmoddev.nethermetals.util.Config.Options;

import net.minecraftforge.fml.common.Loader;

/**
* This class initializes all blocks in Nether Metals.
*
* @author Jasmine Iwanek
*
*/
public class NetherBlocks extends com.mcmoddev.lib.init.Blocks {

private static boolean initDone = false;

/**
*
*/
public static void init() {
if (initDone) {
return;
}

Materials.init();
// ItemGroups.init();

if( !Materials.getMaterialByName("coal").hasBlock(Names.ORE) ) {
final MMDMaterial material = Materials.getMaterialByName("coal");

material.addNewBlock(Names.BLOCK, net.minecraft.init.Blocks.COAL_BLOCK);
material.addNewBlock(Names.ORE, net.minecraft.init.Blocks.COAL_ORE);
}

if( !Materials.getMaterialByName("diamond").hasBlock(Names.ORE) ) {
final MMDMaterial material = Materials.getMaterialByName("diamond");

material.addNewBlock(Names.BLOCK, net.minecraft.init.Blocks.DIAMOND_BLOCK);
material.addNewBlock(Names.ORE, net.minecraft.init.Blocks.DIAMOND_ORE);
}

if( !Materials.getMaterialByName("emerald").hasBlock(Names.ORE) ) {
final MMDMaterial material = Materials.getMaterialByName("emerald");

material.addNewBlock(Names.BLOCK, net.minecraft.init.Blocks.EMERALD_BLOCK);
material.addNewBlock(Names.ORE, net.minecraft.init.Blocks.EMERALD_ORE);
}

if( !Materials.getMaterialByName("gold").hasBlock(Names.ORE) ) {
final MMDMaterial material = Materials.getMaterialByName("gold");

material.addNewBlock(Names.BLOCK, net.minecraft.init.Blocks.GOLD_BLOCK);
material.addNewBlock(Names.ORE, net.minecraft.init.Blocks.GOLD_ORE);
}

if( !Materials.getMaterialByName("lapis").hasBlock(Names.ORE) ) {
final MMDMaterial material = Materials.getMaterialByName("lapis");

material.addNewBlock(Names.BLOCK, net.minecraft.init.Blocks.LAPIS_BLOCK);
material.addNewBlock(Names.ORE, net.minecraft.init.Blocks.LAPIS_ORE);
}

if( !Materials.getMaterialByName("iron").hasBlock(Names.ORE) ) {
final MMDMaterial material = Materials.getMaterialByName("iron");

material.addNewBlock(Names.BLOCK, net.minecraft.init.Blocks.IRON_BLOCK);
material.addNewBlock(Names.ORE, net.minecraft.init.Blocks.IRON_ORE);
}

if( !Materials.getMaterialByName("redstone").hasBlock(Names.ORE) ) {
final MMDMaterial material = Materials.getMaterialByName("redstone");

material.addNewBlock(Names.BLOCK, net.minecraft.init.Blocks.REDSTONE_BLOCK);
material.addNewBlock(Names.ORE, net.minecraft.init.Blocks.REDSTONE_ORE);
}

createNetherOreWrapper(Options.enableCoalNetherOre, Materials.getMaterialByName("coal"));
createNetherOreWrapper(Options.enableDiamondNetherOre, Materials.getMaterialByName("diamond"));
createNetherOreWrapper(Options.enableEmeraldNetherOre, Materials.getMaterialByName("emerald"));
createNetherOreWrapper(Options.enableGoldNetherOre, Materials.getMaterialByName("gold"));
createNetherOreWrapper(Options.enableIronNetherOre, Materials.getMaterialByName("iron"));
createNetherOreWrapper(Options.enableLapisNetherOre, Materials.getMaterialByName("lapis"));
createNetherOreWrapper(Options.enableRedstoneNetherOre, Materials.getMaterialByName("redstone"));

if (Loader.isModLoaded("basemetals")) {
createNetherOreWrapper(Options.enableAntimonyNetherOre, Materials.getMaterialByName("antimony"));
createNetherOreWrapper(Options.enableBismuthNetherOre, Materials.getMaterialByName("bismuth"));
createNetherOreWrapper(Options.enableCopperNetherOre, Materials.getMaterialByName("copper"));
createNetherOreWrapper(Options.enableLeadNetherOre, Materials.getMaterialByName("lead"));
createNetherOreWrapper(Options.enableMercuryNetherOre, Materials.getMaterialByName("mercury"));
createNetherOreWrapper(Options.enableNickelNetherOre, Materials.getMaterialByName("nickel"));
createNetherOreWrapper(Options.enablePlatinumNetherOre, Materials.getMaterialByName("platinum"));
createNetherOreWrapper(Options.enableSilverNetherOre, Materials.getMaterialByName("silver"));
createNetherOreWrapper(Options.enableTinNetherOre, Materials.getMaterialByName("tin"));
createNetherOreWrapper(Options.enableZincNetherOre, Materials.getMaterialByName("zinc"));
}

if (Loader.isModLoaded("modernmetals")) {
createNetherOreWrapper(Options.enableAluminumNetherOre, Materials.getMaterialByName("aluminum"));
createNetherOreWrapper(Options.enableCadmiumNetherOre, Materials.getMaterialByName("cadmium"));
createNetherOreWrapper(Options.enableChromiumNetherOre, Materials.getMaterialByName("chromium"));
createNetherOreWrapper(Options.enableIridiumNetherOre, Materials.getMaterialByName("iridium"));
createNetherOreWrapper(Options.enableMagnesiumNetherOre, Materials.getMaterialByName("magnesium"));
createNetherOreWrapper(Options.enableManganeseNetherOre, Materials.getMaterialByName("manganese"));
createNetherOreWrapper(Options.enableOsmiumNetherOre, Materials.getMaterialByName("osmium"));
createNetherOreWrapper(Options.enablePlutoniumNetherOre, Materials.getMaterialByName("plutonium"));
createNetherOreWrapper(Options.enableRutileNetherOre, Materials.getMaterialByName("rutile"));
createNetherOreWrapper(Options.enableTantalumNetherOre, Materials.getMaterialByName("tantalum"));
createNetherOreWrapper(Options.enableTitaniumNetherOre, Materials.getMaterialByName("titanium"));
createNetherOreWrapper(Options.enableTungstenNetherOre, Materials.getMaterialByName("tungsten"));
createNetherOreWrapper(Options.enableUraniumNetherOre, Materials.getMaterialByName("uranium"));
createNetherOreWrapper(Options.enableZirconiumNetherOre, Materials.getMaterialByName("zirconium"));
}
initDone = true;
}

private static void createNetherOreWrapper(boolean enabled, MMDMaterial material) {
if (enabled) {
if (material != null) {
createNetherOre(material, ItemGroups.blocksTab);
} else {
NetherMetals.logger.error("material was null!");
}
}
}
}
56 changes: 56 additions & 0 deletions src/main/java/com/mcmoddev/nethermetals/init/NetherFluids.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package com.mcmoddev.nethermetals.init;

import com.mcmoddev.lib.init.Materials;
import com.mcmoddev.nethermetals.util.Config.Options;
import com.mcmoddev.lib.init.Fluids;

public class NetherFluids extends Fluids {
private static boolean initDone = false;

private NetherFluids() {
throw new IllegalAccessError("Not a instantiable class");
}

/**
*
*/
public static void init() {
if (initDone) {
return;
}

Fluids.init();

if (Options.enableCoalNetherOre && Materials.getMaterialByName("coal").getFluid() == null) {
addFluid(Materials.getMaterialByName("coal"), 2000, 10000, 769, 10);
addFluidBlock(Materials.getMaterialByName("coal"));
}

if (Options.enableDiamondNetherOre && Materials.getMaterialByName("diamond").getFluid() == null) {
addFluid(Materials.getMaterialByName("diamond"), 2000, 10000, 769, 10);
addFluidBlock(Materials.getMaterialByName("diamond"));
}

if (Options.enableEmeraldNetherOre && Materials.getMaterialByName("emerald").getFluid() == null) {
addFluid(Materials.getMaterialByName("emerald"), 2000, 10000, 769, 10);
addFluidBlock(Materials.getMaterialByName("emerald"));
}

if (Options.enableGoldNetherOre && Materials.getMaterialByName("gold").getFluid() == null) {
addFluid(Materials.getMaterialByName("gold"), 2000, 10000, 769, 10);
addFluidBlock(Materials.getMaterialByName("gold"));
}

if (Options.enableIronNetherOre && Materials.getMaterialByName("iron").getFluid() == null) {
addFluid(Materials.getMaterialByName("iron"), 2000, 10000, 769, 10);
addFluidBlock(Materials.getMaterialByName("iron"));
}

if (Options.enableRedstoneNetherOre && Materials.getMaterialByName("redstone").getFluid() == null) {
addFluid(Materials.getMaterialByName("redstone"), 2000, 10000, 769, 10);
addFluidBlock(Materials.getMaterialByName("redstone"));
}

initDone = true;
}
}
64 changes: 64 additions & 0 deletions src/main/java/com/mcmoddev/nethermetals/init/NetherItems.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package com.mcmoddev.nethermetals.init;

import com.mcmoddev.basemetals.init.ItemGroups;
import com.mcmoddev.lib.data.Names;
import com.mcmoddev.lib.init.Items;
import com.mcmoddev.lib.init.Materials;
import com.mcmoddev.lib.material.MMDMaterial;
import com.mcmoddev.lib.material.MMDMaterial.MaterialType;
import com.mcmoddev.lib.util.TabContainer;
import com.mcmoddev.nethermetals.util.Config.Options;

import net.minecraft.item.ItemStack;

public class NetherItems extends Items {
private static boolean initDone = false;
private static TabContainer myTabs = new TabContainer(ItemGroups.blocksTab, ItemGroups.itemsTab, ItemGroups.toolsTab);

protected NetherItems() {
throw new IllegalAccessError("Not a instantiable class");
}

/**
*
*/
public static void init() {
if (initDone) {
return;
}

NetherBlocks.init();
Items.init();

if( Options.enableCoalNetherOre && !Materials.getMaterialByName("coal").hasItem(Names.INGOT)) {
Materials.getMaterialByName("coal").addNewItem(Names.INGOT, net.minecraft.init.Items.COAL);
}

if(Options.enableDiamondNetherOre && !Materials.getMaterialByName("diamond").hasItem(Names.INGOT)) {
Materials.getMaterialByName("diamond").addNewItem(Names.INGOT, net.minecraft.init.Items.DIAMOND);
}

if(Options.enableEmeraldNetherOre && !Materials.getMaterialByName("emerald").hasItem(Names.INGOT)) {
Materials.getMaterialByName("emerald").addNewItem(Names.INGOT, net.minecraft.init.Items.EMERALD);
}

if(Options.enableGoldNetherOre && !Materials.getMaterialByName("gold").hasItem(Names.INGOT)) {
Materials.getMaterialByName("gold").addNewItem(Names.INGOT, net.minecraft.init.Items.GOLD_INGOT);
}

if(Options.enableIronNetherOre && !Materials.getMaterialByName("iron").hasItem(Names.INGOT)) {
Materials.getMaterialByName("iron").addNewItem(Names.INGOT, net.minecraft.init.Items.IRON_INGOT);
}

if(Options.enableLapisNetherOre && !Materials.getMaterialByName("lapis").hasItem(Names.POWDER)) {
Materials.getMaterialByName("lapis").addNewItem(Names.POWDER, net.minecraft.init.Items.DYE);
}

if(Options.enableRedstoneNetherOre && !Materials.getMaterialByName("redstone").hasItem(Names.POWDER)) {
Materials.getMaterialByName("redstone").addNewItem(Names.POWDER, net.minecraft.init.Items.REDSTONE);
}

initDone = true;
}

}
47 changes: 47 additions & 0 deletions src/main/java/com/mcmoddev/nethermetals/init/NetherMaterials.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.mcmoddev.nethermetals.init;

import com.mcmoddev.lib.init.Materials;
import com.mcmoddev.lib.material.MMDMaterial.MaterialType;
import com.mcmoddev.nethermetals.util.Config.Options;

public class NetherMaterials extends Materials {
private static boolean initDone = false;

protected NetherMaterials() {
throw new IllegalAccessError("Not a instantiable class");
}

public static void init() {
if (initDone) {
return;
}

if( Options.enableCoalNetherOre && Materials.getMaterialByName("coal") == null ) {
createMaterial("coal", MaterialType.MINERAL, 4, 4, 2, 0xFF151515);
}

if(Options.enableDiamondNetherOre && Materials.getMaterialByName("diamond") == null ) {
createMaterial("diamond", MaterialType.GEM, 10, 15, 4, 0xFF8CF4E1);
}

if(Options.enableEmeraldNetherOre && Materials.getMaterialByName("emerald") == null ) {
createMaterial("emerald", MaterialType.GEM, 10, 15, 4, 0xFF82F6AC);
}

if(Options.enableGoldNetherOre && Materials.getMaterialByName("gold") == null ) {
createMaterial("gold", MaterialType.METAL, 1, 1, 10, 0xFFFFFF8B);
}

if(Options.enableIronNetherOre && Materials.getMaterialByName("iron") == null ) {
createMaterial("iron", MaterialType.METAL, 8, 8, 4.5, 0xFFD8D8D8);
}

if(Options.enableLapisNetherOre && Materials.getMaterialByName("lapis") == null ) {
createMaterial("lapis", MaterialType.MINERAL, 1, 1, 1, 0xFF7B7B7B);
}

if(Options.enableRedstoneNetherOre && Materials.getMaterialByName("redstone") == null ) {
createMaterial("redstone", MaterialType.MINERAL, 1, 1, 1, 0xFF7B7B7B);
}
}
}
Loading