Finalized more for the digging upgrade.
This commit is contained in:
parent
cbc2dfbc6d
commit
80a9380e71
|
@ -21,6 +21,7 @@ public class ItemLivingArmour extends ItemArmor
|
|||
{
|
||||
public static String[] names = { "helmet", "chest", "legs", "boots" };
|
||||
|
||||
//TODO: Save/delete cache periodically.
|
||||
public static Map<ItemStack, LivingArmour> armourMap = new HashMap<ItemStack, LivingArmour>();
|
||||
|
||||
public ItemLivingArmour(int armorType)
|
||||
|
|
|
@ -14,6 +14,12 @@ public class LivingArmourUpgradeDigging extends LivingArmourUpgrade
|
|||
{
|
||||
public static HashMap<LivingArmour, Boolean> changeMap = new HashMap<LivingArmour, Boolean>();
|
||||
|
||||
public static final int[] costs = new int[] { 5, 10, 18, 35, 65, 100, 160 };
|
||||
public static final int[] digHasteTime = new int[] { 20, 40, 60, 100, 100, 100 };
|
||||
public static final int[] digHasteLevel = new int[] { 0, 0, 1, 1, 2, 2, 2 };
|
||||
public static final int[] digSpeedTime = new int[] { 0, 60, 60, 100, 100, 100, 100 };
|
||||
public static final int[] digSpeedLevel = new int[] { 0, 0, 0, 1, 1, 1, 1 };
|
||||
|
||||
public static void hasDug(LivingArmour armour)
|
||||
{
|
||||
changeMap.put(armour, true);
|
||||
|
@ -31,7 +37,11 @@ public class LivingArmourUpgradeDigging extends LivingArmourUpgrade
|
|||
{
|
||||
changeMap.put(livingArmour, false);
|
||||
|
||||
player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 100, 0, false, false));
|
||||
player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, digHasteTime[this.level], digHasteLevel[this.level], false, false));
|
||||
if (digSpeedTime[this.level] > 0)
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, digSpeedTime[this.level], digSpeedLevel[this.level], false, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,13 +54,13 @@ public class LivingArmourUpgradeDigging extends LivingArmourUpgrade
|
|||
@Override
|
||||
public int getMaxTier()
|
||||
{
|
||||
return 1;
|
||||
return 5; // Set to here until I can add more upgrades to it.
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCostOfUpgrade()
|
||||
{
|
||||
return 0;
|
||||
return costs[this.level];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -58,7 +58,6 @@ public class StatTrackerDigging extends StatTracker
|
|||
|
||||
changeMap.put(livingArmour, 0);
|
||||
|
||||
System.out.println("Blocks dug: " + totalBlocksDug);
|
||||
this.markDirty();
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue