mirror of
https://github.com/GTNewHorizons/WailaHarvestability.git
synced 2026-11-25 14:24:21 +00:00
43 lines
833 B
Java
43 lines
833 B
Java
package squeek.wailaharvestability.proxy;
|
|
|
|
import java.lang.reflect.Method;
|
|
import net.minecraft.block.Block;
|
|
import cpw.mods.fml.common.Loader;
|
|
|
|
public class ProxyCreativeBlocks
|
|
{
|
|
private static Class<?> CreativeBlocks = null;
|
|
private static Method isCreativeBlock = null;
|
|
|
|
static
|
|
{
|
|
if (Loader.isModLoaded("CreativeBlocks"))
|
|
{
|
|
try
|
|
{
|
|
CreativeBlocks = Class.forName("squeek.creativeblocks.CreativeBlocks");
|
|
isCreativeBlock = CreativeBlocks.getDeclaredMethod("isCreativeBlock", Block.class, int.class);
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
|
|
public static boolean isCreativeBlock(Block block, int meta)
|
|
{
|
|
if (isCreativeBlock != null)
|
|
{
|
|
try
|
|
{
|
|
return (Boolean) isCreativeBlock.invoke(null, block, meta);
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|