ActuallyAdditions/src/main/java/ellpeck/actuallyadditions/util/BlockUtil.java

21 lines
664 B
Java
Raw Normal View History

2015-03-29 15:29:05 +02:00
package ellpeck.actuallyadditions.util;
import cpw.mods.fml.common.registry.GameRegistry;
import ellpeck.actuallyadditions.creative.CreativeTab;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
public class BlockUtil{
public static String createUnlocalizedName(Block block){
return ModUtil.MOD_ID_LOWER + "." + ((IName)block).getName();
}
public static void register(Block block, Class<? extends ItemBlock> itemBlock){
block.setCreativeTab(CreativeTab.instance);
block.setBlockName(createUnlocalizedName(block));
GameRegistry.registerBlock(block, itemBlock, ((IName)block).getName());
}
}