Condensed world generation
Consended blocks and items with inheritance
This commit is contained in:
parent
5c12c3d75a
commit
67609531ce
20 changed files with 207 additions and 525 deletions
|
|
@ -1,36 +1,11 @@
|
|||
package mysticstones.blocks;
|
||||
|
||||
import mysticstones.MysticStones;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemPlanks extends ItemBlock {
|
||||
public static String[] PLANK_TYPE = new String[] { "Purple Planks", "Green Planks", "Black Planks", "Orange Planks", "Red Planks", "Blue Planks", "Yellow Planks" };
|
||||
public class ItemPlanks extends ItemBlockMulti {
|
||||
public static final String[] PLANK_TYPE = new String[] { "Purple Planks", "Green Planks", "Black Planks", "Orange Planks", "Red Planks", "Blue Planks", "Yellow Planks" };
|
||||
|
||||
public ItemPlanks(int par1) {
|
||||
super(par1);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int par1) {
|
||||
return MysticStones.Planks.getIcon(2, par1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1) {
|
||||
return par1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack) {
|
||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, PLANK_TYPE.length);
|
||||
return PLANK_TYPE[meta];
|
||||
super(par1, MysticStones.Planks, PLANK_TYPE);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue