A whole lot of formatting cleanup
Also changes NBTHolder to a standard Constants class with subclasses for each category
This commit is contained in:
parent
f9802900db
commit
34dee6447b
74 changed files with 861 additions and 662 deletions
|
@ -1,8 +1,9 @@
|
|||
package WayofTime.bloodmagic.item.gear;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.NBTHolder;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.altar.IAltarManipulator;
|
||||
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
||||
import WayofTime.bloodmagic.tile.TileAltar;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
@ -23,7 +24,7 @@ public class ItemPackSacrifice extends ItemArmor implements IAltarManipulator {
|
|||
public ItemPackSacrifice() {
|
||||
super(ArmorMaterial.CHAIN, 0, 1);
|
||||
|
||||
setUnlocalizedName(BloodMagic.MODID + ".pack.sacrifice");
|
||||
setUnlocalizedName(Constants.Mod.MODID + ".pack.sacrifice");
|
||||
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||
}
|
||||
|
||||
|
@ -45,10 +46,10 @@ public class ItemPackSacrifice extends ItemArmor implements IAltarManipulator {
|
|||
|
||||
TileAltar altar = (TileAltar) tile;
|
||||
|
||||
if(!altar.isActive()) {
|
||||
if (!altar.isActive()) {
|
||||
int amount = this.getStoredLP(stack);
|
||||
|
||||
if(amount > 0) {
|
||||
if (amount > 0) {
|
||||
int filledAmount = altar.fillMainTank(amount);
|
||||
amount -= filledAmount;
|
||||
setStoredLP(stack, amount);
|
||||
|
@ -63,19 +64,19 @@ public class ItemPackSacrifice extends ItemArmor implements IAltarManipulator {
|
|||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return BloodMagic.DOMAIN + "models/armor/bloodPack_layer_1.png";
|
||||
return Constants.Mod.DOMAIN + "models/armor/bloodPack_layer_1.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean advanced) {
|
||||
stack = NBTHolder.checkNBT(stack);
|
||||
stack = NBTHelper.checkNBT(stack);
|
||||
list.add(TextHelper.localize("tooltip.BloodMagic.pack.sacrifice.desc"));
|
||||
list.add(TextHelper.localize("tooltip.BloodMagic.pack.stored", getStoredLP(stack)));
|
||||
}
|
||||
|
||||
public void addLP(ItemStack stack, int toAdd) {
|
||||
stack = NBTHolder.checkNBT(stack);
|
||||
stack = NBTHelper.checkNBT(stack);
|
||||
|
||||
if (toAdd < 0)
|
||||
toAdd = 0;
|
||||
|
@ -87,12 +88,12 @@ public class ItemPackSacrifice extends ItemArmor implements IAltarManipulator {
|
|||
}
|
||||
|
||||
public void setStoredLP(ItemStack stack, int lp) {
|
||||
stack = NBTHolder.checkNBT(stack);
|
||||
stack.getTagCompound().setInteger(NBTHolder.NBT_STORED_LP, lp);
|
||||
stack = NBTHelper.checkNBT(stack);
|
||||
stack.getTagCompound().setInteger(Constants.NBT.STORED_LP, lp);
|
||||
}
|
||||
|
||||
public int getStoredLP(ItemStack stack) {
|
||||
stack = NBTHolder.checkNBT(stack);
|
||||
return stack.getTagCompound().getInteger(NBTHolder.NBT_STORED_LP);
|
||||
stack = NBTHelper.checkNBT(stack);
|
||||
return stack.getTagCompound().getInteger(Constants.NBT.STORED_LP);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue