Compare commits

..

No commits in common. 'master' and 'master_event' have entirely different histories.

  1. 1
      BankEconomyMod/bin/.gitignore
  2. 2
      BankEconomyMod/bin/me/kaZep/Base/.gitignore
  3. BIN
      BankEconomyMod/bin/me/kaZep/Base/ArrowShooter.class
  4. BIN
      BankEconomyMod/bin/me/kaZep/Base/EnchantLevelDatabase.class
  5. BIN
      BankEconomyMod/bin/me/kaZep/Base/Main$1.class
  6. BIN
      BankEconomyMod/bin/me/kaZep/Base/Main$2.class
  7. BIN
      BankEconomyMod/bin/me/kaZep/Base/Main$3.class
  8. BIN
      BankEconomyMod/bin/me/kaZep/Base/Main$4.class
  9. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerBuffData.class
  10. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerData.class
  11. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$1.class
  12. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$10.class
  13. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$11.class
  14. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$12.class
  15. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$13.class
  16. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$14.class
  17. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$15.class
  18. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$16.class
  19. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$17.class
  20. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$2.class
  21. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$3.class
  22. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$4.class
  23. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$5.class
  24. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$6.class
  25. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$7.class
  26. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$8.class
  27. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$9.class
  28. BIN
      BankEconomyMod/bin/me/kaZep/Commands/JobsDataInfo.class
  29. BIN
      BankEconomyMod/bin/me/kaZep/Commands/commandBankEconomy$1.class
  30. BIN
      BankEconomyMod/bin/me/kaZep/Commands/commandBankEconomy$2.class
  31. BIN
      BankEconomyMod/bin/me/kaZep/Commands/commandBankEconomy$3.class
  32. BIN
      BankEconomyMod/bin/me/kaZep/Commands/commandBankEconomy$4.class
  33. BIN
      BankEconomyMod/bin/me/kaZep/Commands/commandBankEconomy$5.class
  34. BIN
      BankEconomyMod/bin/me/kaZep/Commands/commandBankEconomy$6.class
  35. BIN
      BankEconomyMod/bin/me/kaZep/Commands/commandBankEconomy.class
  36. 4
      BankEconomyMod/bin/sig/ItemSets/.gitignore
  37. 6
      BankEconomyMod/plugin.yml
  38. 13
      BankEconomyMod/src/me/kaZep/Base/ArrowShooter.java
  39. 1134
      BankEconomyMod/src/me/kaZep/Base/EnchantLevelDatabase.java
  40. 2635
      BankEconomyMod/src/me/kaZep/Base/Main.java
  41. 987
      BankEconomyMod/src/me/kaZep/Base/MobHead.java
  42. 61
      BankEconomyMod/src/me/kaZep/Base/MobManager.java
  43. 80
      BankEconomyMod/src/me/kaZep/Base/PlayerBuffData.java
  44. 27
      BankEconomyMod/src/me/kaZep/Base/PlayerData.java
  45. 21971
      BankEconomyMod/src/me/kaZep/Base/PlayerListener.java
  46. 12
      BankEconomyMod/src/me/kaZep/Base/PoweredMob.java
  47. 4
      BankEconomyMod/src/me/kaZep/Base/RecyclingCenterNode.java
  48. 12
      BankEconomyMod/src/me/kaZep/Base/TempBlock.java
  49. 149
      BankEconomyMod/src/me/kaZep/Base/TerrainManager.java
  50. 38
      BankEconomyMod/src/me/kaZep/Commands/JobsDataInfo.java
  51. 928
      BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java

@ -1,2 +0,0 @@
/._PlayerListener.java1265619304918501342.tmp
/._PlayerListener.java3998199996590245987.tmp

@ -0,0 +1,4 @@
/ColorSet.class
/ItemSet.class
/ItemSetList$Armor.class
/ItemSetList.class

@ -25,9 +25,3 @@ commands:
description: Toggles or untoggles events.
ticktime:
description: Displays the server tick time.
rename:
description: Renames a name tag item.
line:
description: Gives the player a line builder tool.
rectangle:
description: Gives the player a rectangle builder tool.

