2015-11-08 18:29:05 +01:00
|
|
|
/*
|
|
|
|
* 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
|
2016-01-03 16:05:51 +01:00
|
|
|
* http://ellpeck.de/actaddlicense/
|
2015-11-08 18:29:05 +01:00
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
*
|
2016-01-03 16:05:51 +01:00
|
|
|
* © 2016 Ellpeck
|
2015-11-08 18:29:05 +01:00
|
|
|
*/
|
|
|
|
|
2015-12-30 22:02:15 +01:00
|
|
|
package de.ellpeck.actuallyadditions.blocks.base;
|
2015-11-08 18:29:05 +01:00
|
|
|
|
2015-12-03 20:15:07 +01:00
|
|
|
import cpw.mods.fml.common.registry.GameRegistry;
|
2015-11-08 18:29:05 +01:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
2015-12-30 22:02:15 +01:00
|
|
|
import de.ellpeck.actuallyadditions.creative.CreativeTab;
|
|
|
|
import de.ellpeck.actuallyadditions.util.ModUtil;
|
2015-11-08 18:29:05 +01:00
|
|
|
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;
|
|
|
|
|
2015-12-19 10:30:39 +01:00
|
|
|
public class BlockWallAA extends BlockWall{
|
2015-11-08 18:29:05 +01:00
|
|
|
|
|
|
|
private String name;
|
|
|
|
private Block baseBlock;
|
2015-12-17 20:18:22 +01:00
|
|
|
private int meta;
|
2015-11-08 18:29:05 +01:00
|
|
|
|
2015-12-19 10:30:39 +01:00
|
|
|
public BlockWallAA(String name, Block base){
|
|
|
|
this(name, base, 0);
|
|
|
|
}
|
|
|
|
|
2015-12-17 20:18:22 +01:00
|
|
|
public BlockWallAA(String name, Block base, int meta){
|
2015-11-08 18:29:05 +01:00
|
|
|
super(base);
|
|
|
|
this.baseBlock = base;
|
|
|
|
this.name = name;
|
2015-12-17 20:18:22 +01:00
|
|
|
this.meta = meta;
|
2015-12-03 20:15:07 +01:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
2015-12-20 22:37:33 +01:00
|
|
|
else{
|
|
|
|
this.setCreativeTab(null);
|
|
|
|
}
|
2015-12-03 20:15:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
protected String getBaseName(){
|
|
|
|
return this.name;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected Class<? extends ItemBlockBase> getItemBlock(){
|
|
|
|
return ItemBlockBase.class;
|
|
|
|
}
|
|
|
|
|
2015-12-19 10:30:39 +01:00
|
|
|
public boolean shouldAddCreative(){
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-12-03 20:15:07 +01:00
|
|
|
public EnumRarity getRarity(ItemStack stack){
|
|
|
|
return EnumRarity.common;
|
2015-11-08 18:29:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
public IIcon getIcon(int side, int meta){
|
2015-12-17 20:18:22 +01:00
|
|
|
return this.baseBlock.getIcon(side, this.meta);
|
2015-11-08 18:29:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@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;
|
|
|
|
}
|
|
|
|
}
|