Added removeAllArtifactAbilityPoints() to API.
This commit is contained in:
parent
4f857919b7
commit
684ca61442
Binary file not shown.
@ -285,6 +285,7 @@ public enum ArtifactAbility {
|
||||
if (containsEnchantment(ability,item)) {
|
||||
for (int i=0;i<lore.size();i++) {
|
||||
if (lore.get(i).contains(ability.GetName())) {
|
||||
TwosideKeeper.log("Removed "+ability.GetName(), 2);
|
||||
//This is the line! Remove it.
|
||||
lore.remove(i);
|
||||
i--;
|
||||
@ -296,6 +297,16 @@ public enum ArtifactAbility {
|
||||
return item;
|
||||
}
|
||||
|
||||
public static ItemStack removeAllEnchantments(ItemStack item) {
|
||||
HashMap<ArtifactAbility,Integer> enchants = getEnchantments(item);
|
||||
for (ArtifactAbility ab : enchants.keySet()) {
|
||||
TwosideKeeper.log("Checking for enchantment "+ab.GetName(), 2);
|
||||
item = removeEnchantment(ab,item);
|
||||
}
|
||||
item = AwakenedArtifact.addAP(item, 0);
|
||||
return item;
|
||||
}
|
||||
|
||||
static boolean hasCurse(ItemStack item) {
|
||||
HashMap<ArtifactAbility,Integer> map = getEnchantments(item);
|
||||
if (map.containsKey(REDUCEDMG) ||
|
||||
|
@ -1171,10 +1171,12 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
//aPlugin.API.sendActionBarMessage(p, "Testing/nMultiple Lines.\nLolz");
|
||||
//TwosideKeeperAPI.setItemSet(p.getEquipment().getItemInMainHand(), ItemSet.PANROS);
|
||||
//p.getWorld().dropItemNaturally(p.getLocation(), TwosideKeeperAPI.generateMegaPiece(Material.LEATHER_CHESTPLATE, true, true, 5));
|
||||
p.getWorld().dropItemNaturally(p.getLocation(), UPGRADE_SHARD.getItemStack());
|
||||
/*p.getWorld().dropItemNaturally(p.getLocation(), UPGRADE_SHARD.getItemStack());
|
||||
ItemStack upgrade = UPGRADE_SHARD.getItemStack();
|
||||
GenericFunctions.setUpgradeShardTier(upgrade,3);
|
||||
p.getWorld().dropItemNaturally(p.getLocation(), upgrade);
|
||||
p.getWorld().dropItemNaturally(p.getLocation(), upgrade);*/
|
||||
log("In here",2);
|
||||
ArtifactAbility.removeAllEnchantments(p.getEquipment().getItemInMainHand());
|
||||
//p.sendMessage("This is tier "+GenericFunctions.getUpgradeShardTier(p.getEquipment().getItemInMainHand()));
|
||||
//ItemSet.SetTier(p.getEquipment().getItemInMainHand(), 7);
|
||||
//p.getWorld().dropItemNaturally(p.getLocation(), STRENGTHENING_VIAL.getItemStack(50));
|
||||
|
@ -92,6 +92,9 @@ public final class TwosideKeeperAPI {
|
||||
public static double getArtifactAbilityValue(ArtifactAbility ability, ItemStack item) {
|
||||
return GenericFunctions.getAbilityValue(ability, item);
|
||||
}
|
||||
public static ItemStack removeAllArtifactAbilityPoints(ItemStack item) {
|
||||
return ArtifactAbility.removeAllEnchantments(item);
|
||||
}
|
||||
|
||||
//Time Commands.
|
||||
public static long getServerTickTime() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user