@ -7,21 +7,14 @@ import org.bukkit.util.Vector;
public class ArrowShooter {
public int timer=0;
public int frequency=0;
public Vector dir;
public Vector spd;
public Location loc;
public LivingEntity shooter;
public float spd = 0.6f;
public float spread = 12f;
public ArrowShooter(Vector dir, Location loc, int duration, int frequency, LivingEntity shooter) {
this(dir, loc, duration, frequency, shooter, 0.6f, 12f);
}
public ArrowShooter(Vector dir, Location loc, int duration, int frequency, LivingEntity shooter, float spd, float spread) {
this.dir=dir;
public ArrowShooter(Vector spd, Location loc, int duration, int frequency, LivingEntity shooter) {
this.spd=spd;
this.loc=loc;
this.frequency=frequency;
this.timer=duration;
this.shooter=shooter;
this.spd=spd;
this.spread=spread;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,987 +0,0 @@
package me.kaZep.Base;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.SkullType;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta;
/**
* Represents a mob head
*/
public class MobHead {
public enum MobHeadType {
SKELETON, WITHER_SKELETON, ZOMBIE, CREEPER,
SPIDER, ENDERMAN, CAVE_SPIDER, BLAZE, GHAST,
ZOMBIE_PIGMAN, MAGMA_CUBE
}
public enum MobHeadRareType {
RARE_TYPE_A, RARE_TYPE_B
}
MobHeadType head_type = null;
MobHeadRareType rare_head_type =null;
boolean rare_head=false;
boolean is_powered=false;
/**
* Compares if two MobHeads are equal to each other
* @param m The MobHead to compare to this MobHead.
* @return true if the two mob heads are the same,
* false otherwise.
*/
public boolean equals(MobHead m) {
if (head_type.equals(m.head_type) &&
rare_head_type.equals(m.rare_head_type) &&
is_powered==m.is_powered && rare_head==m.rare_head) {
return true;
}
return false;
}
/**
* Returns the ItemStack version of this defined Mob Head.
* This is useful for creating new heads that have specific
* attributes.
* @return
*/
public ItemStack getItemStack() {
ItemStack finalhead = new ItemStack(Material.AIR);
if (!rare_head) {
switch (head_type) {
case SKELETON:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
ItemMeta meta = newhead.getItemMeta();
String key = "mob.skeleton";
meta.setDisplayName(ChatColor.WHITE+"Skeleton Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
List<String> newlore = new ArrayList<String>();
newlore.add(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"Ranged Damage");
meta.setLore(newlore);
newhead.setItemMeta(meta);
finalhead = newhead;
}break;
case WITHER_SKELETON:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
newhead.setDurability((short)1);
ItemMeta meta = newhead.getItemMeta();
String key = "mob.witherskeleton";
meta.setDisplayName(ChatColor.WHITE+"Wither Skeleton Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
List<String> newlore = new ArrayList<String>();
newlore.add(ChatColor.LIGHT_PURPLE+"+5 "+ChatColor.GOLD+"second "+ChatColor.GRAY+"Wither I"+ChatColor.GOLD+" duration");
newlore.add(ChatColor.GOLD+" on hit.");
meta.setLore(newlore);
newhead.setItemMeta(meta);
finalhead = newhead;
}break;
case ZOMBIE:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
newhead.setDurability((short)2);
ItemMeta meta = newhead.getItemMeta();
String key = "mob.zombie";
meta.setDisplayName(ChatColor.WHITE+"Zombie Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
List<String> newlore = new ArrayList<String>();
newlore.add(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"Lifesteal");
meta.setLore(newlore);
newhead.setItemMeta(meta);
finalhead = newhead;
}break;
case CREEPER:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
newhead.setDurability((short)4);
ItemMeta meta = newhead.getItemMeta();
String key = "mob.creeper";
meta.setDisplayName(ChatColor.WHITE+"Creeper Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
List<String> newlore = new ArrayList<String>();
newlore.add(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"AoE Damage");
meta.setLore(newlore);
newhead.setItemMeta(meta);
finalhead = newhead;
}break;
case SPIDER:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
newhead.setDurability((short)SkullType.PLAYER.ordinal());
SkullMeta skullMeta = (SkullMeta) newhead.getItemMeta();
String key = "mob.spider";
skullMeta.setDisplayName(ChatColor.WHITE+"Spider Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
skullMeta.setOwner("MHF_Spider");
newhead.setItemMeta(skullMeta);
ItemMeta meta = newhead.getItemMeta();
List<String> newlore = new ArrayList<String>();
newlore.add(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"Slow on hit");
meta.setLore(newlore);
newhead.setItemMeta(meta);
finalhead = newhead;
}break;
case ENDERMAN:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
newhead.setDurability((short)SkullType.PLAYER.ordinal());
SkullMeta skullMeta = (SkullMeta) newhead.getItemMeta();
String key = "mob.enderman";
skullMeta.setDisplayName(ChatColor.WHITE+"Enderman Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
skullMeta.setOwner("MHF_Enderman");
List<String> newlore = new ArrayList<String>();
newlore.add(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"Critical Chance");
skullMeta.setLore(newlore);
newhead.setItemMeta(skullMeta);
finalhead = newhead;
}break;
case CAVE_SPIDER:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
newhead.setDurability((short)SkullType.PLAYER.ordinal());
SkullMeta skullMeta = (SkullMeta) newhead.getItemMeta();
String key = "mob.cavespider";
skullMeta.setDisplayName(ChatColor.WHITE+"Cave Spider Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
skullMeta.setOwner("MHF_CaveSpider");
List<String> newlore = new ArrayList<String>();
newlore.add(ChatColor.LIGHT_PURPLE+"+1 "+ChatColor.GOLD+"second Poison duration");
newlore.add(ChatColor.GOLD+" on hit.");
skullMeta.setLore(newlore);
newhead.setItemMeta(skullMeta);
finalhead = newhead;
}break;
case BLAZE:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
newhead.setDurability((short)SkullType.PLAYER.ordinal());
SkullMeta skullMeta = (SkullMeta) newhead.getItemMeta();
String key = "mob.blaze";
skullMeta.setDisplayName(ChatColor.WHITE+"Blaze Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
skullMeta.setOwner("MHF_Blaze");
List<String> newlore = new ArrayList<String>();
newlore.add(ChatColor.LIGHT_PURPLE+"+1 "+ChatColor.GOLD+"second ignite duration");
newlore.add(ChatColor.GOLD+" on hit.");
skullMeta.setLore(newlore);
newhead.setItemMeta(skullMeta);
finalhead = newhead;
}break;
case GHAST:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
newhead.setDurability((short)SkullType.PLAYER.ordinal());
SkullMeta skullMeta = (SkullMeta) newhead.getItemMeta();
String key = "mob.ghast";
skullMeta.setDisplayName(ChatColor.WHITE+"Ghast Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
skullMeta.setOwner("MHF_Ghast");
List<String> newlore = new ArrayList<String>();
newlore.add(ChatColor.LIGHT_PURPLE+"-1% "+ChatColor.GOLD+"damage taken on hit");
skullMeta.setLore(newlore);
newhead.setItemMeta(skullMeta);
finalhead = newhead;
}break;
case ZOMBIE_PIGMAN:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
newhead.setDurability((short)SkullType.PLAYER.ordinal());
SkullMeta skullMeta = (SkullMeta) newhead.getItemMeta();
String key = "mob.zombiepigman";
skullMeta.setDisplayName(ChatColor.WHITE+"Zombie Pigman Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
skullMeta.setOwner("MHF_PigZombie");
List<String> newlore = new ArrayList<String>();
newlore.add(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"chance of being fully");
newlore.add(ChatColor.GOLD+" healed on kill.");
skullMeta.setLore(newlore);
newhead.setItemMeta(skullMeta);
finalhead = newhead;
}break;
case MAGMA_CUBE:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
newhead.setDurability((short)SkullType.PLAYER.ordinal());
SkullMeta skullMeta = (SkullMeta) newhead.getItemMeta();
String key = "mob.magmacube";
skullMeta.setDisplayName(ChatColor.WHITE+"Magma Cube Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
skullMeta.setOwner("MHF_LavaSlime");
List<String> newlore = new ArrayList<String>();
newlore.add(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"chance of setting the");
newlore.add(ChatColor.GOLD+" mob and surrounding mobs on fire");
newlore.add(ChatColor.GOLD+" for 10 seconds.");
skullMeta.setLore(newlore);
newhead.setItemMeta(skullMeta);
finalhead = newhead;
}break;
}
} else {
switch (head_type) {
case WITHER_SKELETON:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
newhead.setDurability((short)1);
ItemMeta meta = newhead.getItemMeta();
String key = "mob.rarewitherskeleton";
meta.setDisplayName(ChatColor.BLUE+"Rare Wither Skeleton Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
List<String> newlore = new ArrayList<String>();
newlore.add(ChatColor.LIGHT_PURPLE+"+15 "+ChatColor.GOLD+"second "+ChatColor.GRAY+"Wither III"+ChatColor.GOLD+" duration");
newlore.add(ChatColor.GOLD+" on hit.");
meta.setLore(newlore);
newhead.setItemMeta(meta);
newhead.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, 1);
finalhead = newhead;
}break;
case SKELETON:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
ItemMeta meta = newhead.getItemMeta();
String key = "mob.rareskeleton";
meta.setDisplayName(ChatColor.BLUE+"Rare Skeleton Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
List<String> newlore = new ArrayList<String>();
if (rare_head_type==MobHeadRareType.RARE_TYPE_A) {
newlore.add(ChatColor.LIGHT_PURPLE+"+3% "+ChatColor.GOLD+"Ranged Damage");
} else {
newlore.add(ChatColor.LIGHT_PURPLE+"+1 "+ChatColor.GOLD+"m/s Projectile Speed");
}
meta.setLore(newlore);
newhead.setItemMeta(meta);
newhead.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, 1);
finalhead = newhead;
}break;
case ZOMBIE:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
newhead.setDurability((short)2);
ItemMeta meta = newhead.getItemMeta();
String key = "mob.rarezombie";
meta.setDisplayName(ChatColor.BLUE+"Rare Zombie Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
List<String> newlore = new ArrayList<String>();
if (rare_head_type==MobHeadRareType.RARE_TYPE_A) {
newlore.add(ChatColor.LIGHT_PURPLE+"+3% "+ChatColor.GOLD+"Lifesteal");
} else {
newlore.add(ChatColor.LIGHT_PURPLE+"+1 "+ChatColor.GOLD+"Max Health");
}
meta.setLore(newlore);
newhead.setItemMeta(meta);
newhead.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, 1);
finalhead = newhead;
}break;
case CREEPER:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
newhead.setDurability((short)4);
ItemMeta meta = newhead.getItemMeta();
String key = "mob.rarecreeper";
meta.setDisplayName(ChatColor.BLUE+"Rare Creeper Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
List<String> newlore = new ArrayList<String>();
if (rare_head_type==MobHeadRareType.RARE_TYPE_A) {
newlore.add(ChatColor.LIGHT_PURPLE+"+1 "+ChatColor.GOLD+"Damage to all nearby enemies.");
} else {
newlore.add(ChatColor.LIGHT_PURPLE+"+20% "+ChatColor.GOLD+"AoE Damage");
}
meta.setLore(newlore);
newhead.setItemMeta(meta);
newhead.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, 1);
finalhead = newhead;
}break;
case SPIDER:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
newhead.setDurability((short)SkullType.PLAYER.ordinal());
SkullMeta skullMeta = (SkullMeta) newhead.getItemMeta();
skullMeta.setOwner("MHF_Spider");
String key = "mob.rarespider";
skullMeta.setDisplayName(ChatColor.BLUE+"Rare Spider Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
newhead.setItemMeta(skullMeta);
ItemMeta meta = newhead.getItemMeta();
//meta.setDisplayName(ChatColor.BLUE+"Rare Spider Head");
List<String> newlore = new ArrayList<String>();
if (rare_head_type==MobHeadRareType.RARE_TYPE_A) {
newlore.add(ChatColor.LIGHT_PURPLE+"+2 "+ChatColor.GOLD+"second Poison duration");
newlore.add(ChatColor.GOLD+" on hit.");
} else {
newlore.add(ChatColor.LIGHT_PURPLE+"+15% "+ChatColor.GOLD+"Slow on hit");
}
meta.setLore(newlore);
newhead.setItemMeta(meta);
newhead.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, 1);
finalhead = newhead;
}break;
case ENDERMAN:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
newhead.setDurability((short)SkullType.PLAYER.ordinal());
SkullMeta skullMeta = (SkullMeta) newhead.getItemMeta();
skullMeta.setOwner("MHF_Enderman");
String key = "mob.rareenderman";
skullMeta.setDisplayName(ChatColor.BLUE+"Rare Enderman Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
List<String> newlore = new ArrayList<String>();
if (rare_head_type==MobHeadRareType.RARE_TYPE_A) {
newlore.add(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"Item Drop Amount Increase");
} else {
newlore.add(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"Critical Chance");
}
skullMeta.setLore(newlore);
newhead.setItemMeta(skullMeta);
newhead.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, 1);
finalhead = newhead;
}break;
case CAVE_SPIDER:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
newhead.setDurability((short)SkullType.PLAYER.ordinal());
SkullMeta skullMeta = (SkullMeta) newhead.getItemMeta();
String key = "mob.rarecavespider";
skullMeta.setDisplayName(ChatColor.BLUE+"Rare Cave Spider Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
skullMeta.setOwner("MHF_CaveSpider");
List<String> newlore = new ArrayList<String>();
if (rare_head_type==MobHeadRareType.RARE_TYPE_A) {
newlore.add(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"of snaring a target");
newlore.add(ChatColor.GOLD+" for 5 seconds.");
} else {
newlore.add(ChatColor.LIGHT_PURPLE+"+3 "+ChatColor.GOLD+"second Poison duration");
newlore.add(ChatColor.GOLD+" on hit.");
}
skullMeta.setLore(newlore);
newhead.setItemMeta(skullMeta);
newhead.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, 1);
finalhead = newhead;
}break;
case BLAZE:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
newhead.setDurability((short)SkullType.PLAYER.ordinal());
SkullMeta skullMeta = (SkullMeta) newhead.getItemMeta();
String key = "mob.rareblaze";
skullMeta.setDisplayName(ChatColor.BLUE+"Rare Blaze Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
skullMeta.setOwner("MHF_Blaze");
List<String> newlore = new ArrayList<String>();
if (rare_head_type==MobHeadRareType.RARE_TYPE_A) {
newlore.add(ChatColor.LIGHT_PURPLE+"+3 "+ChatColor.GOLD+"second ignite duration");
newlore.add(ChatColor.GOLD+" on hit.");
} else {
newlore.add(ChatColor.LIGHT_PURPLE+"+3% "+ChatColor.GOLD+"chance to send enemy");
newlore.add(ChatColor.GOLD+" airborne.");
}
skullMeta.setLore(newlore);
newhead.setItemMeta(skullMeta);
newhead.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, 1);
finalhead = newhead;
}break;
case GHAST:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
newhead.setDurability((short)SkullType.PLAYER.ordinal());
SkullMeta skullMeta = (SkullMeta) newhead.getItemMeta();
String key = "mob.rareghast";
skullMeta.setDisplayName(ChatColor.BLUE+"Rare Ghast Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
skullMeta.setOwner("MHF_Ghast");
List<String> newlore = new ArrayList<String>();
if (rare_head_type==MobHeadRareType.RARE_TYPE_A) {
newlore.add(ChatColor.LIGHT_PURPLE+"+3% "+ChatColor.GOLD+"chance to send down");
newlore.add(ChatColor.GOLD+" lightning on a target.");
} else {
newlore.add(ChatColor.LIGHT_PURPLE+"-5% "+ChatColor.GOLD+"damage taken on hit");
}
skullMeta.setLore(newlore);
newhead.setItemMeta(skullMeta);
newhead.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, 1);
finalhead = newhead;
}break;
case ZOMBIE_PIGMAN:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
newhead.setDurability((short)SkullType.PLAYER.ordinal());
SkullMeta skullMeta = (SkullMeta) newhead.getItemMeta();
String key = "mob.rarezombiepigman";
skullMeta.setDisplayName(ChatColor.BLUE+"Rare Pig Zombie Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
skullMeta.setOwner("MHF_PigZombie");
List<String> newlore = new ArrayList<String>();
if (rare_head_type==MobHeadRareType.RARE_TYPE_A) {
newlore.add(ChatColor.LIGHT_PURPLE+"+10% "+ChatColor.GOLD+"chance of dropping a");
newlore.add(ChatColor.GOLD+" Golden Nugget on a kill.");
} else {
newlore.add(ChatColor.LIGHT_PURPLE+"+3% "+ChatColor.GOLD+"chance of being fully");
newlore.add(ChatColor.GOLD+" healed on kill.");
}
skullMeta.setLore(newlore);
newhead.setItemMeta(skullMeta);
newhead.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, 1);
finalhead = newhead;
}break;
case MAGMA_CUBE:{
ItemStack newhead = new ItemStack(Material.SKULL_ITEM);
newhead.setDurability((short)SkullType.PLAYER.ordinal());
SkullMeta skullMeta = (SkullMeta) newhead.getItemMeta();
String key = "mob.raremagmacube";
skullMeta.setDisplayName(ChatColor.BLUE+"Rare Magma Cube Head "+ChatColor.ITALIC+"#"+Main.plugin.getConfig().getInt(key));
Main.plugin.getConfig().set(key, Main.plugin.getConfig().getInt(key)+1);
skullMeta.setOwner("MHF_LavaSlime");
List<String> newlore = new ArrayList<String>();
if (rare_head_type==MobHeadRareType.RARE_TYPE_A) {
newlore.add(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"chance of burning an");
newlore.add(ChatColor.GOLD+" enemy to a crisp.");
} else {
newlore.add(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"chance of setting the");
newlore.add(ChatColor.GOLD+" mob and surrounding mobs on fire");
newlore.add(ChatColor.GOLD+" for 10 seconds.");
}
skullMeta.setLore(newlore);
newhead.setItemMeta(skullMeta);
newhead.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, 1);
finalhead = newhead;
}break;
}
}
//Bukkit.getLogger().info("Mobhead is "+toString()+" currently.");
if (is_powered) {
short numb = finalhead.clone().getDurability();
ItemStack poweredhead = convertToPoweredHead(finalhead.clone());
//Bukkit.getLogger().info("Converted head item is "+this.plugin.convertToPoweredHead(result.getMatrix()[i]).toString());
poweredhead.setDurability(numb);
finalhead = poweredhead;
}
return finalhead;
}
/**
* Attempts to get the mob head object that
* corresponds to this item, by checking its lore.
* @param item The item to check for.
* @return Returns null if this item is not a
* valid mob head. Returns the MobHead object
* otherwise.
*/
static public MobHead getMobHead(ItemStack item) {
if (item!=null && item.getType()==Material.SKULL_ITEM && item.hasItemMeta() && item.getItemMeta().hasLore()) {
List<String> getLore = item.getItemMeta().getLore();
MobHeadType headtype = null;
MobHeadRareType raretype = null;
boolean powered = false;
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+5 "+ChatColor.GOLD+"second "+ChatColor.GRAY+"Wither I"+ChatColor.GOLD+" duration")) {
//return new MobHead(MobHeadType.WITHER_SKELETON);
headtype=MobHeadType.WITHER_SKELETON;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"Ranged Damage")) {
//return new MobHead(MobHeadType.SKELETON);
headtype=MobHeadType.SKELETON;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"Lifesteal")) {
//return new MobHead(MobHeadType.ZOMBIE);
headtype=MobHeadType.ZOMBIE;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"AoE Damage") ||
getLore.contains(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"AoE Damage"+ChatColor.BLUE+" &")) {
//return new MobHead(MobHeadType.CREEPER);
headtype=MobHeadType.CREEPER;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"Slow on hit") ||
getLore.contains(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"Slow on hit"+ChatColor.BLUE+" &")) {
//return new MobHead(MobHeadType.SPIDER);
headtype=MobHeadType.SPIDER;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"Critical Chance") ||
getLore.contains(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"Critical Chance"+ChatColor.BLUE+" &")) {
//return new MobHead(MobHeadType.ENDERMAN);
headtype=MobHeadType.ENDERMAN;
}
if ((getLore.contains(ChatColor.LIGHT_PURPLE+"+1 "+ChatColor.GOLD+"second Poison duration") ||
getLore.contains(ChatColor.LIGHT_PURPLE+"+2 "+ChatColor.GOLD+"second Poison duration")) &&
!getLore.contains(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"Slow on hit"+ChatColor.BLUE+" &")) {
//return new MobHead(MobHeadType.CAVE_SPIDER);
headtype=MobHeadType.CAVE_SPIDER;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+1 "+ChatColor.GOLD+"second ignite duration")) {
//return new MobHead(MobHeadType.BLAZE);
headtype=MobHeadType.BLAZE;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"-1% "+ChatColor.GOLD+"damage taken on hit") ||
getLore.contains(ChatColor.LIGHT_PURPLE+"-1% "+ChatColor.GOLD+"damage taken on hit"+ChatColor.BLUE+" &")) {
//return new MobHead(MobHeadType.GHAST);
headtype=MobHeadType.GHAST;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"chance of being fully")) {
//return new MobHead(MobHeadType.ZOMBIE_PIGMAN);
headtype=MobHeadType.ZOMBIE_PIGMAN;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"chance of setting the")) {
//return new MobHead(MobHeadType.MAGMA_CUBE);
headtype=MobHeadType.MAGMA_CUBE;
}
boolean ampersand=false;
for (int i=0;i<getLore.size();i++) {
if (getLore.get(i).contains(ChatColor.BLUE+" &")) {
powered=true;
ampersand=true;
}
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+15 "+ChatColor.GOLD+"second "+ChatColor.GRAY+"Wither III"+ChatColor.GOLD+" duration")) {
//return new MobHead(MobHeadType.WITHER_SKELETON, true, MobHeadRareType.RARE_TYPE_A);
headtype=MobHeadType.WITHER_SKELETON;
raretype=MobHeadRareType.RARE_TYPE_A;
}
if (getLore.contains(ChatColor.GOLD+"Stacks Wither effect by 1")) {
headtype=MobHeadType.WITHER_SKELETON;
powered=true;
}
if (getLore.contains(ChatColor.GOLD+"Stacks Wither effect by 2")) {
headtype=MobHeadType.WITHER_SKELETON;
raretype=MobHeadRareType.RARE_TYPE_A;
powered=true;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+3% "+ChatColor.GOLD+"Ranged Damage")) {
//return new MobHead(MobHeadType.SKELETON, true, MobHeadRareType.RARE_TYPE_A);
headtype=MobHeadType.SKELETON;
if (!ampersand) {raretype=MobHeadRareType.RARE_TYPE_A;}
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+1 "+ChatColor.GOLD+"m/s Projectile Speed")) {
//return new MobHead(MobHeadType.SKELETON, true, MobHeadRareType.RARE_TYPE_B);
headtype=MobHeadType.SKELETON;
if (!ampersand) {raretype=MobHeadRareType.RARE_TYPE_B;}
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+3% "+ChatColor.GOLD+"Lifesteal")) {
//return new MobHead(MobHeadType.ZOMBIE, true, MobHeadRareType.RARE_TYPE_A);
headtype=MobHeadType.ZOMBIE;
if (!ampersand) {raretype=MobHeadRareType.RARE_TYPE_A;}
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+1 "+ChatColor.GOLD+"Max Health")) {
//return new MobHead(MobHeadType.ZOMBIE, true, MobHeadRareType.RARE_TYPE_B);
headtype=MobHeadType.ZOMBIE;
if (!ampersand) {raretype=MobHeadRareType.RARE_TYPE_B;}
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+1 "+ChatColor.GOLD+"Damage to all nearby enemies.")) {
//return new MobHead(MobHeadType.CREEPER, true, MobHeadRareType.RARE_TYPE_A);
headtype=MobHeadType.ZOMBIE;
if (!ampersand) {raretype=MobHeadRareType.RARE_TYPE_A;}
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+20% "+ChatColor.GOLD+"AoE Damage")) {
//return new MobHead(MobHeadType.CREEPER, true, MobHeadRareType.RARE_TYPE_B);
headtype=MobHeadType.CREEPER;
if (!ampersand) {raretype=MobHeadRareType.RARE_TYPE_B;}
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+2 "+ChatColor.GOLD+"second Poison duration") &&
!getLore.contains(ChatColor.GOLD+" on hit."+ChatColor.BLUE+" &")) {
//return new MobHead(MobHeadType.SPIDER, true, MobHeadRareType.RARE_TYPE_A);
headtype=MobHeadType.SPIDER;
if (!ampersand) {raretype=MobHeadRareType.RARE_TYPE_A;}
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+15% "+ChatColor.GOLD+"Slow on hit")) {
//return new MobHead(MobHeadType.SPIDER, true, MobHeadRareType.RARE_TYPE_B);
headtype=MobHeadType.SPIDER;
if (!ampersand) {raretype=MobHeadRareType.RARE_TYPE_B;}
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"Item Drop Amount Increase")) {
//return new MobHead(MobHeadType.ENDERMAN, true, MobHeadRareType.RARE_TYPE_A);
headtype=MobHeadType.ENDERMAN;
if (!ampersand) {raretype=MobHeadRareType.RARE_TYPE_A;}
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"Critical Chance")) {
//return new MobHead(MobHeadType.ENDERMAN, true, MobHeadRareType.RARE_TYPE_B);
headtype=MobHeadType.ENDERMAN;
if (!ampersand) {raretype=MobHeadRareType.RARE_TYPE_B;}
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"of snaring a target")) {
//return new MobHead(MobHeadType.CAVE_SPIDER, true, MobHeadRareType.RARE_TYPE_A);
headtype=MobHeadType.CAVE_SPIDER;
if (!ampersand) {raretype=MobHeadRareType.RARE_TYPE_A;}
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+3 "+ChatColor.GOLD+"second Poison duration")) {
//return new MobHead(MobHeadType.CAVE_SPIDER, true, MobHeadRareType.RARE_TYPE_B);
headtype=MobHeadType.CAVE_SPIDER;
if (!ampersand) {raretype=MobHeadRareType.RARE_TYPE_B;}
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+3% "+ChatColor.GOLD+"chance to send enemy")) {
//return new MobHead(MobHeadType.BLAZE, true, MobHeadRareType.RARE_TYPE_A);
headtype=MobHeadType.BLAZE;
if (!ampersand) {raretype=MobHeadRareType.RARE_TYPE_B;}
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+3 "+ChatColor.GOLD+"second ignite duration")) {
//return new MobHead(MobHeadType.BLAZE, true, MobHeadRareType.RARE_TYPE_B);
headtype=MobHeadType.BLAZE;
if (!ampersand) {raretype=MobHeadRareType.RARE_TYPE_A;}
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+3% "+ChatColor.GOLD+"chance to send down")) {
//return new MobHead(MobHeadType.GHAST, true, MobHeadRareType.RARE_TYPE_A);
headtype=MobHeadType.GHAST;
if (!ampersand) {raretype=MobHeadRareType.RARE_TYPE_A;}
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"-5% "+ChatColor.GOLD+"damage taken on hit")) {
//return new MobHead(MobHeadType.GHAST, true, MobHeadRareType.RARE_TYPE_B);
headtype=MobHeadType.GHAST;
if (!ampersand) {raretype=MobHeadRareType.RARE_TYPE_B;}
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+10% "+ChatColor.GOLD+"chance of dropping a")) {
//return new MobHead(MobHeadType.ZOMBIE_PIGMAN, true, MobHeadRareType.RARE_TYPE_A);
headtype=MobHeadType.ZOMBIE_PIGMAN;
if (!ampersand) {raretype=MobHeadRareType.RARE_TYPE_A;}
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+3% "+ChatColor.GOLD+"chance of being fully")) {
//return new MobHead(MobHeadType.ZOMBIE_PIGMAN, true, MobHeadRareType.RARE_TYPE_B);
headtype=MobHeadType.ZOMBIE_PIGMAN;
if (!ampersand) {raretype=MobHeadRareType.RARE_TYPE_B;}
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"chance of burning an")) {
//return new MobHead(MobHeadType.BLAZE, true, MobHeadRareType.RARE_TYPE_A);
headtype=MobHeadType.BLAZE;
if (!ampersand) {raretype=MobHeadRareType.RARE_TYPE_A;}
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"chance of setting the")) {
//return new MobHead(MobHeadType.BLAZE, true, MobHeadRareType.RARE_TYPE_B);
headtype=MobHeadType.BLAZE;
if (!ampersand) {raretype=MobHeadRareType.RARE_TYPE_B;}
}
////////////////////////////////////////////
if (getLore.contains(ChatColor.LIGHT_PURPLE+"-10% "+ChatColor.GOLD+"damage taken on hit"+ChatColor.BLUE+" &")) {
//return new MobHead(MobHeadType.BLAZE, true, MobHeadRareType.RARE_TYPE_B);
headtype=MobHeadType.GHAST;
raretype=MobHeadRareType.RARE_TYPE_A;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+5 "+ChatColor.GOLD+"second ignite duration")) {
//return new MobHead(MobHeadType.BLAZE, true, MobHeadRareType.RARE_TYPE_B);
headtype=MobHeadType.BLAZE;
raretype=MobHeadRareType.RARE_TYPE_A;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+5 "+ChatColor.GOLD+"second Poison duration")) {
//return new MobHead(MobHeadType.BLAZE, true, MobHeadRareType.RARE_TYPE_B);
headtype=MobHeadType.CAVE_SPIDER;
raretype=MobHeadRareType.RARE_TYPE_A;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+10% "+ChatColor.GOLD+"Critical Chance"+ChatColor.BLUE+" &")) {
//return new MobHead(MobHeadType.BLAZE, true, MobHeadRareType.RARE_TYPE_B);
headtype=MobHeadType.ENDERMAN;
raretype=MobHeadRareType.RARE_TYPE_A;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+30% "+ChatColor.GOLD+"Slow on hit"+ChatColor.BLUE+" &")) {
//return new MobHead(MobHeadType.BLAZE, true, MobHeadRareType.RARE_TYPE_B);
headtype=MobHeadType.SPIDER;
raretype=MobHeadRareType.RARE_TYPE_A;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+30% "+ChatColor.GOLD+"AoE Damage"+ChatColor.BLUE+" &")) {
//return new MobHead(MobHeadType.BLAZE, true, MobHeadRareType.RARE_TYPE_B);
headtype=MobHeadType.CREEPER;
raretype=MobHeadRareType.RARE_TYPE_A;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"Lifesteal"+ChatColor.BLUE+" &")) {
//return new MobHead(MobHeadType.BLAZE, true, MobHeadRareType.RARE_TYPE_B);
headtype=MobHeadType.ZOMBIE;
raretype=MobHeadRareType.RARE_TYPE_A;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"Ranged Damage"+ChatColor.BLUE+" &")) {
//return new MobHead(MobHeadType.BLAZE, true, MobHeadRareType.RARE_TYPE_B);
headtype=MobHeadType.SKELETON;
raretype=MobHeadRareType.RARE_TYPE_A;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+10% "+ChatColor.GOLD+"chance of setting the")) {
//return new MobHead(MobHeadType.BLAZE, true, MobHeadRareType.RARE_TYPE_B);
headtype=MobHeadType.MAGMA_CUBE;
raretype=MobHeadRareType.RARE_TYPE_A;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"chance of being fully")) {
//return new MobHead(MobHeadType.BLAZE, true, MobHeadRareType.RARE_TYPE_B);
headtype=MobHeadType.ZOMBIE_PIGMAN;
raretype=MobHeadRareType.RARE_TYPE_A;
}
if (getLore.contains(ChatColor.GOLD+"Stacks Wither effect by 2") || getLore.contains(ChatColor.GOLD+"Stacks Wither effect by 1")) {
powered=true;
}
if (raretype!=null) {
return new MobHead(headtype,true,raretype,powered);
} else {
return new MobHead(headtype,false,powered);
}
}
return null;
}
/**
* Checks if the given head is powered or
* unpowered.
* @param head The mob head to check for.
* @return Returns true if the head is unpowered
* or false otherwise.
*/
static public boolean isUnpoweredHead(MobHead head) {
return !head.is_powered;
}
/**
* Converts an unpowered mob head to a powered
* version. If this head is not an unpowered version
* or something bad happens along the way, it
* simply returns the same ItemStack that was
* given.
* @param item The head item we are converting.
* @return The converted mob head. (Or the same
* mob head that was given if something bad
* happened.)
*/
static public ItemStack convertToPoweredHead(ItemStack item) {
if (item!=null && item.getType()==Material.SKULL_ITEM && item.hasItemMeta() && item.getItemMeta().hasLore()) {
ItemStack newitem = new ItemStack(Material.SKULL_ITEM);
List<String> getLore = item.getItemMeta().getLore();
ItemMeta newitem_meta = item.getItemMeta();
newitem.setData(item.getData());
if (newitem_meta.getDisplayName().contains("Rare")) {
newitem_meta.setDisplayName(ChatColor.BLUE+"Powered "+newitem_meta.getDisplayName());
} else {
newitem_meta.setDisplayName(ChatColor.RESET+"Powered "+newitem_meta.getDisplayName());
}
newitem.setItemMeta(newitem_meta);
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+5 "+ChatColor.GOLD+"second "+ChatColor.GRAY+"Wither I"+ChatColor.GOLD+" duration")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.GOLD+"Stacks Wither effect by 1");
newLore.add(ChatColor.GOLD+"per hit for 5 seconds.");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"Ranged Damage")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"Ranged Damage "+ChatColor.BLUE+" &");
newLore.add(ChatColor.LIGHT_PURPLE+"+1 "+ChatColor.GOLD+"m/s Projectile Speed");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"Lifesteal")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"Lifesteal"+ChatColor.BLUE+" &");
newLore.add(ChatColor.LIGHT_PURPLE+"+1 "+ChatColor.GOLD+"Max Health");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"AoE Damage")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"AoE Damage"+ChatColor.BLUE+" &");
newLore.add(ChatColor.LIGHT_PURPLE+"+1 "+ChatColor.GOLD+"Damage over time to");
newLore.add(ChatColor.GOLD+" all nearby enemies.");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"Slow on hit")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"Slow on hit"+ChatColor.BLUE+" &");
newLore.add(ChatColor.LIGHT_PURPLE+"+1 "+ChatColor.GOLD+"second Poison duration");
newLore.add(ChatColor.GOLD+" on hit.");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"Critical Chance")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"Critical Chance"+ChatColor.BLUE+" &");
newLore.add(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"Item Drop Increase");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+1 "+ChatColor.GOLD+"second Poison duration")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.LIGHT_PURPLE+"+2 "+ChatColor.GOLD+"second Poison duration");
newLore.add(ChatColor.GOLD+" on hit."+ChatColor.BLUE+" &");
newLore.add(ChatColor.LIGHT_PURPLE+"+3% "+ChatColor.GOLD+"chance of snaring the");
newLore.add(ChatColor.GOLD+" target for 5 seconds.");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+1 "+ChatColor.GOLD+"second ignite duration")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.LIGHT_PURPLE+"+1 "+ChatColor.GOLD+"second ignite duration");
newLore.add(ChatColor.GOLD+" on hit."+ChatColor.BLUE+" &");
newLore.add(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"chance of sending the");
newLore.add(ChatColor.GOLD+" enemy airborne.");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"-1% "+ChatColor.GOLD+"damage taken on hit")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.LIGHT_PURPLE+"-1% "+ChatColor.GOLD+"damage taken on hit"+ChatColor.BLUE+" &");
newLore.add(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"chance to send down");
newLore.add(ChatColor.GOLD+" lightning onto your enemy.");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"chance of being fully")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"chance of being fully");
newLore.add(ChatColor.GOLD+" healed on a kill."+ChatColor.BLUE+" &");
newLore.add(ChatColor.LIGHT_PURPLE+"+3% "+ChatColor.GOLD+"chance of dropping a");
newLore.add(ChatColor.GOLD+" Golden Nugget on a kill");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"chance of setting the")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"chance of setting the");
newLore.add(ChatColor.GOLD+" mob and surrounding mobs on fire");
newLore.add(ChatColor.GOLD+" for 10 seconds."+ChatColor.BLUE+" &");
newLore.add(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"chance of burning an");
newLore.add(ChatColor.GOLD+" enemy to a crisp.");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+15 "+ChatColor.GOLD+"second "+ChatColor.GRAY+"Wither III"+ChatColor.GOLD+" duration")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.GOLD+"Stacks Wither effect by 2");
newLore.add(ChatColor.GOLD+"per hit for 20 seconds.");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+3% "+ChatColor.GOLD+"Ranged Damage") ||
getLore.contains(ChatColor.LIGHT_PURPLE+"+1 "+ChatColor.GOLD+"m/s Projectile Speed")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"Ranged Damage"+ChatColor.BLUE+" &");
newLore.add(ChatColor.LIGHT_PURPLE+"+3 "+ChatColor.GOLD+"m/s Projectile Speed");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+3% "+ChatColor.GOLD+"Lifesteal") ||
getLore.contains(ChatColor.LIGHT_PURPLE+"+1 "+ChatColor.GOLD+"Max Health")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"Lifesteal"+ChatColor.BLUE+" &");
newLore.add(ChatColor.LIGHT_PURPLE+"+4 "+ChatColor.GOLD+"Max Health");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+1 "+ChatColor.GOLD+"Damage to all nearby enemies.") ||
getLore.contains(ChatColor.LIGHT_PURPLE+"+20% "+ChatColor.GOLD+"AoE Damage")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.LIGHT_PURPLE+"+30% "+ChatColor.GOLD+"AoE Damage"+ChatColor.BLUE+" &");
newLore.add(ChatColor.LIGHT_PURPLE+"+3 "+ChatColor.GOLD+"Damage over time to");
newLore.add(ChatColor.GOLD+" all nearby enemies.");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+2 "+ChatColor.GOLD+"second Poison duration") ||
getLore.contains(ChatColor.LIGHT_PURPLE+"+15% "+ChatColor.GOLD+"Slow on hit")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.LIGHT_PURPLE+"+30% "+ChatColor.GOLD+"Slow on hit"+ChatColor.BLUE+" &");
newLore.add(ChatColor.LIGHT_PURPLE+"+5 "+ChatColor.GOLD+"second Poison duration");
newLore.add(ChatColor.GOLD+" on hit.");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+1% "+ChatColor.GOLD+"Item Drop Amount Increase") ||
getLore.contains(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"Critical Chance")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.LIGHT_PURPLE+"+10% "+ChatColor.GOLD+"Critical Chance"+ChatColor.BLUE+" &");
newLore.add(ChatColor.LIGHT_PURPLE+"+3% "+ChatColor.GOLD+"Item Drop Increase");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"of snaring a target") ||
getLore.contains(ChatColor.LIGHT_PURPLE+"+3 "+ChatColor.GOLD+"second Poison duration")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.LIGHT_PURPLE+"+5 "+ChatColor.GOLD+"second Poison duration");
newLore.add(ChatColor.GOLD+" on hit."+ChatColor.BLUE+" &");
newLore.add(ChatColor.LIGHT_PURPLE+"+8% "+ChatColor.GOLD+"chance of snaring the");
newLore.add(ChatColor.GOLD+" target for 5 seconds.");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+3% "+ChatColor.GOLD+"chance to send enemy") ||
getLore.contains(ChatColor.LIGHT_PURPLE+"+3 "+ChatColor.GOLD+"second ignite duration")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.LIGHT_PURPLE+"+5 "+ChatColor.GOLD+"second ignite duration");
newLore.add(ChatColor.GOLD+" on hit."+ChatColor.BLUE+" &");
newLore.add(ChatColor.LIGHT_PURPLE+"+10% "+ChatColor.GOLD+"chance of sending the");
newLore.add(ChatColor.GOLD+" enemy airborne.");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+3% "+ChatColor.GOLD+"chance to send down") ||
getLore.contains(ChatColor.LIGHT_PURPLE+"-5% "+ChatColor.GOLD+"damage taken on hit")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.LIGHT_PURPLE+"-10% "+ChatColor.GOLD+"damage taken on hit"+ChatColor.BLUE+" &");
newLore.add(ChatColor.LIGHT_PURPLE+"+10% "+ChatColor.GOLD+"chance to send down");
newLore.add(ChatColor.GOLD+" lightning onto your enemy.");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+10% "+ChatColor.GOLD+"chance of dropping a") ||
getLore.contains(ChatColor.LIGHT_PURPLE+"+3% "+ChatColor.GOLD+"chance of being fully")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"chance of being fully");
newLore.add(ChatColor.GOLD+" healed on a kill."+ChatColor.BLUE+" &");
newLore.add(ChatColor.LIGHT_PURPLE+"+20% "+ChatColor.GOLD+"chance of dropping a");
newLore.add(ChatColor.GOLD+" Golden Nugget on a kill");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
if (getLore.contains(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"chance of burning an") ||
getLore.contains(ChatColor.LIGHT_PURPLE+"+5% "+ChatColor.GOLD+"chance of setting the")) {
ItemMeta meta = newitem.getItemMeta();
List<String> newLore = new ArrayList<String>();
newLore.add(ChatColor.LIGHT_PURPLE+"+10% "+ChatColor.GOLD+"chance of setting the");
newLore.add(ChatColor.GOLD+" mob and surrounding mobs on fire");
newLore.add(ChatColor.GOLD+" for 10 seconds."+ChatColor.BLUE+" &");
newLore.add(ChatColor.LIGHT_PURPLE+"+10% "+ChatColor.GOLD+"chance of burning an");
newLore.add(ChatColor.GOLD+" enemy to a crisp.");
meta.setLore(newLore);
newitem.setItemMeta(meta);
return newitem;
}
}
return item;
}
@Override
public String toString() {
return "MobHead(Type: "+(head_type!=null?head_type.name():"null")+", Rare Type: "+(rare_head_type!=null?rare_head_type.name():"null")+", is_rare:"+rare_head+", is_powered:"+is_powered+")";
}
public MobHead(MobHeadType head_type) {
MobHead(head_type, false, MobHeadRareType.RARE_TYPE_A, false);
}
public MobHead(MobHeadType head_type, boolean is_rare) {
MobHead(head_type, is_rare, MobHeadRareType.RARE_TYPE_A, false);
}
public MobHead(MobHeadType head_type, boolean is_rare, MobHeadRareType rare_head_type) {
MobHead(head_type, is_rare, rare_head_type, false);
}
public MobHead(MobHeadType head_type, boolean is_rare, boolean is_powered) {
MobHead(head_type, is_rare, MobHeadRareType.RARE_TYPE_A, is_powered);
}
public MobHead(MobHeadType head_type, boolean is_rare, MobHeadRareType rare_head_type, boolean is_powered) {
MobHead(head_type, is_rare, rare_head_type, is_powered);
}
void MobHead(MobHeadType head_type, boolean is_rare, MobHeadRareType rare_head_type, boolean is_powered) {
this.head_type=head_type;
this.rare_head_type=rare_head_type;
this.rare_head=is_rare;
this.is_powered=is_powered;
}
}

