mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-09-29 12:21:05 +02:00
a5dfbc426c
Didn't change anything to the game.
82 lines
2.2 KiB
Java
82 lines
2.2 KiB
Java
/*
|
|
* This file ("BlockWallAA.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 Ellpeck
|
|
*/
|
|
|
|
package ellpeck.actuallyadditions.blocks.base;
|
|
|
|
import cpw.mods.fml.common.registry.GameRegistry;
|
|
import cpw.mods.fml.relauncher.Side;
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
import ellpeck.actuallyadditions.creative.CreativeTab;
|
|
import ellpeck.actuallyadditions.util.ModUtil;
|
|
import net.minecraft.block.Block;
|
|
import net.minecraft.block.BlockWall;
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
import net.minecraft.item.EnumRarity;
|
|
import net.minecraft.item.Item;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.util.IIcon;
|
|
|
|
import java.util.List;
|
|
|
|
public class BlockWallAA extends BlockWall {
|
|
|
|
private String name;
|
|
private Block baseBlock;
|
|
|
|
public BlockWallAA(String name, Block base){
|
|
super(base);
|
|
this.baseBlock = base;
|
|
this.name = name;
|
|
|
|
this.register();
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|
|
|
|
public boolean shouldAddCreative(){
|
|
return true;
|
|
}
|
|
|
|
protected String getBaseName(){
|
|
return this.name;
|
|
}
|
|
|
|
protected Class<? extends ItemBlockBase> getItemBlock(){
|
|
return ItemBlockBase.class;
|
|
}
|
|
|
|
public EnumRarity getRarity(ItemStack stack){
|
|
return EnumRarity.common;
|
|
}
|
|
|
|
@Override
|
|
@SideOnly(Side.CLIENT)
|
|
public IIcon getIcon(int side, int meta){
|
|
return this.baseBlock.getBlockTextureFromSide(side);
|
|
}
|
|
|
|
@SuppressWarnings("unchecked")
|
|
@Override
|
|
@SideOnly(Side.CLIENT)
|
|
public void getSubBlocks(Item item, CreativeTabs tab, List list){
|
|
list.add(new ItemStack(item, 1, 0));
|
|
}
|
|
|
|
@Override
|
|
public int damageDropped(int meta){
|
|
return meta;
|
|
}
|
|
}
|