Metallurgy was easier than expected.
This commit is contained in:
parent
26463711de
commit
f463416c0c
4 changed files with 14 additions and 3 deletions
|
@ -36,4 +36,8 @@ public interface IOreInfo
|
|||
public OreType getType();
|
||||
|
||||
public boolean isEnabled();
|
||||
|
||||
public int getBlockHarvestLevel();
|
||||
|
||||
public int getToolHarvestLevel();
|
||||
}
|
|
@ -6,12 +6,19 @@ public class MetallurgyAPI
|
|||
{
|
||||
|
||||
// Values for name: "base", "precious", "nether", "fantasy", "ender",
|
||||
// "utility"
|
||||
// "utility", "vanilla"
|
||||
public static IMetalSet getMetalSet(String name)
|
||||
{
|
||||
try
|
||||
{
|
||||
final Class metallurgyMetals = Class.forName("rebelkeithy.mods.metallurgy.metals.MetallurgyMetals");
|
||||
String className = "rebelkeithy.mods.metallurgy.metals.MetallurgyMetals";
|
||||
|
||||
if (name.equals("vanilla"))
|
||||
{
|
||||
className = "rebelkeithy.mods.metallurgy.vanilla.MetallurgyVanilla";
|
||||
}
|
||||
|
||||
final Class<?> metallurgyMetals = Class.forName(className);
|
||||
final Field set = metallurgyMetals.getField(name + "Set");
|
||||
return (IMetalSet) set.get(null);
|
||||
} catch (final NoSuchFieldException e)
|
||||
|
@ -43,7 +50,7 @@ public class MetallurgyAPI
|
|||
{
|
||||
// TODO maybe put something to get runtime list here
|
||||
final String[] names =
|
||||
{ "base", "precious", "nether", "fantasy", "ender", "utility" };
|
||||
{ "base", "precious", "nether", "fantasy", "ender", "utility", "vanilla" };
|
||||
return names;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue