mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +00:00
Reorganize folders for modules
This commit is contained in:
1 parent
2c14f315de
commit
e2f0558b6f
370 files changed
+4274
-4788
No files matched your search
@@ -0,0 +1,33 @@
|
||||
package tconstruct.util;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.ShapedRecipes;
|
||||
import tconstruct.TConstruct;
|
||||
|
||||
public class ItemHelper
|
||||
{
|
||||
public static Object getStaticItem (String name, String classPackage)
|
||||
{
|
||||
try
|
||||
{
|
||||
Class clazz = Class.forName(classPackage);
|
||||
Field field = clazz.getDeclaredField(name);
|
||||
Object ret = field.get(null);
|
||||
if (ret != null && (ret instanceof ItemStack || ret instanceof Item))
|
||||
return ret;
|
||||
return null;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
TConstruct.logger.warn("Could not find " + name + "from " + classPackage);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user