Files
Mantle/src/mantle/blocks/BlockUtils.java
T
Sunstrike bb143e8e15 Cleanup some warnings.
Suppress one unused warning, change references to GameData's block/item registries to the new getters.
2014-04-26 18:21:33 +01:00

32 lines
760 B
Java

package mantle.blocks;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.registry.GameData;
public class BlockUtils
{
public static Block getBlockFromItem (Item item)
{
return Block.getBlockFromItem(item);
}
@SuppressWarnings("unused")
public static Block getBlockFromItemStack (ItemStack itemStack)
{
return getBlockFromItem(itemStack.getItem());
}
public static String getUniqueName (Block block)
{
return GameData.getBlockRegistry().getNameForObject(block);
}
public static Block getBlockFromUniqueName (String uniqueName)
{
return GameData.getBlockRegistry().getObject(uniqueName);
}
}