@ -1,61 +0,0 @@
package me.kaZep.Base;
import java.util.UUID;
/**
* The MobManager class handles a certain mob in the game.
* It will allow you to define new properties for mobs
* to keep track of. This is similar to the PlayerData
* class for players.
*/
public class MobManager {
UUID id;
long poison_time;
/**
* Adds a new mob to be tracked.
* @param id The UUID of the mob.
*/
public MobManager(UUID id) {
this.id=id;
this.poison_time=Main.SERVER_TICK_TIME;
}
/**
* If there are already poison ticks on this mob,
* adds to the duration in ticks for the poison
* to last. Otherwise works just like setPoison().
* @param ticks
*/
public void addPoison(long ticks) {
if (poison_time>=Main.SERVER_TICK_TIME) {
poison_time+=ticks;
} else {
setPoison(ticks);
}
}
/**
* Sets the poison ticks directly, overwriting
* any previous poison tick data.
* @param ticks
*/
public void setPoison(long ticks) {
poison_time=Main.SERVER_TICK_TIME+ticks;
}
/**
* Removes the poison ticks from this mob.
*/
public void removePoison() {
poison_time=Main.SERVER_TICK_TIME;
}
/**
* Returns the number of ticks of poison
* left on this mob.
* @return
*/
public long getPoisonTicks() {
if (poison_time>=Main.SERVER_TICK_TIME) {
return poison_time-Main.SERVER_TICK_TIME;
} else {
return 0; //0 ticks, since the stored time is smaller.
}
}
}

