Make the mod classes significantly less godlike.

Move Config variables into their own class, (in api because other stuff in API references config, may make sense to move it back to common later), and move Blocks and Items into final variables in their own classes. It looks a lot cleaner this way and my OCD can finally rest now.
This commit is contained in:
Ben Spiers committed 2014-08-01 01:35:06 +01:00
1 parent 6762f416d3
commit 725b7463f0
163 files changed
+1848 -1789

No files matched your search

@@ -0,0 +1,38 @@
package mekanism.api.util;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class ItemInfo
{
public Item item;
public int meta;
public ItemInfo(Item i, int j)
{
item = i;
meta = j;
}
public static ItemInfo get(ItemStack stack)
{
return new ItemInfo(stack.getItem(), stack.getItemDamage());
}
@Override
public boolean equals(Object obj)
{
return obj instanceof BlockInfo &&
((ItemInfo)obj).item == item &&
((ItemInfo)obj).meta == meta;
}
@Override
public int hashCode()
{
int code = 1;
code = 31 * code + item.getUnlocalizedName().hashCode();
code = 31 * code + meta;
return code;
}
}