2015-08-29 14:33:25 +02:00
|
|
|
|
/*
|
|
|
|
|
* This file ("BlockUtil.java") is part of the Actually Additions Mod for Minecraft.
|
|
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
|
* under the Actually Additions License to be found at
|
|
|
|
|
* http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md
|
|
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
|
*
|
|
|
|
|
* <EFBFBD> 2015 Ellpeck
|
|
|
|
|
*/
|
|
|
|
|
|
2015-03-29 15:29:05 +02:00
|
|
|
|
package ellpeck.actuallyadditions.util;
|
|
|
|
|
|
|
|
|
|
import cpw.mods.fml.common.registry.GameRegistry;
|
|
|
|
|
import ellpeck.actuallyadditions.creative.CreativeTab;
|
2015-10-23 16:48:56 +02:00
|
|
|
|
import ellpeck.actuallyadditions.items.ItemBlockBase;
|
2015-03-29 15:29:05 +02:00
|
|
|
|
import net.minecraft.block.Block;
|
|
|
|
|
import net.minecraft.item.ItemBlock;
|
2015-04-04 05:20:19 +02:00
|
|
|
|
|
2015-03-29 15:29:05 +02:00
|
|
|
|
public class BlockUtil{
|
|
|
|
|
|
2015-10-23 16:48:56 +02:00
|
|
|
|
public static void register(Block block, Class<? extends ItemBlock> itemBlock){
|
2015-10-25 14:30:59 +01:00
|
|
|
|
block.setCreativeTab(CreativeTab.instance);
|
2015-04-04 05:20:19 +02:00
|
|
|
|
block.setBlockName(createUnlocalizedName(block));
|
2015-10-23 16:48:56 +02:00
|
|
|
|
GameRegistry.registerBlock(block, itemBlock, ((IActAddItemOrBlock)block).getName());
|
2015-03-29 15:29:05 +02:00
|
|
|
|
}
|
|
|
|
|
|
2015-10-03 10:19:40 +02:00
|
|
|
|
public static String createUnlocalizedName(Block block){
|
|
|
|
|
return ModUtil.MOD_ID_LOWER+"."+((IActAddItemOrBlock)block).getName();
|
2015-05-20 22:39:43 +02:00
|
|
|
|
}
|
2015-10-23 16:54:33 +02:00
|
|
|
|
|
|
|
|
|
public static void register(Block block){
|
2015-10-25 14:30:59 +01:00
|
|
|
|
register(block, ItemBlockBase.class);
|
2015-10-23 16:54:33 +02:00
|
|
|
|
}
|
2015-03-29 15:29:05 +02:00
|
|
|
|
}
|