Formatting
This commit is contained in:
parent
55558bf211
commit
abae80d52d
6 changed files with 65 additions and 51 deletions
|
@ -5,7 +5,7 @@ import net.minecraft.src.ItemStack;
|
|||
public interface IChargeable {
|
||||
|
||||
public abstract short getCharge(ItemStack stack);
|
||||
|
||||
|
||||
public abstract void setCharge(ItemStack stack, short charge);
|
||||
|
||||
public abstract void increaseCharge(ItemStack stack);
|
||||
|
|
|
@ -26,60 +26,72 @@ import ee3.common.lib.Strings;
|
|||
*/
|
||||
public class ItemAlchemyDust extends ItemEE {
|
||||
|
||||
public static final String[] alchemyDustNames = new String[] {"ash", "minium", "verdant", "azure", "amaranthine", "iridescent"};
|
||||
|
||||
public ItemAlchemyDust(int id) {
|
||||
super(id);
|
||||
this.setHasSubtypes(true);
|
||||
public static final String[] alchemyDustNames = new String[] { "ash", "minium", "verdant", "azure", "amaranthine", "iridescent" };
|
||||
|
||||
public ItemAlchemyDust(int id) {
|
||||
|
||||
super(id);
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxDamage(0);
|
||||
this.setIconCoord(0, 3);
|
||||
this.setItemName(Strings.ALCHEMY_DUST_NAME);
|
||||
this.setCreativeTab(EquivalentExchange3.tabsEE3);
|
||||
maxStackSize = 64;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
maxStackSize = 64;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getIconFromDamage(int meta) {
|
||||
|
||||
int i = MathHelper.clamp_int(meta, 0, 11);
|
||||
return (this.iconIndex + i);
|
||||
}
|
||||
|
||||
public String getItemNameIS(ItemStack stack) {
|
||||
|
||||
public String getItemNameIS(ItemStack stack) {
|
||||
|
||||
int meta = MathHelper.clamp_int(stack.getItemDamage(), 0, 5);
|
||||
return super.getItemName() + "." + alchemyDustNames[meta];
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean hasEffect(ItemStack stack) {
|
||||
int meta = MathHelper.clamp_int(stack.getItemDamage(), 0, 5);
|
||||
|
||||
if (meta == 5) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
int meta = MathHelper.clamp_int(stack.getItemDamage(), 0, 5);
|
||||
|
||||
if (meta == 5) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(ItemStack stack) {
|
||||
int meta = MathHelper.clamp_int(stack.getItemDamage(), 0, 11);
|
||||
|
||||
switch(meta) {
|
||||
case 0: return EquivalentExchange3.proxy.getCustomRarityType(CustomItemRarity.NORMAL);
|
||||
case 1: return EquivalentExchange3.proxy.getCustomRarityType(CustomItemRarity.NORMAL);
|
||||
case 2: return EquivalentExchange3.proxy.getCustomRarityType(CustomItemRarity.UNCOMMON);
|
||||
case 3: return EquivalentExchange3.proxy.getCustomRarityType(CustomItemRarity.MAGICAL);
|
||||
case 4: return EquivalentExchange3.proxy.getCustomRarityType(CustomItemRarity.EPIC);
|
||||
case 5: return EquivalentExchange3.proxy.getCustomRarityType(CustomItemRarity.LEGENDARY);
|
||||
default: return EnumRarity.common;
|
||||
}
|
||||
|
||||
|
||||
int meta = MathHelper.clamp_int(stack.getItemDamage(), 0, 11);
|
||||
|
||||
switch (meta) {
|
||||
case 0:
|
||||
return EquivalentExchange3.proxy.getCustomRarityType(CustomItemRarity.NORMAL);
|
||||
case 1:
|
||||
return EquivalentExchange3.proxy.getCustomRarityType(CustomItemRarity.NORMAL);
|
||||
case 2:
|
||||
return EquivalentExchange3.proxy.getCustomRarityType(CustomItemRarity.UNCOMMON);
|
||||
case 3:
|
||||
return EquivalentExchange3.proxy.getCustomRarityType(CustomItemRarity.MAGICAL);
|
||||
case 4:
|
||||
return EquivalentExchange3.proxy.getCustomRarityType(CustomItemRarity.EPIC);
|
||||
case 5:
|
||||
return EquivalentExchange3.proxy.getCustomRarityType(CustomItemRarity.LEGENDARY);
|
||||
default:
|
||||
return EnumRarity.common;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(int id, CreativeTabs creativeTab, List list)
|
||||
{
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(int id, CreativeTabs creativeTab, List list) {
|
||||
|
||||
for (int meta = 0; meta < 6; ++meta) {
|
||||
list.add(new ItemStack(id, 1, meta));
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.src.Item;
|
|||
public class ItemEE extends Item {
|
||||
|
||||
public ItemEE(int id) {
|
||||
|
||||
super(id - Reference.SHIFTED_ID_RANGE_CORRECTION);
|
||||
maxStackSize = 1;
|
||||
setTextureFile(Sprites.SPRITE_SHEET_LOCATION + Sprites.ITEM_SPRITE_SHEET);
|
||||
|
|
|
@ -14,11 +14,12 @@ import ee3.common.lib.Strings;
|
|||
*/
|
||||
public class ItemInertStone extends ItemEE {
|
||||
|
||||
public ItemInertStone(int id) {
|
||||
super(id);
|
||||
this.setIconCoord(1, 0);
|
||||
this.setItemName(Strings.INERT_STONE_NAME);
|
||||
this.setCreativeTab(EquivalentExchange3.tabsEE3);
|
||||
}
|
||||
public ItemInertStone(int id) {
|
||||
|
||||
super(id);
|
||||
this.setIconCoord(1, 0);
|
||||
this.setItemName(Strings.INERT_STONE_NAME);
|
||||
this.setCreativeTab(EquivalentExchange3.tabsEE3);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -28,8 +28,8 @@ import ee3.common.network.PacketTypeHandler;
|
|||
* @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html)
|
||||
*
|
||||
*/
|
||||
public class ItemMiniumStone extends ItemEE implements ITransmutationStone,
|
||||
IKeyBound {
|
||||
public class ItemMiniumStone extends ItemEE
|
||||
implements ITransmutationStone, IKeyBound {
|
||||
|
||||
public ItemMiniumStone(int id) {
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@ import net.minecraft.src.World;
|
|||
* @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html)
|
||||
*
|
||||
*/
|
||||
public class ItemPhilosopherStone extends ItemEE implements
|
||||
ITransmutationStone, IChargeable, IKeyBound {
|
||||
public class ItemPhilosopherStone extends ItemEE
|
||||
implements ITransmutationStone, IChargeable, IKeyBound {
|
||||
|
||||
private int maxChargeLevel;
|
||||
|
||||
|
@ -124,7 +124,7 @@ public class ItemPhilosopherStone extends ItemEE implements
|
|||
thePlayer.worldObj.playSoundAtEntity(thePlayer, Sounds.CHARGE_DOWN, 0.5F, 1.0F - (0.5F - (0.5F * (getCharge(itemStack) * 1.0F / maxChargeLevel))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue