commit
7a2e0f9f74
@ -0,0 +1,9 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<classpath> |
||||
<classpathentry kind="src" path="src"/> |
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> |
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/Documents/Vault.jar"/> |
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/Downloads/worldedit-5.5.8/WorldEdit.jar"/> |
||||
<classpathentry kind="lib" path="C:/Users/Joshua Sigona/Downloads/bukkit-1.6.4-R1.0.jar"/> |
||||
<classpathentry kind="output" path="bin"/> |
||||
</classpath> |
@ -0,0 +1,23 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<projectDescription> |
||||
<name>BankEconomyMod</name> |
||||
<comment></comment> |
||||
<projects> |
||||
</projects> |
||||
<buildSpec> |
||||
<buildCommand> |
||||
<name>org.eclipse.wst.common.project.facet.core.builder</name> |
||||
<arguments> |
||||
</arguments> |
||||
</buildCommand> |
||||
<buildCommand> |
||||
<name>org.eclipse.jdt.core.javabuilder</name> |
||||
<arguments> |
||||
</arguments> |
||||
</buildCommand> |
||||
</buildSpec> |
||||
<natures> |
||||
<nature>org.eclipse.jdt.core.javanature</nature> |
||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature> |
||||
</natures> |
||||
</projectDescription> |
@ -0,0 +1,4 @@ |
||||
eclipse.preferences.version=1 |
||||
encoding//src/me/kaZep/Base/Main.java=UTF-8 |
||||
encoding//src/me/kaZep/Base/PlayerBuffData.java=UTF-8 |
||||
encoding//src/me/kaZep/Base/PlayerListener.java=UTF-8 |
@ -0,0 +1,11 @@ |
||||
eclipse.preferences.version=1 |
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled |
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 |
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve |
||||
org.eclipse.jdt.core.compiler.compliance=1.6 |
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate |
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate |
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate |
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error |
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error |
||||
org.eclipse.jdt.core.compiler.source=1.6 |
@ -0,0 +1,4 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<faceted-project> |
||||
<installed facet="java" version="1.6"/> |
||||
</faceted-project> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,25 @@ |
||||
name: BankEconomy |
||||
main: me.kaZep.Base.Main |
||||
version: 1.3.0 |
||||
description: Bank plugin which stores money. |
||||
commands: |
||||
bankeconomy: |
||||
description: Bank. |
||||
revive: |
||||
description: Revive. |
||||
tele: |
||||
description: Teleport. |
||||
transfer: |
||||
description: Transfer money to another player. |
||||
jobs: |
||||
description: Jobs. |
||||
sp: |
||||
description: Modify your allocated stat points. |
||||
maintenance: |
||||
description: Toggles Server maintenance status. |
||||
settings: |
||||
description: Modify notification settings. |
||||
unenchant: |
||||
description: Unenchant your currently held item. |
||||
event: |
||||
description: Toggles or untoggles events. |
@ -0,0 +1,20 @@ |
||||
package me.kaZep.Base; |
||||
|
||||
import org.bukkit.Location; |
||||
import org.bukkit.entity.LivingEntity; |
||||
import org.bukkit.util.Vector; |
||||
|
||||
public class ArrowShooter { |
||||
public int timer=0; |
||||
public int frequency=0; |
||||
public Vector spd; |
||||
public Location loc; |
||||
public LivingEntity shooter; |
||||
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; |
||||
} |
||||
} |
@ -0,0 +1,104 @@ |
||||
package me.kaZep.Base; |
||||
|
||||
import org.bukkit.Bukkit; |
||||
import org.bukkit.Location; |
||||
import org.bukkit.Material; |
||||
import org.bukkit.block.BrewingStand; |
||||
import org.bukkit.block.Furnace; |
||||
import org.bukkit.inventory.BrewerInventory; |
||||
import org.bukkit.inventory.ItemStack; |
||||
import org.bukkit.potion.Potion; |
||||
import org.bukkit.potion.PotionType; |
||||
|
||||
public class BrewingStandData { |
||||
|
||||
Location pos; |
||||
String owner; |
||||
long time; |
||||
boolean setnewtime; |
||||
public BrewingStandData(Location pos, String owner) { |
||||
this.pos=pos; |
||||
this.owner=owner; |
||||
this.time=Bukkit.getWorld("world").getFullTime()+9000; |
||||
this.setnewtime=false; |
||||
} |
||||
|
||||
public void setOwner(String owner) { |
||||
this.owner=owner; |
||||
} |
||||
|
||||
public void setBrewingTime(int newval) { |
||||
if ((BrewingStand)Bukkit.getWorld("world").getBlockAt(pos).getState()!=null) { |
||||
BrewingStand brewingstand = (BrewingStand)Bukkit.getWorld("world").getBlockAt(pos).getState(); |
||||
brewingstand.setBrewingTime(newval); |
||||
} |
||||
} |
||||
|
||||
public int getBrewingTime() { |
||||
if ((BrewingStand)Bukkit.getWorld("world").getBlockAt(pos).getState()!=null) { |
||||
BrewingStand brewingstand = (BrewingStand)Bukkit.getWorld("world").getBlockAt(pos).getState(); |
||||
return brewingstand.getBrewingTime(); |
||||
} else { |
||||
return 0; |
||||
} |
||||
} |
||||
|
||||
public int getBrewingPotions() { |
||||
if ((BrewingStand)Bukkit.getWorld("world").getBlockAt(pos).getState()!=null) { |
||||
BrewingStand brewingstand = (BrewingStand)Bukkit.getWorld("world").getBlockAt(pos).getState(); |
||||
ItemStack[] b = brewingstand.getInventory().getContents(); |
||||
int potioncount=0; |
||||
for (int i=0;i<b.length;i++) { |
||||
if (b[i]!=null && |
||||
b[i].getType()!=Material.SUGAR && |
||||
b[i].getType()!=Material.SPIDER_EYE && |
||||
b[i].getType()!=Material.REDSTONE && |
||||
b[i].getType()!=Material.GLOWSTONE_DUST && |
||||
b[i].getType()!=Material.SULPHUR && |
||||
b[i].getType()!=Material.FERMENTED_SPIDER_EYE && |
||||
b[i].getType()!=Material.SPECKLED_MELON && |
||||
b[i].getType()!=Material.NETHER_WARTS && |
||||
b[i].getType()!=Material.GOLDEN_CARROT && |
||||
b[i].getType()!=Material.BLAZE_POWDER && |
||||
b[i].getType()!=Material.MAGMA_CREAM && |
||||
b[i].getType()!=Material.GHAST_TEAR) { |
||||
potioncount++; |
||||
} |
||||
} |
||||
return potioncount; |
||||
} else { |
||||
return 0; |
||||
} |
||||
} |
||||
|
||||
public boolean arePotionsValid() { |
||||
//We are not allowed to brew Potions of Night Vision or Invisibility. If we have one of those in the slot, we have to cancel it.
|
||||
if ((BrewingStand)Bukkit.getWorld("world").getBlockAt(pos).getState()!=null) { |
||||
BrewingStand brewingstand = (BrewingStand)Bukkit.getWorld("world").getBlockAt(pos).getState(); |
||||
if (brewingstand.getInventory().getIngredient().getType()==Material.GOLDEN_CARROT) { |
||||
return false; |
||||
} |
||||
} |
||||
return true; |
||||
} |
||||
|
||||
public Location getLoc() { |
||||
return pos; |
||||
} |
||||
|
||||
public boolean is_newTimeSet() { |
||||
return setnewtime; |
||||
} |
||||
|
||||
public void set_newTime(boolean set) { |
||||
this.setnewtime=set; |
||||
} |
||||
|
||||
public long getTime() { |
||||
return time; |
||||
} |
||||
public void resetTime() { |
||||
this.time=Bukkit.getWorld("world").getFullTime()+9000; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,145 @@ |
||||
package me.kaZep.Base; |
||||
|
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
import java.util.Random; |
||||
|
||||
import org.bukkit.Material; |
||||
import org.bukkit.enchantments.Enchantment; |
||||
import org.bukkit.entity.Player; |
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause; |
||||
import org.bukkit.inventory.ItemStack; |
||||
|
||||
public class DamageAPI { |
||||
|
||||
Random random = new Random(); |
||||
boolean randomness = true; |
||||
|
||||
private int returnChance(int aStart, int aEnd) { |
||||
if (aStart > aEnd) { |
||||
aEnd = aStart; |
||||
} |
||||
long range = (long) aEnd - (long) aStart + 1; |
||||
long fraction = (long) (range * random.nextDouble()); |
||||
int randomNumber = (int) (fraction + aStart); |
||||
return randomNumber; |
||||
} |
||||
|
||||
public void toggleRandom(boolean toggle) { |
||||
randomness = toggle; |
||||
} |
||||
|
||||
public double getDamage(ItemStack helmet, ItemStack chestplate, |
||||
ItemStack leggings, ItemStack boots, Double dmg, DamageCause cause, boolean blocking) { |
||||
ItemStack[] items = { helmet, chestplate, leggings, boots }; |
||||
int[] armReduce = getArmorReduce(items, cause); |
||||
int[] encReduce = getEnchantmentsReducement(items, cause); |
||||
double armour = 0; |
||||
double damage = dmg; |
||||
double enc = 0; |
||||
for (int in : armReduce) |
||||
armour = armour + in; |
||||
for (int in : encReduce) |
||||
enc = enc + in; |
||||
if (enc > 25) |
||||
enc = 25; |
||||
damage = damage - (damage * armour / 25); |
||||
if (randomness == true) |
||||
enc = Math.ceil(returnChance((int) ((enc) / 2) * 10, (int) (enc) * 10)); |
||||
if (enc > 20) |
||||
enc = 20; |
||||
enc = enc * 4; |
||||
damage = damage - (damage * enc / 100); |
||||
if (blocking == true) |
||||
damage = damage/2; |
||||
return damage; |
||||
} |
||||
|
||||
public double getDamage(Player player, Double damage, DamageCause cause) { |
||||
return getDamage(player.getInventory().getHelmet(), player.getInventory() |
||||
.getChestplate(), player.getInventory().getLeggings(), player |
||||
.getInventory().getBoots(), damage, cause, player.isBlocking()); |
||||
} |
||||
|
||||
private int[] getArmorReduce(ItemStack[] item, DamageCause dmg) { |
||||
int[] damage = { 0, 0, 0, 0 }; |
||||
if (dmg.equals(DamageCause.ENTITY_ATTACK) || dmg.equals(DamageCause.FIRE) |
||||
|| dmg.equals(DamageCause.ENTITY_EXPLOSION) |
||||
|| dmg.equals(DamageCause.BLOCK_EXPLOSION) |
||||
|| dmg.equals(DamageCause.CONTACT) || dmg.equals(DamageCause.LAVA) |
||||
|| dmg.equals(DamageCause.PROJECTILE)) { |
||||
int cur = 0; |
||||
for (ItemStack stack : item) { |
||||
if (stack != null) |
||||
damage[cur] = getArmorValue(stack); |
||||
cur = cur + 1; |
||||
} |
||||
} |
||||
return damage; |
||||
} |
||||
|
||||
private static int[] getEnchantmentsReducement(ItemStack[] item, |
||||
DamageCause dmg) { |
||||
int[] damage = { 0, 0, 0, 0 }; |
||||
int cur = 0; |
||||
for (ItemStack stack : item) { |
||||
if (stack != null) { |
||||
Map<Enchantment, Integer> enchants = new HashMap<Enchantment, Integer>( |
||||
stack.getEnchantments()); |
||||
for (Enchantment enchant : enchants.keySet()) { |
||||
if ((dmg.equals(DamageCause.BLOCK_EXPLOSION) || dmg |
||||
.equals(DamageCause.ENTITY_EXPLOSION) |
||||
&& enchant.equals(Enchantment.PROTECTION_EXPLOSIONS))) |
||||
damage[cur] = damage[cur] |
||||
+ (int) Math.floor((6 + enchants.get(enchant) |
||||
* enchants.get(enchant)) / 2); |
||||
if (dmg.equals(DamageCause.FALL) |
||||
&& enchant.equals(Enchantment.PROTECTION_FALL)) |
||||
damage[cur] = damage[cur] + enchants.get(enchant) * 2; |
||||
if (dmg.equals(DamageCause.PROJECTILE) |
||||
&& enchant.equals(Enchantment.PROTECTION_PROJECTILE)) |
||||
damage[cur] = damage[cur] |
||||
+ (int) Math.floor((6 + enchants.get(enchant) |
||||
* enchants.get(enchant)) / 2); |
||||
if ((dmg.equals(DamageCause.LAVA) |
||||
|| dmg.equals(DamageCause.LIGHTNING) |
||||
|| dmg.equals(DamageCause.FIRE) || dmg.equals(DamageCause.LAVA)) |
||||
&& enchant.equals(Enchantment.PROTECTION_FIRE)) |
||||
damage[cur] = damage[cur] |
||||
+ (int) Math.floor((6 + enchants.get(enchant) |
||||
* enchants.get(enchant)) / 2); |
||||
if (enchant.equals(Enchantment.PROTECTION_ENVIRONMENTAL)) |
||||
damage[cur] = damage[cur] |
||||
+ (int) Math.floor((6 + enchants.get(enchant) |
||||
* enchants.get(enchant)) / 2); |
||||
} |
||||
} |
||||
} |
||||
return damage; |
||||
} |
||||
|
||||
private int getArmorValue(ItemStack armor) { |
||||
Material mat = armor.getType(); |
||||
if (mat == Material.LEATHER_HELMET || mat == Material.LEATHER_BOOTS |
||||
|| mat == Material.GOLD_BOOTS || mat == Material.CHAINMAIL_BOOTS) |
||||
return 1; |
||||
if (mat == Material.LEATHER_LEGGINGS || mat == Material.GOLD_HELMET |
||||
|| mat == Material.CHAINMAIL_HELMET || mat == Material.IRON_HELMET |
||||
|| mat == Material.IRON_BOOTS) |
||||
return 2; |
||||
if (mat == Material.LEATHER_CHESTPLATE || mat == Material.GOLD_LEGGINGS |
||||
|| mat == Material.DIAMOND_BOOTS || mat == Material.DIAMOND_HELMET) |
||||
return 3; |
||||
if (mat == Material.CHAINMAIL_LEGGINGS) |
||||
return 4; |
||||
if (mat == Material.GOLD_CHESTPLATE || mat == Material.CHAINMAIL_CHESTPLATE |
||||
|| mat == Material.IRON_LEGGINGS) |
||||
return 5; |
||||
if (mat == Material.IRON_LEGGINGS || mat == Material.DIAMOND_LEGGINGS) |
||||
return 6; |
||||
if (mat == Material.DIAMOND_CHESTPLATE) |
||||
return 8; |
||||
return 0; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,385 @@ |
||||
package me.kaZep.Base; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
import org.bukkit.enchantments.Enchantment; |
||||
|
||||
|
||||
public class EnchantLevelDatabase { |
||||
public List<StoreValues> stone_hoe = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> stone_shovel = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> stone_pickaxe = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> leather_boots = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> leather_cap = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> leather_pants = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> leather_tunic = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> iron_shovel = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> iron_boots = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> iron_pickaxe = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> iron_helmet = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> golden_shovel = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> iron_leggings = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> diamond_shovel = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> diamond_hoe = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> golden_boots = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> iron_chestplate = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> golden_helmet = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> diamond_pickaxe = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> diamond_boots = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> golden_leggings = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> golden_chestplate = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> diamond_helmet = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> diamond_leggings = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> diamond_chestplate = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> wood_sword = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> bow = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> iron_sword = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> gold_sword = new ArrayList<StoreValues>(); |
||||
public List<StoreValues> diamond_sword = new ArrayList<StoreValues>(); |
||||
public EnchantLevelDatabase() { |
||||
stone_hoe.add(new StoreValues(0.359,Enchantment.DURABILITY,1,5)); |
||||
stone_shovel.add(new StoreValues(0.636,Enchantment.DIG_SPEED,1,5)); |
||||
stone_shovel.add(new StoreValues(0.359,Enchantment.DURABILITY,1,5)); |
||||
stone_pickaxe.add(new StoreValues(0.636,Enchantment.DIG_SPEED,1,5)); |
||||
stone_pickaxe.add(new StoreValues(0.359,Enchantment.DURABILITY,1,5)); // OOPS ^.^
|
||||
leather_boots.add(new StoreValues(0.359,Enchantment.PROTECTION_ENVIRONMENTAL,1,5)); |
||||
leather_boots.add(new StoreValues(0.212,Enchantment.PROTECTION_FALL,1,5)); |
||||
leather_boots.add(new StoreValues(0.113,Enchantment.PROTECTION_PROJECTILE,2,5)); |
||||
leather_boots.add(new StoreValues(0.084,Enchantment.PROTECTION_PROJECTILE,1,5)); |
||||
leather_boots.add(new StoreValues(0.081,Enchantment.PROTECTION_EXPLOSIONS,1,5)); |
||||
leather_boots.add(new StoreValues(0.065,Enchantment.PROTECTION_FIRE,1,5)); |
||||
leather_boots.add(new StoreValues(0.052,Enchantment.PROTECTION_FALL,2,5)); |
||||
leather_boots.add(new StoreValues(0.025,Enchantment.PROTECTION_ENVIRONMENTAL,2,5)); |
||||
leather_boots.add(new StoreValues(0.001,Enchantment.PROTECTION_EXPLOSIONS,2,5)); |
||||
leather_cap.add(new StoreValues(0.405,Enchantment.PROTECTION_ENVIRONMENTAL,1,5)); |
||||
leather_cap.add(new StoreValues(0.146,Enchantment.WATER_WORKER,1,5)); |
||||
leather_cap.add(new StoreValues(0.119,Enchantment.PROTECTION_PROJECTILE,2,5)); |
||||
leather_cap.add(new StoreValues(0.094,Enchantment.PROTECTION_PROJECTILE,1,5)); |
||||
leather_cap.add(new StoreValues(0.082,Enchantment.PROTECTION_EXPLOSIONS,1,5)); |
||||
leather_cap.add(new StoreValues(0.069,Enchantment.PROTECTION_FIRE,1,5)); |
||||
leather_cap.add(new StoreValues(0.048,Enchantment.OXYGEN,1,5)); |
||||
leather_cap.add(new StoreValues(0.029,Enchantment.PROTECTION_ENVIRONMENTAL,2,5)); |
||||
leather_cap.add(new StoreValues(0.0001,Enchantment.PROTECTION_EXPLOSIONS,2,5)); |
||||
leather_pants.add(new StoreValues(0.451,Enchantment.PROTECTION_ENVIRONMENTAL,1,5)); |
||||
leather_pants.add(new StoreValues(0.135,Enchantment.PROTECTION_PROJECTILE,2,5)); |
||||
leather_pants.add(new StoreValues(0.104,Enchantment.PROTECTION_PROJECTILE,1,5)); |
||||
leather_pants.add(new StoreValues(0.100,Enchantment.PROTECTION_EXPLOSIONS,1,5)); |
||||
leather_pants.add(new StoreValues(0.079,Enchantment.PROTECTION_FIRE,1,5)); |
||||
leather_pants.add(new StoreValues(0.032,Enchantment.PROTECTION_ENVIRONMENTAL,2,5)); |
||||
leather_pants.add(new StoreValues(0.0001,Enchantment.PROTECTION_EXPLOSIONS,2,5)); |
||||
leather_tunic.add(new StoreValues(0.442,Enchantment.PROTECTION_ENVIRONMENTAL,1,5)); |
||||
leather_tunic.add(new StoreValues(0.140,Enchantment.PROTECTION_PROJECTILE,2,5)); |
||||
leather_tunic.add(new StoreValues(0.102,Enchantment.PROTECTION_PROJECTILE,1,5)); |
||||
leather_tunic.add(new StoreValues(0.094,Enchantment.PROTECTION_EXPLOSIONS,1,5)); |
||||
leather_tunic.add(new StoreValues(0.079,Enchantment.PROTECTION_FIRE,1,5)); |
||||
leather_tunic.add(new StoreValues(0.053,Enchantment.THORNS,1,5)); |
||||
leather_tunic.add(new StoreValues(0.028,Enchantment.PROTECTION_ENVIRONMENTAL,2,5)); |
||||
leather_tunic.add(new StoreValues(0.001,Enchantment.PROTECTION_EXPLOSIONS,2,5)); |
||||
iron_shovel.add(new StoreValues(0.506,Enchantment.DIG_SPEED,1,5)); |
||||
iron_shovel.add(new StoreValues(0.355,Enchantment.DURABILITY,1,5)); |
||||
iron_shovel.add(new StoreValues(0.126,Enchantment.DIG_SPEED,2,5)); |
||||
iron_shovel.add(new StoreValues(0.06,Enchantment.DURABILITY,2,5)); |
||||
iron_boots.add(new StoreValues(0.41,Enchantment.PROTECTION_ENVIRONMENTAL,1,5)); |
||||
iron_boots.add(new StoreValues(0.265,Enchantment.PROTECTION_FALL,1,5)); |
||||
iron_boots.add(new StoreValues(0.143,Enchantment.PROTECTION_PROJECTILE,1,5)); |
||||
iron_boots.add(new StoreValues(0.082,Enchantment.PROTECTION_EXPLOSIONS,1,5)); |
||||
iron_boots.add(new StoreValues(0.065,Enchantment.PROTECTION_PROJECTILE,2,5)); |
||||
iron_boots.add(new StoreValues(0.022,Enchantment.PROTECTION_FIRE,1,5)); |
||||
iron_boots.add(new StoreValues(0.006,Enchantment.PROTECTION_FALL,2,5)); |
||||
iron_pickaxe.add(new StoreValues(0.504,Enchantment.DIG_SPEED,1,5)); |
||||
iron_pickaxe.add(new StoreValues(0.354,Enchantment.DURABILITY,1,5)); |
||||
iron_pickaxe.add(new StoreValues(0.129,Enchantment.DIG_SPEED,2,5)); |
||||
iron_pickaxe.add(new StoreValues(0.06,Enchantment.DURABILITY,2,5)); |
||||
iron_helmet.add(new StoreValues(0.471,Enchantment.PROTECTION_ENVIRONMENTAL,1,5)); |
||||
iron_helmet.add(new StoreValues(0.161,Enchantment.WATER_WORKER,1,5)); |
||||
iron_helmet.add(new StoreValues(0.16,Enchantment.PROTECTION_PROJECTILE,1,5)); |
||||
iron_helmet.add(new StoreValues(0.092,Enchantment.PROTECTION_EXPLOSIONS,1,5)); |
||||
iron_helmet.add(new StoreValues(0.072,Enchantment.PROTECTION_PROJECTILE,2,5)); |
||||
iron_helmet.add(new StoreValues(0.022,Enchantment.PROTECTION_FIRE,1,5)); |
||||
iron_helmet.add(new StoreValues(0.015,Enchantment.OXYGEN,1,5)); |
||||
golden_shovel.add(new StoreValues(0.364,Enchantment.DIG_SPEED,2,5)); |
||||
golden_shovel.add(new StoreValues(0.256,Enchantment.DIG_SPEED,1,5)); |
||||
golden_shovel.add(new StoreValues(0.253,Enchantment.DURABILITY,1,5)); |
||||
golden_shovel.add(new StoreValues(0.101,Enchantment.DURABILITY,2,5)); |
||||
golden_shovel.add(new StoreValues(0.01,Enchantment.LOOT_BONUS_BLOCKS,1,5)); |
||||
golden_shovel.add(new StoreValues(0.006,Enchantment.SILK_TOUCH,1,5)); |
||||
iron_leggings.add(new StoreValues(0.523,Enchantment.PROTECTION_ENVIRONMENTAL,1,5)); |
||||
iron_leggings.add(new StoreValues(0.178,Enchantment.PROTECTION_PROJECTILE,1,5)); |
||||
iron_leggings.add(new StoreValues(0.101,Enchantment.PROTECTION_EXPLOSIONS,1,5)); |
||||
iron_leggings.add(new StoreValues(0.083,Enchantment.PROTECTION_PROJECTILE,2,5)); |
||||
iron_leggings.add(new StoreValues(0.025,Enchantment.PROTECTION_FIRE,1,5)); |
||||
diamond_shovel.add(new StoreValues(0.623,Enchantment.DIG_SPEED,1,5)); |
||||
diamond_shovel.add(new StoreValues(0.356,Enchantment.DURABILITY,1,5)); |
||||
diamond_shovel.add(new StoreValues(0.014,Enchantment.DIG_SPEED,2,5)); |
||||
golden_boots.add(new StoreValues(0.187,Enchantment.PROTECTION_ENVIRONMENTAL,2,5)); |
||||
golden_boots.add(new StoreValues(0.158,Enchantment.PROTECTION_ENVIRONMENTAL,1,5)); |
||||
golden_boots.add(new StoreValues(0.155,Enchantment.PROTECTION_FALL,2,5)); |
||||
golden_boots.add(new StoreValues(0.131,Enchantment.PROTECTION_FIRE,1,5)); |
||||
golden_boots.add(new StoreValues(0.112,Enchantment.PROTECTION_PROJECTILE,2,5)); |
||||
golden_boots.add(new StoreValues(0.082,Enchantment.PROTECTION_FALL,1,5)); |
||||
golden_boots.add(new StoreValues(0.042,Enchantment.PROTECTION_EXPLOSIONS,1,5)); |
||||
golden_boots.add(new StoreValues(0.033,Enchantment.PROTECTION_PROJECTILE,3,5)); |
||||
golden_boots.add(new StoreValues(0.030,Enchantment.PROTECTION_EXPLOSIONS,2,5)); |
||||
golden_boots.add(new StoreValues(0.026,Enchantment.PROTECTION_PROJECTILE,1,5)); |
||||
golden_boots.add(new StoreValues(0.023,Enchantment.PROTECTION_FALL,3,5)); |
||||
golden_boots.add(new StoreValues(0.005,Enchantment.PROTECTION_FIRE,2,5)); |
||||
iron_chestplate.add(new StoreValues(0.525,Enchantment.PROTECTION_ENVIRONMENTAL,1,5)); |
||||
iron_chestplate.add(new StoreValues(0.172,Enchantment.PROTECTION_PROJECTILE,1,5)); |
||||
iron_chestplate.add(new StoreValues(0.10,Enchantment.PROTECTION_EXPLOSIONS,1,5)); |
||||
iron_chestplate.add(new StoreValues(0.083,Enchantment.PROTECTION_PROJECTILE,2,5)); |
||||
iron_chestplate.add(new StoreValues(0.025,Enchantment.PROTECTION_FIRE,1,5)); |
||||
iron_chestplate.add(new StoreValues(0.019,Enchantment.THORNS,1,5)); |
||||
golden_helmet.add(new StoreValues(0.189,Enchantment.PROTECTION_ENVIRONMENTAL,2,5)); |
||||
golden_helmet.add(new StoreValues(0.175,Enchantment.PROTECTION_ENVIRONMENTAL,1,5)); |
||||
golden_helmet.add(new StoreValues(0.134,Enchantment.WATER_WORKER,1,5)); |
||||
golden_helmet.add(new StoreValues(0.132,Enchantment.PROTECTION_FIRE,1,5)); |
||||
golden_helmet.add(new StoreValues(0.118,Enchantment.PROTECTION_PROJECTILE,2,5)); |
||||
golden_helmet.add(new StoreValues(0.101,Enchantment.OXYGEN,1,5)); |
||||
golden_helmet.add(new StoreValues(0.042,Enchantment.PROTECTION_EXPLOSIONS,1,5)); |
||||
golden_helmet.add(new StoreValues(0.038,Enchantment.PROTECTION_PROJECTILE,3,5)); |
||||
golden_helmet.add(new StoreValues(0.03,Enchantment.PROTECTION_PROJECTILE,2,5)); |
||||
golden_helmet.add(new StoreValues(0.028,Enchantment.PROTECTION_EXPLOSIONS,2,5)); |
||||
golden_helmet.add(new StoreValues(0.004,Enchantment.PROTECTION_FIRE,2,5)); |
||||
golden_helmet.add(new StoreValues(0.001,Enchantment.OXYGEN,2,5)); |
||||
diamond_pickaxe.add(new StoreValues(0.618,Enchantment.DIG_SPEED,1,5)); |
||||
diamond_pickaxe.add(new StoreValues(0.361,Enchantment.DURABILITY,1,5)); |
||||
diamond_pickaxe.add(new StoreValues(0.16,Enchantment.DIG_SPEED,2,5)); |
||||
diamond_boots.add(new StoreValues(0.413,Enchantment.PROTECTION_ENVIRONMENTAL,1,5)); |
||||
diamond_boots.add(new StoreValues(0.264,Enchantment.PROTECTION_FALL,1,5)); |
||||
diamond_boots.add(new StoreValues(0.137,Enchantment.PROTECTION_PROJECTILE,1,5)); |
||||
diamond_boots.add(new StoreValues(0.081,Enchantment.PROTECTION_EXPLOSIONS,1,5)); |
||||
diamond_boots.add(new StoreValues(0.069,Enchantment.PROTECTION_PROJECTILE,2,5)); |
||||
diamond_boots.add(new StoreValues(0.021,Enchantment.PROTECTION_FIRE,1,5)); |
||||
diamond_boots.add(new StoreValues(0.007,Enchantment.PROTECTION_FALL,2,5)); |
||||
golden_leggings.add(new StoreValues(0.231,Enchantment.PROTECTION_ENVIRONMENTAL,2,5)); |
||||
golden_leggings.add(new StoreValues(0.199,Enchantment.PROTECTION_ENVIRONMENTAL,1,5)); |
||||
golden_leggings.add(new StoreValues(0.151,Enchantment.PROTECTION_FIRE,1,5)); |
||||
golden_leggings.add(new StoreValues(0.138,Enchantment.PROTECTION_PROJECTILE,2,5)); |
||||
golden_leggings.add(new StoreValues(0.05,Enchantment.PROTECTION_EXPLOSIONS,1,5)); |
||||
golden_leggings.add(new StoreValues(0.042,Enchantment.PROTECTION_PROJECTILE,3,5)); |
||||
golden_leggings.add(new StoreValues(0.041,Enchantment.PROTECTION_PROJECTILE,1,5)); |
||||
golden_leggings.add(new StoreValues(0.029,Enchantment.PROTECTION_EXPLOSIONS,2,5)); |
||||
golden_leggings.add(new StoreValues(0.006,Enchantment.PROTECTION_FIRE,2,5)); |
||||
golden_chestplate.add(new StoreValues(0.211,Enchantment.PROTECTION_ENVIRONMENTAL,2,5)); |
||||
golden_chestplate.add(new StoreValues(0.192,Enchantment.PROTECTION_ENVIRONMENTAL,1,5)); |
||||
golden_chestplate.add(new StoreValues(0.147,Enchantment.PROTECTION_FIRE,1,5)); |
||||
golden_chestplate.add(new StoreValues(0.129,Enchantment.PROTECTION_PROJECTILE,2,5)); |
||||
golden_chestplate.add(new StoreValues(0.129,Enchantment.THORNS,1,5)); |
||||
golden_chestplate.add(new StoreValues(0.049,Enchantment.PROTECTION_EXPLOSIONS,1,5)); |
||||
golden_chestplate.add(new StoreValues(0.042,Enchantment.PROTECTION_PROJECTILE,3,5)); |
||||
golden_chestplate.add(new StoreValues(0.034,Enchantment.PROTECTION_EXPLOSIONS,2,5)); |
||||
golden_chestplate.add(new StoreValues(0.032,Enchantment.PROTECTION_ENVIRONMENTAL,1,5)); |
||||
golden_chestplate.add(new StoreValues(0.005,Enchantment.PROTECTION_FIRE,2,5)); |
||||
diamond_helmet.add(new StoreValues(0.471,Enchantment.PROTECTION_ENVIRONMENTAL,1,5)); |
||||
diamond_helmet.add(new StoreValues(0.158,Enchantment.WATER_WORKER,1,5)); |
||||
diamond_helmet.add(new StoreValues(0.153,Enchantment.PROTECTION_PROJECTILE,1,5)); |
||||
diamond_helmet.add(new StoreValues(0.096,Enchantment.PROTECTION_EXPLOSIONS,1,5)); |
||||
diamond_helmet.add(new StoreValues(0.076,Enchantment.PROTECTION_PROJECTILE,2,5)); |
||||
diamond_helmet.add(new StoreValues(0.023,Enchantment.PROTECTION_FIRE,1,5)); |
||||
diamond_helmet.add(new StoreValues(0.015,Enchantment.OXYGEN,1,5)); |
||||
diamond_leggings.add(new StoreValues(0.519,Enchantment.PROTECTION_ENVIRONMENTAL,1,5)); |
||||
diamond_leggings.add(new StoreValues(0.178,Enchantment.PROTECTION_PROJECTILE,1,5)); |
||||
diamond_leggings.add(new StoreValues(0.102,Enchantment.PROTECTION_EXPLOSIONS,1,5)); |
||||
diamond_leggings.add(new StoreValues(0.087,Enchantment.PROTECTION_PROJECTILE,2,5)); |
||||
diamond_leggings.add(new StoreValues(0.024,Enchantment.PROTECTION_FIRE,1,5)); |
||||
diamond_chestplate.add(new StoreValues(0.512,Enchantment.PROTECTION_ENVIRONMENTAL,1,5)); |
||||
diamond_chestplate.add(new StoreValues(0.176,Enchantment.PROTECTION_PROJECTILE,1,5)); |
||||
diamond_chestplate.add(new StoreValues(0.104,Enchantment.PROTECTION_EXPLOSIONS,1,5)); |
||||
diamond_chestplate.add(new StoreValues(0.081,Enchantment.PROTECTION_PROJECTILE,2,5)); |
||||
diamond_chestplate.add(new StoreValues(0.026,Enchantment.PROTECTION_FIRE,1,5)); |
||||
diamond_chestplate.add(new StoreValues(0.021,Enchantment.THORNS,1,5)); |
||||
wood_sword.add(new StoreValues(0.333,Enchantment.DAMAGE_ALL,1,5)); |
||||
wood_sword.add(new StoreValues(0.241,Enchantment.KNOCKBACK,1,5)); |
||||
wood_sword.add(new StoreValues(0.180,Enchantment.DAMAGE_ARTHROPODS,1,5)); |
||||
wood_sword.add(new StoreValues(0.173,Enchantment.DAMAGE_UNDEAD,1,5)); |
||||
wood_sword.add(new StoreValues(0.035,Enchantment.FIRE_ASPECT,1,5)); |
||||
wood_sword.add(new StoreValues(0.026,Enchantment.DAMAGE_ALL,2,5)); |
||||
wood_sword.add(new StoreValues(0.003,Enchantment.DAMAGE_ARTHROPODS,2,5)); |
||||
wood_sword.add(new StoreValues(0.002,Enchantment.DAMAGE_UNDEAD,2,5)); |
||||
bow.add(new StoreValues(0.926,Enchantment.ARROW_DAMAGE,1,5)); |
||||
iron_sword.add(new StoreValues(0.333,Enchantment.DAMAGE_ALL,1,5)); |
||||
iron_sword.add(new StoreValues(0.241,Enchantment.KNOCKBACK,1,5)); |
||||
iron_sword.add(new StoreValues(0.180,Enchantment.DAMAGE_ARTHROPODS,1,5)); |
||||
iron_sword.add(new StoreValues(0.173,Enchantment.DAMAGE_UNDEAD,1,5)); |
||||
iron_sword.add(new StoreValues(0.035,Enchantment.FIRE_ASPECT,1,5)); |
||||
iron_sword.add(new StoreValues(0.026,Enchantment.DAMAGE_ALL,2,5)); |
||||
iron_sword.add(new StoreValues(0.003,Enchantment.DAMAGE_ARTHROPODS,2,5)); |
||||
iron_sword.add(new StoreValues(0.002,Enchantment.DAMAGE_UNDEAD,2,5)); |
||||
gold_sword.add(new StoreValues(0.333,Enchantment.KNOCKBACK,1,5)); |
||||
gold_sword.add(new StoreValues(0.241,Enchantment.DAMAGE_ALL,1,5)); |
||||
gold_sword.add(new StoreValues(0.180,Enchantment.DAMAGE_ALL,2,5)); |
||||
gold_sword.add(new StoreValues(0.173,Enchantment.DAMAGE_ARTHROPODS,1,5)); |
||||
gold_sword.add(new StoreValues(0.035,Enchantment.DAMAGE_UNDEAD,1,5)); |
||||
gold_sword.add(new StoreValues(0.026,Enchantment.FIRE_ASPECT,1,5)); |
||||
gold_sword.add(new StoreValues(0.003,Enchantment.DAMAGE_UNDEAD,2,5)); |
||||
gold_sword.add(new StoreValues(0.002,Enchantment.DAMAGE_ARTHROPODS,2,5)); |
||||
gold_sword.add(new StoreValues(0.002,Enchantment.LOOT_BONUS_MOBS,1,5)); |
||||
diamond_sword.add(new StoreValues(0.365,Enchantment.DAMAGE_ALL,1,5)); |
||||
diamond_sword.add(new StoreValues(0.247,Enchantment.KNOCKBACK,1,5)); |
||||
diamond_sword.add(new StoreValues(0.187,Enchantment.DAMAGE_ARTHROPODS,1,5)); |
||||
diamond_sword.add(new StoreValues(0.185,Enchantment.DAMAGE_UNDEAD,1,5)); |
||||
diamond_sword.add(new StoreValues(0.01,Enchantment.FIRE_ASPECT,1,5)); |
||||
stone_hoe.add(new StoreValues(0.359,Enchantment.DURABILITY,2,10)); |
||||
stone_shovel.add(new StoreValues(0.575,Enchantment.DIG_SPEED,2,10)); |
||||
stone_shovel.add(new StoreValues(0.255,Enchantment.DURABILITY,1,10)); |
||||
stone_shovel.add(new StoreValues(0.118,Enchantment.DURABILITY,2,10)); |
||||
stone_shovel.add(new StoreValues(0.04,Enchantment.DIG_SPEED,1,10)); |
||||
stone_shovel.add(new StoreValues(0.01,Enchantment.LOOT_BONUS_BLOCKS,1,10)); |
||||
stone_shovel.add(new StoreValues(0.01,Enchantment.SILK_TOUCH,1,10)); |
||||
stone_pickaxe.add(new StoreValues(0.575,Enchantment.DIG_SPEED,2,10)); |
||||
stone_pickaxe.add(new StoreValues(0.255,Enchantment.DURABILITY,1,10)); |
||||
stone_pickaxe.add(new StoreValues(0.118,Enchantment.DURABILITY,2,10)); |
||||
stone_pickaxe.add(new StoreValues(0.04,Enchantment.DIG_SPEED,1,10)); |
||||
stone_pickaxe.add(new StoreValues(0.01,Enchantment.LOOT_BONUS_BLOCKS,1,10)); |
||||
stone_pickaxe.add(new StoreValues(0.01,Enchantment.SILK_TOUCH,1,10)); |
||||
leather_boots.add(new StoreValues(0.305,Enchantment.PROTECTION_ENVIRONMENTAL,2,10)); |
||||
leather_boots.add(new StoreValues(0.237,Enchantment.PROTECTION_FALL,2,10)); |
||||
leather_boots.add(new StoreValues(0.152,Enchantment.PROTECTION_FIRE,1,10)); |
||||
leather_boots.add(new StoreValues(0.104,Enchantment.PROTECTION_PROJECTILE,2,10)); |
||||
leather_boots.add(new StoreValues(0.062,Enchantment.PROTECTION_PROJECTILE,3,10)); |
||||
leather_boots.add(new StoreValues(0.05,Enchantment.PROTECTION_EXPLOSIONS,2,10)); |
||||
leather_boots.add(new StoreValues(0.027,Enchantment.PROTECTION_FALL,3,10)); |
||||
leather_boots.add(new StoreValues(0.025,Enchantment.PROTECTION_ENVIRONMENTAL,1,10)); |
||||
leather_boots.add(new StoreValues(0.013,Enchantment.PROTECTION_EXPLOSIONS,1,10)); |
||||
leather_boots.add(new StoreValues(0.004,Enchantment.PROTECTION_FIRE,2,10)); |
||||
leather_boots.add(new StoreValues(0.003,Enchantment.PROTECTION_FALL,1,10)); |
||||
leather_cap.add(new StoreValues(0.405,Enchantment.PROTECTION_ENVIRONMENTAL,1,10)); |
||||
leather_cap.add(new StoreValues(0.146,Enchantment.WATER_WORKER,1,10)); |
||||
leather_cap.add(new StoreValues(0.119,Enchantment.PROTECTION_PROJECTILE,2,10)); |
||||
leather_cap.add(new StoreValues(0.094,Enchantment.PROTECTION_PROJECTILE,1,10)); |
||||
leather_cap.add(new StoreValues(0.082,Enchantment.PROTECTION_EXPLOSIONS,1,10)); |
||||
leather_cap.add(new StoreValues(0.069,Enchantment.PROTECTION_FIRE,1,10)); |
||||
leather_cap.add(new StoreValues(0.048,Enchantment.OXYGEN,1,10)); |
||||
leather_cap.add(new StoreValues(0.029,Enchantment.PROTECTION_ENVIRONMENTAL,2,10)); |
||||
leather_cap.add(new StoreValues(0.0001,Enchantment.PROTECTION_EXPLOSIONS,2,10)); |
||||
leather_pants.add(new StoreValues(0.451,Enchantment.PROTECTION_ENVIRONMENTAL,1,10)); |
||||
leather_pants.add(new StoreValues(0.135,Enchantment.PROTECTION_PROJECTILE,2,10)); |
||||
leather_pants.add(new StoreValues(0.104,Enchantment.PROTECTION_PROJECTILE,1,10)); |
||||
leather_pants.add(new StoreValues(0.100,Enchantment.PROTECTION_EXPLOSIONS,1,10)); |
||||
leather_pants.add(new StoreValues(0.079,Enchantment.PROTECTION_FIRE,1,10)); |
||||
leather_pants.add(new StoreValues(0.032,Enchantment.PROTECTION_ENVIRONMENTAL,2,10)); |
||||
leather_pants.add(new StoreValues(0.0001,Enchantment.PROTECTION_EXPLOSIONS,2,10)); |
||||
leather_tunic.add(new StoreValues(0.442,Enchantment.PROTECTION_ENVIRONMENTAL,1,10)); |
||||
leather_tunic.add(new StoreValues(0.140,Enchantment.PROTECTION_PROJECTILE,2,10)); |
||||
leather_tunic.add(new StoreValues(0.102,Enchantment.PROTECTION_PROJECTILE,1,10)); |
||||
leather_tunic.add(new StoreValues(0.094,Enchantment.PROTECTION_EXPLOSIONS,1,10)); |
||||
leather_tunic.add(new StoreValues(0.079,Enchantment.PROTECTION_FIRE,1,10)); |
||||
leather_tunic.add(new StoreValues(0.053,Enchantment.THORNS,1,10)); |
||||
leather_tunic.add(new StoreValues(0.028,Enchantment.PROTECTION_ENVIRONMENTAL,2,10)); |
||||
leather_tunic.add(new StoreValues(0.001,Enchantment.PROTECTION_EXPLOSIONS,2,10)); |
||||
iron_shovel.add(new StoreValues(0.506,Enchantment.DIG_SPEED,1,10)); |
||||
iron_shovel.add(new StoreValues(0.355,Enchantment.DURABILITY,1,10)); |
||||
iron_shovel.add(new StoreValues(0.126,Enchantment.DIG_SPEED,2,10)); |
||||
iron_shovel.add(new StoreValues(0.06,Enchantment.DURABILITY,2,10)); |
||||
iron_boots.add(new StoreValues(0.41,Enchantment.PROTECTION_ENVIRONMENTAL,1,10)); |
||||
iron_boots.add(new StoreValues(0.265,Enchantment.PROTECTION_FALL,1,10)); |
||||
iron_boots.add(new StoreValues(0.143,Enchantment.PROTECTION_PROJECTILE,1,10)); |
||||
iron_boots.add(new StoreValues(0.082,Enchantment.PROTECTION_EXPLOSIONS,1,10)); |
||||
iron_boots.add(new StoreValues(0.065,Enchantment.PROTECTION_PROJECTILE,2,10)); |
||||
iron_boots.add(new StoreValues(0.022,Enchantment.PROTECTION_FIRE,1,10)); |
||||
iron_boots.add(new StoreValues(0.006,Enchantment.PROTECTION_FALL,2,10)); |
||||
iron_pickaxe.add(new StoreValues(0.504,Enchantment.DIG_SPEED,1,10)); |
||||
iron_pickaxe.add(new StoreValues(0.354,Enchantment.DURABILITY,1,10)); |
||||
iron_pickaxe.add(new StoreValues(0.129,Enchantment.DIG_SPEED,2,10)); |
||||
iron_pickaxe.add(new StoreValues(0.06,Enchantment.DURABILITY,2,10)); |
||||
iron_helmet.add(new StoreValues(0.471,Enchantment.PROTECTION_ENVIRONMENTAL,1,10)); |
||||
iron_helmet.add(new StoreValues(0.161,Enchantment.WATER_WORKER,1,10)); |
||||
iron_helmet.add(new StoreValues(0.16,Enchantment.PROTECTION_PROJECTILE,1,10)); |
||||
iron_helmet.add(new StoreValues(0.092,Enchantment.PROTECTION_EXPLOSIONS,1,10)); |
||||
iron_helmet.add(new StoreValues(0.072,Enchantment.PROTECTION_PROJECTILE,2,10)); |
||||
iron_helmet.add(new StoreValues(0.022,Enchantment.PROTECTION_FIRE,1,10)); |
||||
iron_helmet.add(new StoreValues(0.015,Enchantment.OXYGEN,1,10)); |
||||
golden_shovel.add(new StoreValues(0.364,Enchantment.DIG_SPEED,2,10)); |
||||
golden_shovel.add(new StoreValues(0.256,Enchantment.DIG_SPEED,1,10)); |
||||
golden_shovel.add(new StoreValues(0.253,Enchantment.DURABILITY,1,10)); |
||||
golden_shovel.add(new StoreValues(0.101,Enchantment.DURABILITY,2,10)); |
||||
golden_shovel.add(new StoreValues(0.01,Enchantment.LOOT_BONUS_BLOCKS,1,10)); |
||||
golden_shovel.add(new StoreValues(0.006,Enchantment.SILK_TOUCH,1,10)); |
||||
iron_leggings.add(new StoreValues(0.523,Enchantment.PROTECTION_ENVIRONMENTAL,1,10)); |
||||
iron_leggings.add(new StoreValues(0.178,Enchantment.PROTECTION_PROJECTILE,1,10)); |
||||
iron_leggings.add(new StoreValues(0.101,Enchantment.PROTECTION_EXPLOSIONS,1,10)); |
||||
iron_leggings.add(new StoreValues(0.083,Enchantment.PROTECTION_PROJECTILE,2,10)); |
||||
iron_leggings.add(new StoreValues(0.025,Enchantment.PROTECTION_FIRE,1,10)); |
||||
diamond_shovel.add(new StoreValues(0.623,Enchantment.DIG_SPEED,1,10)); |
||||
diamond_shovel.add(new StoreValues(0.356,Enchantment.DURABILITY,1,10)); |
||||
diamond_shovel.add(new StoreValues(0.014,Enchantment.DIG_SPEED,2,10)); |
||||
golden_boots.add(new StoreValues(0.187,Enchantment.PROTECTION_ENVIRONMENTAL,2,10)); |
||||
golden_boots.add(new StoreValues(0.158,Enchantment.PROTECTION_ENVIRONMENTAL,1,10)); |
||||
golden_boots.add(new StoreValues(0.155,Enchantment.PROTECTION_FALL,2,10)); |
||||
golden_boots.add(new StoreValues(0.131,Enchantment.PROTECTION_FIRE,1,10)); |
||||
golden_boots.add(new StoreValues(0.112,Enchantment.PROTECTION_PROJECTILE,2,10)); |
||||
golden_boots.add(new StoreValues(0.082,Enchantment.PROTECTION_FALL,1,10)); |
||||
golden_boots.add(new StoreValues(0.042,Enchantment.PROTECTION_EXPLOSIONS,1,10)); |
||||
golden_boots.add(new StoreValues(0.033,Enchantment.PROTECTION_PROJECTILE,3,10)); |
||||
golden_boots.add(new StoreValues(0.030,Enchantment.PROTECTION_EXPLOSIONS,2,10)); |
||||
golden_boots.add(new StoreValues(0.026,Enchantment.PROTECTION_PROJECTILE,1,10)); |
||||
golden_boots.add(new StoreValues(0.023,Enchantment.PROTECTION_FALL,3,10)); |
||||
golden_boots.add(new StoreValues(0.005,Enchantment.PROTECTION_FIRE,2,10)); |
||||
iron_chestplate.add(new StoreValues(0.525,Enchantment.PROTECTION_ENVIRONMENTAL,1,10)); |
||||
iron_chestplate.add(new StoreValues(0.172,Enchantment.PROTECTION_PROJECTILE,1,10)); |
||||
iron_chestplate.add(new StoreValues(0.10,Enchantment.PROTECTION_EXPLOSIONS,1,10)); |
||||
iron_chestplate.add(new StoreValues(0.083,Enchantment.PROTECTION_PROJECTILE,2,10)); |
||||
iron_chestplate.add(new StoreValues(0.025,Enchantment.PROTECTION_FIRE,1,10)); |
||||
iron_chestplate.add(new StoreValues(0.019,Enchantment.THORNS,1,10)); |
||||
golden_helmet.add(new StoreValues(0.189,Enchantment.PROTECTION_ENVIRONMENTAL,2,10)); |
||||
golden_helmet.add(new StoreValues(0.175,Enchantment.PROTECTION_ENVIRONMENTAL,1,10)); |
||||
golden_helmet.add(new StoreValues(0.134,Enchantment.WATER_WORKER,1,10)); |
||||
golden_helmet.add(new StoreValues(0.132,Enchantment.PROTECTION_FIRE,1,10)); |
||||
golden_helmet.add(new StoreValues(0.118,Enchantment.PROTECTION_PROJECTILE,2,10)); |
||||
golden_helmet.add(new StoreValues(0.101,Enchantment.OXYGEN,1,10)); |
||||
golden_helmet.add(new StoreValues(0.042,Enchantment.PROTECTION_EXPLOSIONS,1,10)); |
||||
golden_helmet.add(new StoreValues(0.038,Enchantment.PROTECTION_PROJECTILE,3,10)); |
||||
golden_helmet.add(new StoreValues(0.03,Enchantment.PROTECTION_PROJECTILE,2,10)); |
||||
golden_helmet.add(new StoreValues(0.028,Enchantment.PROTECTION_EXPLOSIONS,2,10)); |
||||
golden_helmet.add(new StoreValues(0.004,Enchantment.PROTECTION_FIRE,2,10)); |
||||
golden_helmet.add(new StoreValues(0.001,Enchantment.OXYGEN,2,10)); |
||||
diamond_pickaxe.add(new StoreValues(0.618,Enchantment.DIG_SPEED,1,10)); |
||||
diamond_pickaxe.add(new StoreValues(0.361,Enchantment.DURABILITY,1,10)); |
||||
diamond_pickaxe.add(new StoreValues(0.16,Enchantment.DIG_SPEED,2,10)); |
||||
diamond_boots.add(new StoreValues(0.413,Enchantment.PROTECTION_ENVIRONMENTAL,1,10)); |
||||
diamond_boots.add(new StoreValues(0.264,Enchantment.PROTECTION_FALL,1,10)); |
||||
diamond_boots.add(new StoreValues(0.137,Enchantment.PROTECTION_PROJECTILE,1,10)); |
||||
diamond_boots.add(new StoreValues(0.081,Enchantment.PROTECTION_EXPLOSIONS,1,10)); |
||||
diamond_boots.add(new StoreValues(0.069,Enchantment.PROTECTION_PROJECTILE,2,10)); |
||||
diamond_boots.add(new StoreValues(0.021,Enchantment.PROTECTION_FIRE,1,10)); |
||||
diamond_boots.add(new StoreValues(0.007,Enchantment.PROTECTION_FALL,2,10)); |
||||
golden_leggings.add(new StoreValues(0.231,Enchantment.PROTECTION_ENVIRONMENTAL,2,10)); |
||||
golden_leggings.add(new StoreValues(0.199,Enchantment.PROTECTION_ENVIRONMENTAL,1,10)); |
||||
golden_leggings.add(new StoreValues(0.151,Enchantment.PROTECTION_FIRE,1,10)); |
||||
golden_leggings.add(new StoreValues(0.138,Enchantment.PROTECTION_PROJECTILE,2,10)); |
||||
golden_leggings.add(new StoreValues(0.05,Enchantment.PROTECTION_EXPLOSIONS,1,10)); |
||||
golden_leggings.add(new StoreValues(0.042,Enchantment.PROTECTION_PROJECTILE,3,10)); |
||||
golden_leggings.add(new StoreValues(0.041,Enchantment.PROTECTION_PROJECTILE,1,10)); |
||||
golden_leggings.add(new StoreValues(0.029,Enchantment.PROTECTION_EXPLOSIONS,2,10)); |
||||
golden_leggings.add(new StoreValues(0.006,Enchantment.PROTECTION_FIRE,2,10)); |
||||
golden_chestplate.add(new StoreValues(0.211,Enchantment.PROTECTION_ENVIRONMENTAL,2,10)); |
||||
golden_chestplate.add(new StoreValues(0.192,Enchantment.PROTECTION_ENVIRONMENTAL,1,10)); |
||||
golden_chestplate.add(new StoreValues(0.147,Enchantment.PROTECTION_FIRE,1,10)); |
||||
golden_chestplate.add(new StoreValues(0.129,Enchantment.PROTECTION_PROJECTILE,2,10)); |
||||
golden_chestplate.add(new StoreValues(0.129,Enchantment.THORNS,1,10)); |
||||
golden_chestplate.add(new StoreValues(0.049,Enchantment.PROTECTION_EXPLOSIONS,1,10)); |
||||
golden_chestplate.add(new StoreValues(0.042,Enchantment.PROTECTION_PROJECTILE,3,10)); |
||||
golden_chestplate.add(new StoreValues(0.034,Enchantment.PROTECTION_EXPLOSIONS,2,10)); |
||||
golden_chestplate.add(new StoreValues(0.032,Enchantment.PROTECTION_ENVIRONMENTAL,1,10)); |
||||
golden_chestplate.add(new StoreValues(0.005,Enchantment.PROTECTION_FIRE,2,10)); |
||||
diamond_helmet.add(new StoreValues(0.471,Enchantment.PROTECTION_ENVIRONMENTAL,1,10)); |
||||
diamond_helmet.add(new StoreValues(0.158,Enchantment.WATER_WORKER,1,10)); |
||||
diamond_helmet.add(new StoreValues(0.153,Enchantment.PROTECTION_PROJECTILE,1,10)); |
||||
diamond_helmet.add(new StoreValues(0.096,Enchantment.PROTECTION_EXPLOSIONS,1,10)); |
||||
diamond_helmet.add(new StoreValues(0.076,Enchantment.PROTECTION_PROJECTILE,2,10)); |
||||
diamond_helmet.add(new StoreValues(0.023,Enchantment.PROTECTION_FIRE,1,10)); |
||||
diamond_helmet.add(new StoreValues(0.015,Enchantment.OXYGEN,1,10)); |
||||
diamond_leggings.add(new StoreValues(0.519,Enchantment.PROTECTION_ENVIRONMENTAL,1,10)); |
||||
diamond_leggings.add(new StoreValues(0.178,Enchantment.PROTECTION_PROJECTILE,1,10)); |
||||
diamond_leggings.add(new StoreValues(0.102,Enchantment.PROTECTION_EXPLOSIONS,1,10)); |
||||
diamond_leggings.add(new StoreValues(0.087,Enchantment.PROTECTION_PROJECTILE,2,10)); |
||||
diamond_leggings.add(new StoreValues(0.024,Enchantment.PROTECTION_FIRE,1,10)); |
||||
diamond_chestplate.add(new StoreValues(0.512,Enchantment.PROTECTION_ENVIRONMENTAL,1,10)); |
||||
diamond_chestplate.add(new StoreValues(0.176,Enchantment.PROTECTION_PROJECTILE,1,10)); |
||||
diamond_chestplate.add(new StoreValues(0.104,Enchantment.PROTECTION_EXPLOSIONS,1,10)); |
||||
diamond_chestplate.add(new StoreValues(0.081,Enchantment.PROTECTION_PROJECTILE,2,10)); |
||||
diamond_chestplate.add(new StoreValues(0.026,Enchantment.PROTECTION_FIRE,1,10)); |
||||
diamond_chestplate.add(new StoreValues(0.021,Enchantment.THORNS,1,10)); |
||||
} |
||||
} |
@ -0,0 +1,26 @@ |
||||
package me.kaZep.Base; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.UUID; |
||||
|
||||
import org.bukkit.Bukkit; |
||||
import org.bukkit.entity.Entity; |
||||
import org.bukkit.entity.Player; |
||||
|
||||
public class EntityHitData { |
||||
public List<UUID> id; |
||||
Player p; |
||||
public long registeredtime; |
||||
public EntityHitData(Player p) { |
||||
this.p=p; |
||||
id = new ArrayList<UUID>(); |
||||
registeredtime = Bukkit.getWorld("world").getFullTime()+1200; |
||||
} |
||||
public List<UUID> getEntities() { |
||||
return id; |
||||
} |
||||
public Player getPlayer() { |
||||
return p; |
||||
} |
||||
} |
@ -0,0 +1,29 @@ |
||||
package me.kaZep.Base; |
||||
|
||||
import java.util.UUID; |
||||
|
||||
import org.bukkit.Bukkit; |
||||
|
||||
public class EntityInteractData { |
||||
UUID entityid; |
||||
String entityowner; |
||||
long removetime; |
||||
public EntityInteractData(UUID id, String owner) { |
||||
this.entityid=id; |
||||
this.entityowner=owner; |
||||
removetime=Bukkit.getWorld("world").getFullTime()+3000; |
||||
} |
||||
public long getTime() { |
||||
return removetime; |
||||
} |
||||
public String getOwner() { |
||||
return entityowner; |
||||
} |
||||
public UUID getID() { |
||||
return entityid; |
||||
} |
||||
public void setOwner(String owner) { |
||||
this.entityowner=owner; |
||||
removetime=Bukkit.getWorld("world").getFullTime()+3000; |
||||
} |
||||
} |
@ -0,0 +1,36 @@ |
||||
package me.kaZep.Base; |
||||
|
||||
import org.bukkit.Bukkit; |
||||
import org.bukkit.Material; |
||||
|
||||
public class ExplorerData { |
||||
String player; |
||||
double xprevious,zprevious; |
||||
double xlookprevious,zlookprevious; |
||||
Material lasttype; |
||||
Material lastinteract, awardinteract; |
||||
int villagecriteria,templecriteria,cavecriteria,undergroundcriteria,nethercriteria; |
||||
int lastmap; |
||||
int lastmapemptycount; |
||||
float expamt; |
||||
int explv; |
||||
boolean wedied; |
||||
public ExplorerData(String playername, double xpos, double zpos) { |
||||
this.player=playername; |
||||
this.xprevious=xpos; |
||||
this.zprevious=zpos; |
||||
this.xlookprevious=xpos; |
||||
this.zlookprevious=zpos; |
||||
lasttype=Material.DIRT; |
||||
lastinteract=Material.DIRT; |
||||
awardinteract=Material.DIRT; |
||||
villagecriteria=100; |
||||
templecriteria=100; |
||||
cavecriteria=100; |
||||
undergroundcriteria=100; |
||||
nethercriteria=100; |
||||
this.expamt=Bukkit.getPlayer(playername).getExp(); |
||||
this.explv=Bukkit.getPlayer(playername).getLevel(); |
||||
this.wedied=false; |
||||
} |
||||
} |
@ -0,0 +1,42 @@ |
||||
package me.kaZep.Base; |
||||
|
||||
import org.bukkit.Bukkit; |
||||
import org.bukkit.Location; |
||||
import org.bukkit.block.Furnace; |
||||
|
||||
public class FurnaceData { |
||||
|
||||
Location pos; |
||||
String owner; |
||||
long time; |
||||
public FurnaceData(Location pos, String owner) { |
||||
this.pos=pos; |
||||
this.owner=owner; |
||||
this.time=Bukkit.getWorld("world").getFullTime()+9000; |
||||
} |
||||
|
||||
public void setOwner(String owner) { |
||||
this.owner=owner; |
||||
} |
||||
|
||||
public short getBurnTime() { |
||||
if ((Furnace)Bukkit.getWorld("world").getBlockAt(pos)!=null) { |
||||
Furnace furnace = (Furnace)Bukkit.getWorld("world").getBlockAt(pos).getState(); |
||||
return furnace.getBurnTime(); |
||||
} else { |
||||
return 0; |
||||
} |
||||
} |
||||
|
||||
public Location getLoc() { |
||||
return pos; |
||||
} |
||||
|
||||
public long getTime() { |
||||
return time; |
||||
} |
||||
public void resetTime() { |
||||
this.time=Bukkit.getWorld("world").getFullTime()+9000; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,12 @@ |
||||
package me.kaZep.Base; |
||||
|
||||
import java.util.UUID; |
||||
|
||||
public class InvisibilityData { |
||||
public UUID val = null; |
||||
public long resettime = 0; |
||||
public InvisibilityData(UUID id, long resettime) { |
||||
this.val=id; |
||||
this.resettime=resettime; |
||||
} |
||||
} |
@ -0,0 +1,75 @@ |
||||
package me.kaZep.Base; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.bukkit.Bukkit; |
||||
import org.bukkit.Material; |
||||
import org.bukkit.block.Block; |
||||
import org.bukkit.block.Jukebox; |
||||
import org.bukkit.entity.Player; |
||||
|
||||
public class JukeboxData { |
||||
Block jukebox; |
||||
Material disk; |
||||
int repeat; |
||||
int songduration; |
||||
long songtickstart; |
||||
double closestplayer=0; |
||||
public JukeboxData(Block box, Material disk, int loopamount, int duration, long currenttime) { |
||||
this.jukebox=box; |
||||
this.disk=disk; |
||||
this.repeat=loopamount; |
||||
this.songduration=duration; |
||||
this.songtickstart=currenttime; |
||||
} |
||||
public boolean Restart() { |
||||
this.songtickstart=Bukkit.getWorld("world").getFullTime(); |
||||
if (jukebox!=null) { |
||||
((Jukebox)jukebox.getState()).setPlaying(disk); |
||||
} else { |
||||
this.repeat=0; |
||||
} |
||||
this.repeat--; |
||||
if (this.repeat<=0) { |
||||
return false; |
||||
} else { |
||||
return true; |
||||
} |
||||
} |
||||
public void updateClosestPlayer() { |
||||
closestplayer=999999999; |
||||
List<Player> onlineplayers = Bukkit.getWorld("world").getPlayers(); |
||||
for (int k=0;k<onlineplayers.size();k++) { |
||||
double distance=Math.abs(jukebox.getX()-onlineplayers.get(k).getLocation().getX())+Math.abs(jukebox.getY()-onlineplayers.get(k).getLocation().getY())+Math.abs(jukebox.getZ()-onlineplayers.get(k).getLocation().getZ()); |
||||
if (distance<closestplayer) { |
||||
closestplayer=distance; |
||||
} |
||||
} |
||||
} |
||||
public void setDisk(Material newdisk) { |
||||
this.disk=newdisk; |
||||
this.repeat=100; |
||||
} |
||||
public Material getDisk() { |
||||
return disk; |
||||
} |
||||
public double getClosestPlayer() { |
||||
return closestplayer; |
||||
} |
||||
public long getSongStart() { |
||||
return songtickstart; |
||||
} |
||||
public int getSongDuration() { |
||||
return songduration; |
||||
} |
||||
public int getRepeatsRemaining() { |
||||
return this.repeat; |
||||
} |
||||
public Block getJukebox() { |
||||
if (jukebox!=null) { |
||||
return jukebox; |
||||
} else { |
||||
return null; |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,359 @@ |
||||
package me.kaZep.Base; |
||||
|
||||
import java.io.BufferedReader; |
||||
import java.io.File; |
||||
import java.io.IOException; |
||||
import java.io.InputStreamReader; |
||||
import java.io.OutputStreamWriter; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.net.Proxy; |
||||
import java.net.URL; |
||||
import java.net.URLConnection; |
||||
import java.net.URLEncoder; |
||||
import java.util.Collections; |
||||
import java.util.HashSet; |
||||
import java.util.Iterator; |
||||
import java.util.LinkedHashSet; |
||||
import java.util.Set; |
||||
import java.util.UUID; |
||||
import java.util.logging.Level; |
||||
import java.util.logging.Logger; |
||||
import org.bukkit.Bukkit; |
||||
import org.bukkit.Server; |
||||
import org.bukkit.configuration.InvalidConfigurationException; |
||||
import org.bukkit.configuration.file.YamlConfiguration; |
||||
import org.bukkit.configuration.file.YamlConfigurationOptions; |
||||
import org.bukkit.plugin.Plugin; |
||||
import org.bukkit.plugin.PluginDescriptionFile; |
||||
import org.bukkit.scheduler.BukkitScheduler; |
||||
|
||||
public class Metrics |
||||
{ |
||||
private static final int REVISION = 5; |
||||
private static final String BASE_URL = "http://mcstats.org"; |
||||
private static final String REPORT_URL = "/report/%s"; |
||||
private static final String CONFIG_FILE = "plugins/PluginMetrics/config.yml"; |
||||
private static final String CUSTOM_DATA_SEPARATOR = "~~"; |
||||
private static final int PING_INTERVAL = 10; |
||||
private final Plugin plugin; |
||||
private final Set<Graph> graphs = Collections.synchronizedSet(new HashSet()); |
||||
|
||||
private final Graph defaultGraph = new Graph("Default"); |
||||
private final YamlConfiguration configuration; |
||||
private final File configurationFile; |
||||
private final String guid; |
||||
private final Object optOutLock = new Object(); |
||||
|
||||
private volatile int taskId = -1; |
||||
|
||||
public Metrics(Plugin plugin) throws IOException { |
||||
if (plugin == null) { |
||||
throw new IllegalArgumentException("Plugin cannot be null"); |
||||
} |
||||
|
||||
this.plugin = plugin; |
||||
|
||||
this.configurationFile = new File("plugins/PluginMetrics/config.yml"); |
||||
this.configuration = YamlConfiguration.loadConfiguration(this.configurationFile); |
||||
|
||||
this.configuration.addDefault("opt-out", Boolean.valueOf(false)); |
||||
this.configuration.addDefault("guid", UUID.randomUUID().toString()); |
||||
|
||||
if (this.configuration.get("guid", null) == null) { |
||||
this.configuration.options().header("http://mcstats.org").copyDefaults(true); |
||||
this.configuration.save(this.configurationFile); |
||||
} |
||||
|
||||
this.guid = this.configuration.getString("guid"); |
||||
} |
||||
|
||||
public Graph createGraph(String name) |
||||
{ |
||||
if (name == null) { |
||||
throw new IllegalArgumentException("Graph name cannot be null"); |
||||
} |
||||
|
||||
Graph graph = new Graph(name); |
||||
|
||||
this.graphs.add(graph); |
||||
|
||||
return graph; |
||||
} |
||||
|
||||
public void addCustomData(Plotter plotter) |
||||
{ |
||||
if (plotter == null) { |
||||
throw new IllegalArgumentException("Plotter cannot be null"); |
||||
} |
||||
|
||||
this.defaultGraph.addPlotter(plotter); |
||||
|
||||
this.graphs.add(this.defaultGraph); |
||||
} |
||||
|
||||
public boolean start() |
||||
{ |
||||
synchronized (this.optOutLock) |
||||
{ |
||||
if (isOptOut()) { |
||||
return false; |
||||
} |
||||
|
||||
if (this.taskId >= 0) { |
||||
return true; |
||||
} |
||||
|
||||
this.taskId = this.plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(this.plugin, new Runnable() |
||||
{ |
||||
private boolean firstPost = true; |
||||
|
||||
public void run() |
||||
{ |
||||
try { |
||||
synchronized (Metrics.this.optOutLock) |
||||
{ |
||||
if ((Metrics.this.isOptOut()) && (Metrics.this.taskId > 0)) { |
||||
Metrics.this.plugin.getServer().getScheduler().cancelTask(Metrics.this.taskId); |
||||
Metrics.this.taskId = -1; |
||||
} |
||||
|
||||
} |
||||
|
||||
Metrics.this.postPlugin(!this.firstPost); |
||||
|
||||
this.firstPost = false; |
||||
} catch (IOException e) { |
||||
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + e.getMessage()); |
||||
} |
||||
} |
||||
} |
||||
, 0L, 12000L); |
||||
|
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public boolean isOptOut() |
||||
{ |
||||
synchronized (this.optOutLock) |
||||
{ |
||||
try { |
||||
this.configuration.load("plugins/PluginMetrics/config.yml"); |
||||
} catch (IOException ex) { |
||||
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage()); |
||||
return true; |
||||
} catch (InvalidConfigurationException ex) { |
||||
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage()); |
||||
return true; |
||||
} |
||||
return this.configuration.getBoolean("opt-out", false); |
||||
} |
||||
} |
||||
|
||||
public void enable() |
||||
throws IOException |
||||
{ |
||||
synchronized (this.optOutLock) |
||||
{ |
||||
if (isOptOut()) { |
||||
this.configuration.set("opt-out", Boolean.valueOf(false)); |
||||
this.configuration.save(this.configurationFile); |
||||
} |
||||
|
||||
if (this.taskId < 0) |
||||
start(); |
||||
} |
||||
} |
||||
|
||||
public void disable() |
||||
throws IOException |
||||
{ |
||||
synchronized (this.optOutLock) |
||||
{ |
||||
if (!isOptOut()) { |
||||
this.configuration.set("opt-out", Boolean.valueOf(true)); |
||||
this.configuration.save(this.configurationFile); |
||||
} |
||||
|
||||
if (this.taskId > 0) { |
||||
this.plugin.getServer().getScheduler().cancelTask(this.taskId); |
||||
this.taskId = -1; |
||||
} |
||||
} |
||||
} |
||||
|
||||
private void postPlugin(boolean isPing) |
||||
throws IOException |
||||
{ |
||||
PluginDescriptionFile description = this.plugin.getDescription(); |
||||
|
||||
StringBuilder data = new StringBuilder(); |
||||
data.append(encode("guid")).append('=').append(encode(this.guid)); |
||||
encodeDataPair(data, "version", description.getVersion()); |
||||
encodeDataPair(data, "server", Bukkit.getVersion()); |
||||
encodeDataPair(data, "players", Integer.toString(Bukkit.getServer().getOnlinePlayers().length)); |
||||
encodeDataPair(data, "revision", String.valueOf(5)); |
||||
|
||||
if (isPing) { |
||||
encodeDataPair(data, "ping", "true"); |
||||
} |
||||
|
||||
synchronized (this.graphs) { |
||||
Iterator iter = this.graphs.iterator(); |
||||
Iterator localIterator1; |
||||
for (; iter.hasNext(); |
||||
localIterator1.hasNext()) |
||||
{ |
||||
Graph graph = (Graph)iter.next(); |
||||
|
||||
localIterator1 = graph.getPlotters().iterator(); continue; |
||||
} |
||||
|
||||
} |
||||
|
||||
URL url = new URL("http://mcstats.org" + String.format("/report/%s", new Object[] { encode(this.plugin.getDescription().getName()) })); |
||||
URLConnection connection; |
||||
if (isMineshafterPresent()) |
||||
connection = url.openConnection(Proxy.NO_PROXY); |
||||
else { |
||||
connection = url.openConnection(); |
||||
} |
||||
|
||||
connection.setDoOutput(true); |
||||
|
||||
OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream()); |
||||
writer.write(data.toString()); |
||||
writer.flush(); |
||||
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); |
||||
String response = reader.readLine(); |
||||
|
||||
writer.close(); |
||||
reader.close(); |
||||
|
||||
if ((response == null) || (response.startsWith("ERR"))) { |
||||
throw new IOException(response); |
||||
} |
||||
|
||||
if (response.contains("OK This is your first update this hour")) |
||||
synchronized (this.graphs) { |
||||
Iterator iter = this.graphs.iterator(); |
||||
Iterator localIterator2; |
||||
for (; iter.hasNext(); |
||||
localIterator2.hasNext()) |
||||
{ |
||||
Graph graph = (Graph)iter.next(); |
||||
|
||||
localIterator2 = graph.getPlotters().iterator(); continue; |
||||
} |
||||
} |
||||
} |
||||
|
||||
private boolean isMineshafterPresent() |
||||
{ |
||||
try |
||||
{ |
||||
Class.forName("mineshafter.MineServer"); |
||||
return true; } catch (Exception e) { |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
private static void encodeDataPair(StringBuilder buffer, String key, String value) |
||||
throws UnsupportedEncodingException |
||||
{ |
||||
buffer.append('&').append(encode(key)).append('=').append(encode(value)); |
||||
} |
||||
|
||||
private static String encode(String text) |
||||
throws UnsupportedEncodingException |
||||
{ |
||||
return URLEncoder.encode(text, "UTF-8"); |
||||
} |
||||
|
||||
public static class Graph |
||||
{ |
||||
private final String name; |
||||
private final Set<Metrics.Plotter> plotters = new LinkedHashSet(); |
||||
|
||||
private Graph(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
public String getName() |
||||
{ |
||||
return this.name; |
||||
} |
||||
|
||||
public void addPlotter(Metrics.Plotter plotter) |
||||
{ |
||||
this.plotters.add(plotter); |
||||
} |
||||
|
||||
public void removePlotter(Metrics.Plotter plotter) |
||||
{ |
||||
this.plotters.remove(plotter); |
||||
} |
||||
|
||||
public Set<Metrics.Plotter> getPlotters() |
||||
{ |
||||
return Collections.unmodifiableSet(this.plotters); |
||||
} |
||||
|
||||
public int hashCode() |
||||
{ |
||||
return this.name.hashCode(); |
||||
} |
||||
|
||||
public boolean equals(Object object) |
||||
{ |
||||
if (!(object instanceof Graph)) { |
||||
return false; |
||||
} |
||||
|
||||
Graph graph = (Graph)object; |
||||
return graph.name.equals(this.name); |
||||
} |
||||
} |
||||
|
||||
public static abstract class Plotter |
||||
{ |
||||
private final String name; |
||||
|
||||
public Plotter() |
||||
{ |
||||
this("Default"); |
||||
} |
||||
|
||||
public Plotter(String name) |
||||
{ |
||||
this.name = name; |
||||
} |
||||
|
||||
public abstract int getValue(); |
||||
|
||||
public String getColumnName() |
||||
{ |
||||
return this.name; |
||||
} |
||||
|
||||
public void reset() |
||||
{ |
||||
} |
||||
|
||||
public int hashCode() |
||||
{ |
||||
return getColumnName().hashCode() + getValue(); |
||||
} |
||||
|
||||
public boolean equals(Object object) |
||||
{ |
||||
if (!(object instanceof Plotter)) { |
||||
return false; |
||||
} |
||||
|
||||
Plotter plotter = (Plotter)object; |
||||
return (plotter.name.equals(this.name)) && (plotter.getValue() == getValue()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,18 @@ |
||||
package me.kaZep.Base; |
||||
|
||||
import org.bukkit.Bukkit; |
||||
|
||||
public class PersistentExplorerList { |
||||
public String name; |
||||
public long expiretime; |
||||
public int event; |
||||
public float data; |
||||
public float data2; |
||||
//Event 0: Player used up their "second chance" life. 1 hour wait time.
|
||||
//Event 1: Stores the EXP value of a player who died.
|
||||
//Event 2: Simply says if this player has died recently or not.
|
||||
public PersistentExplorerList(String name) { |
||||
this.name=name; |
||||
this.expiretime=Bukkit.getWorld("world").getFullTime()+36000; |
||||
} |
||||
} |
@ -0,0 +1,237 @@ |
||||
package me.kaZep.Base; |
||||
|
||||
import java.text.DecimalFormat; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Collection; |
||||
import java.util.ConcurrentModificationException; |
||||
import java.util.Iterator; |
||||
import java.util.List; |
||||
|
||||
import org.bukkit.Bukkit; |
||||
import org.bukkit.ChatColor; |
||||
import org.bukkit.entity.Player; |
||||
import org.bukkit.potion.PotionEffect; |
||||
import org.bukkit.potion.PotionEffectType; |
||||
|
||||
public class PlayerBuffData { |
||||
Player p; |
||||
int base_spdlv; |
||||
int base_armorlv; |
||||
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; |
||||
public Main plugin; |
||||
|
||||
public String healthbar(double curHP,double maxHP) { |
||||
//█ ▌
|
||||
int bits=(int)(Math.ceil(curHP/maxHP*10)); |
||||
String bar=" "; |
||||
if (bits>6) { |
||||
bar+=ChatColor.GREEN+""; |
||||
} else |
||||
if (bits>3) { |
||||
bar+=ChatColor.YELLOW+""; |
||||
} else |
||||
{ |
||||
bar+=ChatColor.RED+""; |
||||
} |
||||
for (int i=0;i<bits/2;i++) { |
||||
bar+="█"; |
||||
} |
||||
if (bits%2!=0) { |
||||
bar+="▌"; |
||||
} |
||||
return bar; |
||||
} |
||||
|
||||
public PlayerBuffData(Player p, Main thisplugin) { |
||||
this.p=p; |
||||
this.base_spdlv=0; |
||||
this.base_armorlv=0; |
||||
this.hpbuff_time=0; |
||||
this.armorbufflist=new ArrayList<Player>(); |
||||
this.hpbufflist=new ArrayList<Player>(); |
||||
this.last_money_report_time=Bukkit.getWorld("world").getFullTime(); |
||||
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(); |
||||
//Figure out potion effects when player joins.
|
||||
while (effects.hasNext()) { |
||||
PotionEffect nexteffect = effects.next(); |
||||
if (nexteffect.getType().getName().compareTo(PotionEffectType.SPEED.getName())==0) { |
||||
potion_spdlv = nexteffect.getAmplifier(); |
||||
//Bukkit.getLogger().info("Speed level is "+nexteffect.getAmplifier()+" and lasts for "+nexteffect.getDuration()+" ticks.");
|
||||
potion_time = Bukkit.getWorld("world").getFullTime()+nexteffect.getDuration(); |
||||
} |
||||
effects.remove(); |
||||
} |
||||
|
||||
} catch (ConcurrentModificationException ex_e) { |
||||
Bukkit.getLogger().warning("Potion Effect Collection not accessible while initializing player speed."); |
||||
} |
||||
p.removePotionEffect(PotionEffectType.SPEED); |
||||
} |
||||
public void setBaseSpd(int spd) { |
||||
this.base_spdlv=spd; |
||||
} |
||||
public void updateBaseArmor() { |
||||
|
||||
|
||||
} |
||||
public void updatePlayerSpd() { |
||||
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.getAccountsConfig().getInt(p.getName()+".stats.stat8")>0) { |
||||
base_hplv+=this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")/2); |
||||
} |
||||
//Check player equipment to see if an item could possibly have a health buff.
|
||||
for (int i=0;i<p.getEquipment().getArmorContents().length;i++) { |
||||
//Bukkit.getLogger().info("Got to 1.");
|
||||
if (p.getEquipment().getArmorContents()[i]!=null && p.getEquipment().getArmorContents()[i].getItemMeta()!=null && p.getEquipment().getArmorContents()[i].getItemMeta().getLore()!=null) { |
||||
//Bukkit.getLogger().info("Got to 2.");
|
||||
for (int j=0;j<p.getEquipment().getArmorContents()[i].getItemMeta().getLore().size();j++) { |
||||
//Bukkit.getLogger().info("Got to 3.");
|
||||
if (this.plugin.containsEnchantment(p.getEquipment().getArmorContents()[i].getItemMeta().getLore().get(j), "Health")) { |
||||
//Bukkit.getLogger().info("Got to 4.");
|
||||
base_hplv+=this.plugin.getEnchantmentNumb(p.getEquipment().getArmorContents()[i].getItemMeta().getLore().get(j)); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
extra_hp=0; |
||||
//p.setMaxHealth(base_hplv);
|
||||
boolean hasabsorption=false; |
||||
try { |
||||
Iterator<PotionEffect> effects = p.getActivePotionEffects().iterator(); |
||||
//Figure out potion effects when player joins.
|
||||
while (effects.hasNext()) { |
||||
PotionEffect nexteffect = effects.next(); |
||||
if (nexteffect.getType().getName().compareTo(PotionEffectType.HEALTH_BOOST.getName())==0) { |
||||
base_hplv+=(nexteffect.getAmplifier()+1)*4; |
||||
extra_hp=(nexteffect.getAmplifier()+1)*4; |
||||
} |
||||
if (nexteffect.getType().getName().compareTo(PotionEffectType.ABSORPTION.getName())==0) { |
||||
hasabsorption=true; |
||||
} |
||||
effects.remove(); |
||||
} |
||||
|
||||
} catch (ConcurrentModificationException ex_e) { |
||||
Bukkit.getLogger().warning("Potion Effect Collection not accessible while finalizing player speed."); |
||||
} |
||||
if (/*!hasabsorption && */this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")>0) { |
||||
p.removePotionEffect(PotionEffectType.ABSORPTION); |
||||
p.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION,3610,this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")/3)/4-1)); |
||||
//p.sendMessage("Absorption level is "+(this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")/4)/4-1));
|
||||
} |
||||
if (this.plugin.getAccountsConfig().getInt(p.getName()+".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()+".stats.stat2")/4)/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);
|
||||
} |
||||
if (base_hplv!=p.getMaxHealth()) { |
||||
double temphp=0; |
||||
if (base_hplv<p.getMaxHealth()) { |
||||
p.setMaxHealth(base_hplv-extra_hp); |
||||
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<Bukkit.getWorld("world").getFullTime()) { |
||||
//Remove the potion speed buff.
|
||||
potion_spdlv=0; |
||||
} |
||||
try { |
||||
Iterator<PotionEffect> effects = p.getActivePotionEffects().iterator(); |
||||
//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.
|
||||
potion_spdlv+=nexteffect.getAmplifier()+1; |
||||
//p.sendMessage("Store speed "+nexteffect.getAmplifier()+" for "+nexteffect.getDuration()+" ticks.");
|
||||
potion_time = Bukkit.getWorld("world").getFullTime()+nexteffect.getDuration(); |
||||
} |
||||
} |
||||
effects.remove(); |
||||
} |
||||
if (hpbuff_time<Bukkit.getWorld("world").getFullTime()) { |
||||
while (hpbufflist.size()>0) { |
||||
hpbufflist.remove(0); |
||||
} |
||||
} |
||||
|
||||
} catch (ConcurrentModificationException ex_e) { |
||||
Bukkit.getLogger().warning("Potion Effect Collection not accessible while finalizing player speed."); |
||||
} |
||||
|
||||
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<Bukkit.getWorld("world").getFullTime()) { |
||||
last_money_report_time=Bukkit.getWorld("world").getFullTime(); |
||||
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".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."); |
||||
} |
||||
money_gained=0; |
||||
} |
||||
p.getScoreboard().getTeam(p.getName()).setSuffix(healthbar(p.getHealth(),p.getMaxHealth())); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,69 @@ |
||||
package me.kaZep.Base; |
||||
|
||||
import org.bukkit.Bukkit; |
||||
import org.bukkit.Material; |
||||
import org.bukkit.entity.Player; |
||||
|
||||
public class PlayerData { |
||||
int buildamt=10; |
||||
Material lastblocktype=null; |
||||
long lastinteracttime=0; |
||||
long lastminetime=0; |
||||
int minestreak=0; |
||||
Player data=null; |
||||
public PlayerData(Player p) { |
||||
this.data=p; |
||||
this.lastblocktype=Material.DIRT; |
||||
lastinteracttime=Bukkit.getWorld("world").getFullTime(); |
||||
lastminetime=Bukkit.getWorld("world").getFullTime(); |
||||
minestreak=0; |
||||
} |
||||
public boolean CheckMineStreak() { |
||||
//Increases mining streak by one if the miner hasn't stopped mining for more than 10 seconds.
|
||||
//Resets when the miner hasn't mined for 10 seconds.
|
||||
//If it reaches 10 blocks, we assume the miner is mining, and we need to do something about it.
|
||||
//Attempt to spawn Charge Zombie II's in rooms that are unlit.
|
||||
if (Bukkit.getWorld("world").getFullTime()>lastminetime+200) { |
||||
//Reset. Too much time has passed.
|
||||
lastminetime=Bukkit.getWorld("world").getFullTime(); |
||||
minestreak=0; |
||||
} else { |
||||
minestreak++; |
||||
lastminetime=Bukkit.getWorld("world").getFullTime(); |
||||
if (minestreak>10) { |
||||
minestreak=0; |
||||
return true; |
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
public boolean GoodInteract() { |
||||
//A good interact is doing their part of the job.
|
||||
buildamt--; |
||||
if (buildamt<=0) { |
||||
buildamt=0; |
||||
return true; |
||||
} else { |
||||
if (buildamt>10) { |
||||
buildamt=10; //This is the upper bound of this value.
|
||||
} |
||||
return false; |
||||
} |
||||
//Use this whenever you do a good interaction. Check the return value to see if we are allowed to gain exp from it.
|
||||
} |
||||
public void BadInteract(Material blockType) { |
||||
//This method will add to the list of blocks created/destroyed, in an attempt to detect any further attempts to not be allowed to destroy things.
|
||||
//This event should be called whenever a bad interaction happens.
|
||||
if (blockType!=this.lastblocktype) { |
||||
//We are interacting with a different type of block. Give more lee-way for this block.
|
||||
buildamt+=1; |
||||
this.lastblocktype=blockType; |
||||
} else { |
||||
//This is a block type we are dealing with from beforehand. We will need to add more to buildamt to make sure we are not cheating the system.
|
||||
buildamt+=2; |
||||
} |
||||
} |
||||
public Player getPlayer() { |
||||
return data; |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,24 @@ |
||||
package me.kaZep.Base; |
||||
|
||||
import org.bukkit.Bukkit; |
||||
import org.bukkit.Location; |
||||
import org.bukkit.entity.Player; |
||||
import org.bukkit.inventory.ItemStack; |
||||
|
||||
public class ReviveInventory { |
||||
public ItemStack[] mainInventory; |
||||
public ItemStack[] armorInventory; |
||||
public float expamt; |
||||
public float explv; |
||||
public long dropTime; |
||||
public Player p; |
||||
public Location deathLocation; |
||||
public ReviveInventory(Player p) { |
||||
mainInventory = p.getInventory().getContents(); |
||||
armorInventory = p.getInventory().getArmorContents(); |
||||
expamt = p.getExp(); |
||||
explv = p.getLevel(); |
||||
dropTime = Bukkit.getWorld("world").getFullTime()+12000; |
||||
deathLocation = p.getLocation(); |
||||
} |
||||
} |
@ -0,0 +1,16 @@ |
||||
package me.kaZep.Base; |
||||
|
||||
import org.bukkit.enchantments.Enchantment; |
||||
|
||||
public class StoreValues { |
||||
double chance; |
||||
Enchantment enchant; |
||||
int level; |
||||
int enchantlevel; |
||||
StoreValues(double chance, Enchantment enchant,int level,int enchantlevel) { |
||||
this.chance=chance; |
||||
this.enchant=enchant; |
||||
this.level=level; |
||||
this.enchantlevel=enchantlevel; |
||||
} |
||||
} |
@ -0,0 +1,26 @@ |
||||
package me.kaZep.Base; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.UUID; |
||||
|
||||
import org.bukkit.Bukkit; |
||||
import org.bukkit.entity.Entity; |
||||
import org.bukkit.entity.Player; |
||||
|
||||
public class SupportEntity { |
||||
public List<UUID> id; |
||||
Player p; |
||||
public long registeredtime; |
||||
public SupportEntity(Player p) { |
||||
this.p=p; |
||||
id = new ArrayList<UUID>(); |
||||
registeredtime = Bukkit.getWorld("world").getFullTime()+1200; |
||||
} |
||||
public List<UUID> getEntities() { |
||||
return id; |
||||
} |
||||
public Player getPlayer() { |
||||
return p; |
||||
} |
||||
} |
@ -0,0 +1,13 @@ |
||||
package me.kaZep.Base; |
||||
|
||||
import org.bukkit.entity.Player; |
||||
|
||||
public class SupportPlayer { |
||||
Player p; |
||||
int myarmorbuff=0; |
||||
int myhpbuff=0; |
||||
int myspdbuff=0; |
||||
public SupportPlayer(Player p) { |
||||
this.p=p; |
||||
} |
||||
} |
@ -0,0 +1,12 @@ |
||||
package me.kaZep.Base; |
||||
|
||||
import org.bukkit.Location; |
||||
|
||||
public class TempWeb { |
||||
public Location loc; |
||||
public int timer; |
||||
public TempWeb(Location loc, int timer) { |
||||
this.loc=loc; |
||||
this.timer=timer; |
||||
} |
||||
} |
@ -0,0 +1,252 @@ |
||||
package me.kaZep.Commands; |
||||
|
||||
import java.text.DecimalFormat; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
import org.bukkit.ChatColor; |
||||
import org.bukkit.entity.Player; |
||||
|
||||
public class JobsDataInfo { |
||||
String jobname; |
||||
String introstring; |
||||
String actionname1; |
||||
String actionname2; |
||||
String actionname3; |
||||
String actionname4; |
||||
List<String> extrainfo; |
||||
List<String> datanames1; |
||||
List<String> datanames2; |
||||
List<String> datanames3; |
||||
List<String> datanames4; |
||||
String lv5buff; |
||||
String lv10buff; |
||||
String lv20buff; |
||||
String lv40buff; |
||||
List<Double> dataprice1; |
||||
List<Double> dataprice2; |
||||
List<Double> dataprice3; |
||||
List<Double> dataprice4; |
||||
List<Double> dataexp1; |
||||
List<Double> dataexp2; |
||||
List<Double> dataexp3; |
||||
List<Double> dataexp4; |
||||
public double basexp; |
||||
public double explvup; |
||||
public double explvmult; |
||||
public double moneymult; |
||||
public JobsDataInfo() { |
||||
jobname = ""; |
||||
introstring = ""; |
||||
actionname1 = ""; |
||||
actionname2 = ""; |
||||
actionname3 = ""; |
||||
actionname4 = ""; |
||||
extrainfo = new ArrayList<String>(); |
||||
datanames1 = new ArrayList<String>(); |
||||
datanames2 = new ArrayList<String>(); |
||||
datanames3 = new ArrayList<String>(); |
||||
datanames4 = new ArrayList<String>(); |
||||
lv5buff = ""; |
||||
lv10buff = ""; |
||||
lv20buff = ""; |
||||
lv40buff = ""; |
||||
dataprice1 = new ArrayList<Double>(); |
||||
dataprice2 = new ArrayList<Double>(); |
||||
dataprice3 = new ArrayList<Double>(); |
||||
dataprice4 = new ArrayList<Double>(); |
||||
dataexp1 = new ArrayList<Double>(); |
||||
dataexp2 = new ArrayList<Double>(); |
||||
dataexp3 = new ArrayList<Double>(); |
||||
dataexp4 = new ArrayList<Double>(); |
||||
basexp = 0; |
||||
explvup = 0; |
||||
explvmult = 0; |
||||
moneymult = 0; |
||||
} |
||||
public void setJobName(String title) { |
||||
this.jobname = title; |
||||
} |
||||
public void setJobDescription(String desc) { |
||||
this.introstring = desc; |
||||
} |
||||
public void addExtraData(String info) { |
||||
extrainfo.add(info); |
||||
} |
||||
public String getBuffData(int lv) { |
||||
switch (lv) { |
||||
case 5:{ |
||||
return this.lv5buff; |
||||
} |
||||
case 10:{ |
||||
return this.lv10buff; |
||||
} |
||||
case 20:{ |
||||
return this.lv20buff; |
||||
} |
||||
case 40:{ |
||||
return this.lv40buff; |
||||
} |
||||
} |
||||
return ""; |
||||
} |
||||
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 setAction(int numb, String name) { |
||||
switch (numb) { |
||||
case 0:{ |
||||
this.actionname1=name; |
||||
}break; |
||||
case 1:{ |
||||
this.actionname2=name; |
||||
}break; |
||||
case 2:{ |
||||
this.actionname3=name; |
||||
}break; |
||||
case 3:{ |
||||
this.actionname4=name; |
||||
}break; |
||||
default:{ |
||||
this.actionname1=name; |
||||
} |
||||
} |
||||
} |
||||
public void setExp(double base, double lvup, double lvmult, double moneymult) { |
||||
this.basexp=base; |
||||
this.explvup=lvup; |
||||
this.explvmult=lvmult; |
||||
this.moneymult=moneymult-1; |
||||
} |
||||
public void addData(String name, double price, double exp, int actionnumb) { |
||||
switch (actionnumb) { |
||||
case 0:{ |
||||
this.datanames1.add(name); |
||||
this.dataprice1.add(price); |
||||
this.dataexp1.add(exp); |
||||
}break; |
||||
case 1:{ |
||||
this.datanames2.add(name); |
||||
this.dataprice2.add(price); |
||||
this.dataexp2.add(exp); |
||||
}break; |
||||
case 2:{ |
||||
this.datanames3.add(name); |
||||
this.dataprice3.add(price); |
||||
this.dataexp3.add(exp); |
||||
}break; |
||||
case 3:{ |
||||
this.datanames4.add(name); |
||||
this.dataprice4.add(price); |
||||
this.dataexp4.add(exp); |
||||
}break; |
||||
default:{ |
||||
this.datanames1.add(name); |
||||
this.dataprice1.add(price); |
||||
this.dataexp1.add(exp); |
||||
} |
||||
} |
||||
} |
||||
public void sendOutput(Player p) { |
||||
DecimalFormat df = new DecimalFormat("#0.00"); |
||||
p.sendMessage(this.jobname); |
||||
p.sendMessage(""); |
||||
p.sendMessage(this.introstring); |
||||
if (this.extrainfo!=null) { |
||||
for (int i=0;i<this.extrainfo.size();i++) { |
||||
p.sendMessage(ChatColor.YELLOW+this.extrainfo.get(i)); |
||||
} |
||||
} |
||||
if (this.datanames1!=null) { |
||||
p.sendMessage(""); |
||||
p.sendMessage(this.actionname1+":"); |
||||
for (int i=0;i<this.datanames1.size();i++) { |
||||
p.sendMessage(ChatColor.AQUA+" "+this.datanames1.get(i)+ChatColor.WHITE +" - "+ChatColor.GOLD+"$ "+df.format(this.dataprice1.get(i)+0.00d)+" "+ChatColor.ITALIC+ChatColor.LIGHT_PURPLE+" "+Math.round(this.dataexp1.get(i))+"xp"); |
||||
} |
||||
} |
||||
if (this.datanames2!=null) { |
||||
if (this.actionname2!="") { |
||||
p.sendMessage(""); |
||||
p.sendMessage(this.actionname2+":"); |
||||
for (int i=0;i<this.datanames2.size();i++) { |
||||
p.sendMessage(ChatColor.AQUA+" "+this.datanames2.get(i)+ChatColor.WHITE +" - "+ChatColor.GOLD+"$ "+df.format(this.dataprice2.get(i))+" "+ChatColor.ITALIC+ChatColor.LIGHT_PURPLE+" "+Math.round(this.dataexp2.get(i))+"xp"); |
||||
} |
||||
} |
||||
} |
||||
if (this.datanames3!=null) { |
||||
if (this.actionname3!="") { |
||||
p.sendMessage(""); |
||||
p.sendMessage(this.actionname3+":"); |
||||
for (int i=0;i<this.datanames3.size();i++) { |
||||
p.sendMessage(ChatColor.AQUA+" "+this.datanames3.get(i)+ChatColor.WHITE +" - "+ChatColor.GOLD+"$ "+df.format(this.dataprice3.get(i))+" "+ChatColor.ITALIC+ChatColor.LIGHT_PURPLE+" "+Math.round(this.dataexp3.get(i))+"xp"); |
||||
} |
||||
} |
||||
} |
||||
if (this.datanames4!=null) { |
||||
if (this.actionname4!="") { |
||||
p.sendMessage(""); |
||||
p.sendMessage(this.actionname4+":"); |
||||
for (int i=0;i<this.datanames4.size();i++) { |
||||
p.sendMessage(ChatColor.AQUA+" "+this.datanames4.get(i)+ChatColor.WHITE +" - "+ChatColor.GOLD+"$ "+df.format(this.dataprice4.get(i))+" "+ChatColor.ITALIC+ChatColor.LIGHT_PURPLE+" "+Math.round(this.dataexp4.get(i))+"xp"); |
||||
} |
||||
} |
||||
} |
||||
return; |
||||
} |
||||
public boolean sendOutput(Player p,int lv) { |
||||
if (lv>0 && lv<=40) { |
||||
DecimalFormat df = new DecimalFormat("#0.00"); |
||||
p.sendMessage(this.jobname); |
||||
p.sendMessage(""); |
||||
p.sendMessage(this.introstring); |
||||
if (this.extrainfo!=null) { |
||||
for (int i=0;i<this.extrainfo.size();i++) { |
||||
p.sendMessage(ChatColor.YELLOW+this.extrainfo.get(i)); |
||||
} |
||||
} |
||||
if (this.datanames1!=null) { |
||||
p.sendMessage(""); |
||||
p.sendMessage(this.actionname1+":"); |
||||
for (int i=0;i<this.datanames1.size();i++) { |
||||
p.sendMessage(ChatColor.AQUA+" "+this.datanames1.get(i)+ChatColor.WHITE +" - "+ChatColor.GOLD+"$ "+df.format(this.dataprice1.get(i)*(1d+(moneymult*(lv-1))))+" "+ChatColor.ITALIC+ChatColor.LIGHT_PURPLE+" "+Math.round(this.dataexp1.get(i))+"xp"); |
||||
} |
||||
} |
||||
if (this.datanames2!=null) { |
||||
if (this.actionname2!="") { |
||||
p.sendMessage(""); |
||||
p.sendMessage(this.actionname2+":"); |
||||
for (int i=0;i<this.datanames2.size();i++) { |
||||
p.sendMessage(ChatColor.AQUA+" "+this.datanames2.get(i)+ChatColor.WHITE +" - "+ChatColor.GOLD+"$ "+df.format(this.dataprice2.get(i)*(1d+(moneymult*(lv-1))))+" "+ChatColor.ITALIC+ChatColor.LIGHT_PURPLE+" "+Math.round(this.dataexp2.get(i))+"xp"); |
||||
} |
||||
} |
||||
} |
||||
if (this.datanames3!=null) { |
||||
if (this.actionname3!="") { |
||||
p.sendMessage(""); |
||||
p.sendMessage(this.actionname3+":"); |
||||
for (int i=0;i<this.datanames3.size();i++) { |
||||
p.sendMessage(ChatColor.AQUA+" "+this.datanames3.get(i)+ChatColor.WHITE +" - "+ChatColor.GOLD+"$ "+df.format(this.dataprice3.get(i)*(1d+(moneymult*(lv-1))))+" "+ChatColor.ITALIC+ChatColor.LIGHT_PURPLE+" "+Math.round(this.dataexp3.get(i))+"xp"); |
||||
} |
||||
} |
||||
} |
||||
if (this.datanames4!=null) { |
||||
if (this.actionname4!="") { |
||||
p.sendMessage(""); |
||||
p.sendMessage(this.actionname4+":"); |
||||
for (int i=0;i<this.datanames4.size();i++) { |
||||
p.sendMessage(ChatColor.AQUA+" "+this.datanames4.get(i)+ChatColor.WHITE +" - "+ChatColor.GOLD+"$ "+df.format(this.dataprice4.get(i)*(1d+(moneymult*(lv-1))))+" "+ChatColor.ITALIC+ChatColor.LIGHT_PURPLE+" "+Math.round(this.dataexp4.get(i))+"xp"); |
||||
} |
||||
} |
||||
} |
||||
return true; |
||||
} else { |
||||
if (lv<0 || lv>40) { |
||||
p.sendMessage(ChatColor.RED+"Level must be between 1 and 40."); |
||||
} |
||||
return false; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue