0.9.30 WIP

This commit is contained in:
nossr50 2011-04-14 20:48:54 -07:00
parent 6236e0960e
commit bc0c3c7a57
18 changed files with 680 additions and 483 deletions

View File

@ -1,5 +1,14 @@
Changelog: Changelog:
#Versions without changelogs probably had very small misc fixes, like tweaks to the source code# #Versions without changelogs probably had very small misc fixes, like tweaks to the source code#
Version 0.9.29
Fixes critical bug involving water turning anything into clay
Version 0.9.28
Green thumb can now spread grass to dirt using seeds
Adding XP will check for level ups again
Acrobatics won't hand out XP on death anymore
Acrobatics will check plugins for the event being cancelled before handing out XP
Version 0.9.27 Version 0.9.27
Fixed Herbalism not properly receiving Triple Drops from Green Terra Fixed Herbalism not properly receiving Triple Drops from Green Terra
Fixed Herbalism not handing out any XP outside of Green Terra Fixed Herbalism not handing out any XP outside of Green Terra

View File

@ -22,7 +22,7 @@ public class mcAcrobatics {
int acrovar = PP.getAcrobaticsInt(); int acrovar = PP.getAcrobaticsInt();
if(player.isSneaking()) if(player.isSneaking())
acrovar = acrovar * 2; acrovar = acrovar * 2;
if(Math.random() * 1000 <= acrovar){ if(Math.random() * 1000 <= acrovar && !event.isCancelled()){
int threshold = 7; int threshold = 7;
if(player.isSneaking()) if(player.isSneaking())
threshold = 14; threshold = 14;
@ -34,7 +34,7 @@ public class mcAcrobatics {
*/ */
if(player.getHealth() - newDamage >= 1){ if(player.getHealth() - newDamage >= 1){
if(!event.isCancelled()) if(!event.isCancelled())
PP.addAcrobaticsGather((event.getDamage() * 8) * mcLoadProperties.xpGainMultiplier); PP.addAcrobaticsXP((event.getDamage() * 8) * mcLoadProperties.xpGainMultiplier);
mcSkills.getInstance().XpCheck(player); mcSkills.getInstance().XpCheck(player);
event.setDamage(newDamage); event.setDamage(newDamage);
if(event.getDamage() <= 0) if(event.getDamage() <= 0)
@ -45,11 +45,13 @@ public class mcAcrobatics {
player.sendMessage("**ROLL**"); player.sendMessage("**ROLL**");
} }
} }
} else if (!mcConfig.getInstance().isBlockWatched(loc.getWorld().getBlockAt(xx, y, z)) && !event.isCancelled()){ } else if (!event.isCancelled()){
PP.addAcrobaticsGather((event.getDamage() * 12) * mcLoadProperties.xpGainMultiplier); if(player.getHealth() - event.getDamage() >= 1){
PP.addAcrobaticsXP((event.getDamage() * 12) * mcLoadProperties.xpGainMultiplier);
mcSkills.getInstance().XpCheck(player); mcSkills.getInstance().XpCheck(player);
} }
} }
} }
}
} }

View File

