mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-05 16:39:10 +01:00
21 lines
664 B
Java
21 lines
664 B
Java
|
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());
|
||
|
}
|
||
|
|
||
|
}
|