@ -8,10 +8,6 @@ import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.List;
import me.kaZep.Base.MobHead.MobHeadRareType;
import me.kaZep.Base.MobHead.MobHeadType;
import me.kaZep.Commands.JobsDataInfo.Job;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
@ -26,22 +22,23 @@ public class PlayerBuffData {
List<Player> armorbufflist;
double base_hplv;
List<Player> hpbufflist;
short helmet_durability,chestplate_durability,leggings_durability,boots_durability;
int potion_spdlv;
long potion_time;
long hpbuff_time;
double extra_hp=0;
double money_gained=0;
long last_money_report_time=0;
long last_sneak_time=0;
public Main plugin;
public String toString() {
//A method that outputs this class as a string.
return "PlayerBuffData@{p = "+((p!=null)?p.toString():"null")+", base_spdlv = "+base_spdlv+", base_armorlv = "+base_armorlv+", armorbufflist = "+
((armorbufflist!=null)?armorbufflist.toString():"null")+", base_hplv = "+base_hplv+", hpbufflist = "+((hpbufflist!=null)?hpbufflist.toString():"null")+
", potion_spdlv = "+potion_spdlv+", potion_time = "+potion_time+", hpbuff_time = "+
return ((java.lang.Object)this).toString()+"{p = "+p.toString()+", base_spdlv = "+base_spdlv+", base_armorlv = "+base_armorlv+", armorbufflist = "+
armorbufflist.toString()+", base_hplv = "+base_hplv+", hpbufflist = "+hpbufflist.toString()+", helmet_durability = "+
helmet_durability+", chestplate_durability = "+chestplate_durability+", leggings_durability = "+leggings_durability+"," +
" boots_durability = "+boots_durability+", potion_spdlv = "+potion_spdlv+", potion_time = "+potion_time+", hpbuff_time = "+
hpbuff_time+", extra_hp = "+extra_hp+", money_gained = "+money_gained+", last_money_report_time = "+last_money_report_time+"," +
"plugin = "+((plugin!=null)?plugin.toString():"null")+"}";
"plugin = "+plugin.toString()+"}";
}
public String healthbar(double curHP,double maxHP) {
@ -109,6 +106,26 @@ public class PlayerBuffData {
this.hpbufflist=new ArrayList<Player>();
this.last_money_report_time=Main.SERVER_TICK_TIME;
this.money_gained=0;
if (p.getInventory().getHelmet()!=null) {
this.helmet_durability=p.getInventory().getHelmet().getDurability();
} else {
this.helmet_durability=-1;
}
if (p.getInventory().getChestplate()!=null) {
this.chestplate_durability=p.getInventory().getChestplate().getDurability();
} else {
this.chestplate_durability=-1;
}
if (p.getInventory().getLeggings()!=null) {
this.leggings_durability=p.getInventory().getLeggings().getDurability();
} else {
this.leggings_durability=-1;
}
if (p.getInventory().getBoots()!=null) {
this.boots_durability=p.getInventory().getBoots().getDurability();
} else {
this.boots_durability=-1;
}
this.plugin=thisplugin;
try {
Iterator<PotionEffect> effects = p.getActivePotionEffects().iterator();
@ -139,9 +156,6 @@ public class PlayerBuffData {
if (!p.isDead()) { //Don't even try to set things if we're dead.
base_hplv=20;
base_hplv+=hpbufflist.size()*10;
if (this.plugin.hasJobBuff("Hunter", p, Job.JOB40)) {
base_hplv+=20;
}
if (this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat8")>0) {
base_hplv+=this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat8")/2);
}
@ -159,17 +173,6 @@ public class PlayerBuffData {
}
}
}
if (p.getInventory()!=null) {
List<MobHead> playerheads = this.plugin.getMobHeads(p);
int zombierarebheads = this.plugin.getMobHeadAmt(new MobHead(MobHeadType.ZOMBIE,true,MobHeadRareType.RARE_TYPE_B), playerheads);
int zombiepoweredheads = this.plugin.getMobHeadAmt(new MobHead(MobHeadType.ZOMBIE,false,true), playerheads);
int zombiepoweredrareheads = this.plugin.getMobHeadAmt(new MobHead(MobHeadType.ZOMBIE,true,true), playerheads);
//Bukkit.getLogger().info("Base Health is "+base_hplv+".");
base_hplv+=zombierarebheads;
base_hplv+=zombiepoweredheads;
base_hplv+=zombiepoweredrareheads*4;
//Bukkit.getLogger().info("Base Health is "+base_hplv+".");
}
extra_hp=0;
//p.setMaxHealth(base_hplv);
boolean hasabsorption=false;
@ -193,29 +196,37 @@ public class PlayerBuffData {
}
if (!hasabsorption && this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat4")>0) {
p.removePotionEffect(PotionEffectType.ABSORPTION);
p.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION,3600,this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat4")/3)/4-1),true);
p.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION,3590,this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat4")/3)/4-1));
//p.sendMessage("Absorption level is "+(this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat4")/4)/4-1));
}
if (this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat2")>0) {
p.removePotionEffect(PotionEffectType.FAST_DIGGING);
p.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING,399,this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName().toLowerCase()+".stats.stat2")/5)/20-1));
}
//p.sendMessage("Health: "+p.getHealth()+"/"+p.getMaxHealth()+" Base HP Level: "+base_hplv);
if (p.getHealth()>p.getMaxHealth()) {
p.setHealth(p.getMaxHealth());
//p.sendMessage("Health: "+p.getHealth()+"/"+p.getMaxHealth()+" Set new health: "+p.getMaxHealth()+"+"+extra_hp);
}
//Bukkit.getLogger().info("Base hp level: "+base_hplv+" Max Health: "+p.getMaxHealth());
if (base_hplv!=p.getMaxHealth()) {
double temphp=0;
temphp = p.getHealth();
if (base_hplv<p.getMaxHealth()) {
p.setMaxHealth(base_hplv-extra_hp);
if (temphp>p.getMaxHealth()) {
p.setHealth(p.getMaxHealth());
p.setHealth(base_hplv);
} else {
temphp = p.getHealth();
p.setMaxHealth(base_hplv-extra_hp);
p.setHealth(temphp);
}
}
/*if (base_hplv!=p.getMaxHealth()) {
p.setMaxHealth(base_hplv-extra_hp);
}*/
/*
if (p.getHealth()>base_hplv) {
p.setHealth(base_hplv);
//p.sendMessage("Health too high. Lowering to "+p.getMaxHealth());
}*/
//Send new speed totals so the player's speed can be manually adjusted.
if (potion_spdlv>0 && potion_time<Main.SERVER_TICK_TIME) {
//Remove the potion speed buff.
@ -226,13 +237,12 @@ public class PlayerBuffData {
//Figure out potion effects when player joins.
while (effects.hasNext()) {
PotionEffect nexteffect = effects.next();
/*
if (nexteffect.getType().getName().compareTo(PotionEffectType.INCREASE_DAMAGE.getName())==0) {
if (nexteffect.getAmplifier()>0) {
p.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);
p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE,nexteffect.getDuration()*4,0));
}
}*/
}
if (nexteffect.getType().getName().compareTo(PotionEffectType.SPEED.getName())==0) {
if (nexteffect.getDuration()<47479999) {
//This is not a buff we applied via our plugin.
@ -255,20 +265,18 @@ public class PlayerBuffData {
p.removePotionEffect(PotionEffectType.SPEED);
if ((base_spdlv+potion_spdlv)>0) {
//Bukkit.getPlayer("AaMay").sendMessage("Explorer giving speed buff: "+(base_spdlv-1+potion_spdlv));
p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 2147479999, base_spdlv-1+potion_spdlv, true));
}
if (last_money_report_time+72000<Main.SERVER_TICK_TIME) {
last_money_report_time=Main.SERVER_TICK_TIME;
if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify6")) {
DecimalFormat df = new DecimalFormat("#0.00");
//p.sendMessage(ChatColor.YELLOW+""+ChatColor.ITALIC+"You have earned $"+df.format(money_gained)+" from your jobs in the past hour.");
p.sendMessage(ChatColor.YELLOW+""+ChatColor.ITALIC+"You have earned $"+df.format(money_gained)+" from your jobs in the past hour.");
}
money_gained=0;
}
p.getScoreboard().getTeam(p.getName().toLowerCase()).setSuffix(healthbar(p.getHealth(),p.getMaxHealth(),p.getFoodLevel()));
} else {
base_hplv=20;
p.setMaxHealth(base_hplv);
}
}
}

