First Commit
This commit is contained in:
commit
7a2e0f9f74
9
BankEconomyMod/.classpath
Normal file
9
BankEconomyMod/.classpath
Normal file
@ -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>
|
23
BankEconomyMod/.project
Normal file
23
BankEconomyMod/.project
Normal file
@ -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
|
11
BankEconomyMod/.settings/org.eclipse.jdt.core.prefs
Normal file
11
BankEconomyMod/.settings/org.eclipse.jdt.core.prefs
Normal file
@ -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>
|
0
BankEconomyMod/accounts.yml
Normal file
0
BankEconomyMod/accounts.yml
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/ArrowShooter.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/ArrowShooter.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/BrewingStandData.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/BrewingStandData.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/DamageAPI.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/DamageAPI.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/EnchantLevelDatabase.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/EnchantLevelDatabase.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/EntityHitData.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/EntityHitData.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/EntityInteractData.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/EntityInteractData.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/ExplorerData.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/ExplorerData.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/FurnaceData.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/FurnaceData.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/InvisibilityData.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/InvisibilityData.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/JukeboxData.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/JukeboxData.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/Main$1.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/Main$1.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/Main$2.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/Main$2.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/Main$3.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/Main$3.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/Main$4.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/Main$4.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/Main.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/Main.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/Metrics$1.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/Metrics$1.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/Metrics$Graph.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/Metrics$Graph.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/Metrics$Plotter.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/Metrics$Plotter.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/Metrics.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/Metrics.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/PersistentExplorerList.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/PersistentExplorerList.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/PlayerBuffData.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/PlayerBuffData.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/PlayerData.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/PlayerData.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/PlayerListener$1.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/PlayerListener$1.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/PlayerListener$2.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/PlayerListener$2.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/PlayerListener$3.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/PlayerListener$3.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/PlayerListener$4.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/PlayerListener$4.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/PlayerListener$5.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/PlayerListener$5.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/PlayerListener$6.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/PlayerListener$6.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/PlayerListener.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/PlayerListener.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/ReviveInventory.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/ReviveInventory.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/StoreValues.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/StoreValues.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/SupportEntity.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/SupportEntity.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/SupportPlayer.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/SupportPlayer.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Base/TempWeb.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Base/TempWeb.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Commands/JobsDataInfo.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Commands/JobsDataInfo.class
Normal file
Binary file not shown.
BIN
BankEconomyMod/bin/me/kaZep/Commands/commandBankEconomy.class
Normal file
BIN
BankEconomyMod/bin/me/kaZep/Commands/commandBankEconomy.class
Normal file
Binary file not shown.
0
BankEconomyMod/config.yml
Normal file
0
BankEconomyMod/config.yml
Normal file
25
BankEconomyMod/plugin.yml
Normal file
25
BankEconomyMod/plugin.yml
Normal file
@ -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.
|
20
BankEconomyMod/src/me/kaZep/Base/ArrowShooter.java
Normal file
20
BankEconomyMod/src/me/kaZep/Base/ArrowShooter.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
104
BankEconomyMod/src/me/kaZep/Base/BrewingStandData.java
Normal file
104
BankEconomyMod/src/me/kaZep/Base/BrewingStandData.java
Normal file
@ -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;
|
||||
}
|
||||
|
||||
}
|
145
BankEconomyMod/src/me/kaZep/Base/DamageAPI.java
Normal file
145
BankEconomyMod/src/me/kaZep/Base/DamageAPI.java
Normal file
@ -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;
|
||||
}
|
||||
|
||||
}
|
385
BankEconomyMod/src/me/kaZep/Base/EnchantLevelDatabase.java
Normal file
385
BankEconomyMod/src/me/kaZep/Base/EnchantLevelDatabase.java
Normal file
@ -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));
|
||||
}
|
||||
}
|
26
BankEconomyMod/src/me/kaZep/Base/EntityHitData.java
Normal file
26
BankEconomyMod/src/me/kaZep/Base/EntityHitData.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
29
BankEconomyMod/src/me/kaZep/Base/EntityInteractData.java
Normal file
29
BankEconomyMod/src/me/kaZep/Base/EntityInteractData.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
36
BankEconomyMod/src/me/kaZep/Base/ExplorerData.java
Normal file
36
BankEconomyMod/src/me/kaZep/Base/ExplorerData.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
42
BankEconomyMod/src/me/kaZep/Base/FurnaceData.java
Normal file
42
BankEconomyMod/src/me/kaZep/Base/FurnaceData.java
Normal file
@ -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;
|
||||
}
|
||||
|
||||
}
|
12
BankEconomyMod/src/me/kaZep/Base/InvisibilityData.java
Normal file
12
BankEconomyMod/src/me/kaZep/Base/InvisibilityData.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
75
BankEconomyMod/src/me/kaZep/Base/JukeboxData.java
Normal file
75
BankEconomyMod/src/me/kaZep/Base/JukeboxData.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
3984
BankEconomyMod/src/me/kaZep/Base/Main.java
Normal file
3984
BankEconomyMod/src/me/kaZep/Base/Main.java
Normal file
File diff suppressed because it is too large
Load Diff
359
BankEconomyMod/src/me/kaZep/Base/Metrics.java
Normal file
359
BankEconomyMod/src/me/kaZep/Base/Metrics.java
Normal file
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
18
BankEconomyMod/src/me/kaZep/Base/PersistentExplorerList.java
Normal file
18
BankEconomyMod/src/me/kaZep/Base/PersistentExplorerList.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
237
BankEconomyMod/src/me/kaZep/Base/PlayerBuffData.java
Normal file
237
BankEconomyMod/src/me/kaZep/Base/PlayerBuffData.java
Normal file
@ -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()));
|
||||
}
|
||||
}
|
||||
}
|
69
BankEconomyMod/src/me/kaZep/Base/PlayerData.java
Normal file
69
BankEconomyMod/src/me/kaZep/Base/PlayerData.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
10131
BankEconomyMod/src/me/kaZep/Base/PlayerListener.java
Normal file
10131
BankEconomyMod/src/me/kaZep/Base/PlayerListener.java
Normal file
File diff suppressed because it is too large
Load Diff
24
BankEconomyMod/src/me/kaZep/Base/ReviveInventory.java
Normal file
24
BankEconomyMod/src/me/kaZep/Base/ReviveInventory.java
Normal file
@ -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();
|
||||
}
|
||||
}
|
16
BankEconomyMod/src/me/kaZep/Base/StoreValues.java
Normal file
16
BankEconomyMod/src/me/kaZep/Base/StoreValues.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
26
BankEconomyMod/src/me/kaZep/Base/SupportEntity.java
Normal file
26
BankEconomyMod/src/me/kaZep/Base/SupportEntity.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
13
BankEconomyMod/src/me/kaZep/Base/SupportPlayer.java
Normal file
13
BankEconomyMod/src/me/kaZep/Base/SupportPlayer.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
12
BankEconomyMod/src/me/kaZep/Base/TempWeb.java
Normal file
12
BankEconomyMod/src/me/kaZep/Base/TempWeb.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
252
BankEconomyMod/src/me/kaZep/Commands/JobsDataInfo.java
Normal file
252
BankEconomyMod/src/me/kaZep/Commands/JobsDataInfo.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
913
BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java
Normal file
913
BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java
Normal file
@ -0,0 +1,913 @@
|
||||
package me.kaZep.Commands;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import me.kaZep.Base.Main;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.MerchantInventory;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
|
||||
public class commandBankEconomy
|
||||
implements CommandExecutor
|
||||
{
|
||||
public Main plugin;
|
||||
String prefix = "<EFBFBD>˜2[BankEconomy]";
|
||||
String usage = "<EFBFBD>˜bUsage:";
|
||||
String invARG = "<EFBFBD>˜cInvalid argument. Please use <20>˜2/bankeconomy<6D>˜c to see a full list of commands.";
|
||||
String invARGT2 = "<EFBFBD>˜cInvalid argument or insufficient permissions.";
|
||||
String offlinePlayer = "<EFBFBD>˜cPlayer not found.";
|
||||
String accountDisabled = "<EFBFBD>˜cYour account is disabled.";
|
||||
|
||||
String cmdInfo = "<EFBFBD>˜aYour bank balance is<69>˜b";
|
||||
String cmdCheckARG1 = "<EFBFBD>˜a/bankeconomy check <player>";
|
||||
String cmdResetARG1 = "<EFBFBD>˜a/bankeconomy reset <player>";
|
||||
String cmdDepositARG1 = "<EFBFBD>˜a";
|
||||
String cmdWithdrawARG1 = "<EFBFBD>˜a";
|
||||
String cmdTransferARG1 = "<EFBFBD>˜a/transfer <player> <amount>";
|
||||
String cmdTransferARG2 = "<EFBFBD>˜aPlease precise the name of the player.";
|
||||
String cmdEditARG1 = "<EFBFBD>˜a/bankeconomy edit <action> <player> <value>";
|
||||
String cmdEditARG2 = "<EFBFBD>˜aPlease precise the value.";
|
||||
|
||||
String cmdCheckReponsePlayer = "<EFBFBD>˜a's bank balance is<69>˜b";
|
||||
String cmdResetToPlayer1 = "<EFBFBD>˜aYou have reset";
|
||||
String cmdResetToPlayer2 = "'s bank account.";
|
||||
String cmdResetToTarget = "has reset your bank account.";
|
||||
String cmdReload = "<EFBFBD>˜aAll the configs have been reloaded succesfully.";
|
||||
String notEnoughMoney = "<EFBFBD>˜aYou do not own that amount of money.";
|
||||
String succesfullDeposited = "<EFBFBD>˜aYou have deposited<65>˜b";
|
||||
String succesfullWithdraw = "<EFBFBD>˜aYou have withdrawn<77>˜b";
|
||||
String cmdTransferToPlayer1 = "<EFBFBD>˜aYou have transfered<65>˜b";
|
||||
String cmdTransferToPlayer2 = "<EFBFBD>˜ato<EFBFBD>˜b";
|
||||
String cmdTransferToTarget1 = "<EFBFBD>˜ahas transfered to you<6F>˜b";
|
||||
String cmdTransferSameNick = "<EFBFBD>˜aYou can't transfer money to yourself.";
|
||||
String cmdEditAvaibleActions = "<EFBFBD>˜aAvaible actions: status, balance";
|
||||
String cmdEditDisabledToPlayer1 = "<EFBFBD>˜aYou have disabled";
|
||||
String cmdEditDisabledToPlayer2 = "'s bank account.";
|
||||
String cmdEditEnableToPlayer1 = "<EFBFBD>˜aYou have enabled";
|
||||
String cmdEditEnableToPlayer2 = "'s bank account.";
|
||||
String cmdEditAmountSetPlayer1 = "<EFBFBD>˜aYou have set";
|
||||
String cmdEditAmountSetPlayer2 = "<EFBFBD>˜ato<EFBFBD>˜b";
|
||||
String cmdEditAmountSetPlayer3 = "<EFBFBD>˜a's account.";
|
||||
|
||||
public commandBankEconomy(Main plugin)
|
||||
{
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
|
||||
{
|
||||
if ((sender instanceof Player)) {
|
||||
Player p = (Player)sender;
|
||||
|
||||
boolean status = this.plugin.getAccountsConfig().getBoolean(p.getName() + ".status");
|
||||
int playerBankBalance = this.plugin.getAccountsConfig().getInt(p.getName() + ".money");
|
||||
|
||||
String currencySingular = Main.economy.currencyNameSingular();
|
||||
String currencyPlural = Main.economy.currencyNamePlural();
|
||||
|
||||
if (!status)
|
||||
p.sendMessage(this.prefix + " " + this.accountDisabled);
|
||||
else if (status) {
|
||||
if ((args.length == 0)) {
|
||||
if (cmd.getName().equalsIgnoreCase("sp")) {
|
||||
//Show a list of all stat points and what you have currently allocated.
|
||||
p.sendMessage("");
|
||||
p.sendMessage("Stat Listing shown as: "+ChatColor.AQUA+"Cost, "+ChatColor.YELLOW+"Current Buff, "+ChatColor.RED+"Next Level, "+ChatColor.GREEN+" Description");
|
||||
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#10 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")/6+" - "+ChatColor.AQUA+" 6 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")/6)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")/6+1):ChatColor.RED+"+"+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")/6+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")/6))))+ChatColor.GREEN+" Health Regeneration.");
|
||||
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#9 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")/5+" - "+ChatColor.AQUA+" 5 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")/5)+"%"+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")/5+1)+"%":ChatColor.RED+"+"+this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")/5+1)+"%"):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")/5)+"%")))+ChatColor.GREEN+" block destroying speed.");
|
||||
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#8 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")/4+" - "+ChatColor.AQUA+" 4 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")/4)+"%"+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")/4+1)+"%":ChatColor.RED+"+"+this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")/4+1)+"%"):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")/4)+"%")))+ChatColor.GREEN+" damage reduction.");
|
||||
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#7 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4+" - "+ChatColor.AQUA+" 4 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4+1):ChatColor.RED+"+"+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4))))+ChatColor.GREEN+" armor penetration.");
|
||||
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#6 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")/3+" - "+ChatColor.AQUA+" 3 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")/3)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")/3+1):ChatColor.RED+"+"+this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")/3+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")/3))))+ChatColor.GREEN+" temporary health. (Regenerates every 3 minutes)");
|
||||
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#5 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6")/3+" - "+ChatColor.AQUA+" 3 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6")/3)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6")/3+1):ChatColor.RED+"+"+this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6")/3+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6")/3))))+ChatColor.GREEN+" seconds of fire resistance when caught on fire.");
|
||||
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#4 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")/2+" - "+ChatColor.AQUA+" 2 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")/2)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")/2+1):ChatColor.RED+"+"+this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")/2+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")/2))))+ChatColor.GREEN+" base damage.");
|
||||
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#3 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")/2+" - "+ChatColor.AQUA+" 2 pts: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")<24 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")/2)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")/2+1):ChatColor.RED+"+"+this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")/2+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")/2))))+ChatColor.GREEN+" health.");
|
||||
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#2 "+ChatColor.RESET+ChatColor.WHITE+"-"+this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9")/1+" - "+ChatColor.AQUA+" 1 pt: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9")<25 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9")>0/*Has a point in it.*/?ChatColor.YELLOW+"-"+this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9")/1)+"%"+"/"+ChatColor.RED+"-"+this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9")/1+1)+"%":ChatColor.RED+"-"+this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9")/1+1)+"%"):(ChatColor.YELLOW+"-"+this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9")/1)+"%")))+ChatColor.GREEN+" hunger decay.");
|
||||
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"#1 "+ChatColor.RESET+ChatColor.WHITE+"+"+this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat10")/1+" - "+ChatColor.AQUA+" 1 pt: "+ChatColor.YELLOW+((this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat10")<25 /*Not maxed.*/?(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat10")>0/*Has a point in it.*/?ChatColor.YELLOW+"+"+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat10")/1)+"/"+ChatColor.RED+"+"+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat10")/1+1):ChatColor.RED+"+"+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat10")/1+1)):(ChatColor.YELLOW+"+"+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat10")/1))))+ChatColor.GREEN+" seconds of water breathing.");
|
||||
p.sendMessage(ChatColor.ITALIC+""+ChatColor.DARK_AQUA+"Remember that 1 Health / Damage point is half a heart.");
|
||||
if (this.plugin.getStatPointTotal(p)<this.plugin.getJobTotalLvs(p)/5+1) {
|
||||
//Check if we have extra stat points.
|
||||
p.sendMessage(ChatColor.GOLD+"Type "+ChatColor.BLUE+ChatColor.BOLD+"/sp #"+ChatColor.RESET+ChatColor.GOLD+" with the number of the buff you want to add a point to. (You have "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+".)");
|
||||
}
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("tele")) {
|
||||
p.sendMessage("Usage: "+ChatColor.RED+"/tele to "+ChatColor.GREEN+" <player>"+ChatColor.WHITE+" - Teleport to a player for a cost.");
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("settings")) {
|
||||
Inventory i = Bukkit.createInventory(p, 27, "Notification Options");
|
||||
int count=-1;
|
||||
ItemStack temp,on,off;
|
||||
temp=new ItemStack(Material.DIRT);
|
||||
ItemMeta temp_meta=temp.getItemMeta();temp_meta.setDisplayName(ChatColor.YELLOW+"Pick Up Items");List<String> temp_meta_lore = new ArrayList<String>();temp_meta_lore.add(ChatColor.ITALIC+"Get notified whenever you pick up items.");temp_meta_lore.add(ChatColor.ITALIC+"");temp_meta_lore.add(ChatColor.ITALIC+""+ChatColor.GRAY+"Click to toggle this option on or off.");temp_meta.setLore(temp_meta_lore);temp.setItemMeta(temp_meta);
|
||||
on=new ItemStack(Material.REDSTONE_TORCH_ON);
|
||||
off=new ItemStack(Material.REDSTONE_TORCH_OFF);
|
||||
i.setItem(count+=2, temp);on.setItemMeta(temp_meta);off.setItemMeta(temp_meta); i.setItem(count+=1, (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify1")?on:off));
|
||||
temp_meta.setDisplayName(ChatColor.YELLOW+"Craft Items");temp_meta_lore = new ArrayList<String>();temp_meta_lore.add(ChatColor.ITALIC+"Get notified whenever you craft an item.");temp_meta_lore.add(ChatColor.ITALIC+"");temp_meta_lore.add(ChatColor.ITALIC+""+ChatColor.GRAY+"Click to toggle this option on or off.");temp_meta.setLore(temp_meta_lore);
|
||||
temp=new ItemStack(Material.WORKBENCH);
|
||||
temp.setItemMeta(temp_meta);i.setItem(count+=3, temp);on.setItemMeta(temp_meta);off.setItemMeta(temp_meta); i.setItem(count+=1, (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify2")?on:off));
|
||||
temp_meta.setDisplayName(ChatColor.YELLOW+"Experience Points");temp_meta_lore = new ArrayList<String>();temp_meta_lore.add(ChatColor.ITALIC+"Get notified whenever you gain");temp_meta_lore.add(ChatColor.ITALIC+"experience points.");temp_meta_lore.add(ChatColor.ITALIC+"");temp_meta_lore.add(ChatColor.ITALIC+""+ChatColor.GRAY+"Click to toggle this option on or off.");temp_meta.setLore(temp_meta_lore);
|
||||
temp=new ItemStack(Material.SLIME_BALL);
|
||||
temp.setItemMeta(temp_meta);i.setItem(count+=4, temp);on.setItemMeta(temp_meta);off.setItemMeta(temp_meta); i.setItem(count+=1, (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify3")?on:off));
|
||||
temp_meta.setDisplayName(ChatColor.YELLOW+"Damage Dealt");temp_meta_lore = new ArrayList<String>();temp_meta_lore.add(ChatColor.ITALIC+"Get notified whenever you deal");temp_meta_lore.add(ChatColor.ITALIC+"damage to enemies.");temp_meta_lore.add(ChatColor.ITALIC+"");temp_meta_lore.add(ChatColor.ITALIC+""+ChatColor.GRAY+"Click to toggle this option on or off.");temp_meta.setLore(temp_meta_lore);
|
||||
temp=new ItemStack(Material.IRON_SWORD);
|
||||
temp.setItemMeta(temp_meta);i.setItem(count+=3, temp);on.setItemMeta(temp_meta);off.setItemMeta(temp_meta); i.setItem(count+=1, (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")?on:off));
|
||||
temp_meta.setDisplayName(ChatColor.YELLOW+"Damage Received");temp_meta_lore = new ArrayList<String>();temp_meta_lore.add(ChatColor.ITALIC+"Get notified whenever you take damage");temp_meta_lore.add(ChatColor.ITALIC+" from enemies and other sources of damage.");temp_meta_lore.add(ChatColor.ITALIC+"");temp_meta_lore.add(ChatColor.ITALIC+""+ChatColor.GRAY+"Click to toggle this option on or off.");temp_meta.setLore(temp_meta_lore);
|
||||
temp=new ItemStack(Material.IRON_CHESTPLATE);
|
||||
temp.setItemMeta(temp_meta); i.setItem(count+=4, temp);on.setItemMeta(temp_meta);off.setItemMeta(temp_meta); i.setItem(count+=1, (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify5")?on:off));
|
||||
temp_meta.setDisplayName(ChatColor.YELLOW+"Money Gained");temp_meta_lore = new ArrayList<String>();temp_meta_lore.add(ChatColor.ITALIC+"Get notified of how much money you made");temp_meta_lore.add(ChatColor.ITALIC+" from your jobs in the past hour.");temp_meta_lore.add(ChatColor.ITALIC+"");temp_meta_lore.add(ChatColor.ITALIC+""+ChatColor.GRAY+"Click to toggle this option on or off.");temp_meta.setLore(temp_meta_lore);
|
||||
temp=new ItemStack(Material.GOLD_INGOT);
|
||||
temp.setItemMeta(temp_meta);i.setItem(count+=3, temp);on.setItemMeta(temp_meta);off.setItemMeta(temp_meta); i.setItem(count+=1, (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify6")?on:off));
|
||||
p.openInventory(i);
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("event")) {
|
||||
if (p.hasPermission("maintenance-mode-admin")) {
|
||||
p.sendMessage("Events available: halloween. Use: /event <eventname>");
|
||||
}
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("maintenance")) {
|
||||
if (p.hasPermission("maintenance-mode-admin")) {
|
||||
if (this.plugin.getConfig().getBoolean("maintenance-mode")) {
|
||||
this.plugin.getConfig().set("maintenance-mode", Boolean.valueOf(false));
|
||||
Bukkit.broadcastMessage("Maintenance mode is now "+ChatColor.BLUE+" OFF"+ChatColor.RESET+".");
|
||||
} else {
|
||||
this.plugin.getConfig().set("maintenance-mode", Boolean.valueOf(true));
|
||||
Bukkit.broadcastMessage("Maintenance mode is now "+ChatColor.RED+" ON"+ChatColor.RESET+".");
|
||||
}
|
||||
this.plugin.saveConfig();
|
||||
}
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("transfer")) {
|
||||
p.sendMessage("Usage: "+ChatColor.RED+"/transfer name money"+ChatColor.WHITE+" - Transfer money to a player.");
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("revive")) {
|
||||
p.sendMessage("Usage: "+ChatColor.RED+"/revive me "+ChatColor.WHITE+" - Revive to the last location you died at.");
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("unenchant")) {
|
||||
Map<Enchantment,Integer> map = p.getItemInHand().getEnchantments();
|
||||
for (Map.Entry<Enchantment,Integer> entry : map.entrySet()) {
|
||||
p.getItemInHand().removeEnchantment(entry.getKey());
|
||||
}
|
||||
p.sendMessage("Enchantments removed on this item.");
|
||||
}
|
||||
else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs")) {
|
||||
FileConfiguration config = this.plugin.getConfig();
|
||||
int MAXJOBS = config.getInt("jobs.MAX_JOBS");
|
||||
p.sendMessage(ChatColor.GOLD+" Blacksmith ("+config.getInt("jobs.Blacksmith")+"/"+MAXJOBS+")");
|
||||
p.sendMessage(ChatColor.DARK_GREEN+" Breeder ("+config.getInt("jobs.Breeder")+"/"+MAXJOBS+")");
|
||||
p.sendMessage(ChatColor.LIGHT_PURPLE+" Brewer ("+config.getInt("jobs.Brewer")+"/"+MAXJOBS+")");
|
||||
p.sendMessage(ChatColor.WHITE+" Builder ("+config.getInt("jobs.Builder")+"/"+MAXJOBS+")");
|
||||
p.sendMessage(ChatColor.YELLOW+" Cook ("+config.getInt("jobs.Cook")+"/"+MAXJOBS+")");
|
||||
p.sendMessage(ChatColor.GOLD+" Digger ("+config.getInt("jobs.Digger")+"/"+MAXJOBS+")");
|
||||
p.sendMessage(ChatColor.DARK_BLUE+" Enchanter ("+config.getInt("jobs.Enchanter")+"/"+MAXJOBS+")");
|
||||
p.sendMessage(ChatColor.WHITE+" Explorer ("+config.getInt("jobs.Explorer")+"/"+MAXJOBS+")");
|
||||
p.sendMessage(ChatColor.BLUE+" Farmer ("+config.getInt("jobs.Farmer")+"/"+MAXJOBS+")");
|
||||
p.sendMessage(ChatColor.AQUA+" Fisherman ("+config.getInt("jobs.Fisherman")+"/"+MAXJOBS+")");
|
||||
p.sendMessage(ChatColor.RED+" Hunter ("+config.getInt("jobs.Hunter")+"/"+MAXJOBS+")");
|
||||
p.sendMessage(ChatColor.GRAY+" Miner ("+config.getInt("jobs.Miner")+"/"+MAXJOBS+")");
|
||||
p.sendMessage(ChatColor.DARK_RED+" Support ("+config.getInt("jobs.Support")+"/"+MAXJOBS+")");
|
||||
p.sendMessage(ChatColor.DARK_PURPLE+" Weaponsmith ("+config.getInt("jobs.Weaponsmith")+"/"+MAXJOBS+")");
|
||||
p.sendMessage(ChatColor.GREEN+" Woodcutter ("+config.getInt("jobs.Woodcutter")+"/"+MAXJOBS+")");
|
||||
p.sendMessage("For more information, type "+ChatColor.GREEN+"/jobs info [JobName]");
|
||||
} else
|
||||
if (!p.hasPermission("bankeconomy.main.admin")) {
|
||||
p.sendMessage(ChatColor.GOLD + "---===" + this.prefix +
|
||||
ChatColor.GOLD + "===---");
|
||||
p.sendMessage(ChatColor.RED + "/bankeconomy transfer " +
|
||||
ChatColor.AQUA +
|
||||
"- Transfer some money to other player.");
|
||||
p.sendMessage(ChatColor.RED + "/bankeconomy info " +
|
||||
ChatColor.AQUA + "- See your bank informations.");
|
||||
p.sendMessage(ChatColor.RED + "/revive me" +
|
||||
ChatColor.AQUA + "- Revive after a death.");
|
||||
p.sendMessage(ChatColor.RED + "/revive amount " +
|
||||
ChatColor.AQUA + "- Check cost to revive at current location.");
|
||||
} else {
|
||||
p.sendMessage(ChatColor.GOLD + "---===" + this.prefix +
|
||||
ChatColor.GOLD + "===---");
|
||||
p.sendMessage(ChatColor.RED + "/bankeconomy transfer " +
|
||||
ChatColor.AQUA +
|
||||
"- Transfer some money to other player.");
|
||||
p.sendMessage(ChatColor.RED + "/bankeconomy info " +
|
||||
ChatColor.AQUA + "- See your bank informations.");
|
||||
p.sendMessage(ChatColor.DARK_RED + "/bankeconomy edit " +
|
||||
ChatColor.DARK_AQUA + "- Edit a player bank account.");
|
||||
p.sendMessage(ChatColor.RED + "/revive me" +
|
||||
ChatColor.AQUA + "- Revive after a death.");
|
||||
p.sendMessage(ChatColor.RED + "/revive amount " +
|
||||
ChatColor.AQUA + "- Check cost to revive at current location.");
|
||||
p.sendMessage(ChatColor.DARK_RED + "/bankeconomy check " +
|
||||
ChatColor.DARK_AQUA +
|
||||
"- Check a player bank account.");
|
||||
p.sendMessage(ChatColor.DARK_RED + "/bankeconomy reset " +
|
||||
ChatColor.DARK_AQUA +
|
||||
"- Delete a player bank account.");
|
||||
p.sendMessage(ChatColor.DARK_RED + "/bankeconomy reload " +
|
||||
ChatColor.DARK_AQUA +
|
||||
"- Reloads config and accounts.");
|
||||
}
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("event") && args.length==1 && p.hasPermission("maintenance-mode-admin")) {
|
||||
if (args[0].equalsIgnoreCase("halloween")) {
|
||||
if (this.plugin.getConfig().getBoolean("halloween-enabled")) {
|
||||
this.plugin.getConfig().set("halloween-enabled", Boolean.valueOf(false));
|
||||
p.sendMessage("Halloween event disabled.");
|
||||
} else {
|
||||
this.plugin.getConfig().set("halloween-enabled", Boolean.valueOf(true));
|
||||
p.sendMessage("Halloween event enabled.");
|
||||
}
|
||||
this.plugin.saveConfig();
|
||||
}
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("event") && args.length==2 && p.hasPermission("maintenance-mode-admin")) {
|
||||
if (args[0].equalsIgnoreCase("halloween") && args[1].equalsIgnoreCase("giant_pumpkin")) {
|
||||
if (this.plugin.getConfig().getBoolean("halloween-enabled")) {
|
||||
ItemStack item = new ItemStack(Material.PUMPKIN);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.GREEN+"Giant Pumpkin");
|
||||
List<String> lore = new ArrayList<String>();
|
||||
lore.add("Place the Giant Pumpkin on an Orange");
|
||||
lore.add("Block to start carving your pumpkin!");
|
||||
meta.setLore(lore);
|
||||
item.setItemMeta(meta);
|
||||
p.getInventory().addItem(item);
|
||||
}
|
||||
this.plugin.saveConfig();
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("halloween") && args[1].equalsIgnoreCase("pie_label")) {
|
||||
if (this.plugin.getConfig().getBoolean("halloween-enabled")) {
|
||||
for (int i=1;i<11;i++) {
|
||||
ItemStack item = new ItemStack(Material.PUMPKIN_PIE);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setDisplayName("Pie "+i);
|
||||
item.setItemMeta(meta);
|
||||
p.getInventory().addItem(item);
|
||||
}
|
||||
}
|
||||
this.plugin.saveConfig();
|
||||
}
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("transfer") && args.length==1) {
|
||||
p.sendMessage("Usage: "+ChatColor.RED+"/transfer name money"+ChatColor.WHITE+" - Transfer money to a player.");
|
||||
}
|
||||
else
|
||||
if (cmd.getName().equalsIgnoreCase("transfer") && args.length==2) {
|
||||
double amount = Double.parseDouble(args[1].replaceAll("[^0-9\\.]", ""));
|
||||
Player target = p.getServer().getPlayer(args[0]);
|
||||
if (target == null) {
|
||||
p.sendMessage(this.prefix + " " + this.offlinePlayer);
|
||||
}
|
||||
else if (target.getName() == p.getName()) {
|
||||
p.sendMessage(this.prefix + " " + this.cmdTransferSameNick);
|
||||
}
|
||||
else if (amount > playerBankBalance) {
|
||||
p.sendMessage(this.prefix + " " + this.notEnoughMoney);
|
||||
} else if (amount <= playerBankBalance) {
|
||||
double totalWithdraw = playerBankBalance - amount;
|
||||
double totalDeposit = amount + this.plugin.getAccountsConfig().getInt(target.getName() + ".money");
|
||||
|
||||
this.plugin.getAccountsConfig().set(p.getName() + ".money", Double.valueOf(totalWithdraw));
|
||||
this.plugin.getAccountsConfig().set(target.getName() + ".money", Double.valueOf(totalDeposit));
|
||||
this.plugin.saveAccountsConfig();
|
||||
|
||||
if (amount > 1.0D) {
|
||||
p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencyPlural + " " + this.cmdTransferToPlayer2 + " " + target.getName() + "<EFBFBD>˜a.");
|
||||
target.sendMessage(this.prefix + " <20>˜b" + p.getName() + " " + this.cmdTransferToTarget1 + " " + amount + currencyPlural + "<EFBFBD>˜a.");
|
||||
} else if (amount <= 1.0D) {
|
||||
p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencySingular + " " + this.cmdTransferToPlayer2 + " " + target.getName() + "<EFBFBD>˜a.");
|
||||
target.sendMessage(this.prefix + " <20>˜b" + p.getName() + " " + this.cmdTransferToTarget1 + " " + amount + currencySingular + "<EFBFBD>˜a.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
if (cmd.getName().equalsIgnoreCase("sp") && args.length==1) {
|
||||
try {
|
||||
int readvalue = Integer.valueOf(args[0]);
|
||||
if (readvalue<=10 && readvalue>=1) {
|
||||
int statpoints = (this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p);
|
||||
if (readvalue==10) {
|
||||
if (statpoints>=6) {
|
||||
this.plugin.getAccountsConfig().set(p.getName()+".stats.stat1", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")+6));
|
||||
this.plugin.saveAccountsConfig();
|
||||
p.sendMessage("You added 1 stat point to Health Regeneration! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1")/6)+" of extra health regeneration! (Every time you regenerate health, you get "+this.plugin.getStatBonus(0, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat1"))+" extra hearts!) "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left.");
|
||||
} else {
|
||||
p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 6.)");
|
||||
}
|
||||
} else
|
||||
if (readvalue==9) {
|
||||
if (statpoints>=5) {
|
||||
this.plugin.getAccountsConfig().set(p.getName()+".stats.stat2", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")+5));
|
||||
this.plugin.saveAccountsConfig();
|
||||
p.sendMessage("You added 1 stat point to block destroying speed! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(1, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat2")/5)+"% block destruction speed! "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left.");
|
||||
} else {
|
||||
p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 5.)");
|
||||
}
|
||||
} else
|
||||
if (readvalue==8) {
|
||||
if (statpoints>=4) {
|
||||
this.plugin.getAccountsConfig().set(p.getName()+".stats.stat3", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")+4));
|
||||
this.plugin.saveAccountsConfig();
|
||||
p.sendMessage("You added 1 stat point to block damage reduction! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(2, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat3")/4)+"% of damage taken reduced! "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left.");
|
||||
} else {
|
||||
p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 4.)");
|
||||
}
|
||||
} else
|
||||
if (readvalue==6) {
|
||||
if (statpoints>=3) {
|
||||
this.plugin.getAccountsConfig().set(p.getName()+".stats.stat4", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")+3));
|
||||
this.plugin.saveAccountsConfig();
|
||||
p.sendMessage("You added 1 stat point to temporary health! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(3, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat4")/4)+" extra temporary health. (Regenerates every 3 minutes.) "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left.");
|
||||
} else {
|
||||
p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 3.)");
|
||||
}
|
||||
} else
|
||||
if (readvalue==7) {
|
||||
if (statpoints>=4) {
|
||||
this.plugin.getAccountsConfig().set(p.getName()+".stats.stat5", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")+4));
|
||||
this.plugin.saveAccountsConfig();
|
||||
p.sendMessage("You added 1 stat point to armor penetration! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)+" damage of armor penetration. Armor-Wearers will be more afraid of you! "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left.");
|
||||
} else {
|
||||
p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 4.)");
|
||||
}
|
||||
} else
|
||||
if (readvalue==5) {
|
||||
if (statpoints>=3) {
|
||||
this.plugin.getAccountsConfig().set(p.getName()+".stats.stat6", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6")+3));
|
||||
this.plugin.saveAccountsConfig();
|
||||
p.sendMessage("You added 1 stat point to fire resistance! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(5, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat6")/3)+" seconds of fire resistance when you catch on fire. (Resets when you stop burning) "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left.");
|
||||
} else {
|
||||
p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 3.)");
|
||||
}
|
||||
} else
|
||||
if (readvalue==4) {
|
||||
if (statpoints>=2) {
|
||||
this.plugin.getAccountsConfig().set(p.getName()+".stats.stat7", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")+2));
|
||||
this.plugin.saveAccountsConfig();
|
||||
p.sendMessage("You added 1 stat point to base damage! "+ChatColor.BLUE+"You now have +"+this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")/2)+" base damage. "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left.");
|
||||
} else {
|
||||
p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 2.)");
|
||||
}
|
||||
} else
|
||||
if (readvalue==3) {
|
||||
if (statpoints>=2) {
|
||||
this.plugin.getAccountsConfig().set(p.getName()+".stats.stat8", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")+2));
|
||||
this.plugin.saveAccountsConfig();
|
||||
p.sendMessage("You added 1 stat point to base health! "+ChatColor.BLUE+"You now have +"+this.plugin.getStatBonus(7, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat8")/2)+" base health. "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left.");
|
||||
} else {
|
||||
p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 2.)");
|
||||
}
|
||||
} else
|
||||
if (readvalue==2) {
|
||||
if (statpoints>=1) {
|
||||
this.plugin.getAccountsConfig().set(p.getName()+".stats.stat9", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9")+1));
|
||||
this.plugin.saveAccountsConfig();
|
||||
p.sendMessage("You added 1 stat point to hunger decay! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(8, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat9"))+"% less hunger decay "+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left.");
|
||||
} else {
|
||||
p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 1.)");
|
||||
}
|
||||
} else
|
||||
if (readvalue==1) {
|
||||
if (statpoints>=1) {
|
||||
this.plugin.getAccountsConfig().set(p.getName()+".stats.stat10", Integer.valueOf(this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat10")+1));
|
||||
this.plugin.saveAccountsConfig();
|
||||
p.sendMessage("You added 1 stat point to water breathing! "+ChatColor.BLUE+"You now have "+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat10"))+" seconds of water breathing. "+ChatColor.WHITE+((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))+" stat point"+(((this.plugin.getJobTotalLvs(p)/5+1)-this.plugin.getStatPointTotal(p))==1?"":"s")+" left.");
|
||||
//Increase maximum air by 200 ticks.
|
||||
p.setMaximumAir(300+this.plugin.getStatBonus(9, this.plugin.getAccountsConfig().getInt(p.getName() + ".stats.stat10"))*20);
|
||||
} else {
|
||||
p.sendMessage(ChatColor.RED+"You do not have enough stat points to get that stat! (You need 1.)");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
p.sendMessage(ChatColor.RED+"Please choose an appropriate stat point slot (1-10).");
|
||||
}
|
||||
} catch (NumberFormatException ex_e) {
|
||||
p.sendMessage(ChatColor.RED+"The inputted slot is not a valid number.");
|
||||
}
|
||||
}
|
||||
else if (cmd.getName().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("info")) && (p.hasPermission("bankeconomy.info"))) {
|
||||
if (args.length == 1) {
|
||||
if (playerBankBalance <= 1)
|
||||
p.sendMessage(this.prefix + " " + this.cmdInfo + " " + playerBankBalance + currencySingular + "<EFBFBD>˜a.");
|
||||
else if (playerBankBalance > 1)
|
||||
p.sendMessage(this.prefix + " " + this.cmdInfo + " " + playerBankBalance + currencyPlural + "<EFBFBD>˜a.");
|
||||
}
|
||||
else
|
||||
p.sendMessage(this.invARG);
|
||||
}
|
||||
else if (cmd.getName().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("check")) && (p.hasPermission("bankeconomy.check"))) {
|
||||
if (args.length == 1) {
|
||||
p.sendMessage(this.prefix + " " + this.usage + " " + this.cmdCheckARG1);
|
||||
} else if (args.length == 2) {
|
||||
Player target = p.getServer().getPlayer(args[1]);
|
||||
|
||||
if (target == null) {
|
||||
p.sendMessage(this.prefix + " " + this.offlinePlayer);
|
||||
} else {
|
||||
int targetBalance = this.plugin.getAccountsConfig().getInt(target.getName() + ".money");
|
||||
|
||||
if (targetBalance <= 1)
|
||||
p.sendMessage(this.prefix + "<EFBFBD>˜a " + target.getName() + this.cmdCheckReponsePlayer + " " + targetBalance + currencySingular);
|
||||
else if (targetBalance > 1)
|
||||
p.sendMessage(this.prefix + "<EFBFBD>˜a " + target.getName() + this.cmdCheckReponsePlayer + " " + targetBalance + currencyPlural);
|
||||
}
|
||||
}
|
||||
else {
|
||||
p.sendMessage(this.invARG);
|
||||
}
|
||||
} else if (cmd.getName().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("reset")) && (p.hasPermission("bankeconomy.reset"))) {
|
||||
if (args.length == 1) {
|
||||
p.sendMessage(this.prefix + " " + this.usage + " " + this.cmdResetARG1);
|
||||
} else if (args.length == 2) {
|
||||
Player target = p.getServer().getPlayer(args[1]);
|
||||
|
||||
if (target == null) {
|
||||
p.sendMessage(this.prefix + " " + this.offlinePlayer);
|
||||
} else {
|
||||
this.plugin.getAccountsConfig().set(target.getName() + ".money", Integer.valueOf(0));
|
||||
this.plugin.saveAccountsConfig();
|
||||
|
||||
p.sendMessage(this.prefix + " " + this.cmdResetToPlayer1 + " " + target.getName() + this.cmdResetToPlayer2);
|
||||
target.sendMessage(this.prefix + " <20>˜a" + p.getName() + " " + this.cmdResetToTarget);
|
||||
}
|
||||
} else {
|
||||
p.sendMessage(this.invARG);
|
||||
}
|
||||
} else if ((args[0].equalsIgnoreCase("reload")) && (p.hasPermission("bankeconomy.reload"))) {
|
||||
if (args.length == 1) {
|
||||
p.sendMessage(this.prefix + " " + this.cmdReload);
|
||||
|
||||
FileConfiguration conf = this.plugin.getConfig();
|
||||
this.plugin.reloadConfig();
|
||||
return conf == this.plugin.getConfig();
|
||||
}
|
||||
p.sendMessage(this.invARG);
|
||||
}
|
||||
else if (cmd.getName().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("transfer")) && (p.hasPermission("bankeconomy.transfer"))) {
|
||||
if (args.length == 1) {
|
||||
p.sendMessage(this.prefix + " " + this.usage + " " + this.cmdTransferARG1);
|
||||
} else if (args.length == 2) {
|
||||
p.sendMessage(this.prefix + " " + this.cmdTransferARG2);
|
||||
} else if (args.length == 3) {
|
||||
double amount = Double.parseDouble(args[1].replaceAll("[^0-9\\.]", ""));
|
||||
Player target = p.getServer().getPlayer(args[2]);
|
||||
|
||||
if (target == null) {
|
||||
p.sendMessage(this.prefix + " " + this.offlinePlayer);
|
||||
}
|
||||
else if (target.getName() == p.getName()) {
|
||||
p.sendMessage(this.prefix + " " + this.cmdTransferSameNick);
|
||||
}
|
||||
else if (amount > playerBankBalance) {
|
||||
p.sendMessage(this.prefix + " " + this.notEnoughMoney);
|
||||
} else if (amount <= playerBankBalance) {
|
||||
double totalWithdraw = playerBankBalance - amount;
|
||||
double totalDeposit = amount + this.plugin.getAccountsConfig().getInt(target.getName() + ".money");
|
||||
|
||||
this.plugin.getAccountsConfig().set(p.getName() + ".money", Double.valueOf(totalWithdraw));
|
||||
this.plugin.getAccountsConfig().set(target.getName() + ".money", Double.valueOf(totalDeposit));
|
||||
this.plugin.saveAccountsConfig();
|
||||
|
||||
if (amount > 1.0D) {
|
||||
p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencyPlural + " " + this.cmdTransferToPlayer2 + " " + target.getName() + "<EFBFBD>˜a.");
|
||||
target.sendMessage(this.prefix + " <20>˜b" + p.getName() + " " + this.cmdTransferToTarget1 + " " + amount + currencyPlural + "<EFBFBD>˜a.");
|
||||
} else if (amount <= 1.0D) {
|
||||
p.sendMessage(this.prefix + " " + this.cmdTransferToPlayer1 + " " + amount + currencySingular + " " + this.cmdTransferToPlayer2 + " " + target.getName() + "<EFBFBD>˜a.");
|
||||
target.sendMessage(this.prefix + " <20>˜b" + p.getName() + " " + this.cmdTransferToTarget1 + " " + amount + currencySingular + "<EFBFBD>˜a.");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
p.sendMessage(this.invARG);
|
||||
}
|
||||
} else if (cmd.getName().equalsIgnoreCase("bankeconomy") && (args[0].equalsIgnoreCase("edit")) && (p.hasPermission("bankeconomy.edit"))) {
|
||||
if (args.length == 1) {
|
||||
p.sendMessage(this.prefix + " " + this.usage + " " + this.cmdEditARG1);
|
||||
p.sendMessage(this.prefix + " " + this.cmdEditAvaibleActions);
|
||||
} else if (args.length == 2) {
|
||||
p.sendMessage(this.prefix + " " + this.cmdTransferARG2);
|
||||
} else if (args.length == 3) {
|
||||
p.sendMessage(this.prefix + " " + this.cmdEditARG2);
|
||||
} else if (args.length == 4) {
|
||||
double amount = Double.parseDouble(args[3].replaceAll("[^0-9\\.]", ""));
|
||||
Player target = p.getServer().getPlayer(args[2]);
|
||||
|
||||
if (target == null) {
|
||||
p.sendMessage(this.prefix + " " + this.offlinePlayer);
|
||||
}
|
||||
else if (args[1].equalsIgnoreCase("status")) {
|
||||
if (amount == 1.0D) {
|
||||
this.plugin.getAccountsConfig().set(target.getName() + ".status", Boolean.valueOf(true));
|
||||
this.plugin.saveAccountsConfig();
|
||||
|
||||
p.sendMessage(this.prefix + " " + this.cmdEditEnableToPlayer1 + " " + p.getName() + this.cmdEditEnableToPlayer2);
|
||||
} else if (amount == 0.0D) {
|
||||
this.plugin.getAccountsConfig().set(target.getName() + ".status", Boolean.valueOf(false));
|
||||
this.plugin.saveAccountsConfig();
|
||||
|
||||
p.sendMessage(this.prefix + " " + this.cmdEditDisabledToPlayer1 + " " + p.getName() + this.cmdEditDisabledToPlayer2);
|
||||
}
|
||||
} else if (args[1].equalsIgnoreCase("balance")) {
|
||||
this.plugin.getAccountsConfig().set(target.getName() + ".money", Double.valueOf(amount));
|
||||
this.plugin.saveAccountsConfig();
|
||||
|
||||
if (amount > 1.0D)
|
||||
p.sendMessage(this.prefix + " " + this.cmdEditAmountSetPlayer1 + " <20>˜b" + amount + currencyPlural + " " + this.cmdEditAmountSetPlayer2 + " " + target.getName() + this.cmdEditAmountSetPlayer3);
|
||||
else if (amount <= 1.0D)
|
||||
p.sendMessage(this.prefix + " " + this.cmdEditAmountSetPlayer1 + " <20>˜b" + amount + currencySingular + " " + this.cmdEditAmountSetPlayer2 + " " + target.getName() + this.cmdEditAmountSetPlayer3);
|
||||
}
|
||||
else {
|
||||
p.sendMessage(this.prefix + " " + this.cmdEditAvaibleActions);
|
||||
}
|
||||
}
|
||||
else {
|
||||
p.sendMessage(this.invARG);
|
||||
}
|
||||
}
|
||||
else if (cmd.getName().equalsIgnoreCase("revive") && args[0].equalsIgnoreCase("me")) {
|
||||
DecimalFormat df = new DecimalFormat("#0.00");
|
||||
double deathX = this.plugin.getAccountsConfig().getDouble(p.getName() + ".deathpointX");
|
||||
double deathY = this.plugin.getAccountsConfig().getDouble(p.getName() + ".deathpointY");
|
||||
double deathZ = this.plugin.getAccountsConfig().getDouble(p.getName() + ".deathpointZ");
|
||||
String deathWorld = this.plugin.getAccountsConfig().getString(p.getName() + ".deathworld");
|
||||
//p.sendMessage("Got 1.");
|
||||
if (this.plugin.getAccountsConfig().getBoolean(p.getName() + ".revived")==false && p.getPlayerTime()-this.plugin.getAccountsConfig().getDouble(p.getName() + ".revivetime")<12000) {
|
||||
double mincost = this.plugin.getConfig().getDouble("revive-cost-rate");
|
||||
//p.sendMessage("Got 2.");
|
||||
if (p.getBedSpawnLocation()!=null) {
|
||||
mincost *= Math.abs(p.getBedSpawnLocation().getX()-deathX)+Math.abs(p.getBedSpawnLocation().getY()-deathY)+Math.abs(p.getBedSpawnLocation().getZ()-deathZ);
|
||||
} else {
|
||||
mincost *= Math.abs(p.getWorld().getSpawnLocation().getX()-deathX)+Math.abs(p.getWorld().getSpawnLocation().getY()-deathY)+Math.abs(p.getWorld().getSpawnLocation().getZ()-deathZ);
|
||||
}
|
||||
double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName() + ".money");
|
||||
double finalcost = (mincost*this.plugin.getConfig().getDouble("revive-cost-rate")) + (mymoney*this.plugin.getConfig().getDouble("revive-cost-tax"));
|
||||
if (this.plugin.PlayerinJob(p, "Explorer") && this.plugin.getJobLv("Explorer", p)>=20) {
|
||||
finalcost*=0.25;
|
||||
}
|
||||
//p.sendMessage("Got 3.");
|
||||
if (mymoney>=finalcost) {
|
||||
this.plugin.getAccountsConfig().set(p.getName() + ".revived", Boolean.valueOf(true));
|
||||
this.plugin.getAccountsConfig().set(p.getName() + ".money", mymoney-finalcost);
|
||||
this.plugin.getAccountsConfig().set(p.getName() + ".revivetime", Double.valueOf(0.0d));
|
||||
this.plugin.saveAccountsConfig();
|
||||
//p.sendMessage("Got 4.");
|
||||
p.sendMessage("You spent $"+df.format(finalcost)+" to revive. New Bank Balance: $"+ChatColor.YELLOW+df.format(mymoney-finalcost));
|
||||
//p.sendMessage("Got 5.");
|
||||
org.bukkit.Location teleportloc = p.getLocation();
|
||||
if (p.getBedSpawnLocation()!=null) {
|
||||
teleportloc = p.getBedSpawnLocation();
|
||||
} else {
|
||||
//Use world spawn point.
|
||||
teleportloc = p.getWorld().getSpawnLocation();
|
||||
}
|
||||
teleportloc.setX(deathX);
|
||||
teleportloc.setY(deathY);
|
||||
teleportloc.setZ(deathZ);
|
||||
teleportloc.setWorld(Bukkit.getWorld(deathWorld));
|
||||
//p.sendMessage("Got 6.");
|
||||
p.teleport(teleportloc);
|
||||
//p.sendMessage("Got 7.");
|
||||
Bukkit.broadcastMessage(ChatColor.GREEN+p.getName()+ChatColor.WHITE+" decided to revive to their death location.");
|
||||
} else {
|
||||
p.sendMessage("You cannot revive. You need to have $"+df.format(finalcost)+" to do so.");
|
||||
}
|
||||
} else {
|
||||
p.sendMessage("You haven't died. So you cannot revive.");
|
||||
}
|
||||
this.plugin.saveAccountsConfig();
|
||||
return true;
|
||||
}
|
||||
else if (cmd.getName().equalsIgnoreCase("revive") && (args[0].equalsIgnoreCase("amount"))) {
|
||||
DecimalFormat df = new DecimalFormat("#0.00");
|
||||
double deathX = p.getLocation().getX();
|
||||
double deathY = p.getLocation().getY();
|
||||
double deathZ = p.getLocation().getZ();
|
||||
double mincost = this.plugin.getConfig().getDouble("revive-cost-rate");
|
||||
if (p.getBedSpawnLocation()!=null) {
|
||||
mincost *= Math.abs(p.getBedSpawnLocation().getX()-deathX)+Math.abs(p.getBedSpawnLocation().getY()-deathY)+Math.abs(p.getBedSpawnLocation().getZ()-deathZ);
|
||||
} else {
|
||||
mincost *= Math.abs(p.getWorld().getSpawnLocation().getX()-deathX)+Math.abs(p.getWorld().getSpawnLocation().getY()-deathY)+Math.abs(p.getWorld().getSpawnLocation().getZ()-deathZ);
|
||||
}
|
||||
double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName() + ".money");
|
||||
double finalcost = (mincost*this.plugin.getConfig().getDouble("revive-cost-rate")) + (mymoney*this.plugin.getConfig().getDouble("revive-cost-tax"));
|
||||
if (this.plugin.PlayerinJob(p, "Explorer") && this.plugin.getJobLv("Explorer", p)>=20) {
|
||||
finalcost*=0.25;
|
||||
}
|
||||
p.sendMessage("You need to have $"+df.format(finalcost)+" to revive.");
|
||||
return true;
|
||||
}
|
||||
else if (cmd.getName().equalsIgnoreCase("tele") && (args[0].equalsIgnoreCase("to"))) {
|
||||
DecimalFormat df = new DecimalFormat("#0.00");
|
||||
if (p.getPlayerTime()-this.plugin.getAccountsConfig().getDouble(p.getName() + ".teletime")<400) {
|
||||
if (args.length==1) {
|
||||
p.sendMessage("Usage: "+ChatColor.RED+"/tele to "+ChatColor.GREEN+" <player>"+ChatColor.WHITE+" - Teleport to a player for a cost.");
|
||||
} else if (args.length==2) {
|
||||
//Teleport.
|
||||
Player target = p.getServer().getPlayer(args[1]);
|
||||
if (target == null) {
|
||||
p.sendMessage(this.prefix + " " + this.offlinePlayer);
|
||||
} else {
|
||||
if (target.getName() == this.plugin.getAccountsConfig().getString(p.getName() + ".teleplayer")) {
|
||||
//Determine distance of player to other player.
|
||||
double otherx = target.getLocation().getX();
|
||||
double othery = target.getLocation().getY();
|
||||
double otherz = target.getLocation().getZ();
|
||||
double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName() + ".money");
|
||||
double finalcost = Math.abs(p.getLocation().getX()-otherx)+Math.abs(p.getLocation().getY()-othery)+Math.abs(p.getLocation().getZ()-otherz);
|
||||
finalcost *= this.plugin.getConfig().getDouble("teleport-cost-rate");
|
||||
finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax");
|
||||
if (mymoney>=finalcost) {
|
||||
//Allow teleport to occur.
|
||||
this.plugin.getAccountsConfig().set(p.getName() + ".money", mymoney-finalcost);
|
||||
this.plugin.getAccountsConfig().set(p.getName() + ".teletime", Double.valueOf(0.0d));
|
||||
this.plugin.saveAccountsConfig();
|
||||
if (this.plugin.PlayerinJob(p, "Support")) {
|
||||
//Give exp for doing so.
|
||||
this.plugin.gainMoneyExp(p,"Support",0,100);
|
||||
}
|
||||
p.sendMessage("Teleported to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+" for $"+ChatColor.YELLOW+df.format(finalcost)+ChatColor.WHITE+". New Account balance: $"+df.format(mymoney-finalcost));
|
||||
target.sendMessage(ChatColor.GREEN+p.getName()+ChatColor.WHITE+" teleported to your location.");
|
||||
p.teleport(target);
|
||||
} else {
|
||||
p.sendMessage("You need $"+ChatColor.YELLOW+df.format(finalcost)+" in the bank to teleport to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+"!");
|
||||
}
|
||||
} else {
|
||||
//Setup another player.
|
||||
//Determine distance of player to other player.
|
||||
double otherx = target.getLocation().getX();
|
||||
double othery = target.getLocation().getY();
|
||||
double otherz = target.getLocation().getZ();
|
||||
double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName() + ".money");
|
||||
double finalcost = Math.abs(p.getLocation().getX()-otherx)+Math.abs(p.getLocation().getY()-othery)+Math.abs(p.getLocation().getZ()-otherz);
|
||||
finalcost *= this.plugin.getConfig().getDouble("teleport-cost-rate");
|
||||
finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax");
|
||||
if (mymoney>=finalcost) {
|
||||
//Allow teleport to occur.
|
||||
p.sendMessage("Teleporting to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+" costs $"+ChatColor.YELLOW+df.format(finalcost)+". Type the command again to teleport.");
|
||||
this.plugin.getAccountsConfig().set(p.getName() + ".teletime", Double.valueOf(p.getPlayerTime()));
|
||||
this.plugin.getAccountsConfig().set(p.getName() + ".teleplayer", String.valueOf(target.getName()));
|
||||
} else {
|
||||
p.sendMessage("Teleporting to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+" costs $"+ChatColor.YELLOW+df.format(finalcost)+". You do not have enough in the bank for that.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//Say how much it costs. If the player is found. =
|
||||
if (args.length==1) {
|
||||
p.sendMessage("Usage: "+ChatColor.RED+"/tele to "+ChatColor.GREEN+" <player>"+ChatColor.WHITE+" - Teleport to a player for a cost.");
|
||||
} else if (args.length==2) {
|
||||
//Teleport.
|
||||
Player target = p.getServer().getPlayer(args[1]);
|
||||
if (target == null) {
|
||||
p.sendMessage(this.prefix + " " + this.offlinePlayer);
|
||||
} else {
|
||||
//Determine distance of player to other player.
|
||||
double otherx = target.getLocation().getX();
|
||||
double othery = target.getLocation().getY();
|
||||
double otherz = target.getLocation().getZ();
|
||||
double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName() + ".money");
|
||||
double finalcost = Math.abs(p.getLocation().getX()-otherx)+Math.abs(p.getLocation().getY()-othery)+Math.abs(p.getLocation().getZ()-otherz);
|
||||
finalcost *= this.plugin.getConfig().getDouble("teleport-cost-rate");
|
||||
finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax");
|
||||
if (mymoney>=finalcost) {
|
||||
//Allow teleport to occur.
|
||||
p.sendMessage("Teleporting to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+" costs $"+ChatColor.YELLOW+df.format(finalcost)+". Type the command again to teleport.");
|
||||
this.plugin.getAccountsConfig().set(p.getName() + ".teletime", Double.valueOf(p.getPlayerTime()));
|
||||
this.plugin.getAccountsConfig().set(p.getName() + ".teleplayer", String.valueOf(target.getName()));
|
||||
} else {
|
||||
p.sendMessage("Teleporting to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+" costs $"+ChatColor.YELLOW+df.format(finalcost)+". You do not have enough in the bank for that.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("info")) {
|
||||
p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs info [JobName]"+ChatColor.WHITE+" - Get information about a job.");
|
||||
p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs info [JobName] "+ChatColor.LIGHT_PURPLE+"[lv]"+ChatColor.WHITE+" - Get information about a job at a certain job level.");
|
||||
p.sendMessage(" Type /jobs to see the jobs.");
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("join")) {
|
||||
p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs join [JobName]"+ChatColor.WHITE+" - Join a job. Type /jobs to see the jobs.");
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("leave")) {
|
||||
p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs leave [JobName]"+ChatColor.WHITE+" - Leave a job. Type /jobs stats to see your jobs.");
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 1 && args[0].equalsIgnoreCase("buffs")) {
|
||||
p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs buffs [JobName]"+ChatColor.WHITE+" - Get buffs information about a job. Type /jobs to see the jobs.");
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("join")) {
|
||||
//Attempt to join the job.
|
||||
this.plugin.joinJob(p,args[1]);
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && args.length == 2 && args[0].equalsIgnoreCase("leave")) {
|
||||
//Attempt to join the job.
|
||||
this.plugin.leaveJob(p,args[1]);
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && (args.length == 2 || args.length==3) && args[0].equalsIgnoreCase("info")) {
|
||||
JobsDataInfo[] Jobsinfo = {this.plugin.Woodcutter_job,this.plugin.Miner_job,this.plugin.Builder_job,this.plugin.Digger_job,this.plugin.Farmer_job,this.plugin.Hunter_job,this.plugin.Fisherman_job,this.plugin.Weaponsmith_job,this.plugin.Blacksmith_job,this.plugin.Cook_job,this.plugin.Brewer_job,this.plugin.Enchanter_job,this.plugin.Breeder_job,this.plugin.Explorer_job,this.plugin.Support_job};
|
||||
boolean found=false;
|
||||
int matchedjob=0;
|
||||
boolean error=false;
|
||||
for (int i=0;i<this.plugin.ValidJobs.length;i++) {
|
||||
if (this.plugin.ValidJobs[i].equalsIgnoreCase(args[1])) {
|
||||
//Found the job, display that data.
|
||||
if (args.length==2) {
|
||||
//Get slot this job is in for this player.
|
||||
String[] joblist = this.plugin.getJobs(p);
|
||||
int slot=0;
|
||||
for (int j=0;j<joblist.length;j++) {
|
||||
if (args[1].equalsIgnoreCase(joblist[j])) {
|
||||
slot=j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (this.plugin.PlayerinJob(p, args[1])) {
|
||||
Jobsinfo[i].sendOutput(p,this.plugin.getAccountsConfig().getInt(p.getName()+".jobs.job"+(slot+1)+"lv"));
|
||||
} else {
|
||||
Jobsinfo[i].sendOutput(p);
|
||||
}
|
||||
} else {
|
||||
Jobsinfo[i].sendOutput(p,(int)Double.parseDouble(args[2].replaceAll("[^0-9\\.]", "")));
|
||||
error=true;
|
||||
}
|
||||
found=true;
|
||||
matchedjob=i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!error)
|
||||
{
|
||||
p.sendMessage(ChatColor.GOLD+"Job $$ Growth Rate: "+ChatColor.WHITE+Math.round(Jobsinfo[matchedjob].moneymult*100)+"% per level");
|
||||
p.sendMessage("");
|
||||
p.sendMessage(ChatColor.BLUE+"To see the buffs this job gives, type "+ChatColor.GREEN+" /jobs buffs "+args[1]+ChatColor.WHITE+".");
|
||||
}
|
||||
if (!found) {
|
||||
p.sendMessage(ChatColor.GOLD+"That is not a valid job name.");
|
||||
p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs info [JobName]"+ChatColor.WHITE+" - Get information about a job. Type /jobs to see the jobs.");
|
||||
} else {
|
||||
if (!this.plugin.PlayerinJob(p, args[1]) && this.plugin.getPlayerJobCount(p)<3) {
|
||||
p.sendMessage("");
|
||||
p.sendMessage("To join this job, type "+ChatColor.GREEN+" /jobs join "+args[1]+ChatColor.WHITE+".");
|
||||
} else {
|
||||
if (!this.plugin.PlayerinJob(p, args[1]) && this.plugin.getPlayerJobCount(p)==3) {
|
||||
p.sendMessage("");
|
||||
p.sendMessage("You can't join this job until you leave a job with "+ChatColor.GREEN+" /jobs leave"+ChatColor.WHITE+".");
|
||||
}
|
||||
}
|
||||
}
|
||||
p.sendMessage("");
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && (args.length == 2) && args[0].equalsIgnoreCase("buffs")) {
|
||||
JobsDataInfo[] Jobsinfo = {this.plugin.Woodcutter_job,this.plugin.Miner_job,this.plugin.Builder_job,this.plugin.Digger_job,this.plugin.Farmer_job,this.plugin.Hunter_job,this.plugin.Fisherman_job,this.plugin.Weaponsmith_job,this.plugin.Blacksmith_job,this.plugin.Cook_job,this.plugin.Brewer_job,this.plugin.Enchanter_job,this.plugin.Breeder_job,this.plugin.Explorer_job,this.plugin.Support_job};
|
||||
boolean found=false;
|
||||
int slot=0;
|
||||
for (int i=0;i<this.plugin.ValidJobs.length;i++) {
|
||||
if (this.plugin.ValidJobs[i].equalsIgnoreCase(args[1])) {
|
||||
//This is a valid job.
|
||||
found=true;
|
||||
slot=i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
p.sendMessage(ChatColor.GOLD+"That is not a valid job name.");
|
||||
p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs buffs [JobName]"+ChatColor.WHITE+" - Get buffs information about a job. Type /jobs to see the jobs.");
|
||||
} else {
|
||||
p.sendMessage("");
|
||||
p.sendMessage("Buffs for the "+args[1]+" job:");
|
||||
p.sendMessage("");
|
||||
p.sendMessage(ChatColor.BLUE+"Lv5 BUFF: "+ChatColor.WHITE+Jobsinfo[slot].lv5buff);
|
||||
p.sendMessage("");
|
||||
p.sendMessage(ChatColor.GREEN+"Lv10 BUFF: "+ChatColor.WHITE+Jobsinfo[slot].lv10buff);
|
||||
p.sendMessage("");
|
||||
p.sendMessage(ChatColor.GOLD+"Lv20 BUFF: "+ChatColor.WHITE+Jobsinfo[slot].lv20buff);
|
||||
p.sendMessage("");
|
||||
p.sendMessage(ChatColor.RED+"Lv40 ULTI: "+ChatColor.WHITE+Jobsinfo[slot].lv40buff);
|
||||
p.sendMessage("");
|
||||
p.sendMessage(ChatColor.ITALIC+"Note that only one ultimate buff can be chosen. And CANNOT BE CHANGED.");
|
||||
}
|
||||
} else
|
||||
if (cmd.getName().equalsIgnoreCase("jobs") && (args.length == 1 || args.length==2) && args[0].equalsIgnoreCase("stats")) {
|
||||
if (args.length==1) {
|
||||
//Show your stats.
|
||||
p.sendMessage("");
|
||||
p.sendMessage("Your jobs:");
|
||||
String[] joblist=this.plugin.getJobs(p);
|
||||
for (int i=0;i<joblist.length;i++) {
|
||||
if (!joblist[i].equalsIgnoreCase("None")) {
|
||||
int mylv=this.plugin.getAccountsConfig().getInt(p.getName()+".jobs.job"+(i+1)+"lv");
|
||||
p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(p.getName()+".jobs.job"+(i+1)+"exp"))+"/"+Math.round(this.plugin.getJobExp(joblist[i], this.plugin.getAccountsConfig().getInt(p.getName()+".jobs.job"+(i+1)+"lv")))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":""));if (joblist[i].equalsIgnoreCase("Explorer") && this.plugin.getJobLv(joblist[i], p)>=10) {
|
||||
//Check to see if the buff is on cooldown for this player or not.
|
||||
boolean discovered=false;
|
||||
long timeleft=0;
|
||||
for (int j=0;j<this.plugin.explorers.size();j++) {
|
||||
if (this.plugin.explorers.get(j).name.compareToIgnoreCase(p.getName())==0 && this.plugin.explorers.get(j).event==0) {
|
||||
discovered=true;
|
||||
timeleft=this.plugin.explorers.get(j).expiretime-Bukkit.getWorld("world").getFullTime();
|
||||
}
|
||||
}
|
||||
//Add-on message for explorer buff cooldown.
|
||||
DecimalFormat df = new DecimalFormat("00");
|
||||
p.sendMessage(" "+ChatColor.ITALIC+ChatColor.GOLD+"Fatal Survivor Buff: "+ChatColor.RESET+((discovered)?((timeleft<=0)?ChatColor.GREEN+"Available":ChatColor.RED+"Unavailable"+ChatColor.ITALIC+ChatColor.WHITE+" Cooldown: "+df.format(timeleft/36000)+":"+df.format((timeleft/600)%60)+":"+df.format((timeleft/10)%60)):ChatColor.GREEN+"Available"));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//Look for that player. First just see if they are online.
|
||||
boolean found=false;
|
||||
if (p.getServer().getPlayer(args[1])!=null) {
|
||||
//This is the player. Show job stats.
|
||||
p.sendMessage("");
|
||||
p.sendMessage(p.getServer().getPlayer(args[1]).getName()+"'s jobs:");
|
||||
String[] joblist=this.plugin.getJobs(p.getServer().getPlayer(args[1]));
|
||||
for (int i=0;i<joblist.length;i++) {
|
||||
if (!joblist[i].equalsIgnoreCase("None")) {
|
||||
int mylv=this.plugin.getAccountsConfig().getInt(p.getServer().getPlayer(args[1]).getName()+".jobs.job"+(i+1)+"lv");
|
||||
p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(p.getServer().getPlayer(args[1]).getName()+".jobs.job"+(i+1)+"exp"))+"/"+Math.round(this.plugin.getJobExp(joblist[i], this.plugin.getAccountsConfig().getInt(p.getServer().getPlayer(args[1]).getName()+".jobs.job"+(i+1)+"lv")))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":""));
|
||||
if (joblist[i].equalsIgnoreCase("Explorer") && this.plugin.getJobLv(joblist[i], p.getServer().getPlayer(args[1]))>=10) {
|
||||
//Check to see if the buff is on cooldown for this player or not.
|
||||
boolean discovered=false;
|
||||
long timeleft=0;
|
||||
for (int j=0;j<this.plugin.explorers.size();j++) {
|
||||
if (this.plugin.explorers.get(j).name.compareToIgnoreCase(p.getServer().getPlayer(args[1]).getName())==0 && this.plugin.explorers.get(j).event==0) {
|
||||
discovered=true;
|
||||
timeleft=this.plugin.explorers.get(j).expiretime-Bukkit.getWorld("world").getFullTime();
|
||||
}
|
||||
}
|
||||
//Add-on message for explorer buff cooldown.
|
||||
DecimalFormat df = new DecimalFormat("00");
|
||||
p.sendMessage(" "+ChatColor.ITALIC+ChatColor.GOLD+"Fatal Survivor Buff: "+ChatColor.RESET+((discovered)?((timeleft<=0)?ChatColor.GREEN+"Available":ChatColor.RED+"Unavailable"+ChatColor.ITALIC+ChatColor.WHITE+" Cooldown: "+df.format(timeleft/36000)+":"+df.format((timeleft/600)%60)+":"+df.format((timeleft/10)%60)):ChatColor.GREEN+"Available"));
|
||||
}
|
||||
}
|
||||
}
|
||||
found=true;
|
||||
}
|
||||
if (!found) {
|
||||
OfflinePlayer q = Bukkit.getOfflinePlayer(args[1]);
|
||||
|
||||
//Try a search in the config directly.
|
||||
if (this.plugin.getAccountsConfig().contains(q.getName())) {
|
||||
//This player seems to exist. Check out their stats.
|
||||
p.sendMessage("");
|
||||
p.sendMessage(q.getName()+"'s jobs:");
|
||||
String[] joblist=this.plugin.getJobs(q.getName());
|
||||
for (int i=0;i<joblist.length;i++) {
|
||||
if (!joblist[i].equalsIgnoreCase("None")) {
|
||||
int mylv=this.plugin.getAccountsConfig().getInt(q.getName()+".jobs.job"+(i+1)+"lv");
|
||||
p.sendMessage("Lv"+mylv+" "+this.plugin.getJobColor(joblist[i])+joblist[i]+ChatColor.WHITE+": "+Math.round(this.plugin.getAccountsConfig().getInt(q.getName()+".jobs.job"+(i+1)+"exp"))+"/"+Math.round(this.plugin.getJobExp(joblist[i], this.plugin.getAccountsConfig().getInt(q.getName()+".jobs.job"+(i+1)+"lv")))+"xp "+ChatColor.BLUE+(mylv>=5?"+Lv5 Buff":"")+ChatColor.GREEN+(mylv>=10?" +Lv10 Buff":"")+ChatColor.GOLD+(mylv>=20?" +Lv20 Buff":""));
|
||||
}
|
||||
if (joblist[i].equalsIgnoreCase("Explorer") && this.plugin.getJobLv(joblist[i], q.getName())>=10) {
|
||||
//Check to see if the buff is on cooldown for this player or not.
|
||||
boolean discovered=false;
|
||||
long timeleft=0;
|
||||
for (int j=0;j<this.plugin.explorers.size();j++) {
|
||||
if (this.plugin.explorers.get(j).name.compareToIgnoreCase(q.getName())==0 && this.plugin.explorers.get(j).event==0) {
|
||||
discovered=true;
|
||||
timeleft=this.plugin.explorers.get(j).expiretime-Bukkit.getWorld("world").getFullTime();
|
||||
}
|
||||
}
|
||||
//Add-on message for explorer buff cooldown.
|
||||
DecimalFormat df = new DecimalFormat("00");
|
||||
p.sendMessage(" "+ChatColor.ITALIC+ChatColor.GOLD+"Fatal Survivor Buff: "+ChatColor.RESET+((discovered)?((timeleft<=0)?ChatColor.GREEN+"Available":ChatColor.RED+"Unavailable"+ChatColor.ITALIC+ChatColor.WHITE+" Cooldown: "+df.format(timeleft/36000)+":"+df.format((timeleft/600)%60)+":"+df.format((timeleft/10)%60)):ChatColor.GREEN+"Available"));
|
||||
}
|
||||
}
|
||||
found=true;
|
||||
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
p.sendMessage(ChatColor.GOLD+"Could not find player!");
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
p.sendMessage(this.invARGT2);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user