ActuallyAdditions/src/main/java/ellpeck/actuallyadditions/blocks/base/BlockStair.java

62 lines
1.6 KiB
Java
Raw Normal View History

2015-08-29 14:33:25 +02:00
/*
* This file ("BlockStair.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
*
2015-11-02 20:55:19 +01:00
* © 2015 Ellpeck
2015-08-29 14:33:25 +02:00
*/
package ellpeck.actuallyadditions.blocks.base;
2015-06-28 03:12:32 +02:00
import cpw.mods.fml.common.registry.GameRegistry;
import ellpeck.actuallyadditions.creative.CreativeTab;
import ellpeck.actuallyadditions.util.ModUtil;
2015-06-28 03:12:32 +02:00
import net.minecraft.block.Block;
import net.minecraft.block.BlockStairs;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
public class BlockStair extends BlockStairs{
2015-06-28 03:12:32 +02:00
private String name;
2015-12-17 20:18:22 +01:00
public BlockStair(Block block, String name, int meta){
super(block, meta);
2015-06-28 03:12:32 +02:00
this.name = name;
this.setLightOpacity(0);
this.register();
}
2015-12-17 20:18:22 +01:00
public BlockStair(Block block, String name){
this(block, name, 0);
}
private void register(){
this.setBlockName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName());
GameRegistry.registerBlock(this, this.getItemBlock(), this.getBaseName());
if(this.shouldAddCreative()){
this.setCreativeTab(CreativeTab.instance);
}
2015-06-28 03:12:32 +02:00
}
public boolean shouldAddCreative(){
return true;
}
protected String getBaseName(){
2015-06-28 03:12:32 +02:00
return this.name;
}
protected Class<? extends ItemBlockBase> getItemBlock(){
return ItemBlockBase.class;
}
public EnumRarity getRarity(ItemStack stack){
return EnumRarity.common;
2015-06-28 03:12:32 +02:00
}
}