@ -1,38 +1,21 @@
package me.kaZep.Base;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
public class PlayerData {
int buildamt=10;
Material lastblocktype=null;
int gameinteractions=0;
long lastinteracttime=0;
long lastminetime=0;
long lastsneaktime=0;
int minestreak=0;
long furytime=0;
long invulntime=0;
int furyamt=0;
boolean is_renaming_item=false;
boolean haslanded=true;
long lasteattime=Main.SERVER_TICK_TIME;
int blockstack=0; //The amount of times you've gotten hit (The amount of "blocking" stacks you now have)
int fishingstreak=0;
int fishingrodfails=0; //The amount of times in a row you've failed to catch fish.
long fishingroduse=Main.SERVER_TICK_TIME; //The last time you threw the fishing rod in the water.
double fishingrodcatchrate = 0.002; //The current chance of catching a fish.
Location clickedblock1=null; //Stores the location of a clicked block.
Player data=null;
long lastflighttime=0;
public PlayerData(Player p) {
this.data=p;
this.lastblocktype=Material.DIRT;
lastinteracttime=
lastminetime=
lastflighttime=Main.SERVER_TICK_TIME;
lastinteracttime=Main.SERVER_TICK_TIME;
lastminetime=Main.SERVER_TICK_TIME;
minestreak=0;
}
public boolean CheckMineStreak() {
@ -80,12 +63,6 @@ public class PlayerData {
buildamt+=2;
}
}
public void SetClickedBlock(Location l) {
clickedblock1 = l;
}
public Location GetClickedBlock() {
return clickedblock1;
}
public Player getPlayer() {
return data;
}

File diff suppressed because it is too large Load Diff

@ -1,12 +0,0 @@
package me.kaZep.Base;
import java.util.UUID;
public class PoweredMob {
UUID id;
long power_time;
public PoweredMob(UUID id, long power_time) {
this.id=id;
this.power_time=power_time;
}
}

@ -91,9 +91,7 @@ public class RecyclingCenterNode {
}
public void recycleItem(ItemStack item) {
boolean allowed=true;
if (item.getItemMeta().hasDisplayName() && item.getItemMeta().getDisplayName().toLowerCase().contains("quickshop")) {allowed=false;}
if (allowed) {
if (item.getItemMeta().hasDisplayName()==false) {
//Choose one of the random recycling centers.
int center=(int)(Math.random()*locations.size());
double tempchance = chance; //Store the current chance so we can check for duplicates.

@ -1,12 +0,0 @@
package me.kaZep.Base;
import org.bukkit.Location;
public class TempBlock {
public Location loc;
public int timer;
public TempBlock(Location loc, int timer) {
this.loc=loc;
this.timer=timer;
}
}

@ -1,149 +0,0 @@
package me.kaZep.Base;
import java.io.File;
import java.io.IOException;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;
import com.sk89q.worldedit.CuboidClipboard;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.EmptyClipboardException;
import com.sk89q.worldedit.FilenameException;
import com.sk89q.worldedit.LocalPlayer;
import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.bukkit.BukkitWorld;
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
import com.sk89q.worldedit.data.DataException;
import com.sk89q.worldedit.schematic.SchematicFormat;
/**
* @author desht
*
* A wrapper class for the WorldEdit terrain loading & saving API to make things a little
* simple for other plugins to use.
*/
public class TerrainManager {
private static final String EXTENSION = "schematic";
private final WorldEdit we;
private final LocalSession localSession;
private final EditSession editSession;
private final LocalPlayer localPlayer;
/**
* Constructor
*
* @param wep the WorldEdit plugin instance
* @param player the player to work with
*/
public TerrainManager(WorldEditPlugin wep, Player player) {
we = wep.getWorldEdit();
localPlayer = wep.wrapPlayer(player);
localSession = we.getSession(localPlayer);
editSession = localSession.createEditSession(localPlayer);
}
/**
* Constructor
*
* @param wep the WorldEdit plugin instance
* @param world the world to work in
*/
public TerrainManager(WorldEditPlugin wep, World world) {
we = wep.getWorldEdit();
localPlayer = null;
localSession = new LocalSession(we.getConfiguration());
editSession = new EditSession(new BukkitWorld(world), we.getConfiguration().maxChangeLimit);
}
/**
* Write the terrain bounded by the given locations to the given file as a MCedit format
* schematic.
*
* @param saveFile a File representing the schematic file to create
* @param l1 one corner of the region to save
* @param l2 the corner of the region to save, opposite to l1
* @throws DataException
* @throws IOException
*/
public void saveTerrain(File saveFile, Location l1, Location l2) throws FilenameException, DataException, IOException {
Vector min = getMin(l1, l2);
Vector max = getMax(l1, l2);
saveFile = we.getSafeSaveFile(localPlayer,
saveFile.getParentFile(), saveFile.getName(),
EXTENSION, new String[] { EXTENSION });
editSession.enableQueue();
CuboidClipboard clipboard = new CuboidClipboard(max.subtract(min).add(new Vector(1, 1, 1)), min);
clipboard.copy(editSession);
SchematicFormat.MCEDIT.save(clipboard, saveFile);
editSession.flushQueue();
}
/**
* Load the data from the given schematic file and paste it at the given location. If the location is null, then
* paste it at the saved data's origin.
*
* @param saveFile a File representing the schematic file to load
* @param loc the location to paste the clipboard at (may be null)
* @throws FilenameException
* @throws DataException
* @throws IOException
* @throws MaxChangedBlocksException
* @throws EmptyClipboardException
*/
public void loadSchematic(File saveFile, Location loc) throws FilenameException, DataException, IOException, MaxChangedBlocksException, EmptyClipboardException {
saveFile = we.getSafeSaveFile(localPlayer,
saveFile.getParentFile(), saveFile.getName(),
EXTENSION, new String[] { EXTENSION });
editSession.enableQueue();
localSession.setClipboard(SchematicFormat.MCEDIT.load(saveFile));
localSession.getClipboard().place(editSession, getPastePosition(loc), false);
editSession.flushQueue();
we.flushBlockBag(localPlayer, editSession);
}
/**
* Load the data from the given schematic file and paste it at the saved clipboard's origin.
*
* @param saveFile
* @throws FilenameException
* @throws DataException
* @throws IOException
* @throws MaxChangedBlocksException
* @throws EmptyClipboardException
*/
public void loadSchematic(File saveFile) throws FilenameException, DataException, IOException, MaxChangedBlocksException, EmptyClipboardException {
loadSchematic(saveFile, null);
}
private Vector getPastePosition(Location loc) throws EmptyClipboardException {
if (loc == null)
return localSession.getClipboard().getOrigin();
else
return new Vector(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
}
private Vector getMin(Location l1, Location l2) {
return new Vector(
Math.min(l1.getBlockX(), l2.getBlockX()),
Math.min(l1.getBlockY(), l2.getBlockY()),
Math.min(l1.getBlockZ(), l2.getBlockZ())
);
}
private Vector getMax(Location l1, Location l2) {
return new Vector(
Math.max(l1.getBlockX(), l2.getBlockX()),
Math.max(l1.getBlockY(), l2.getBlockY()),
Math.max(l1.getBlockZ(), l2.getBlockZ())
);
}
}

@ -8,7 +8,6 @@ import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
public class JobsDataInfo {
public enum Job {JOB5,JOB10,JOB20,JOB30A,JOB30B,JOB40};
String jobname;
String introstring;
String actionname1;
@ -23,8 +22,6 @@ public class JobsDataInfo {
String lv5buff;
String lv10buff;
String lv20buff;
String lv30_1buff;
String lv30_2buff;
String lv40buff;
List<Double> dataprice1;
List<Double> dataprice2;
@ -53,8 +50,6 @@ public class JobsDataInfo {
lv5buff = "";
lv10buff = "";
lv20buff = "";
lv30_1buff = "";
lv30_2buff = "";
lv40buff = "";
dataprice1 = new ArrayList<Double>();
dataprice2 = new ArrayList<Double>();
@ -78,7 +73,6 @@ public class JobsDataInfo {
public void addExtraData(String info) {
extrainfo.add(info);
}
@Deprecated
public String getBuffData(int lv) {
switch (lv) {
case 5:{
@ -96,44 +90,12 @@ public class JobsDataInfo {
}
return "";
}
public String getBuffData(Job job) {
switch (job) {
case JOB5:{
return this.lv5buff;
}
case JOB10:{
return this.lv10buff;
}
case JOB20:{
return this.lv20buff;
}
case JOB30A:{
return this.lv30_1buff;
}
case JOB30B:{
return this.lv30_2buff;
}
case JOB40:{
return this.lv40buff;
}
}
return "";
}
@Deprecated
public void setBuffData(String lv5,String lv10,String lv20,String lv40) {
this.lv5buff=lv5;
this.lv10buff=lv10;
this.lv20buff=lv20;
this.lv40buff=lv40;
}
public void setBuffData(String lv5,String lv10,String lv20,String lv30_1,String lv30_2,String lv40) {
this.lv5buff=lv5;
this.lv10buff=lv10;
this.lv20buff=lv20;
this.lv30_1buff=lv30_1;
this.lv30_2buff=lv30_2;
this.lv40buff=lv40;
}
public void setAction(int numb, String name) {
switch (numb) {
case 0:{

Loading…
Cancel
Save