@ -88,13 +88,13 @@ public class mcBlockListener extends BlockListener {
if(mcm.getInstance().isAxes(inhand)){ if(mcm.getInstance().isAxes(inhand)){
if(!mcConfig.getInstance().isBlockWatched(block)){ if(!mcConfig.getInstance().isBlockWatched(block)){
mcWoodCutting.getInstance().woodCuttingProcCheck(player, block); mcWoodCutting.getInstance().woodCuttingProcCheck(player, block);
PP.addWoodcuttingGather(7 * mcLoadProperties.xpGainMultiplier); PP.addWoodcuttingXP(7 * mcLoadProperties.xpGainMultiplier);
} }
} }
} else { } else {
if(block.getData() != 5){ if(block.getData() != 5){
mcWoodCutting.getInstance().woodCuttingProcCheck(player, block); mcWoodCutting.getInstance().woodCuttingProcCheck(player, block);
PP.addWoodcuttingGather(7 * mcLoadProperties.xpGainMultiplier); PP.addWoodcuttingXP(7 * mcLoadProperties.xpGainMultiplier);
} }
} }
mcSkills.getInstance().XpCheck(player); mcSkills.getInstance().XpCheck(player);
@ -120,7 +120,7 @@ public class mcBlockListener extends BlockListener {
//XP WOODCUTTING //XP WOODCUTTING
if(!mcConfig.getInstance().isBlockWatched(block)){ if(!mcConfig.getInstance().isBlockWatched(block)){
mcWoodCutting.getInstance().woodCuttingProcCheck(player, blockx); mcWoodCutting.getInstance().woodCuttingProcCheck(player, blockx);
PP.addWoodcuttingGather(7); PP.addWoodcuttingXP(7);
} }
} }
if(blockx.getTypeId() == 18){ if(blockx.getTypeId() == 18){
@ -265,7 +265,7 @@ public class mcBlockListener extends BlockListener {
for (int cz = -radius; cz <= radius; cz++) { for (int cz = -radius; cz <= radius; cz++) {
Block block = world.getBlockAt(ox + cx, oy + cy, oz + cz); Block block = world.getBlockAt(ox + cx, oy + cy, oz + cz);
//If block is block //If block is block
if (isWater == true){ if (isWater == true && block.getType() == Material.GRAVEL){
//Change //Change
block.setType(Material.CLAY); block.setType(Material.CLAY);
return; return;

View File

@ -93,11 +93,11 @@ public class mcCombat {
if(PPd.inParty() && PPa.inParty() && mcParty.getInstance().inSameParty(attacker, defender)) if(PPd.inParty() && PPa.inParty() && mcParty.getInstance().inSameParty(attacker, defender))
return; return;
if(mcm.getInstance().isAxes(attacker.getItemInHand())) if(mcm.getInstance().isAxes(attacker.getItemInHand()))
PPa.addAxesGather((event.getDamage() * 3) * mcLoadProperties.pvpxprewardmodifier); PPa.addAxesXP((event.getDamage() * 3) * mcLoadProperties.pvpxprewardmodifier);
if(mcm.getInstance().isSwords(attacker.getItemInHand())) if(mcm.getInstance().isSwords(attacker.getItemInHand()))
PPa.addSwordsGather((event.getDamage() * 3) * mcLoadProperties.pvpxprewardmodifier); PPa.addSwordsXP((event.getDamage() * 3) * mcLoadProperties.pvpxprewardmodifier);
if(attacker.getItemInHand().getTypeId() == 0) if(attacker.getItemInHand().getTypeId() == 0)
PPa.addUnarmedGather((event.getDamage() * 3) * mcLoadProperties.pvpxprewardmodifier); PPa.addUnarmedXP((event.getDamage() * 3) * mcLoadProperties.pvpxprewardmodifier);
} }
/* /*
* CHECK FOR LEVEL UPS * CHECK FOR LEVEL UPS
@ -113,13 +113,13 @@ public class mcCombat {
} }
Squid defender = (Squid)event.getEntity(); Squid defender = (Squid)event.getEntity();
if(mcm.getInstance().isSwords(attacker.getItemInHand()) && defender.getHealth() > 0 && mcPermissions.getInstance().swords(attacker)){ if(mcm.getInstance().isSwords(attacker.getItemInHand()) && defender.getHealth() > 0 && mcPermissions.getInstance().swords(attacker)){
PPa.addSwordsGather(10 * mcLoadProperties.xpGainMultiplier); PPa.addSwordsXP(10 * mcLoadProperties.xpGainMultiplier);
} }
mcSkills.getInstance().XpCheck(attacker); mcSkills.getInstance().XpCheck(attacker);
if(mcm.getInstance().isAxes(attacker.getItemInHand()) if(mcm.getInstance().isAxes(attacker.getItemInHand())
&& defender.getHealth() > 0 && defender.getHealth() > 0
&& mcPermissions.getInstance().axes(attacker)){ && mcPermissions.getInstance().axes(attacker)){
PPa.addAxesGather(10 * mcLoadProperties.xpGainMultiplier); PPa.addAxesXP(10 * mcLoadProperties.xpGainMultiplier);
mcSkills.getInstance().XpCheck(attacker); mcSkills.getInstance().XpCheck(attacker);
} }
if(mcm.getInstance().isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker)){ if(mcm.getInstance().isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker)){
@ -144,7 +144,7 @@ public class mcCombat {
//XP //XP
if(defender.getHealth() != 0){ if(defender.getHealth() != 0){
PPa.addUnarmedGather(10 * mcLoadProperties.xpGainMultiplier); PPa.addUnarmedXP(10 * mcLoadProperties.xpGainMultiplier);
mcSkills.getInstance().XpCheck(attacker); mcSkills.getInstance().XpCheck(attacker);
} }
} }
@ -191,15 +191,15 @@ public class mcCombat {
&& mcPermissions.getInstance().swords(attacker)){ && mcPermissions.getInstance().swords(attacker)){
if(!mcConfig.getInstance().isMobSpawnTracked(x)){ if(!mcConfig.getInstance().isMobSpawnTracked(x)){
if(x instanceof Creeper) if(x instanceof Creeper)
PPa.addSwordsGather((event.getDamage() * 4) * mcLoadProperties.xpGainMultiplier); PPa.addSwordsXP((event.getDamage() * 4) * mcLoadProperties.xpGainMultiplier);
if(x instanceof Spider) if(x instanceof Spider)
PPa.addSwordsGather((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier); PPa.addSwordsXP((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
if(x instanceof Skeleton) if(x instanceof Skeleton)
PPa.addSwordsGather((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier); PPa.addSwordsXP((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
if(x instanceof Zombie) if(x instanceof Zombie)
PPa.addSwordsGather((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier); PPa.addSwordsXP((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
if(x instanceof PigZombie) if(x instanceof PigZombie)
PPa.addSwordsGather((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier); PPa.addSwordsXP((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
} }
mcSkills.getInstance().XpCheck(attacker); mcSkills.getInstance().XpCheck(attacker);
} }
@ -208,15 +208,15 @@ public class mcCombat {
&& mcPermissions.getInstance().axes(attacker)){ && mcPermissions.getInstance().axes(attacker)){
if(!mcConfig.getInstance().isMobSpawnTracked(x)){ if(!mcConfig.getInstance().isMobSpawnTracked(x)){
if(x instanceof Creeper) if(x instanceof Creeper)
PPa.addAxesGather((event.getDamage() * 4) * mcLoadProperties.xpGainMultiplier); PPa.addAxesXP((event.getDamage() * 4) * mcLoadProperties.xpGainMultiplier);
if(x instanceof Spider) if(x instanceof Spider)
PPa.addAxesGather((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier); PPa.addAxesXP((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
if(x instanceof Skeleton) if(x instanceof Skeleton)
PPa.addAxesGather((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier); PPa.addAxesXP((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
if(x instanceof Zombie) if(x instanceof Zombie)
PPa.addAxesGather((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier); PPa.addAxesXP((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
if(x instanceof PigZombie) if(x instanceof PigZombie)
PPa.addAxesGather((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier); PPa.addAxesXP((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
} }
mcSkills.getInstance().XpCheck(attacker); mcSkills.getInstance().XpCheck(attacker);
} }
@ -243,15 +243,15 @@ public class mcCombat {
//XP //XP
if(!mcConfig.getInstance().isMobSpawnTracked(x)){ if(!mcConfig.getInstance().isMobSpawnTracked(x)){
if(x instanceof Creeper) if(x instanceof Creeper)
PPa.addUnarmedGather((event.getDamage() * 4) * mcLoadProperties.xpGainMultiplier); PPa.addUnarmedXP((event.getDamage() * 4) * mcLoadProperties.xpGainMultiplier);
if(x instanceof Spider) if(x instanceof Spider)
PPa.addUnarmedGather((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier); PPa.addUnarmedXP((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
if(x instanceof Skeleton) if(x instanceof Skeleton)
PPa.addUnarmedGather((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier); PPa.addUnarmedXP((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
if(x instanceof Zombie) if(x instanceof Zombie)
PPa.addUnarmedGather((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier); PPa.addUnarmedXP((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
if(x instanceof PigZombie) if(x instanceof PigZombie)
PPa.addUnarmedGather((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier); PPa.addUnarmedXP((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
} }
mcSkills.getInstance().XpCheck(attacker); mcSkills.getInstance().XpCheck(attacker);
} }
@ -351,15 +351,15 @@ public class mcCombat {
//XP //XP
if(!mcConfig.getInstance().isMobSpawnTracked(x)){ if(!mcConfig.getInstance().isMobSpawnTracked(x)){
if(x instanceof Creeper) if(x instanceof Creeper)
PPa.addArcheryGather((event.getDamage() * 4) * mcLoadProperties.xpGainMultiplier); PPa.addArcheryXP((event.getDamage() * 4) * mcLoadProperties.xpGainMultiplier);
if(x instanceof Spider) if(x instanceof Spider)
PPa.addArcheryGather((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier); PPa.addArcheryXP((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
if(x instanceof Skeleton) if(x instanceof Skeleton)
PPa.addArcheryGather((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier); PPa.addArcheryXP((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
if(x instanceof Zombie) if(x instanceof Zombie)
PPa.addArcheryGather((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier); PPa.addArcheryXP((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
if(x instanceof PigZombie) if(x instanceof PigZombie)
PPa.addArcheryGather((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier); PPa.addArcheryXP((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
} }
} }
/* /*
@ -415,7 +415,7 @@ public class mcCombat {
* PVP XP * PVP XP
*/ */
if(mcLoadProperties.pvpxp && !mcParty.getInstance().inSameParty(attacker, defender)){ if(mcLoadProperties.pvpxp && !mcParty.getInstance().inSameParty(attacker, defender)){
PPa.addArcheryGather((event.getDamage() * 3) * mcLoadProperties.pvpxprewardmodifier); PPa.addArcheryXP((event.getDamage() * 3) * mcLoadProperties.pvpxprewardmodifier);
} }
/* /*
* DAZE PROC * DAZE PROC

View File

@ -8,6 +8,7 @@ import org.bukkit.craftbukkit.entity.CraftEntity;
import org.bukkit.entity.Arrow; import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.Wolf;
import org.bukkit.event.entity.CreatureSpawnEvent; import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageByProjectileEvent; import org.bukkit.event.entity.EntityDamageByProjectileEvent;
@ -70,9 +71,9 @@ public class mcEntityListener extends EntityListener {
* Entity Damage by Entity checks * Entity Damage by Entity checks
*/ */
if(event instanceof EntityDamageByEntityEvent && event.getDamage() >= 1){ if(event instanceof EntityDamageByEntityEvent && event.getDamage() >= 1){
if(event.isCancelled()){ if(event.isCancelled())
return; return;
}
EntityDamageByEntityEvent eventb = (EntityDamageByEntityEvent)event; EntityDamageByEntityEvent eventb = (EntityDamageByEntityEvent)event;
Entity e = eventb.getEntity(); //Defender Entity e = eventb.getEntity(); //Defender
Entity f = eventb.getDamager(); //Attacker Entity f = eventb.getDamager(); //Attacker
@ -209,7 +210,7 @@ public class mcEntityListener extends EntityListener {
if(PPd.getAcrobaticsInt() <= 800){ if(PPd.getAcrobaticsInt() <= 800){
if(Math.random() * 4000 <= PPd.getAcrobaticsInt()){ if(Math.random() * 4000 <= PPd.getAcrobaticsInt()){
defender.sendMessage(ChatColor.GREEN+"**DODGE**"); defender.sendMessage(ChatColor.GREEN+"**DODGE**");
PPd.addAcrobaticsGather(event.getDamage() * 12); PPd.addAcrobaticsXP(event.getDamage() * 12);
mcSkills.getInstance().XpCheck(defender); mcSkills.getInstance().XpCheck(defender);
event.setDamage(event.getDamage() / 2); event.setDamage(event.getDamage() / 2);
//Needs to do minimal damage //Needs to do minimal damage
@ -218,7 +219,7 @@ public class mcEntityListener extends EntityListener {
} }
} else if(Math.random() * 4000 <= 800) { } else if(Math.random() * 4000 <= 800) {
defender.sendMessage(ChatColor.GREEN+"**DODGE**"); defender.sendMessage(ChatColor.GREEN+"**DODGE**");
PPd.addAcrobaticsGather(event.getDamage() * 12); PPd.addAcrobaticsXP(event.getDamage() * 12);
mcSkills.getInstance().XpCheck(defender); mcSkills.getInstance().XpCheck(defender);
event.setDamage(event.getDamage() / 2); event.setDamage(event.getDamage() / 2);
//Needs to do minimal damage //Needs to do minimal damage
@ -227,7 +228,20 @@ public class mcEntityListener extends EntityListener {
} }
} }
} }
/*
* TAMING STUFF
*/
if(f instanceof Wolf){
Wolf theWolf = (Wolf)f;
if(mcTaming.getInstance().hasOwner(theWolf, plugin)){
Player wolfMaster = mcTaming.getInstance().getOwner(theWolf, plugin);
if(!event.isCancelled()){
mcUsers.getProfile(wolfMaster.getName()).addXpToSkill(event.getDamage(), "Taming");
} }
}
}
}
/* /*
* Check to see if the defender took damage so we can apply recently hurt * Check to see if the defender took damage so we can apply recently hurt

View File

@ -74,14 +74,14 @@ public class mcExcavation {
if(PP.getExcavationInt() > 250){ if(PP.getExcavationInt() > 250){
//CHANCE TO GET EGGS //CHANCE TO GET EGGS
if(mcLoadProperties.eggs == true && Math.random() * 100 > 99){ if(mcLoadProperties.eggs == true && Math.random() * 100 > 99){
PP.addExcavationGather(10 * mcLoadProperties.xpGainMultiplier); PP.addExcavationXP(10 * mcLoadProperties.xpGainMultiplier);
mat = Material.getMaterial(344); mat = Material.getMaterial(344);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
} }
//CHANCE TO GET APPLES //CHANCE TO GET APPLES
if(mcLoadProperties.apples == true && Math.random() * 100 > 99){ if(mcLoadProperties.apples == true && Math.random() * 100 > 99){
PP.addExcavationGather(10 * mcLoadProperties.xpGainMultiplier); PP.addExcavationXP(10 * mcLoadProperties.xpGainMultiplier);
mat = Material.getMaterial(260); mat = Material.getMaterial(260);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
@ -90,11 +90,11 @@ public class mcExcavation {
} }
//DIRT SAND OR GRAVEL //DIRT SAND OR GRAVEL
if(type == 3 || type == 13 || type == 2 || type == 12){ if(type == 3 || type == 13 || type == 2 || type == 12){
PP.addExcavationGather(4 * mcLoadProperties.xpGainMultiplier); PP.addExcavationXP(4 * mcLoadProperties.xpGainMultiplier);
if(PP.getExcavationInt() > 750){ if(PP.getExcavationInt() > 750){
//CHANCE TO GET CAKE //CHANCE TO GET CAKE
if(mcLoadProperties.cake == true && Math.random() * 2000 > 1999){ if(mcLoadProperties.cake == true && Math.random() * 2000 > 1999){
PP.addExcavationGather(300 * mcLoadProperties.xpGainMultiplier); PP.addExcavationXP(300 * mcLoadProperties.xpGainMultiplier);
mat = Material.getMaterial(354); mat = Material.getMaterial(354);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
@ -103,7 +103,7 @@ public class mcExcavation {
if(PP.getExcavationInt() > 350){ if(PP.getExcavationInt() > 350){
//CHANCE TO GET DIAMOND //CHANCE TO GET DIAMOND
if(mcLoadProperties.diamond == true && Math.random() * 750 > 749){ if(mcLoadProperties.diamond == true && Math.random() * 750 > 749){
PP.addExcavationGather(100 * mcLoadProperties.xpGainMultiplier); PP.addExcavationXP(100 * mcLoadProperties.xpGainMultiplier);
mat = Material.getMaterial(264); mat = Material.getMaterial(264);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
@ -112,7 +112,7 @@ public class mcExcavation {
if(PP.getExcavationInt() > 250){ if(PP.getExcavationInt() > 250){
//CHANCE TO GET YELLOW MUSIC //CHANCE TO GET YELLOW MUSIC
if(mcLoadProperties.music == true && Math.random() * 2000 > 1999){ if(mcLoadProperties.music == true && Math.random() * 2000 > 1999){
PP.addExcavationGather(300 * mcLoadProperties.xpGainMultiplier); PP.addExcavationXP(300 * mcLoadProperties.xpGainMultiplier);
mat = Material.getMaterial(2256); mat = Material.getMaterial(2256);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
@ -122,7 +122,7 @@ public class mcExcavation {
if(PP.getExcavationInt() > 350){ if(PP.getExcavationInt() > 350){
//CHANCE TO GET GREEN MUSIC //CHANCE TO GET GREEN MUSIC
if(mcLoadProperties.music == true && Math.random() * 2000 > 1999){ if(mcLoadProperties.music == true && Math.random() * 2000 > 1999){
PP.addExcavationGather(300 * mcLoadProperties.xpGainMultiplier); PP.addExcavationXP(300 * mcLoadProperties.xpGainMultiplier);
mat = Material.getMaterial(2257); mat = Material.getMaterial(2257);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
@ -133,14 +133,14 @@ public class mcExcavation {
if(type == 12){ if(type == 12){
//CHANCE TO GET GLOWSTONE //CHANCE TO GET GLOWSTONE
if(mcLoadProperties.glowstone == true && PP.getExcavationInt() > 50 && Math.random() * 100 > 95){ if(mcLoadProperties.glowstone == true && PP.getExcavationInt() > 50 && Math.random() * 100 > 95){
PP.addExcavationGather(8 * mcLoadProperties.xpGainMultiplier); PP.addExcavationXP(8 * mcLoadProperties.xpGainMultiplier);
mat = Material.getMaterial(348); mat = Material.getMaterial(348);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
} }
//CHANCE TO GET SLOWSAND //CHANCE TO GET SLOWSAND
if(mcLoadProperties.slowsand == true && PP.getExcavationInt() > 650 && Math.random() * 200 > 199){ if(mcLoadProperties.slowsand == true && PP.getExcavationInt() > 650 && Math.random() * 200 > 199){
PP.addExcavationGather(8 * mcLoadProperties.xpGainMultiplier); PP.addExcavationXP(8 * mcLoadProperties.xpGainMultiplier);
mat = Material.getMaterial(88); mat = Material.getMaterial(88);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
@ -151,7 +151,7 @@ public class mcExcavation {
if(PP.getExcavationInt() > 50){ if(PP.getExcavationInt() > 50){
//CHANCE FOR COCOA BEANS //CHANCE FOR COCOA BEANS
if(mcLoadProperties.eggs == true && Math.random() * 75 > 74){ if(mcLoadProperties.eggs == true && Math.random() * 75 > 74){
PP.addExcavationGather(10 * mcLoadProperties.xpGainMultiplier); PP.addExcavationXP(10 * mcLoadProperties.xpGainMultiplier);
mat = Material.getMaterial(351); mat = Material.getMaterial(351);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
is.setDurability((byte) 3); //COCOA is.setDurability((byte) 3); //COCOA
@ -160,7 +160,7 @@ public class mcExcavation {
} }
//CHANCE FOR SHROOMS //CHANCE FOR SHROOMS
if(mcLoadProperties.mushrooms == true && PP.getExcavationInt() > 500 && Math.random() * 200 > 199){ if(mcLoadProperties.mushrooms == true && PP.getExcavationInt() > 500 && Math.random() * 200 > 199){
PP.addExcavationGather(8 * mcLoadProperties.xpGainMultiplier); PP.addExcavationXP(8 * mcLoadProperties.xpGainMultiplier);
if(Math.random() * 10 > 5){ if(Math.random() * 10 > 5){
mat = Material.getMaterial(39); mat = Material.getMaterial(39);
} else { } else {
@ -171,7 +171,7 @@ public class mcExcavation {
} }
//CHANCE TO GET GLOWSTONE //CHANCE TO GET GLOWSTONE
if(mcLoadProperties.glowstone == true && PP.getExcavationInt() > 25 && Math.random() * 100 > 95){ if(mcLoadProperties.glowstone == true && PP.getExcavationInt() > 25 && Math.random() * 100 > 95){
PP.addExcavationGather(8 * mcLoadProperties.xpGainMultiplier); PP.addExcavationXP(8 * mcLoadProperties.xpGainMultiplier);
mat = Material.getMaterial(348); mat = Material.getMaterial(348);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
@ -181,7 +181,7 @@ public class mcExcavation {
if(type == 13){ if(type == 13){
//CHANCE TO GET NETHERRACK //CHANCE TO GET NETHERRACK
if(mcLoadProperties.netherrack == true && PP.getExcavationInt() > 850 && Math.random() * 200 > 199){ if(mcLoadProperties.netherrack == true && PP.getExcavationInt() > 850 && Math.random() * 200 > 199){
PP.addExcavationGather(3 * mcLoadProperties.xpGainMultiplier); PP.addExcavationXP(3 * mcLoadProperties.xpGainMultiplier);
mat = Material.getMaterial(87); mat = Material.getMaterial(87);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
@ -189,7 +189,7 @@ public class mcExcavation {
//CHANCE TO GET SULPHUR //CHANCE TO GET SULPHUR
if(mcLoadProperties.sulphur == true && PP.getExcavationInt() > 75){ if(mcLoadProperties.sulphur == true && PP.getExcavationInt() > 75){
if(Math.random() * 10 > 9){ if(Math.random() * 10 > 9){
PP.addExcavationGather(3 * mcLoadProperties.xpGainMultiplier); PP.addExcavationXP(3 * mcLoadProperties.xpGainMultiplier);
mat = Material.getMaterial(289); mat = Material.getMaterial(289);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
@ -198,7 +198,7 @@ public class mcExcavation {
//CHANCE TO GET BONES //CHANCE TO GET BONES
if(mcLoadProperties.bones == true && PP.getExcavationInt() > 175){ if(mcLoadProperties.bones == true && PP.getExcavationInt() > 175){
if(Math.random() * 10 > 9){ if(Math.random() * 10 > 9){
PP.addExcavationGather(3 * mcLoadProperties.xpGainMultiplier); PP.addExcavationXP(3 * mcLoadProperties.xpGainMultiplier);
mat = Material.getMaterial(352); mat = Material.getMaterial(352);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);

View File

@ -32,7 +32,7 @@ public class mcHerbalism {
Material mat = Material.getMaterial(296); Material mat = Material.getMaterial(296);
Location loc = block.getLocation(); Location loc = block.getLocation();
ItemStack is = new ItemStack(mat, 1, (byte)0, (byte)0); ItemStack is = new ItemStack(mat, 1, (byte)0, (byte)0);
PP.addHerbalismGather(5 * mcLoadProperties.xpGainMultiplier); PP.addHerbalismXP(5 * mcLoadProperties.xpGainMultiplier);
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
herbalismProcCheck(block, player, event); herbalismProcCheck(block, player, event);
herbalismProcCheck(block, player, event); herbalismProcCheck(block, player, event);
@ -128,7 +128,7 @@ public class mcHerbalism {
if(type == 59 && block.getData() == (byte) 0x7){ if(type == 59 && block.getData() == (byte) 0x7){
mat = Material.getMaterial(296); mat = Material.getMaterial(296);
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
PP.addHerbalismGather(5 * mcLoadProperties.xpGainMultiplier); PP.addHerbalismXP(5 * mcLoadProperties.xpGainMultiplier);
if(player != null){ if(player != null){
if(Math.random() * 1000 <= PP.getHerbalismInt()){ if(Math.random() * 1000 <= PP.getHerbalismInt()){
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
@ -172,7 +172,7 @@ public class mcHerbalism {
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
} }
} }
PP.addHerbalismGather(3 * mcLoadProperties.xpGainMultiplier); PP.addHerbalismXP(3 * mcLoadProperties.xpGainMultiplier);
} }
//Sugar Canes //Sugar Canes
if(type == 83){ if(type == 83){
@ -182,7 +182,7 @@ public class mcHerbalism {
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
} }
} }
PP.addHerbalismGather(3 * mcLoadProperties.xpGainMultiplier); PP.addHerbalismXP(3 * mcLoadProperties.xpGainMultiplier);
} }
//Pumpkins //Pumpkins
if(type == 91 || type == 86){ if(type == 91 || type == 86){
@ -193,7 +193,7 @@ public class mcHerbalism {
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
} }
} }
PP.addHerbalismGather(55 * mcLoadProperties.xpGainMultiplier); PP.addHerbalismXP(55 * mcLoadProperties.xpGainMultiplier);
} }
//Mushroom //Mushroom
if(type == 39 || type == 40){ if(type == 39 || type == 40){
@ -204,7 +204,7 @@ public class mcHerbalism {
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
} }
} }
PP.addHerbalismGather(40 * mcLoadProperties.xpGainMultiplier); PP.addHerbalismXP(40 * mcLoadProperties.xpGainMultiplier);
} }
//Flower //Flower
if(type == 37 || type == 38){ if(type == 37 || type == 38){
@ -215,7 +215,7 @@ public class mcHerbalism {
loc.getWorld().dropItemNaturally(loc, is); loc.getWorld().dropItemNaturally(loc, is);
} }
} }
PP.addHerbalismGather(10 * mcLoadProperties.xpGainMultiplier); PP.addHerbalismXP(10 * mcLoadProperties.xpGainMultiplier);
} }
} }
mcSkills.getInstance().XpCheck(player); mcSkills.getInstance().XpCheck(player);

View File

@ -3,7 +3,7 @@ package com.gmail.nossr50;
public class mcLoadProperties { public class mcLoadProperties {
public static Boolean cocoabeans, archeryFireRateLimit, mushrooms, toolsLoseDurabilityFromAbilities, pvpxp, miningrequirespickaxe, woodcuttingrequiresaxe, pvp, eggs, apples, myspawnclearsinventory, cake, music, diamond, glowstone, slowsand, sulphur, netherrack, bones, coal, clay, anvilmessages; public static Boolean cocoabeans, archeryFireRateLimit, mushrooms, toolsLoseDurabilityFromAbilities, pvpxp, miningrequirespickaxe, woodcuttingrequiresaxe, pvp, eggs, apples, myspawnclearsinventory, cake, music, diamond, glowstone, slowsand, sulphur, netherrack, bones, coal, clay, anvilmessages;
public static String addxp, mcability, mcmmo, mcc, mcrefresh, mcitem, mcgod, stats, mmoedit, ptp, party, myspawn, setmyspawn, whois, invite, accept, clearmyspawn; public static String addxp, mcability, mcmmo, mcc, mcrefresh, mcitem, mcgod, stats, mmoedit, ptp, party, myspawn, setmyspawn, whois, invite, accept, clearmyspawn;
public static int xpGainMultiplier, superBreakerCooldown, greenTerraCooldown, gigaDrillBreakerCooldown, treeFellerCooldown, berserkCooldown, serratedStrikeCooldown, skullSplitterCooldown, abilityDurabilityLoss, feathersConsumedByChimaeraWing, pvpxprewardmodifier, repairdiamondlevel, globalxpmodifier, miningxpmodifier, repairxpmodifier, woodcuttingxpmodifier, unarmedxpmodifier, herbalismxpmodifier, excavationxpmodifier, archeryxpmodifier, swordsxpmodifier, axesxpmodifier, acrobaticsxpmodifier; public static int xpGainMultiplier, superBreakerCooldown, greenTerraCooldown, gigaDrillBreakerCooldown, treeFellerCooldown, berserkCooldown, serratedStrikeCooldown, skullSplitterCooldown, abilityDurabilityLoss, feathersConsumedByChimaeraWing, pvpxprewardmodifier, repairdiamondlevel, globalxpmodifier, tamingxpmodifier, miningxpmodifier, repairxpmodifier, woodcuttingxpmodifier, unarmedxpmodifier, herbalismxpmodifier, excavationxpmodifier, archeryxpmodifier, swordsxpmodifier, axesxpmodifier, acrobaticsxpmodifier;
public static void loadMain(){ public static void loadMain(){
String propertiesFile = mcMMO.maindirectory + "mcmmo.properties"; String propertiesFile = mcMMO.maindirectory + "mcmmo.properties";
@ -38,6 +38,7 @@ public class mcLoadProperties {
* EXPERIENCE RATE MODIFIER * EXPERIENCE RATE MODIFIER
*/ */
globalxpmodifier = properties.getInteger("globalXpModifier", 1); globalxpmodifier = properties.getInteger("globalXpModifier", 1);
tamingxpmodifier = properties.getInteger("tamingXpModifier", 2);
miningxpmodifier = properties.getInteger("miningXpModifier", 2); miningxpmodifier = properties.getInteger("miningXpModifier", 2);
repairxpmodifier = properties.getInteger("repairXpModifier", 2); repairxpmodifier = properties.getInteger("repairXpModifier", 2);
woodcuttingxpmodifier = properties.getInteger("woodcuttingXpModifier", 2); woodcuttingxpmodifier = properties.getInteger("woodcuttingXpModifier", 2);

View File

@ -118,6 +118,7 @@ public class mcMMO extends JavaPlugin {
public void addXp(Player player, String skillname, Integer newvalue){ public void addXp(Player player, String skillname, Integer newvalue){
PlayerProfile PP = mcUsers.getProfile(player.getName()); PlayerProfile PP = mcUsers.getProfile(player.getName());
PP.addXpToSkill(newvalue, skillname); PP.addXpToSkill(newvalue, skillname);
mcSkills.getInstance().XpCheck(player);
} }
public void modifySkill(Player player, String skillname, Integer newvalue){ public void modifySkill(Player player, String skillname, Integer newvalue){
PlayerProfile PP = mcUsers.getProfile(player.getName()); PlayerProfile PP = mcUsers.getProfile(player.getName());

View File

@ -163,7 +163,7 @@ public class mcMining {
xp += 40; xp += 40;
blockProcCheck(block, player); blockProcCheck(block, player);
} }
PP.addMiningGather(xp * mcLoadProperties.xpGainMultiplier); PP.addMiningXP(xp * mcLoadProperties.xpGainMultiplier);
mcSkills.getInstance().XpCheck(player); mcSkills.getInstance().XpCheck(player);
} }
/* /*
@ -318,7 +318,7 @@ public class mcMining {
block.setType(Material.AIR); block.setType(Material.AIR);
} }
if(block.getData() != (byte) 5) if(block.getData() != (byte) 5)
PP.addMiningGather(xp * mcLoadProperties.xpGainMultiplier); PP.addMiningXP(xp * mcLoadProperties.xpGainMultiplier);
mcSkills.getInstance().XpCheck(player); mcSkills.getInstance().XpCheck(player);
} }
} }

View File

@ -183,6 +183,13 @@ public class mcPermissions {
} }
return instance; return instance;
} }
public boolean taming(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.taming");
} else {
return true;
}
}
public boolean mining(Player player) { public boolean mining(Player player) {
if (permissionsEnabled) { if (permissionsEnabled) {
return permission(player, "mcmmo.skills.mining"); return permission(player, "mcmmo.skills.mining");

View File

@ -116,15 +116,20 @@ public class mcPlayerListener extends PlayerListener {
} }
//GREEN THUMB //GREEN THUMB
if(block != null && block.getType() == Material.COBBLESTONE && player.getItemInHand().getType() == Material.SEEDS){ if(block != null && (block.getType() == Material.COBBLESTONE || block.getType() == Material.DIRT) && player.getItemInHand().getType() == Material.SEEDS){
boolean pass = false; boolean pass = false;
if(mcHerbalism.getInstance().hasSeeds(player)){ if(mcHerbalism.getInstance().hasSeeds(player)){
mcHerbalism.getInstance().removeSeeds(player); mcHerbalism.getInstance().removeSeeds(player);
if(Math.random() * 1500 <= PP.getHerbalismInt()){ if(block.getType() == Material.COBBLESTONE && Math.random() * 1500 <= PP.getHerbalismInt()){
player.sendMessage(ChatColor.GREEN+"**GREEN THUMB**"); player.sendMessage(ChatColor.GREEN+"**GREEN THUMB**");
block.setType(Material.MOSSY_COBBLESTONE); block.setType(Material.MOSSY_COBBLESTONE);
pass = true; pass = true;
} }
if(block.getType() == Material.DIRT && Math.random() * 1500 <= PP.getHerbalismInt()){
player.sendMessage(ChatColor.GREEN+"**GREEN THUMB**");
block.setType(Material.GRASS);
pass = true;
}
if(pass == false) if(pass == false)
player.sendMessage(ChatColor.RED+"**GREEN THUMB FAIL**"); player.sendMessage(ChatColor.RED+"**GREEN THUMB FAIL**");
} }
@ -368,45 +373,49 @@ public class mcPlayerListener extends PlayerListener {
player.sendMessage("Health: "+target.getHealth()+ChatColor.GRAY+" (20 is full health)"); player.sendMessage("Health: "+target.getHealth()+ChatColor.GRAY+" (20 is full health)");
player.sendMessage("OP: " + target.isOp()); player.sendMessage("OP: " + target.isOp());
player.sendMessage(ChatColor.GREEN+"mcMMO Stats for "+ChatColor.YELLOW+target.getName()); player.sendMessage(ChatColor.GREEN+"mcMMO Stats for "+ChatColor.YELLOW+target.getName());
if(mcPermissions.getInstance().taming(target))
player.sendMessage(ChatColor.YELLOW + "Taming Skill: " + ChatColor.GREEN + PPt.getTaming()+ChatColor.DARK_AQUA
+ " XP("+PPt.getTamingXP()
+"/"+PPt.getXpToLevel("taming")+")");
if(mcPermissions.getInstance().mining(target)) if(mcPermissions.getInstance().mining(target))
player.sendMessage(ChatColor.YELLOW + "Mining Skill: " + ChatColor.GREEN + PPt.getMining()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Mining Skill: " + ChatColor.GREEN + PPt.getMining()+ChatColor.DARK_AQUA
+ " XP("+PPt.getMiningGather() + " XP("+PPt.getMiningXP()
+"/"+PPt.getXpToLevel("mining")+")"); +"/"+PPt.getXpToLevel("mining")+")");
if(mcPermissions.getInstance().repair(target)) if(mcPermissions.getInstance().repair(target))
player.sendMessage(ChatColor.YELLOW + "Repair Skill: "+ ChatColor.GREEN + PPt.getRepair()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Repair Skill: "+ ChatColor.GREEN + PPt.getRepair()+ChatColor.DARK_AQUA
+ " XP("+PPt.getRepairGather() + " XP("+PPt.getRepairXP()
+"/"+PPt.getXpToLevel("repair")+")"); +"/"+PPt.getXpToLevel("repair")+")");
if(mcPermissions.getInstance().woodcutting(target)) if(mcPermissions.getInstance().woodcutting(target))
player.sendMessage(ChatColor.YELLOW + "Woodcutting Skill: "+ ChatColor.GREEN + PPt.getWoodCutting()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Woodcutting Skill: "+ ChatColor.GREEN + PPt.getWoodCutting()+ChatColor.DARK_AQUA
+ " XP("+PPt.getWoodCuttingGather() + " XP("+PPt.getWoodCuttingXP()
+"/"+PPt.getXpToLevel("woodcutting")+")"); +"/"+PPt.getXpToLevel("woodcutting")+")");
if(mcPermissions.getInstance().unarmed(target)) if(mcPermissions.getInstance().unarmed(target))
player.sendMessage(ChatColor.YELLOW + "Unarmed Skill: " + ChatColor.GREEN + PPt.getUnarmed()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Unarmed Skill: " + ChatColor.GREEN + PPt.getUnarmed()+ChatColor.DARK_AQUA
+ " XP("+PPt.getUnarmedGather() + " XP("+PPt.getUnarmedXP()
+"/"+PPt.getXpToLevel("unarmed")+")"); +"/"+PPt.getXpToLevel("unarmed")+")");
if(mcPermissions.getInstance().herbalism(target)) if(mcPermissions.getInstance().herbalism(target))
player.sendMessage(ChatColor.YELLOW + "Herbalism Skill: "+ ChatColor.GREEN + PPt.getHerbalism()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Herbalism Skill: "+ ChatColor.GREEN + PPt.getHerbalism()+ChatColor.DARK_AQUA
+ " XP("+PPt.getHerbalismGather() + " XP("+PPt.getHerbalismXP()
+"/"+PPt.getXpToLevel("herbalism")+")"); +"/"+PPt.getXpToLevel("herbalism")+")");
if(mcPermissions.getInstance().excavation(target)) if(mcPermissions.getInstance().excavation(target))
player.sendMessage(ChatColor.YELLOW + "Excavation Skill: "+ ChatColor.GREEN + PPt.getExcavation()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Excavation Skill: "+ ChatColor.GREEN + PPt.getExcavation()+ChatColor.DARK_AQUA
+ " XP("+PPt.getExcavationGather() + " XP("+PPt.getExcavationXP()
+"/"+PPt.getXpToLevel("excavation")+")"); +"/"+PPt.getXpToLevel("excavation")+")");
if(mcPermissions.getInstance().archery(target)) if(mcPermissions.getInstance().archery(target))
player.sendMessage(ChatColor.YELLOW + "Archery Skill: " + ChatColor.GREEN + PPt.getArchery()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Archery Skill: " + ChatColor.GREEN + PPt.getArchery()+ChatColor.DARK_AQUA
+ " XP("+PPt.getArcheryGather() + " XP("+PPt.getArcheryXP()
+"/"+PPt.getXpToLevel("archery")+")"); +"/"+PPt.getXpToLevel("archery")+")");
if(mcPermissions.getInstance().swords(target)) if(mcPermissions.getInstance().swords(target))
player.sendMessage(ChatColor.YELLOW + "Swords Skill: " + ChatColor.GREEN + PPt.getSwords()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Swords Skill: " + ChatColor.GREEN + PPt.getSwords()+ChatColor.DARK_AQUA
+ " XP("+PPt.getSwordsGather() + " XP("+PPt.getSwordsXP()
+"/"+PPt.getXpToLevel("swords")+")"); +"/"+PPt.getXpToLevel("swords")+")");
if(mcPermissions.getInstance().axes(target)) if(mcPermissions.getInstance().axes(target))
player.sendMessage(ChatColor.YELLOW + "Axes Skill: " + ChatColor.GREEN + PPt.getAxes()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Axes Skill: " + ChatColor.GREEN + PPt.getAxes()+ChatColor.DARK_AQUA
+ " XP("+PPt.getAxesGather() + " XP("+PPt.getAxesXP()
+"/"+PPt.getXpToLevel("axes")+")"); +"/"+PPt.getXpToLevel("axes")+")");
if(mcPermissions.getInstance().acrobatics(target)) if(mcPermissions.getInstance().acrobatics(target))
player.sendMessage(ChatColor.YELLOW + "Acrobatics Skill: " + ChatColor.GREEN + PPt.getAcrobatics()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Acrobatics Skill: " + ChatColor.GREEN + PPt.getAcrobatics()+ChatColor.DARK_AQUA
+ " XP("+PPt.getAcrobaticsGather() + " XP("+PPt.getAcrobaticsXP()
+"/"+PPt.getXpToLevel("acrobatics")+")"); +"/"+PPt.getXpToLevel("acrobatics")+")");
player.sendMessage(ChatColor.DARK_RED+"POWER LEVEL: "+ChatColor.GREEN+(mcm.getInstance().getPowerLevel(target))); player.sendMessage(ChatColor.DARK_RED+"POWER LEVEL: "+ChatColor.GREEN+(mcm.getInstance().getPowerLevel(target)));
player.sendMessage(ChatColor.GREEN+"~~COORDINATES~~"); player.sendMessage(ChatColor.GREEN+"~~COORDINATES~~");
@ -423,45 +432,50 @@ public class mcPlayerListener extends PlayerListener {
player.sendMessage(ChatColor.GREEN + "Your mcMMO Stats"); player.sendMessage(ChatColor.GREEN + "Your mcMMO Stats");
if(mcPermissions.getInstance().permissionsEnabled) if(mcPermissions.getInstance().permissionsEnabled)
player.sendMessage(ChatColor.DARK_GRAY+"If you don't have access to a skill it will not be shown here."); player.sendMessage(ChatColor.DARK_GRAY+"If you don't have access to a skill it will not be shown here.");
if(mcPermissions.getInstance().taming(player))
player.sendMessage(ChatColor.YELLOW + "Taming Skill: " + ChatColor.GREEN + PP.getTaming()+ChatColor.DARK_AQUA
+ " XP("+PP.getTamingXP()
+"/"+PP.getXpToLevel("taming")+")");
if(mcPermissions.getInstance().mining(player)) if(mcPermissions.getInstance().mining(player))
player.sendMessage(ChatColor.YELLOW + "Mining Skill: " + ChatColor.GREEN + PP.getMining()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Mining Skill: " + ChatColor.GREEN + PP.getMining()+ChatColor.DARK_AQUA
+ " XP("+PP.getMiningGather() + " XP("+PP.getMiningXP()
+"/"+PP.getXpToLevel("mining")+")"); +"/"+PP.getXpToLevel("mining")+")");
if(mcPermissions.getInstance().repair(player)) if(mcPermissions.getInstance().repair(player))
player.sendMessage(ChatColor.YELLOW + "Repair Skill: "+ ChatColor.GREEN + PP.getRepair()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Repair Skill: "+ ChatColor.GREEN + PP.getRepair()+ChatColor.DARK_AQUA
+ " XP("+PP.getRepairGather() + " XP("+PP.getRepairXP()
+"/"+PP.getXpToLevel("repair")+")"); +"/"+PP.getXpToLevel("repair")+")");
if(mcPermissions.getInstance().woodcutting(player)) if(mcPermissions.getInstance().woodcutting(player))
player.sendMessage(ChatColor.YELLOW + "Woodcutting Skill: "+ ChatColor.GREEN + PP.getWoodCutting()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Woodcutting Skill: "+ ChatColor.GREEN + PP.getWoodCutting()+ChatColor.DARK_AQUA
+ " XP("+PP.getWoodCuttingGather() + " XP("+PP.getWoodCuttingXP()
+"/"+PP.getXpToLevel("woodcutting")+")"); +"/"+PP.getXpToLevel("woodcutting")+")");
if(mcPermissions.getInstance().unarmed(player)) if(mcPermissions.getInstance().unarmed(player))
player.sendMessage(ChatColor.YELLOW + "Unarmed Skill: " + ChatColor.GREEN + PP.getUnarmed()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Unarmed Skill: " + ChatColor.GREEN + PP.getUnarmed()+ChatColor.DARK_AQUA
+ " XP("+PP.getUnarmedGather() + " XP("+PP.getUnarmedXP()
+"/"+PP.getXpToLevel("unarmed")+")"); +"/"+PP.getXpToLevel("unarmed")+")");
if(mcPermissions.getInstance().herbalism(player)) if(mcPermissions.getInstance().herbalism(player))
player.sendMessage(ChatColor.YELLOW + "Herbalism Skill: "+ ChatColor.GREEN + PP.getHerbalism()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Herbalism Skill: "+ ChatColor.GREEN + PP.getHerbalism()+ChatColor.DARK_AQUA
+ " XP("+PP.getHerbalismGather() + " XP("+PP.getHerbalismXP()
+"/"+PP.getXpToLevel("herbalism")+")"); +"/"+PP.getXpToLevel("herbalism")+")");
if(mcPermissions.getInstance().excavation(player)) if(mcPermissions.getInstance().excavation(player))
player.sendMessage(ChatColor.YELLOW + "Excavation Skill: "+ ChatColor.GREEN + PP.getExcavation()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Excavation Skill: "+ ChatColor.GREEN + PP.getExcavation()+ChatColor.DARK_AQUA
+ " XP("+PP.getExcavationGather() + " XP("+PP.getExcavationXP()
+"/"+PP.getXpToLevel("excavation")+")"); +"/"+PP.getXpToLevel("excavation")+")");
if(mcPermissions.getInstance().archery(player)) if(mcPermissions.getInstance().archery(player))
player.sendMessage(ChatColor.YELLOW + "Archery Skill: " + ChatColor.GREEN + PP.getArchery()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Archery Skill: " + ChatColor.GREEN + PP.getArchery()+ChatColor.DARK_AQUA
+ " XP("+PP.getArcheryGather() + " XP("+PP.getArcheryXP()
+"/"+PP.getXpToLevel("archery")+")"); +"/"+PP.getXpToLevel("archery")+")");
if(mcPermissions.getInstance().swords(player)) if(mcPermissions.getInstance().swords(player))
player.sendMessage(ChatColor.YELLOW + "Swords Skill: " + ChatColor.GREEN + PP.getSwords()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Swords Skill: " + ChatColor.GREEN + PP.getSwords()+ChatColor.DARK_AQUA
+ " XP("+PP.getSwordsGather() + " XP("+PP.getSwordsXP()
+"/"+PP.getXpToLevel("swords")+")"); +"/"+PP.getXpToLevel("swords")+")");
if(mcPermissions.getInstance().axes(player)) if(mcPermissions.getInstance().axes(player))
player.sendMessage(ChatColor.YELLOW + "Axes Skill: " + ChatColor.GREEN + PP.getAxes()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Axes Skill: " + ChatColor.GREEN + PP.getAxes()+ChatColor.DARK_AQUA
+ " XP("+PP.getAxesGather() + " XP("+PP.getAxesXP()
+"/"+PP.getXpToLevel("axes")+")"); +"/"+PP.getXpToLevel("axes")+")");
if(mcPermissions.getInstance().acrobatics(player)) if(mcPermissions.getInstance().acrobatics(player))
player.sendMessage(ChatColor.YELLOW + "Acrobatics Skill: " + ChatColor.GREEN + PP.getAcrobatics()+ChatColor.DARK_AQUA player.sendMessage(ChatColor.YELLOW + "Acrobatics Skill: " + ChatColor.GREEN + PP.getAcrobatics()+ChatColor.DARK_AQUA
+ " XP("+PP.getAcrobaticsGather() + " XP("+PP.getAcrobaticsXP()
+"/"+PP.getXpToLevel("acrobatics")+")"); +"/"+PP.getXpToLevel("acrobatics")+")");
player.sendMessage(ChatColor.DARK_RED+"POWER LEVEL: "+ChatColor.GREEN+(mcm.getInstance().getPowerLevel(player))); player.sendMessage(ChatColor.DARK_RED+"POWER LEVEL: "+ChatColor.GREEN+(mcm.getInstance().getPowerLevel(player)));
} }

View File

@ -42,7 +42,7 @@ public class mcRepair {
player.sendMessage(String.valueOf(durabilityBefore - durabilityAfter)); player.sendMessage(String.valueOf(durabilityBefore - durabilityAfter));
dif = (short) (durabilityBefore - durabilityAfter); dif = (short) (durabilityBefore - durabilityAfter);
dif = (short) (dif * 6); //Boost XP dif = (short) (dif * 6); //Boost XP
PP.addRepairGather(dif * mcLoadProperties.xpGainMultiplier); PP.addRepairXP(dif * mcLoadProperties.xpGainMultiplier);
} else if (isIronArmor(is) && hasIron(player)){ } else if (isIronArmor(is) && hasIron(player)){
/* /*
* IRON ARMOR * IRON ARMOR
@ -52,7 +52,7 @@ public class mcRepair {
durabilityAfter = player.getItemInHand().getDurability(); durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter); dif = (short) (durabilityBefore - durabilityAfter);
dif = (short) (dif * 2); //Boost XP dif = (short) (dif * 2); //Boost XP
PP.addRepairGather(dif * mcLoadProperties.xpGainMultiplier); PP.addRepairXP(dif * mcLoadProperties.xpGainMultiplier);
//GOLD ARMOR //GOLD ARMOR
} else if (isGoldArmor(is) && hasGold(player)){ } else if (isGoldArmor(is) && hasGold(player)){
removeGold(player); removeGold(player);
@ -60,7 +60,7 @@ public class mcRepair {
durabilityAfter = player.getItemInHand().getDurability(); durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter); dif = (short) (durabilityBefore - durabilityAfter);
dif = (short) (dif * 4); //Boost XP of Gold to around Iron dif = (short) (dif * 4); //Boost XP of Gold to around Iron
PP.addRepairGather(dif * mcLoadProperties.xpGainMultiplier); PP.addRepairXP(dif * mcLoadProperties.xpGainMultiplier);
} else { } else {
needMoreVespeneGas(is, player); needMoreVespeneGas(is, player);
} }
@ -86,7 +86,7 @@ public class mcRepair {
dif = (short) (dif / 2); dif = (short) (dif / 2);
if(mcm.getInstance().isHoe(is)) if(mcm.getInstance().isHoe(is))
dif = (short) (dif / 2); dif = (short) (dif / 2);
PP.addRepairGather(dif * mcLoadProperties.xpGainMultiplier); PP.addRepairXP(dif * mcLoadProperties.xpGainMultiplier);
} else if (isDiamondTools(is) && hasDiamond(player) && PP.getRepairInt() >= mcLoadProperties.repairdiamondlevel){ //Check if its diamond and the player has diamonds } else if (isDiamondTools(is) && hasDiamond(player) && PP.getRepairInt() >= mcLoadProperties.repairdiamondlevel){ //Check if its diamond and the player has diamonds
/* /*
* DIAMOND TOOLS * DIAMOND TOOLS
@ -101,7 +101,7 @@ public class mcRepair {
dif = (short) (dif / 2); dif = (short) (dif / 2);
if(mcm.getInstance().isHoe(is)) if(mcm.getInstance().isHoe(is))
dif = (short) (dif / 2); dif = (short) (dif / 2);
PP.addRepairGather(dif * mcLoadProperties.xpGainMultiplier); PP.addRepairXP(dif * mcLoadProperties.xpGainMultiplier);
} else if(isGoldTools(is) && hasGold(player)){ } else if(isGoldTools(is) && hasGold(player)){
player.getItemInHand().setDurability(getToolRepairAmount(is, player)); player.getItemInHand().setDurability(getToolRepairAmount(is, player));
removeGold(player); removeGold(player);
@ -114,7 +114,7 @@ public class mcRepair {
dif = (short) (dif / 2); dif = (short) (dif / 2);
if(mcm.getInstance().isHoe(is)) if(mcm.getInstance().isHoe(is))
dif = (short) (dif / 2); dif = (short) (dif / 2);
PP.addRepairGather(dif * mcLoadProperties.xpGainMultiplier); PP.addRepairXP(dif * mcLoadProperties.xpGainMultiplier);
} else { } else {
needMoreVespeneGas(is, player); needMoreVespeneGas(is, player);
} }

View File

@ -342,14 +342,27 @@ public class mcSkills {
} }
public void XpCheck(Player player){ public void XpCheck(Player player){
PlayerProfile PP = mcUsers.getProfile(player.getName()); PlayerProfile PP = mcUsers.getProfile(player.getName());
/*
* TAMING
*/
if(player != null && PP.getTamingXPInt() >= PP.getXpToLevel("taming")){
int skillups = 0;
while(PP.getTamingXPInt() >= PP.getXpToLevel("taming")){
skillups++;
PP.removeTamingXP(PP.getXpToLevel("taming"));
PP.skillUpTaming(1);
}
if(player != null && PP.getTaming() != null)
player.sendMessage(ChatColor.YELLOW+"Taming skill increased by "+skillups+"."+" Total ("+PP.getTaming()+")");
}
/* /*
* ACROBATICS * ACROBATICS
*/ */
if(player != null && PP.getAcrobaticsGatherInt() >= PP.getXpToLevel("acrobatics")){ if(player != null && PP.getAcrobaticsXPInt() >= PP.getXpToLevel("acrobatics")){
int skillups = 0; int skillups = 0;
while(PP.getAcrobaticsGatherInt() >= PP.getXpToLevel("acrobatics")){ while(PP.getAcrobaticsXPInt() >= PP.getXpToLevel("acrobatics")){
skillups++; skillups++;
PP.removeAcrobaticsGather(PP.getXpToLevel("acrobatics")); PP.removeAcrobaticsXP(PP.getXpToLevel("acrobatics"));
PP.skillUpAcrobatics(1); PP.skillUpAcrobatics(1);
} }
if(player != null && PP.getAcrobatics() != null) if(player != null && PP.getAcrobatics() != null)
@ -358,11 +371,11 @@ public class mcSkills {
/* /*
* ARCHERY * ARCHERY
*/ */
if(PP.getArcheryGatherInt() >= PP.getXpToLevel("archery")){ if(PP.getArcheryXPInt() >= PP.getXpToLevel("archery")){
int skillups = 0; int skillups = 0;
while(PP.getArcheryGatherInt() >= PP.getXpToLevel("archery")){ while(PP.getArcheryXPInt() >= PP.getXpToLevel("archery")){
skillups++; skillups++;
PP.removeArcheryGather(PP.getXpToLevel("archery")); PP.removeArcheryXP(PP.getXpToLevel("archery"));
PP.skillUpArchery(1); PP.skillUpArchery(1);
} }
if(player != null && PP.getArchery() != null) if(player != null && PP.getArchery() != null)
@ -371,11 +384,11 @@ public class mcSkills {
/* /*
* SWORDS * SWORDS
*/ */
if(PP.getSwordsGatherInt() >= PP.getXpToLevel("swords")){ if(PP.getSwordsXPInt() >= PP.getXpToLevel("swords")){
int skillups = 0; int skillups = 0;
while(PP.getSwordsGatherInt() >= PP.getXpToLevel("swords")){ while(PP.getSwordsXPInt() >= PP.getXpToLevel("swords")){
skillups++; skillups++;
PP.removeSwordsGather(PP.getXpToLevel("swords")); PP.removeSwordsXP(PP.getXpToLevel("swords"));
PP.skillUpSwords(1); PP.skillUpSwords(1);
} }
if(player != null && PP.getSwords() != null) if(player != null && PP.getSwords() != null)
@ -384,11 +397,11 @@ public class mcSkills {
/* /*
* AXES * AXES
*/ */
if(PP.getAxesGatherInt() >= PP.getXpToLevel("axes")){ if(PP.getAxesXPInt() >= PP.getXpToLevel("axes")){
int skillups = 0; int skillups = 0;
while(PP.getAxesGatherInt() >= PP.getXpToLevel("axes")){ while(PP.getAxesXPInt() >= PP.getXpToLevel("axes")){
skillups++; skillups++;
PP.removeAxesGather(PP.getXpToLevel("axes")); PP.removeAxesXP(PP.getXpToLevel("axes"));
PP.skillUpAxes(1); PP.skillUpAxes(1);
} }
if(player != null && PP.getAxes() != null) if(player != null && PP.getAxes() != null)
@ -397,11 +410,11 @@ public class mcSkills {
/* /*
* UNARMED * UNARMED
*/ */
if(PP.getUnarmedGatherInt() >= PP.getXpToLevel("unarmed")){ if(PP.getUnarmedXPInt() >= PP.getXpToLevel("unarmed")){
int skillups = 0; int skillups = 0;
while(PP.getUnarmedGatherInt() >= PP.getXpToLevel("unarmed")){ while(PP.getUnarmedXPInt() >= PP.getXpToLevel("unarmed")){
skillups++; skillups++;
PP.removeUnarmedGather(PP.getXpToLevel("unarmed")); PP.removeUnarmedXP(PP.getXpToLevel("unarmed"));
PP.skillUpUnarmed(1); PP.skillUpUnarmed(1);
} }
if(player != null && PP.getUnarmed() != null) if(player != null && PP.getUnarmed() != null)
@ -410,11 +423,11 @@ public class mcSkills {
/* /*
* HERBALISM * HERBALISM
*/ */
if(PP.getHerbalismGatherInt() >= PP.getXpToLevel("herbalism")){ if(PP.getHerbalismXPInt() >= PP.getXpToLevel("herbalism")){
int skillups = 0; int skillups = 0;
while(PP.getHerbalismGatherInt() >= PP.getXpToLevel("herbalism")){ while(PP.getHerbalismXPInt() >= PP.getXpToLevel("herbalism")){
skillups++; skillups++;
PP.removeHerbalismGather(PP.getXpToLevel("herbalism")); PP.removeHerbalismXP(PP.getXpToLevel("herbalism"));
PP.skillUpHerbalism(1); PP.skillUpHerbalism(1);
} }
if(player != null && PP.getHerbalism() != null) if(player != null && PP.getHerbalism() != null)
@ -423,11 +436,11 @@ public class mcSkills {
/* /*
* MINING * MINING
*/ */
if(player != null && PP.getMiningGatherInt() >= PP.getXpToLevel("mining")){ if(player != null && PP.getMiningXPInt() >= PP.getXpToLevel("mining")){
int skillups = 0; int skillups = 0;
while(PP.getMiningGatherInt() >= PP.getXpToLevel("mining")){ while(PP.getMiningXPInt() >= PP.getXpToLevel("mining")){
skillups++; skillups++;
PP.removeMiningGather(PP.getXpToLevel("mining")); PP.removeMiningXP(PP.getXpToLevel("mining"));
PP.skillUpMining(1); PP.skillUpMining(1);
} }
if(player != null && PP.getMining() != null) if(player != null && PP.getMining() != null)
@ -436,11 +449,11 @@ public class mcSkills {
/* /*
* WOODCUTTING * WOODCUTTING
*/ */
if(player != null && PP.getWoodCuttingGatherInt() >= PP.getXpToLevel("woodcutting")){ if(player != null && PP.getWoodCuttingXPInt() >= PP.getXpToLevel("woodcutting")){
int skillups = 0; int skillups = 0;
while(PP.getWoodCuttingGatherInt() >= PP.getXpToLevel("woodcutting")){ while(PP.getWoodCuttingXPInt() >= PP.getXpToLevel("woodcutting")){
skillups++; skillups++;
PP.removeWoodCuttingGather(PP.getXpToLevel("woodcutting")); PP.removeWoodCuttingXP(PP.getXpToLevel("woodcutting"));
PP.skillUpWoodCutting(1); PP.skillUpWoodCutting(1);
} }
if(player != null && PP.getWoodCutting() != null) if(player != null && PP.getWoodCutting() != null)
@ -449,11 +462,11 @@ public class mcSkills {
/* /*
* REPAIR * REPAIR
*/ */
if(PP.getRepairGatherInt() >= PP.getXpToLevel("repair")){ if(PP.getRepairXPInt() >= PP.getXpToLevel("repair")){
int skillups = 0; int skillups = 0;
while(PP.getRepairGatherInt() >= PP.getXpToLevel("repair")){ while(PP.getRepairXPInt() >= PP.getXpToLevel("repair")){
skillups++; skillups++;
PP.removeRepairGather(PP.getXpToLevel("repair")); PP.removeRepairXP(PP.getXpToLevel("repair"));
PP.skillUpRepair(1); PP.skillUpRepair(1);
} }
if(player != null && PP.getRepair() != null) if(player != null && PP.getRepair() != null)
@ -462,11 +475,11 @@ public class mcSkills {
/* /*
* EXCAVATION * EXCAVATION
*/ */
if(PP.getExcavationGatherInt() >= PP.getXpToLevel("excavation")){ if(PP.getExcavationXPInt() >= PP.getXpToLevel("excavation")){
int skillups = 0; int skillups = 0;
while(PP.getExcavationGatherInt() >= PP.getXpToLevel("excavation")){ while(PP.getExcavationXPInt() >= PP.getXpToLevel("excavation")){
skillups++; skillups++;
PP.removeExcavationGather(PP.getXpToLevel("excavation")); PP.removeExcavationXP(PP.getXpToLevel("excavation"));
PP.skillUpExcavation(1); PP.skillUpExcavation(1);
} }
if(player != null && PP.getExcavation() != null) if(player != null && PP.getExcavation() != null)
@ -478,6 +491,9 @@ public class mcSkills {
if(skillname.equals("all")){ if(skillname.equals("all")){
return true; return true;
} }
if(skillname.equals("taming")){
return true;
}
if(skillname.equals("mining")){ if(skillname.equals("mining")){
return true; return true;
} }

View File

@ -0,0 +1,47 @@
package com.gmail.nossr50;
import net.minecraft.server.EntityWolf;
import org.bukkit.craftbukkit.entity.CraftWolf;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
public class mcTaming {
private static mcMMO plugin;
public mcTaming(mcMMO instance) {
plugin = instance;
}
private static volatile mcTaming instance;
public static mcTaming getInstance() {
if (instance == null) {
instance = new mcTaming(plugin);
}
return instance;
}
public String getOwnerName(Entity theWolf){
CraftWolf cWolf = (CraftWolf)theWolf;
EntityWolf eWolf = (EntityWolf)cWolf.getHandle();
String playerName = eWolf.v();
return playerName;
}
public boolean hasOwner(Entity theWolf, Plugin pluginx){
for(Player x : pluginx.getServer().getOnlinePlayers()){
if(x != null && x.getName().equals(getOwnerName(theWolf))){
return true;
}
}
return false;
}
public Player getOwner(Entity theWolf, Plugin pluginx){
for(Player x : pluginx.getServer().getOnlinePlayers()){
if(x != null && x.getName().equals(getOwnerName(theWolf))){
return x;
}
}
return null;
}
}

View File

@ -155,8 +155,8 @@ class PlayerList
class PlayerProfile class PlayerProfile
{ {
protected final Logger log = Logger.getLogger("Minecraft"); protected final Logger log = Logger.getLogger("Minecraft");
private String playerName, gather, wgather, woodcutting, repair, mining, party, myspawn, myspawnworld, unarmed, herbalism, excavation, private String taming, tamingXP, playerName, miningXP, woodCuttingXP, woodcutting, repair, mining, party, myspawn, myspawnworld, unarmed, herbalism, excavation,
archery, swords, axes, invite, acrobatics, repairgather, unarmedgather, herbalismgather, excavationgather, archerygather, swordsgather, axesgather, acrobaticsgather; archery, swords, axes, invite, acrobatics, repairXP, unarmedXP, herbalismXP, excavationXP, archeryXP, swordsXP, axesXP, acrobaticsXP;
private boolean greenTerraMode, partyChatOnly = false, greenTerraInformed = true, berserkInformed = true, skullSplitterInformed = true, gigaDrillBreakerInformed = true, superBreakerInformed = true, serratedStrikesInformed = true, treeFellerInformed = true, dead, abilityuse = true, treeFellerMode, superBreakerMode, gigaDrillBreakerMode, serratedStrikesMode, hoePreparationMode, shovelPreparationMode, swordsPreparationMode, fistsPreparationMode, pickaxePreparationMode, axePreparationMode, skullSplitterMode, berserkMode; private boolean greenTerraMode, partyChatOnly = false, greenTerraInformed = true, berserkInformed = true, skullSplitterInformed = true, gigaDrillBreakerInformed = true, superBreakerInformed = true, serratedStrikesInformed = true, treeFellerInformed = true, dead, abilityuse = true, treeFellerMode, superBreakerMode, gigaDrillBreakerMode, serratedStrikesMode, hoePreparationMode, shovelPreparationMode, swordsPreparationMode, fistsPreparationMode, pickaxePreparationMode, axePreparationMode, skullSplitterMode, berserkMode;
private long gigaDrillBreakerCooldown = 0, berserkCooldown = 0, superBreakerCooldown = 0, skullSplitterCooldown = 0, serratedStrikesCooldown = 0, private long gigaDrillBreakerCooldown = 0, berserkCooldown = 0, superBreakerCooldown = 0, skullSplitterCooldown = 0, serratedStrikesCooldown = 0,
greenTerraCooldown = 0, treeFellerCooldown = 0, recentlyHurt = 0, archeryShotATS = 0, berserkATS = 0, berserkDATS = 0, gigaDrillBreakerATS = 0, gigaDrillBreakerDATS = 0, greenTerraCooldown = 0, treeFellerCooldown = 0, recentlyHurt = 0, archeryShotATS = 0, berserkATS = 0, berserkDATS = 0, gigaDrillBreakerATS = 0, gigaDrillBreakerDATS = 0,
@ -188,29 +188,31 @@ class PlayerList
myspawnworld = new String(); myspawnworld = new String();
mining = new String(); mining = new String();
repair = new String(); repair = new String();
repairgather = new String(); repairXP = new String();
unarmed = new String(); unarmed = new String();
unarmedgather = new String(); unarmedXP = new String();
herbalism = new String(); herbalism = new String();
herbalismgather = new String(); herbalismXP = new String();
excavation = new String(); excavation = new String();
excavationgather = new String(); excavationXP = new String();
archery = new String(); archery = new String();
archerygather = new String(); archeryXP = new String();
swords = new String(); swords = new String();
swordsgather = new String(); swordsXP = new String();
axes = new String(); axes = new String();
axesgather = new String(); axesXP = new String();
acrobatics = new String(); acrobatics = new String();
acrobaticsgather = new String(); acrobaticsXP = new String();
taming = new String();
tamingXP = new String();
invite = new String(); invite = new String();
//mining = "0"; //mining = "0";
wgather = new String(); woodCuttingXP = new String();
//wgather = "0"; //woodCuttingXP = "0";
woodcutting = new String(); woodcutting = new String();
//woodcutting = "0"; //woodcutting = "0";
gather = new String(); miningXP = new String();
//gather = "0"; //XP = "0";
party = null; party = null;
dead = false; dead = false;
treeFellerMode = false; treeFellerMode = false;
@ -258,13 +260,13 @@ class PlayerList
//Party //Party
if(character.length > 3) if(character.length > 3)
party = character[3]; party = character[3];
//Mining Gather //Mining XP
if(character.length > 4) if(character.length > 4)
gather = character[4]; miningXP = character[4];
if(character.length > 5) if(character.length > 5)
woodcutting = character[5]; woodcutting = character[5];
if(character.length > 6) if(character.length > 6)
wgather = character[6]; woodCuttingXP = character[6];
if(character.length > 7) if(character.length > 7)
repair = character[7]; repair = character[7];
if(character.length > 8) if(character.length > 8)
@ -282,23 +284,27 @@ class PlayerList
if(character.length > 14) if(character.length > 14)
acrobatics = character[14]; acrobatics = character[14];
if(character.length > 15) if(character.length > 15)
repairgather = character[15]; repairXP = character[15];
if(character.length > 16) if(character.length > 16)
unarmedgather = character[16]; unarmedXP = character[16];
if(character.length > 17) if(character.length > 17)
herbalismgather = character[17]; herbalismXP = character[17];
if(character.length > 18) if(character.length > 18)
excavationgather = character[18]; excavationXP = character[18];
if(character.length > 19) if(character.length > 19)
archerygather = character[19]; archeryXP = character[19];
if(character.length > 20) if(character.length > 20)
swordsgather = character[20]; swordsXP = character[20];
if(character.length > 21) if(character.length > 21)
axesgather = character[21]; axesXP = character[21];
if(character.length > 22) if(character.length > 22)
acrobaticsgather = character[22]; acrobaticsXP = character[22];
if(character.length > 23) if(character.length > 23)
myspawnworld = character[23]; myspawnworld = character[23];
if(character.length > 24)
taming = character[24];
if(character.length > 25)
tamingXP = character[25];
in.close(); in.close();
return true; return true;
} }
@ -341,9 +347,9 @@ class PlayerList
writer.append(mining + ":"); writer.append(mining + ":");
writer.append(myspawn + ":"); writer.append(myspawn + ":");
writer.append(party+":"); writer.append(party+":");
writer.append(gather+":"); writer.append(miningXP+":");
writer.append(woodcutting+":"); writer.append(woodcutting+":");
writer.append(wgather+":"); writer.append(woodCuttingXP+":");
writer.append(repair+":"); writer.append(repair+":");
writer.append(unarmed+":"); writer.append(unarmed+":");
writer.append(herbalism+":"); writer.append(herbalism+":");
@ -352,15 +358,17 @@ class PlayerList
writer.append(swords+":"); writer.append(swords+":");
writer.append(axes+":"); writer.append(axes+":");
writer.append(acrobatics+":"); writer.append(acrobatics+":");
writer.append(repairgather+":"); writer.append(repairXP+":");
writer.append(unarmedgather+":"); writer.append(unarmedXP+":");
writer.append(herbalismgather+":"); writer.append(herbalismXP+":");
writer.append(excavationgather+":"); writer.append(excavationXP+":");
writer.append(archerygather+":"); writer.append(archeryXP+":");
writer.append(swordsgather+":"); writer.append(swordsXP+":");
writer.append(axesgather+":"); writer.append(axesXP+":");
writer.append(acrobaticsgather+":"); writer.append(acrobaticsXP+":");
writer.append(myspawnworld+":"); writer.append(myspawnworld+":");
writer.append(taming+":");
writer.append(tamingXP+":");
writer.append("\r\n"); writer.append("\r\n");
} }
} }
@ -385,9 +393,9 @@ class PlayerList
out.append(0 + ":"); //mining out.append(0 + ":"); //mining
out.append(myspawn+":"); out.append(myspawn+":");
out.append(party+":"); out.append(party+":");
out.append(0+":"); //gather out.append(0+":"); //XP
out.append(0+":"); //woodcutting out.append(0+":"); //woodcutting
out.append(0+":"); //wgather out.append(0+":"); //woodCuttingXP
out.append(0+":"); //repair out.append(0+":"); //repair
out.append(0+":"); //unarmed out.append(0+":"); //unarmed
out.append(0+":"); //herbalism out.append(0+":"); //herbalism
@ -396,15 +404,17 @@ class PlayerList
out.append(0+":"); //swords out.append(0+":"); //swords
out.append(0+":"); //axes out.append(0+":"); //axes
out.append(0+":"); //acrobatics out.append(0+":"); //acrobatics
out.append(0+":"); //repairgather out.append(0+":"); //repairXP
out.append(0+":"); //unarmedgather out.append(0+":"); //unarmedXP
out.append(0+":"); //herbalismgather out.append(0+":"); //herbalismXP
out.append(0+":"); //excavationgather out.append(0+":"); //excavationXP
out.append(0+":"); //archerygather out.append(0+":"); //archeryXP
out.append(0+":"); //swordsgather out.append(0+":"); //swordsXP
out.append(0+":"); //axesgather out.append(0+":"); //axesXP
out.append(0+":"); //acrobaticsgather out.append(0+":"); //acrobaticsXP
out.append(thisplayer.getWorld().getName()); out.append(thisplayer.getWorld().getName());
out.append(0+":"); //taming
out.append(0+":"); //tamingXP
//Add more in the same format as the line above //Add more in the same format as the line above
out.newLine(); out.newLine();
@ -770,6 +780,20 @@ class PlayerList
public void setRecentlyHurt(long newvalue){ public void setRecentlyHurt(long newvalue){
recentlyHurt = newvalue; recentlyHurt = newvalue;
} }
public void skillUpTaming(int newskill){
int x = 0;
if(taming != null){
if(isInt(taming)){
x = Integer.parseInt(taming);
}else {
taming = "0";
x = Integer.parseInt(taming);
}
}
x += newskill;
taming = Integer.toString(x);
save();
}
public void skillUpAxes(int newskill){ public void skillUpAxes(int newskill){
int x = 0; int x = 0;
if(axes != null){ if(axes != null){
@ -910,6 +934,13 @@ class PlayerList
woodcutting = Integer.toString(x); woodcutting = Integer.toString(x);
save(); save();
} }
public String getTaming(){
if(taming != null && !taming.equals("") && !taming.equals("null")){
return taming;
} else {
return "0";
}
}
public String getRepair(){ public String getRepair(){
if(repair != null && !repair.equals("") && !repair.equals("null")){ if(repair != null && !repair.equals("") && !repair.equals("null")){
return repair; return repair;
@ -973,6 +1004,14 @@ class PlayerList
return "0"; return "0";
} }
} }
public int getTamingInt(){
if(isInt(taming)){
int x = Integer.parseInt(taming);
return x;
} else{
return 0;
}
}
public int getMiningInt(){ public int getMiningInt(){
if(isInt(mining)){ if(isInt(mining)){
int x = Integer.parseInt(mining); int x = Integer.parseInt(mining);
@ -1063,220 +1102,242 @@ class PlayerList
/* /*
* EXPERIENCE STUFF * EXPERIENCE STUFF
*/ */
public void clearRepairGather(){ public void clearTamingXP(){
repairgather = "0"; tamingXP = "0";
} }
public void clearUnarmedGather(){ public void clearRepairXP(){
unarmedgather = "0"; repairXP = "0";
} }
public void clearHerbalismGather(){ public void clearUnarmedXP(){
herbalismgather = "0"; unarmedXP = "0";
} }
public void clearExcavationGather(){ public void clearHerbalismXP(){
excavationgather = "0"; herbalismXP = "0";
} }
public void clearArcheryGather(){ public void clearExcavationXP(){
archerygather = "0"; excavationXP = "0";
} }
public void clearSwordsGather(){ public void clearArcheryXP(){
swordsgather = "0"; archeryXP = "0";
} }
public void clearAxesGather(){ public void clearSwordsXP(){
axesgather = "0"; swordsXP = "0";
} }
public void clearAcrobaticsGather(){ public void clearAxesXP(){
acrobaticsgather = "0"; axesXP = "0";
} }
public void addAcrobaticsGather(int newgather) public void clearAcrobaticsXP(){
acrobaticsXP = "0";
}
public void addTamingXP(int newXP)
{ {
int x = 0; int x = 0;
if(isInt(acrobaticsgather)){ if(isInt(tamingXP)){
x = Integer.parseInt(acrobaticsgather); x = Integer.parseInt(tamingXP);
} }
x += newgather; x += newXP;
acrobaticsgather = String.valueOf(x); acrobaticsXP = String.valueOf(x);
save(); save();
} }
public void addAxesGather(int newgather) public void addAcrobaticsXP(int newXP)
{ {
int x = 0; int x = 0;
if(isInt(axesgather)){ if(isInt(acrobaticsXP)){
x = Integer.parseInt(axesgather); x = Integer.parseInt(acrobaticsXP);
} }
x += newgather; x += newXP;
axesgather = String.valueOf(x); acrobaticsXP = String.valueOf(x);
save(); save();
} }
public void addSwordsGather(int newgather) public void addAxesXP(int newXP)
{ {
int x = 0; int x = 0;
if(isInt(swordsgather)){ if(isInt(axesXP)){
x = Integer.parseInt(swordsgather); x = Integer.parseInt(axesXP);
} }
x += newgather; x += newXP;
swordsgather = String.valueOf(x); axesXP = String.valueOf(x);
save(); save();
} }
public void addArcheryGather(int newgather) public void addSwordsXP(int newXP)
{ {
int x = 0; int x = 0;
if(isInt(archerygather)){ if(isInt(swordsXP)){
x = Integer.parseInt(archerygather); x = Integer.parseInt(swordsXP);
} }
x += newgather; x += newXP;
archerygather = String.valueOf(x); swordsXP = String.valueOf(x);
save(); save();
} }
public void addExcavationGather(int newgather) public void addArcheryXP(int newXP)
{ {
int x = 0; int x = 0;
if(isInt(excavationgather)){ if(isInt(archeryXP)){
x = Integer.parseInt(excavationgather); x = Integer.parseInt(archeryXP);
} }
x += newgather; x += newXP;
excavationgather = String.valueOf(x); archeryXP = String.valueOf(x);
save(); save();
} }
public void addHerbalismGather(int newgather) public void addExcavationXP(int newXP)
{ {
int x = 0; int x = 0;
if(isInt(herbalismgather)){ if(isInt(excavationXP)){
x = Integer.parseInt(herbalismgather); x = Integer.parseInt(excavationXP);
} }
x += newgather; x += newXP;
herbalismgather = String.valueOf(x); excavationXP = String.valueOf(x);
save(); save();
} }
public void addRepairGather(int newgather) public void addHerbalismXP(int newXP)
{ {
int x = 0; int x = 0;
if(isInt(repairgather)){ if(isInt(herbalismXP)){
x = Integer.parseInt(repairgather); x = Integer.parseInt(herbalismXP);
} }
x += newgather; x += newXP;
repairgather = String.valueOf(x); herbalismXP = String.valueOf(x);
save(); save();
} }
public void addUnarmedGather(int newgather) public void addRepairXP(int newXP)
{ {
int x = 0; int x = 0;
if(isInt(unarmedgather)){ if(isInt(repairXP)){
x = Integer.parseInt(unarmedgather); x = Integer.parseInt(repairXP);
} }
x += newgather; x += newXP;
unarmedgather = String.valueOf(x); repairXP = String.valueOf(x);
save(); save();
} }
public void addWoodcuttingGather(int newgather) public void addUnarmedXP(int newXP)
{ {
int x = 0; int x = 0;
if(isInt(wgather)){ if(isInt(unarmedXP)){
x = Integer.parseInt(wgather); x = Integer.parseInt(unarmedXP);
} }
x += newgather; x += newXP;
wgather = String.valueOf(x); unarmedXP = String.valueOf(x);
save(); save();
} }
public void removeWoodCuttingGather(int newgather){ public void addWoodcuttingXP(int newXP)
int x = 0;
if(isInt(wgather)){
x = Integer.parseInt(wgather);
}
x -= newgather;
wgather = String.valueOf(x);
save();
}
public void addMiningGather(int newgather)
{ {
int x = 0; int x = 0;
if(isInt(gather)){ if(isInt(woodCuttingXP)){
x = Integer.parseInt(gather); x = Integer.parseInt(woodCuttingXP);
}
x += newXP;
woodCuttingXP = String.valueOf(x);
save();
}
public void removeTamingXP(int newXP){
int x = 0;
if(isInt(tamingXP)){
x = Integer.parseInt(tamingXP);
}
x -= newXP;
tamingXP = String.valueOf(x);
save();
}
public void removeWoodCuttingXP(int newXP){
int x = 0;
if(isInt(woodCuttingXP)){
x = Integer.parseInt(woodCuttingXP);
}
x -= newXP;
woodCuttingXP = String.valueOf(x);
save();
}
public void addMiningXP(int newXP)
{
int x = 0;
if(isInt(miningXP)){
x = Integer.parseInt(miningXP);
} else { } else {
x = 0; x = 0;
} }
x += newgather; x += newXP;
gather = String.valueOf(x); miningXP = String.valueOf(x);
save(); save();
} }
public void removeMiningGather(int newgather){ public void removeMiningXP(int newXP){
int x = 0; int x = 0;
if(isInt(gather)){ if(isInt(miningXP)){
x = Integer.parseInt(gather); x = Integer.parseInt(miningXP);
} }
x -= newgather; x -= newXP;
gather = String.valueOf(x); miningXP = String.valueOf(x);
save(); save();
} }
public void removeRepairGather(int newgather){ public void removeRepairXP(int newXP){
int x = 0; int x = 0;
if(isInt(repairgather)){ if(isInt(repairXP)){
x = Integer.parseInt(repairgather); x = Integer.parseInt(repairXP);
} }
x -= newgather; x -= newXP;
repairgather = String.valueOf(x); repairXP = String.valueOf(x);
save(); save();
} }
public void removeUnarmedGather(int newgather){ public void removeUnarmedXP(int newXP){
int x = 0; int x = 0;
if(isInt(unarmedgather)){ if(isInt(unarmedXP)){
x = Integer.parseInt(unarmedgather); x = Integer.parseInt(unarmedXP);
} }
x -= newgather; x -= newXP;
unarmedgather = String.valueOf(x); unarmedXP = String.valueOf(x);
save(); save();
} }
public void removeHerbalismGather(int newgather){ public void removeHerbalismXP(int newXP){
int x = 0; int x = 0;
if(isInt(herbalismgather)){ if(isInt(herbalismXP)){
x = Integer.parseInt(herbalismgather); x = Integer.parseInt(herbalismXP);
} }
x -= newgather; x -= newXP;
herbalismgather = String.valueOf(x); herbalismXP = String.valueOf(x);
save(); save();
} }
public void removeExcavationGather(int newgather){ public void removeExcavationXP(int newXP){
int x = 0; int x = 0;
if(isInt(excavationgather)){ if(isInt(excavationXP)){
x = Integer.parseInt(excavationgather); x = Integer.parseInt(excavationXP);
} }
x -= newgather; x -= newXP;
excavationgather = String.valueOf(x); excavationXP = String.valueOf(x);
save(); save();
} }
public void removeArcheryGather(int newgather){ public void removeArcheryXP(int newXP){
int x = 0; int x = 0;
if(isInt(archerygather)){ if(isInt(archeryXP)){
x = Integer.parseInt(archerygather); x = Integer.parseInt(archeryXP);
} }
x -= newgather; x -= newXP;
archerygather = String.valueOf(x); archeryXP = String.valueOf(x);
save(); save();
} }
public void removeSwordsGather(int newgather){ public void removeSwordsXP(int newXP){
int x = 0; int x = 0;
if(isInt(swordsgather)){ if(isInt(swordsXP)){
x = Integer.parseInt(swordsgather); x = Integer.parseInt(swordsXP);
} }
x -= newgather; x -= newXP;
swordsgather = String.valueOf(x); swordsXP = String.valueOf(x);
save(); save();
} }
public void removeAxesGather(int newgather){ public void removeAxesXP(int newXP){
int x = 0; int x = 0;
if(isInt(axesgather)){ if(isInt(axesXP)){
x = Integer.parseInt(axesgather); x = Integer.parseInt(axesXP);
} }
x -= newgather; x -= newXP;
axesgather = String.valueOf(x); axesXP = String.valueOf(x);
save(); save();
} }
public void removeAcrobaticsGather(int newgather){ public void removeAcrobaticsXP(int newXP){
int x = 0; int x = 0;
if(isInt(acrobaticsgather)){ if(isInt(acrobaticsXP)){
x = Integer.parseInt(acrobaticsgather); x = Integer.parseInt(acrobaticsXP);
} }
x -= newgather; x -= newXP;
acrobaticsgather = String.valueOf(x); acrobaticsXP = String.valueOf(x);
save(); save();
} }
@ -1306,230 +1367,252 @@ class PlayerList
public void modifyInvite(String invitename){ public void modifyInvite(String invitename){
invite = invitename; invite = invitename;
} }
//Returns player gather //Returns player XP
public String getMiningGather(){ public String getTamingXP(){
if(gather != null && !gather.equals("") && !gather.equals("null")){ if(tamingXP != null && !tamingXP.equals("") && !tamingXP.equals("null")){
return gather; return tamingXP;
} else {
return "0";
}
}
public String getMiningXP(){
if(miningXP != null && !miningXP.equals("") && !miningXP.equals("null")){
return miningXP;
} else { } else {
return "0"; return "0";
} }
} }
public String getInvite() { return invite; } public String getInvite() { return invite; }
public String getWoodCuttingGather(){ public String getWoodCuttingXP(){
if(wgather != null && !wgather.equals("") && !wgather.equals("null")){ if(woodCuttingXP != null && !woodCuttingXP.equals("") && !woodCuttingXP.equals("null")){
return wgather; return woodCuttingXP;
} else { } else {
return "0"; return "0";
} }
} }
public String getRepairGather(){ public String getRepairXP(){
if(repairgather != null && !repairgather.equals("") && !repairgather.equals("null")){ if(repairXP != null && !repairXP.equals("") && !repairXP.equals("null")){
return repairgather; return repairXP;
} else { } else {
return "0"; return "0";
} }
} }
public String getHerbalismGather(){ public String getHerbalismXP(){
if(herbalismgather != null && !herbalismgather.equals("") && !herbalismgather.equals("null")){ if(herbalismXP != null && !herbalismXP.equals("") && !herbalismXP.equals("null")){
return herbalismgather; return herbalismXP;
} else { } else {
return "0"; return "0";
} }
} }
public String getExcavationGather(){ public String getExcavationXP(){
if(excavationgather != null && !excavationgather.equals("") && !excavationgather.equals("null")){ if(excavationXP != null && !excavationXP.equals("") && !excavationXP.equals("null")){
return excavationgather; return excavationXP;
} else { } else {
return "0"; return "0";
} }
} }
public String getArcheryGather(){ public String getArcheryXP(){
if(archerygather != null && !archerygather.equals("") && !archerygather.equals("null")){ if(archeryXP != null && !archeryXP.equals("") && !archeryXP.equals("null")){
return archerygather; return archeryXP;
} else { } else {
return "0"; return "0";
} }
} }
public String getSwordsGather(){ public String getSwordsXP(){
if(swordsgather != null && !swordsgather.equals("") && !swordsgather.equals("null")){ if(swordsXP != null && !swordsXP.equals("") && !swordsXP.equals("null")){
return swordsgather; return swordsXP;
} else { } else {
return "0"; return "0";
} }
} }
public String getAxesGather(){ public String getAxesXP(){
if(axesgather != null && !axesgather.equals("") && !axesgather.equals("null")){ if(axesXP != null && !axesXP.equals("") && !axesXP.equals("null")){
return axesgather; return axesXP;
} else { } else {
return "0"; return "0";
} }
} }
public String getAcrobaticsGather(){ public String getAcrobaticsXP(){
if(acrobaticsgather != null && !acrobaticsgather.equals("") && !acrobaticsgather.equals("null")){ if(acrobaticsXP != null && !acrobaticsXP.equals("") && !acrobaticsXP.equals("null")){
return acrobaticsgather; return acrobaticsXP;
} else { } else {
return "0"; return "0";
} }
} }
public String getUnarmedGather(){ public String getUnarmedXP(){
if(unarmedgather != null && !unarmedgather.equals("") && !unarmedgather.equals("null")){ if(unarmedXP != null && !unarmedXP.equals("") && !unarmedXP.equals("null")){
return unarmedgather; return unarmedXP;
} else { } else {
return "0"; return "0";
} }
} }
public int getTamingXPInt() {
public int getWoodCuttingGatherInt() { if(isInt(tamingXP)){
if(isInt(wgather)){ return Integer.parseInt(tamingXP);
return Integer.parseInt(wgather);
} else { } else {
wgather = "0"; tamingXP = "0";
save(); save();
return 0; return 0;
} }
} }
public int getRepairGatherInt() { public int getWoodCuttingXPInt() {
if(isInt(repairgather)){ if(isInt(woodCuttingXP)){
return Integer.parseInt(repairgather); return Integer.parseInt(woodCuttingXP);
} else { } else {
repairgather = "0"; woodCuttingXP = "0";
save(); save();
return 0; return 0;
} }
} }
public int getUnarmedGatherInt() { public int getRepairXPInt() {
if(isInt(unarmedgather)){ if(isInt(repairXP)){
return Integer.parseInt(unarmedgather); return Integer.parseInt(repairXP);
} else { } else {
unarmedgather = "0"; repairXP = "0";
save(); save();
return 0; return 0;
} }
} }
public int getHerbalismGatherInt() { public int getUnarmedXPInt() {
if(isInt(herbalismgather)){ if(isInt(unarmedXP)){
return Integer.parseInt(herbalismgather); return Integer.parseInt(unarmedXP);
} else { } else {
herbalismgather = "0"; unarmedXP = "0";
save(); save();
return 0; return 0;
} }
} }
public int getExcavationGatherInt() { public int getHerbalismXPInt() {
if(isInt(excavationgather)){ if(isInt(herbalismXP)){
return Integer.parseInt(excavationgather); return Integer.parseInt(herbalismXP);
} else { } else {
excavationgather = "0"; herbalismXP = "0";
save(); save();
return 0; return 0;
} }
} }
public int getArcheryGatherInt() { public int getExcavationXPInt() {
if(isInt(archerygather)){ if(isInt(excavationXP)){
return Integer.parseInt(archerygather); return Integer.parseInt(excavationXP);
} else { } else {
archerygather = "0"; excavationXP = "0";
save(); save();
return 0; return 0;
} }
} }
public int getSwordsGatherInt() { public int getArcheryXPInt() {
if(isInt(swordsgather)){ if(isInt(archeryXP)){
return Integer.parseInt(swordsgather); return Integer.parseInt(archeryXP);
} else { } else {
swordsgather = "0"; archeryXP = "0";
save(); save();
return 0; return 0;
} }
} }
public int getAxesGatherInt() { public int getSwordsXPInt() {
if(isInt(axesgather)){ if(isInt(swordsXP)){
return Integer.parseInt(axesgather); return Integer.parseInt(swordsXP);
} else { } else {
axesgather = "0"; swordsXP = "0";
save(); save();
return 0; return 0;
} }
} }
public int getAcrobaticsGatherInt() { public int getAxesXPInt() {
if(isInt(acrobaticsgather)){ if(isInt(axesXP)){
return Integer.parseInt(acrobaticsgather); return Integer.parseInt(axesXP);
} else { } else {
acrobaticsgather = "0"; axesXP = "0";
save();
return 0;
}
}
public int getAcrobaticsXPInt() {
if(isInt(acrobaticsXP)){
return Integer.parseInt(acrobaticsXP);
} else {
acrobaticsXP = "0";
save(); save();
return 0; return 0;
} }
} }
public void addXpToSkill(int newvalue, String skillname){ public void addXpToSkill(int newvalue, String skillname){
if(!isInt(gather)) if(!isInt(tamingXP))
gather = String.valueOf(0); tamingXP = String.valueOf(0);
if(!isInt(wgather)) if(!isInt(miningXP))
wgather = String.valueOf(0); miningXP = String.valueOf(0);
if(!isInt(repairgather)) if(!isInt(woodCuttingXP))
repairgather = String.valueOf(0); woodCuttingXP = String.valueOf(0);
if(!isInt(herbalismgather)) if(!isInt(repairXP))
herbalismgather = String.valueOf(0); repairXP = String.valueOf(0);
if(!isInt(acrobaticsgather)) if(!isInt(herbalismXP))
acrobaticsgather = String.valueOf(0); herbalismXP = String.valueOf(0);
if(!isInt(swordsgather)) if(!isInt(acrobaticsXP))
swordsgather = String.valueOf(0); acrobaticsXP = String.valueOf(0);
if(!isInt(archerygather)) if(!isInt(swordsXP))
archerygather = String.valueOf(0); swordsXP = String.valueOf(0);
if(!isInt(unarmedgather)) if(!isInt(archeryXP))
unarmedgather = String.valueOf(0); archeryXP = String.valueOf(0);
if(!isInt(excavationgather)) if(!isInt(unarmedXP))
excavationgather = String.valueOf(0); unarmedXP = String.valueOf(0);
if(!isInt(axesgather)) if(!isInt(excavationXP))
axesgather = String.valueOf(0); excavationXP = String.valueOf(0);
if(!isInt(axesXP))
axesXP = String.valueOf(0);
if(skillname.toLowerCase().equals("taming")){
tamingXP = String.valueOf(Integer.valueOf(tamingXP)+newvalue);
}
if(skillname.toLowerCase().equals("mining")){ if(skillname.toLowerCase().equals("mining")){
gather = String.valueOf(Integer.valueOf(gather)+newvalue); miningXP = String.valueOf(Integer.valueOf(miningXP)+newvalue);
} }
if(skillname.toLowerCase().equals("woodcutting")){ if(skillname.toLowerCase().equals("woodcutting")){
wgather = String.valueOf(Integer.valueOf(wgather)+newvalue); woodCuttingXP = String.valueOf(Integer.valueOf(woodCuttingXP)+newvalue);
} }
if(skillname.toLowerCase().equals("repair")){ if(skillname.toLowerCase().equals("repair")){
repairgather = String.valueOf(Integer.valueOf(repairgather)+newvalue); repairXP = String.valueOf(Integer.valueOf(repairXP)+newvalue);
} }
if(skillname.toLowerCase().equals("herbalism")){ if(skillname.toLowerCase().equals("herbalism")){
herbalismgather = String.valueOf(Integer.valueOf(herbalismgather)+newvalue); herbalismXP = String.valueOf(Integer.valueOf(herbalismXP)+newvalue);
} }
if(skillname.toLowerCase().equals("acrobatics")){ if(skillname.toLowerCase().equals("acrobatics")){
acrobaticsgather = String.valueOf(Integer.valueOf(acrobaticsgather)+newvalue); acrobaticsXP = String.valueOf(Integer.valueOf(acrobaticsXP)+newvalue);
} }
if(skillname.toLowerCase().equals("swords")){ if(skillname.toLowerCase().equals("swords")){
swordsgather = String.valueOf(Integer.valueOf(swordsgather)+newvalue); swordsXP = String.valueOf(Integer.valueOf(swordsXP)+newvalue);
} }
if(skillname.toLowerCase().equals("archery")){ if(skillname.toLowerCase().equals("archery")){
archerygather = String.valueOf(Integer.valueOf(archerygather)+newvalue); archeryXP = String.valueOf(Integer.valueOf(archeryXP)+newvalue);
} }
if(skillname.toLowerCase().equals("unarmed")){ if(skillname.toLowerCase().equals("unarmed")){
unarmedgather = String.valueOf(Integer.valueOf(unarmedgather)+newvalue); unarmedXP = String.valueOf(Integer.valueOf(unarmedXP)+newvalue);
} }
if(skillname.toLowerCase().equals("excavation")){ if(skillname.toLowerCase().equals("excavation")){
excavationgather = String.valueOf(Integer.valueOf(excavationgather)+newvalue); excavationXP = String.valueOf(Integer.valueOf(excavationXP)+newvalue);
} }
if(skillname.toLowerCase().equals("axes")){ if(skillname.toLowerCase().equals("axes")){
axesgather = String.valueOf(Integer.valueOf(axesgather)+newvalue); axesXP = String.valueOf(Integer.valueOf(axesXP)+newvalue);
} }
if(skillname.toLowerCase().equals("all")){ if(skillname.toLowerCase().equals("all")){
gather = String.valueOf(Integer.valueOf(gather)+newvalue); tamingXP = String.valueOf(Integer.valueOf(tamingXP)+newvalue);
wgather = String.valueOf(Integer.valueOf(wgather)+newvalue); miningXP = String.valueOf(Integer.valueOf(miningXP)+newvalue);
repairgather = String.valueOf(Integer.valueOf(repairgather)+newvalue); woodCuttingXP = String.valueOf(Integer.valueOf(woodCuttingXP)+newvalue);
herbalismgather = String.valueOf(Integer.valueOf(herbalismgather)+newvalue); repairXP = String.valueOf(Integer.valueOf(repairXP)+newvalue);
acrobaticsgather = String.valueOf(Integer.valueOf(acrobaticsgather)+newvalue); herbalismXP = String.valueOf(Integer.valueOf(herbalismXP)+newvalue);
swordsgather = String.valueOf(Integer.valueOf(swordsgather)+newvalue); acrobaticsXP = String.valueOf(Integer.valueOf(acrobaticsXP)+newvalue);
archerygather = String.valueOf(Integer.valueOf(archerygather)+newvalue); swordsXP = String.valueOf(Integer.valueOf(swordsXP)+newvalue);
unarmedgather = String.valueOf(Integer.valueOf(unarmedgather)+newvalue); archeryXP = String.valueOf(Integer.valueOf(archeryXP)+newvalue);
excavationgather = String.valueOf(Integer.valueOf(excavationgather)+newvalue); unarmedXP = String.valueOf(Integer.valueOf(unarmedXP)+newvalue);
axesgather = String.valueOf(Integer.valueOf(axesgather)+newvalue); excavationXP = String.valueOf(Integer.valueOf(excavationXP)+newvalue);
axesXP = String.valueOf(Integer.valueOf(axesXP)+newvalue);
} }
save(); save();
if(isPlayer(playerName)){
mcSkills.getInstance().XpCheck(thisplayer); mcSkills.getInstance().XpCheck(thisplayer);
} }
}
public void modifyskill(int newvalue, String skillname){ public void modifyskill(int newvalue, String skillname){
if(skillname.toLowerCase().equals("taming")){
taming = String.valueOf(newvalue);
}
if(skillname.toLowerCase().equals("mining")){ if(skillname.toLowerCase().equals("mining")){
mining = String.valueOf(newvalue); mining = String.valueOf(newvalue);
} }
@ -1561,6 +1644,7 @@ class PlayerList
axes = String.valueOf(newvalue); axes = String.valueOf(newvalue);
} }
if(skillname.toLowerCase().equals("all")){ if(skillname.toLowerCase().equals("all")){
taming = String.valueOf(newvalue);
mining = String.valueOf(newvalue); mining = String.valueOf(newvalue);
woodcutting = String.valueOf(newvalue); woodcutting = String.valueOf(newvalue);
repair = String.valueOf(newvalue); repair = String.valueOf(newvalue);
@ -1575,6 +1659,9 @@ class PlayerList
save(); save();
} }
public Integer getXpToLevel(String skillname){ public Integer getXpToLevel(String skillname){
if(skillname.equals("taming")){
return ((getTamingInt() + 50) * mcLoadProperties.tamingxpmodifier) * mcLoadProperties.globalxpmodifier;
}
if(skillname.equals("mining")){ if(skillname.equals("mining")){
return ((getMiningInt() + 50) * mcLoadProperties.miningxpmodifier) * mcLoadProperties.globalxpmodifier; return ((getMiningInt() + 50) * mcLoadProperties.miningxpmodifier) * mcLoadProperties.globalxpmodifier;
} }
@ -1608,11 +1695,11 @@ class PlayerList
return 0; return 0;
} }
} }
public int getMiningGatherInt() { public int getMiningXPInt() {
if(isInt(gather)){ if(isInt(miningXP)){
return Integer.parseInt(gather); return Integer.parseInt(miningXP);
} else { } else {
gather = "0"; miningXP = "0";
save(); save();
return 0; return 0;
} }
@ -1696,7 +1783,6 @@ class PlayerList
return loc; return loc;
} }
} }
} }

View File

@ -77,9 +77,9 @@ public class mcWoodCutting {
public void treeFeller(Block block, Player player){ public void treeFeller(Block block, Player player){
PlayerProfile PP = mcUsers.getProfile(player.getName()); PlayerProfile PP = mcUsers.getProfile(player.getName());
int radius = 1; int radius = 1;
if(PP.getWoodCuttingGatherInt() >= 500) if(PP.getWoodCuttingXPInt() >= 500)
radius++; radius++;
if(PP.getWoodCuttingGatherInt() >= 950) if(PP.getWoodCuttingXPInt() >= 950)
radius++; radius++;
ArrayList<Block> blocklist = new ArrayList<Block>(); ArrayList<Block> blocklist = new ArrayList<Block>();
ArrayList<Block> toAdd = new ArrayList<Block>(); ArrayList<Block> toAdd = new ArrayList<Block>();

View File

@ -1,3 +1,3 @@
name: mcMMO name: mcMMO
main: com.gmail.nossr50.mcMMO main: com.gmail.nossr50.mcMMO
version: 0.9.27 version: 0.9.30 WIP