mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
0.9.30 WIP
This commit is contained in:
parent
6236e0960e
commit
bc0c3c7a57
@ -1,5 +1,14 @@
|
||||
Changelog:
|
||||
#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
|
||||
Fixed Herbalism not properly receiving Triple Drops from Green Terra
|
||||
Fixed Herbalism not handing out any XP outside of Green Terra
|
||||
|
@ -22,7 +22,7 @@ public class mcAcrobatics {
|
||||
int acrovar = PP.getAcrobaticsInt();
|
||||
if(player.isSneaking())
|
||||
acrovar = acrovar * 2;
|
||||
if(Math.random() * 1000 <= acrovar){
|
||||
if(Math.random() * 1000 <= acrovar && !event.isCancelled()){
|
||||
int threshold = 7;
|
||||
if(player.isSneaking())
|
||||
threshold = 14;
|
||||
@ -34,7 +34,7 @@ public class mcAcrobatics {
|
||||
*/
|
||||
if(player.getHealth() - newDamage >= 1){
|
||||
if(!event.isCancelled())
|
||||
PP.addAcrobaticsGather((event.getDamage() * 8) * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addAcrobaticsXP((event.getDamage() * 8) * mcLoadProperties.xpGainMultiplier);
|
||||
mcSkills.getInstance().XpCheck(player);
|
||||
event.setDamage(newDamage);
|
||||
if(event.getDamage() <= 0)
|
||||
@ -45,9 +45,11 @@ public class mcAcrobatics {
|
||||
player.sendMessage("**ROLL**");
|
||||
}
|
||||
}
|
||||
} else if (!mcConfig.getInstance().isBlockWatched(loc.getWorld().getBlockAt(xx, y, z)) && !event.isCancelled()){
|
||||
PP.addAcrobaticsGather((event.getDamage() * 12) * mcLoadProperties.xpGainMultiplier);
|
||||
mcSkills.getInstance().XpCheck(player);
|
||||
} else if (!event.isCancelled()){
|
||||
if(player.getHealth() - event.getDamage() >= 1){
|
||||
PP.addAcrobaticsXP((event.getDamage() * 12) * mcLoadProperties.xpGainMultiplier);
|
||||
mcSkills.getInstance().XpCheck(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -88,13 +88,13 @@ public class mcBlockListener extends BlockListener {
|
||||
if(mcm.getInstance().isAxes(inhand)){
|
||||
if(!mcConfig.getInstance().isBlockWatched(block)){
|
||||
mcWoodCutting.getInstance().woodCuttingProcCheck(player, block);
|
||||
PP.addWoodcuttingGather(7 * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addWoodcuttingXP(7 * mcLoadProperties.xpGainMultiplier);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(block.getData() != 5){
|
||||
mcWoodCutting.getInstance().woodCuttingProcCheck(player, block);
|
||||
PP.addWoodcuttingGather(7 * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addWoodcuttingXP(7 * mcLoadProperties.xpGainMultiplier);
|
||||
}
|
||||
}
|
||||
mcSkills.getInstance().XpCheck(player);
|
||||
@ -120,7 +120,7 @@ public class mcBlockListener extends BlockListener {
|
||||
//XP WOODCUTTING
|
||||
if(!mcConfig.getInstance().isBlockWatched(block)){
|
||||
mcWoodCutting.getInstance().woodCuttingProcCheck(player, blockx);
|
||||
PP.addWoodcuttingGather(7);
|
||||
PP.addWoodcuttingXP(7);
|
||||
}
|
||||
}
|
||||
if(blockx.getTypeId() == 18){
|
||||
@ -265,7 +265,7 @@ public class mcBlockListener extends BlockListener {
|
||||
for (int cz = -radius; cz <= radius; cz++) {
|
||||
Block block = world.getBlockAt(ox + cx, oy + cy, oz + cz);
|
||||
//If block is block
|
||||
if (isWater == true){
|
||||
if (isWater == true && block.getType() == Material.GRAVEL){
|
||||
//Change
|
||||
block.setType(Material.CLAY);
|
||||
return;
|
||||
|
@ -93,11 +93,11 @@ public class mcCombat {
|
||||
if(PPd.inParty() && PPa.inParty() && mcParty.getInstance().inSameParty(attacker, defender))
|
||||
return;
|
||||
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()))
|
||||
PPa.addSwordsGather((event.getDamage() * 3) * mcLoadProperties.pvpxprewardmodifier);
|
||||
PPa.addSwordsXP((event.getDamage() * 3) * mcLoadProperties.pvpxprewardmodifier);
|
||||
if(attacker.getItemInHand().getTypeId() == 0)
|
||||
PPa.addUnarmedGather((event.getDamage() * 3) * mcLoadProperties.pvpxprewardmodifier);
|
||||
PPa.addUnarmedXP((event.getDamage() * 3) * mcLoadProperties.pvpxprewardmodifier);
|
||||
}
|
||||
/*
|
||||
* CHECK FOR LEVEL UPS
|
||||
@ -113,13 +113,13 @@ public class mcCombat {
|
||||
}
|
||||
Squid defender = (Squid)event.getEntity();
|
||||
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);
|
||||
if(mcm.getInstance().isAxes(attacker.getItemInHand())
|
||||
&& defender.getHealth() > 0
|
||||
&& mcPermissions.getInstance().axes(attacker)){
|
||||
PPa.addAxesGather(10 * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addAxesXP(10 * mcLoadProperties.xpGainMultiplier);
|
||||
mcSkills.getInstance().XpCheck(attacker);
|
||||
}
|
||||
if(mcm.getInstance().isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker)){
|
||||
@ -144,7 +144,7 @@ public class mcCombat {
|
||||
|
||||
//XP
|
||||
if(defender.getHealth() != 0){
|
||||
PPa.addUnarmedGather(10 * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addUnarmedXP(10 * mcLoadProperties.xpGainMultiplier);
|
||||
mcSkills.getInstance().XpCheck(attacker);
|
||||
}
|
||||
}
|
||||
@ -191,15 +191,15 @@ public class mcCombat {
|
||||
&& mcPermissions.getInstance().swords(attacker)){
|
||||
if(!mcConfig.getInstance().isMobSpawnTracked(x)){
|
||||
if(x instanceof Creeper)
|
||||
PPa.addSwordsGather((event.getDamage() * 4) * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addSwordsXP((event.getDamage() * 4) * mcLoadProperties.xpGainMultiplier);
|
||||
if(x instanceof Spider)
|
||||
PPa.addSwordsGather((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addSwordsXP((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
|
||||
if(x instanceof Skeleton)
|
||||
PPa.addSwordsGather((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addSwordsXP((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
|
||||
if(x instanceof Zombie)
|
||||
PPa.addSwordsGather((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addSwordsXP((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
|
||||
if(x instanceof PigZombie)
|
||||
PPa.addSwordsGather((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addSwordsXP((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
|
||||
}
|
||||
mcSkills.getInstance().XpCheck(attacker);
|
||||
}
|
||||
@ -208,15 +208,15 @@ public class mcCombat {
|
||||
&& mcPermissions.getInstance().axes(attacker)){
|
||||
if(!mcConfig.getInstance().isMobSpawnTracked(x)){
|
||||
if(x instanceof Creeper)
|
||||
PPa.addAxesGather((event.getDamage() * 4) * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addAxesXP((event.getDamage() * 4) * mcLoadProperties.xpGainMultiplier);
|
||||
if(x instanceof Spider)
|
||||
PPa.addAxesGather((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addAxesXP((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
|
||||
if(x instanceof Skeleton)
|
||||
PPa.addAxesGather((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addAxesXP((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
|
||||
if(x instanceof Zombie)
|
||||
PPa.addAxesGather((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addAxesXP((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
|
||||
if(x instanceof PigZombie)
|
||||
PPa.addAxesGather((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addAxesXP((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
|
||||
}
|
||||
mcSkills.getInstance().XpCheck(attacker);
|
||||
}
|
||||
@ -243,15 +243,15 @@ public class mcCombat {
|
||||
//XP
|
||||
if(!mcConfig.getInstance().isMobSpawnTracked(x)){
|
||||
if(x instanceof Creeper)
|
||||
PPa.addUnarmedGather((event.getDamage() * 4) * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addUnarmedXP((event.getDamage() * 4) * mcLoadProperties.xpGainMultiplier);
|
||||
if(x instanceof Spider)
|
||||
PPa.addUnarmedGather((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addUnarmedXP((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
|
||||
if(x instanceof Skeleton)
|
||||
PPa.addUnarmedGather((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addUnarmedXP((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
|
||||
if(x instanceof Zombie)
|
||||
PPa.addUnarmedGather((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addUnarmedXP((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
|
||||
if(x instanceof PigZombie)
|
||||
PPa.addUnarmedGather((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addUnarmedXP((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
|
||||
}
|
||||
mcSkills.getInstance().XpCheck(attacker);
|
||||
}
|
||||
@ -351,15 +351,15 @@ public class mcCombat {
|
||||
//XP
|
||||
if(!mcConfig.getInstance().isMobSpawnTracked(x)){
|
||||
if(x instanceof Creeper)
|
||||
PPa.addArcheryGather((event.getDamage() * 4) * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addArcheryXP((event.getDamage() * 4) * mcLoadProperties.xpGainMultiplier);
|
||||
if(x instanceof Spider)
|
||||
PPa.addArcheryGather((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addArcheryXP((event.getDamage() * 3) * mcLoadProperties.xpGainMultiplier);
|
||||
if(x instanceof Skeleton)
|
||||
PPa.addArcheryGather((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addArcheryXP((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
|
||||
if(x instanceof Zombie)
|
||||
PPa.addArcheryGather((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
|
||||
PPa.addArcheryXP((event.getDamage() * 2) * mcLoadProperties.xpGainMultiplier);
|
||||
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
|
||||
*/
|
||||
if(mcLoadProperties.pvpxp && !mcParty.getInstance().inSameParty(attacker, defender)){
|
||||
PPa.addArcheryGather((event.getDamage() * 3) * mcLoadProperties.pvpxprewardmodifier);
|
||||
PPa.addArcheryXP((event.getDamage() * 3) * mcLoadProperties.pvpxprewardmodifier);
|
||||
}
|
||||
/*
|
||||
* DAZE PROC
|
||||
|
@ -8,6 +8,7 @@ import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Wolf;
|
||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityDamageByProjectileEvent;
|
||||
@ -70,9 +71,9 @@ public class mcEntityListener extends EntityListener {
|
||||
* Entity Damage by Entity checks
|
||||
*/
|
||||
if(event instanceof EntityDamageByEntityEvent && event.getDamage() >= 1){
|
||||
if(event.isCancelled()){
|
||||
if(event.isCancelled())
|
||||
return;
|
||||
}
|
||||
|
||||
EntityDamageByEntityEvent eventb = (EntityDamageByEntityEvent)event;
|
||||
Entity e = eventb.getEntity(); //Defender
|
||||
Entity f = eventb.getDamager(); //Attacker
|
||||
@ -209,7 +210,7 @@ public class mcEntityListener extends EntityListener {
|
||||
if(PPd.getAcrobaticsInt() <= 800){
|
||||
if(Math.random() * 4000 <= PPd.getAcrobaticsInt()){
|
||||
defender.sendMessage(ChatColor.GREEN+"**DODGE**");
|
||||
PPd.addAcrobaticsGather(event.getDamage() * 12);
|
||||
PPd.addAcrobaticsXP(event.getDamage() * 12);
|
||||
mcSkills.getInstance().XpCheck(defender);
|
||||
event.setDamage(event.getDamage() / 2);
|
||||
//Needs to do minimal damage
|
||||
@ -218,7 +219,7 @@ public class mcEntityListener extends EntityListener {
|
||||
}
|
||||
} else if(Math.random() * 4000 <= 800) {
|
||||
defender.sendMessage(ChatColor.GREEN+"**DODGE**");
|
||||
PPd.addAcrobaticsGather(event.getDamage() * 12);
|
||||
PPd.addAcrobaticsXP(event.getDamage() * 12);
|
||||
mcSkills.getInstance().XpCheck(defender);
|
||||
event.setDamage(event.getDamage() / 2);
|
||||
//Needs to do minimal damage
|
||||
@ -227,8 +228,21 @@ 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
|
||||
*/
|
||||
|
@ -74,14 +74,14 @@ public class mcExcavation {
|
||||
if(PP.getExcavationInt() > 250){
|
||||
//CHANCE TO GET EGGS
|
||||
if(mcLoadProperties.eggs == true && Math.random() * 100 > 99){
|
||||
PP.addExcavationGather(10 * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addExcavationXP(10 * mcLoadProperties.xpGainMultiplier);
|
||||
mat = Material.getMaterial(344);
|
||||
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
||||
loc.getWorld().dropItemNaturally(loc, is);
|
||||
}
|
||||
//CHANCE TO GET APPLES
|
||||
if(mcLoadProperties.apples == true && Math.random() * 100 > 99){
|
||||
PP.addExcavationGather(10 * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addExcavationXP(10 * mcLoadProperties.xpGainMultiplier);
|
||||
mat = Material.getMaterial(260);
|
||||
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
||||
loc.getWorld().dropItemNaturally(loc, is);
|
||||
@ -90,11 +90,11 @@ public class mcExcavation {
|
||||
}
|
||||
//DIRT SAND OR GRAVEL
|
||||
if(type == 3 || type == 13 || type == 2 || type == 12){
|
||||
PP.addExcavationGather(4 * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addExcavationXP(4 * mcLoadProperties.xpGainMultiplier);
|
||||
if(PP.getExcavationInt() > 750){
|
||||
//CHANCE TO GET CAKE
|
||||
if(mcLoadProperties.cake == true && Math.random() * 2000 > 1999){
|
||||
PP.addExcavationGather(300 * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addExcavationXP(300 * mcLoadProperties.xpGainMultiplier);
|
||||
mat = Material.getMaterial(354);
|
||||
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
||||
loc.getWorld().dropItemNaturally(loc, is);
|
||||
@ -103,7 +103,7 @@ public class mcExcavation {
|
||||
if(PP.getExcavationInt() > 350){
|
||||
//CHANCE TO GET DIAMOND
|
||||
if(mcLoadProperties.diamond == true && Math.random() * 750 > 749){
|
||||
PP.addExcavationGather(100 * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addExcavationXP(100 * mcLoadProperties.xpGainMultiplier);
|
||||
mat = Material.getMaterial(264);
|
||||
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
||||
loc.getWorld().dropItemNaturally(loc, is);
|
||||
@ -112,7 +112,7 @@ public class mcExcavation {
|
||||
if(PP.getExcavationInt() > 250){
|
||||
//CHANCE TO GET YELLOW MUSIC
|
||||
if(mcLoadProperties.music == true && Math.random() * 2000 > 1999){
|
||||
PP.addExcavationGather(300 * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addExcavationXP(300 * mcLoadProperties.xpGainMultiplier);
|
||||
mat = Material.getMaterial(2256);
|
||||
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
||||
loc.getWorld().dropItemNaturally(loc, is);
|
||||
@ -122,7 +122,7 @@ public class mcExcavation {
|
||||
if(PP.getExcavationInt() > 350){
|
||||
//CHANCE TO GET GREEN MUSIC
|
||||
if(mcLoadProperties.music == true && Math.random() * 2000 > 1999){
|
||||
PP.addExcavationGather(300 * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addExcavationXP(300 * mcLoadProperties.xpGainMultiplier);
|
||||
mat = Material.getMaterial(2257);
|
||||
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
||||
loc.getWorld().dropItemNaturally(loc, is);
|
||||
@ -133,14 +133,14 @@ public class mcExcavation {
|
||||
if(type == 12){
|
||||
//CHANCE TO GET GLOWSTONE
|
||||
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);
|
||||
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
||||
loc.getWorld().dropItemNaturally(loc, is);
|
||||
}
|
||||
//CHANCE TO GET SLOWSAND
|
||||
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);
|
||||
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
||||
loc.getWorld().dropItemNaturally(loc, is);
|
||||
@ -151,7 +151,7 @@ public class mcExcavation {
|
||||
if(PP.getExcavationInt() > 50){
|
||||
//CHANCE FOR COCOA BEANS
|
||||
if(mcLoadProperties.eggs == true && Math.random() * 75 > 74){
|
||||
PP.addExcavationGather(10 * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addExcavationXP(10 * mcLoadProperties.xpGainMultiplier);
|
||||
mat = Material.getMaterial(351);
|
||||
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
||||
is.setDurability((byte) 3); //COCOA
|
||||
@ -160,7 +160,7 @@ public class mcExcavation {
|
||||
}
|
||||
//CHANCE FOR SHROOMS
|
||||
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){
|
||||
mat = Material.getMaterial(39);
|
||||
} else {
|
||||
@ -171,7 +171,7 @@ public class mcExcavation {
|
||||
}
|
||||
//CHANCE TO GET GLOWSTONE
|
||||
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);
|
||||
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
||||
loc.getWorld().dropItemNaturally(loc, is);
|
||||
@ -181,7 +181,7 @@ public class mcExcavation {
|
||||
if(type == 13){
|
||||
//CHANCE TO GET NETHERRACK
|
||||
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);
|
||||
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
||||
loc.getWorld().dropItemNaturally(loc, is);
|
||||
@ -189,7 +189,7 @@ public class mcExcavation {
|
||||
//CHANCE TO GET SULPHUR
|
||||
if(mcLoadProperties.sulphur == true && PP.getExcavationInt() > 75){
|
||||
if(Math.random() * 10 > 9){
|
||||
PP.addExcavationGather(3 * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addExcavationXP(3 * mcLoadProperties.xpGainMultiplier);
|
||||
mat = Material.getMaterial(289);
|
||||
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
||||
loc.getWorld().dropItemNaturally(loc, is);
|
||||
@ -198,7 +198,7 @@ public class mcExcavation {
|
||||
//CHANCE TO GET BONES
|
||||
if(mcLoadProperties.bones == true && PP.getExcavationInt() > 175){
|
||||
if(Math.random() * 10 > 9){
|
||||
PP.addExcavationGather(3 * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addExcavationXP(3 * mcLoadProperties.xpGainMultiplier);
|
||||
mat = Material.getMaterial(352);
|
||||
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
||||
loc.getWorld().dropItemNaturally(loc, is);
|
||||
|
@ -32,7 +32,7 @@ public class mcHerbalism {
|
||||
Material mat = Material.getMaterial(296);
|
||||
Location loc = block.getLocation();
|
||||
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);
|
||||
herbalismProcCheck(block, player, event);
|
||||
herbalismProcCheck(block, player, event);
|
||||
@ -128,7 +128,7 @@ public class mcHerbalism {
|
||||
if(type == 59 && block.getData() == (byte) 0x7){
|
||||
mat = Material.getMaterial(296);
|
||||
is = new ItemStack(mat, 1, (byte)0, (byte)0);
|
||||
PP.addHerbalismGather(5 * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addHerbalismXP(5 * mcLoadProperties.xpGainMultiplier);
|
||||
if(player != null){
|
||||
if(Math.random() * 1000 <= PP.getHerbalismInt()){
|
||||
loc.getWorld().dropItemNaturally(loc, is);
|
||||
@ -172,7 +172,7 @@ public class mcHerbalism {
|
||||
loc.getWorld().dropItemNaturally(loc, is);
|
||||
}
|
||||
}
|
||||
PP.addHerbalismGather(3 * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addHerbalismXP(3 * mcLoadProperties.xpGainMultiplier);
|
||||
}
|
||||
//Sugar Canes
|
||||
if(type == 83){
|
||||
@ -182,7 +182,7 @@ public class mcHerbalism {
|
||||
loc.getWorld().dropItemNaturally(loc, is);
|
||||
}
|
||||
}
|
||||
PP.addHerbalismGather(3 * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addHerbalismXP(3 * mcLoadProperties.xpGainMultiplier);
|
||||
}
|
||||
//Pumpkins
|
||||
if(type == 91 || type == 86){
|
||||
@ -193,7 +193,7 @@ public class mcHerbalism {
|
||||
loc.getWorld().dropItemNaturally(loc, is);
|
||||
}
|
||||
}
|
||||
PP.addHerbalismGather(55 * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addHerbalismXP(55 * mcLoadProperties.xpGainMultiplier);
|
||||
}
|
||||
//Mushroom
|
||||
if(type == 39 || type == 40){
|
||||
@ -204,7 +204,7 @@ public class mcHerbalism {
|
||||
loc.getWorld().dropItemNaturally(loc, is);
|
||||
}
|
||||
}
|
||||
PP.addHerbalismGather(40 * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addHerbalismXP(40 * mcLoadProperties.xpGainMultiplier);
|
||||
}
|
||||
//Flower
|
||||
if(type == 37 || type == 38){
|
||||
@ -215,7 +215,7 @@ public class mcHerbalism {
|
||||
loc.getWorld().dropItemNaturally(loc, is);
|
||||
}
|
||||
}
|
||||
PP.addHerbalismGather(10 * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addHerbalismXP(10 * mcLoadProperties.xpGainMultiplier);
|
||||
}
|
||||
}
|
||||
mcSkills.getInstance().XpCheck(player);
|
||||
|
@ -3,7 +3,7 @@ package com.gmail.nossr50;
|
||||
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 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(){
|
||||
String propertiesFile = mcMMO.maindirectory + "mcmmo.properties";
|
||||
@ -38,6 +38,7 @@ public class mcLoadProperties {
|
||||
* EXPERIENCE RATE MODIFIER
|
||||
*/
|
||||
globalxpmodifier = properties.getInteger("globalXpModifier", 1);
|
||||
tamingxpmodifier = properties.getInteger("tamingXpModifier", 2);
|
||||
miningxpmodifier = properties.getInteger("miningXpModifier", 2);
|
||||
repairxpmodifier = properties.getInteger("repairXpModifier", 2);
|
||||
woodcuttingxpmodifier = properties.getInteger("woodcuttingXpModifier", 2);
|
||||
|
@ -118,6 +118,7 @@ public class mcMMO extends JavaPlugin {
|
||||
public void addXp(Player player, String skillname, Integer newvalue){
|
||||
PlayerProfile PP = mcUsers.getProfile(player.getName());
|
||||
PP.addXpToSkill(newvalue, skillname);
|
||||
mcSkills.getInstance().XpCheck(player);
|
||||
}
|
||||
public void modifySkill(Player player, String skillname, Integer newvalue){
|
||||
PlayerProfile PP = mcUsers.getProfile(player.getName());
|
||||
|
@ -163,7 +163,7 @@ public class mcMining {
|
||||
xp += 40;
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
PP.addMiningGather(xp * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addMiningXP(xp * mcLoadProperties.xpGainMultiplier);
|
||||
mcSkills.getInstance().XpCheck(player);
|
||||
}
|
||||
/*
|
||||
@ -318,7 +318,7 @@ public class mcMining {
|
||||
block.setType(Material.AIR);
|
||||
}
|
||||
if(block.getData() != (byte) 5)
|
||||
PP.addMiningGather(xp * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addMiningXP(xp * mcLoadProperties.xpGainMultiplier);
|
||||
mcSkills.getInstance().XpCheck(player);
|
||||
}
|
||||
}
|
||||
|
@ -183,6 +183,13 @@ public class mcPermissions {
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
public boolean taming(Player player) {
|
||||
if (permissionsEnabled) {
|
||||
return permission(player, "mcmmo.skills.taming");
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public boolean mining(Player player) {
|
||||
if (permissionsEnabled) {
|
||||
return permission(player, "mcmmo.skills.mining");
|
||||
|
@ -116,15 +116,20 @@ public class mcPlayerListener extends PlayerListener {
|
||||
}
|
||||
|
||||
//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;
|
||||
if(mcHerbalism.getInstance().hasSeeds(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**");
|
||||
block.setType(Material.MOSSY_COBBLESTONE);
|
||||
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)
|
||||
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("OP: " + target.isOp());
|
||||
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))
|
||||
player.sendMessage(ChatColor.YELLOW + "Mining Skill: " + ChatColor.GREEN + PPt.getMining()+ChatColor.DARK_AQUA
|
||||
+ " XP("+PPt.getMiningGather()
|
||||
+ " XP("+PPt.getMiningXP()
|
||||
+"/"+PPt.getXpToLevel("mining")+")");
|
||||
if(mcPermissions.getInstance().repair(target))
|
||||
player.sendMessage(ChatColor.YELLOW + "Repair Skill: "+ ChatColor.GREEN + PPt.getRepair()+ChatColor.DARK_AQUA
|
||||
+ " XP("+PPt.getRepairGather()
|
||||
+ " XP("+PPt.getRepairXP()
|
||||
+"/"+PPt.getXpToLevel("repair")+")");
|
||||
if(mcPermissions.getInstance().woodcutting(target))
|
||||
player.sendMessage(ChatColor.YELLOW + "Woodcutting Skill: "+ ChatColor.GREEN + PPt.getWoodCutting()+ChatColor.DARK_AQUA
|
||||
+ " XP("+PPt.getWoodCuttingGather()
|
||||
+ " XP("+PPt.getWoodCuttingXP()
|
||||
+"/"+PPt.getXpToLevel("woodcutting")+")");
|
||||
if(mcPermissions.getInstance().unarmed(target))
|
||||
player.sendMessage(ChatColor.YELLOW + "Unarmed Skill: " + ChatColor.GREEN + PPt.getUnarmed()+ChatColor.DARK_AQUA
|
||||
+ " XP("+PPt.getUnarmedGather()
|
||||
+ " XP("+PPt.getUnarmedXP()
|
||||
+"/"+PPt.getXpToLevel("unarmed")+")");
|
||||
if(mcPermissions.getInstance().herbalism(target))
|
||||
player.sendMessage(ChatColor.YELLOW + "Herbalism Skill: "+ ChatColor.GREEN + PPt.getHerbalism()+ChatColor.DARK_AQUA
|
||||
+ " XP("+PPt.getHerbalismGather()
|
||||
+ " XP("+PPt.getHerbalismXP()
|
||||
+"/"+PPt.getXpToLevel("herbalism")+")");
|
||||
if(mcPermissions.getInstance().excavation(target))
|
||||
player.sendMessage(ChatColor.YELLOW + "Excavation Skill: "+ ChatColor.GREEN + PPt.getExcavation()+ChatColor.DARK_AQUA
|
||||
+ " XP("+PPt.getExcavationGather()
|
||||
+ " XP("+PPt.getExcavationXP()
|
||||
+"/"+PPt.getXpToLevel("excavation")+")");
|
||||
if(mcPermissions.getInstance().archery(target))
|
||||
player.sendMessage(ChatColor.YELLOW + "Archery Skill: " + ChatColor.GREEN + PPt.getArchery()+ChatColor.DARK_AQUA
|
||||
+ " XP("+PPt.getArcheryGather()
|
||||
+ " XP("+PPt.getArcheryXP()
|
||||
+"/"+PPt.getXpToLevel("archery")+")");
|
||||
if(mcPermissions.getInstance().swords(target))
|
||||
player.sendMessage(ChatColor.YELLOW + "Swords Skill: " + ChatColor.GREEN + PPt.getSwords()+ChatColor.DARK_AQUA
|
||||
+ " XP("+PPt.getSwordsGather()
|
||||
+ " XP("+PPt.getSwordsXP()
|
||||
+"/"+PPt.getXpToLevel("swords")+")");
|
||||
if(mcPermissions.getInstance().axes(target))
|
||||
player.sendMessage(ChatColor.YELLOW + "Axes Skill: " + ChatColor.GREEN + PPt.getAxes()+ChatColor.DARK_AQUA
|
||||
+ " XP("+PPt.getAxesGather()
|
||||
+ " XP("+PPt.getAxesXP()
|
||||
+"/"+PPt.getXpToLevel("axes")+")");
|
||||
if(mcPermissions.getInstance().acrobatics(target))
|
||||
player.sendMessage(ChatColor.YELLOW + "Acrobatics Skill: " + ChatColor.GREEN + PPt.getAcrobatics()+ChatColor.DARK_AQUA
|
||||
+ " XP("+PPt.getAcrobaticsGather()
|
||||
+ " XP("+PPt.getAcrobaticsXP()
|
||||
+"/"+PPt.getXpToLevel("acrobatics")+")");
|
||||
player.sendMessage(ChatColor.DARK_RED+"POWER LEVEL: "+ChatColor.GREEN+(mcm.getInstance().getPowerLevel(target)));
|
||||
player.sendMessage(ChatColor.GREEN+"~~COORDINATES~~");
|
||||
@ -423,45 +432,50 @@ public class mcPlayerListener extends PlayerListener {
|
||||
player.sendMessage(ChatColor.GREEN + "Your mcMMO Stats");
|
||||
if(mcPermissions.getInstance().permissionsEnabled)
|
||||
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))
|
||||
player.sendMessage(ChatColor.YELLOW + "Mining Skill: " + ChatColor.GREEN + PP.getMining()+ChatColor.DARK_AQUA
|
||||
+ " XP("+PP.getMiningGather()
|
||||
+ " XP("+PP.getMiningXP()
|
||||
+"/"+PP.getXpToLevel("mining")+")");
|
||||
if(mcPermissions.getInstance().repair(player))
|
||||
player.sendMessage(ChatColor.YELLOW + "Repair Skill: "+ ChatColor.GREEN + PP.getRepair()+ChatColor.DARK_AQUA
|
||||
+ " XP("+PP.getRepairGather()
|
||||
+ " XP("+PP.getRepairXP()
|
||||
+"/"+PP.getXpToLevel("repair")+")");
|
||||
if(mcPermissions.getInstance().woodcutting(player))
|
||||
player.sendMessage(ChatColor.YELLOW + "Woodcutting Skill: "+ ChatColor.GREEN + PP.getWoodCutting()+ChatColor.DARK_AQUA
|
||||
+ " XP("+PP.getWoodCuttingGather()
|
||||
+ " XP("+PP.getWoodCuttingXP()
|
||||
+"/"+PP.getXpToLevel("woodcutting")+")");
|
||||
if(mcPermissions.getInstance().unarmed(player))
|
||||
player.sendMessage(ChatColor.YELLOW + "Unarmed Skill: " + ChatColor.GREEN + PP.getUnarmed()+ChatColor.DARK_AQUA
|
||||
+ " XP("+PP.getUnarmedGather()
|
||||
+ " XP("+PP.getUnarmedXP()
|
||||
+"/"+PP.getXpToLevel("unarmed")+")");
|
||||
if(mcPermissions.getInstance().herbalism(player))
|
||||
player.sendMessage(ChatColor.YELLOW + "Herbalism Skill: "+ ChatColor.GREEN + PP.getHerbalism()+ChatColor.DARK_AQUA
|
||||
+ " XP("+PP.getHerbalismGather()
|
||||
+ " XP("+PP.getHerbalismXP()
|
||||
+"/"+PP.getXpToLevel("herbalism")+")");
|
||||
if(mcPermissions.getInstance().excavation(player))
|
||||
player.sendMessage(ChatColor.YELLOW + "Excavation Skill: "+ ChatColor.GREEN + PP.getExcavation()+ChatColor.DARK_AQUA
|
||||
+ " XP("+PP.getExcavationGather()
|
||||
+ " XP("+PP.getExcavationXP()
|
||||
+"/"+PP.getXpToLevel("excavation")+")");
|
||||
if(mcPermissions.getInstance().archery(player))
|
||||
player.sendMessage(ChatColor.YELLOW + "Archery Skill: " + ChatColor.GREEN + PP.getArchery()+ChatColor.DARK_AQUA
|
||||
+ " XP("+PP.getArcheryGather()
|
||||
+ " XP("+PP.getArcheryXP()
|
||||
+"/"+PP.getXpToLevel("archery")+")");
|
||||
if(mcPermissions.getInstance().swords(player))
|
||||
player.sendMessage(ChatColor.YELLOW + "Swords Skill: " + ChatColor.GREEN + PP.getSwords()+ChatColor.DARK_AQUA
|
||||
+ " XP("+PP.getSwordsGather()
|
||||
+ " XP("+PP.getSwordsXP()
|
||||
+"/"+PP.getXpToLevel("swords")+")");
|
||||
if(mcPermissions.getInstance().axes(player))
|
||||
player.sendMessage(ChatColor.YELLOW + "Axes Skill: " + ChatColor.GREEN + PP.getAxes()+ChatColor.DARK_AQUA
|
||||
+ " XP("+PP.getAxesGather()
|
||||
+ " XP("+PP.getAxesXP()
|
||||
+"/"+PP.getXpToLevel("axes")+")");
|
||||
if(mcPermissions.getInstance().acrobatics(player))
|
||||
player.sendMessage(ChatColor.YELLOW + "Acrobatics Skill: " + ChatColor.GREEN + PP.getAcrobatics()+ChatColor.DARK_AQUA
|
||||
+ " XP("+PP.getAcrobaticsGather()
|
||||
+ " XP("+PP.getAcrobaticsXP()
|
||||
+"/"+PP.getXpToLevel("acrobatics")+")");
|
||||
player.sendMessage(ChatColor.DARK_RED+"POWER LEVEL: "+ChatColor.GREEN+(mcm.getInstance().getPowerLevel(player)));
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ public class mcRepair {
|
||||
player.sendMessage(String.valueOf(durabilityBefore - durabilityAfter));
|
||||
dif = (short) (durabilityBefore - durabilityAfter);
|
||||
dif = (short) (dif * 6); //Boost XP
|
||||
PP.addRepairGather(dif * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addRepairXP(dif * mcLoadProperties.xpGainMultiplier);
|
||||
} else if (isIronArmor(is) && hasIron(player)){
|
||||
/*
|
||||
* IRON ARMOR
|
||||
@ -52,7 +52,7 @@ public class mcRepair {
|
||||
durabilityAfter = player.getItemInHand().getDurability();
|
||||
dif = (short) (durabilityBefore - durabilityAfter);
|
||||
dif = (short) (dif * 2); //Boost XP
|
||||
PP.addRepairGather(dif * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addRepairXP(dif * mcLoadProperties.xpGainMultiplier);
|
||||
//GOLD ARMOR
|
||||
} else if (isGoldArmor(is) && hasGold(player)){
|
||||
removeGold(player);
|
||||
@ -60,7 +60,7 @@ public class mcRepair {
|
||||
durabilityAfter = player.getItemInHand().getDurability();
|
||||
dif = (short) (durabilityBefore - durabilityAfter);
|
||||
dif = (short) (dif * 4); //Boost XP of Gold to around Iron
|
||||
PP.addRepairGather(dif * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addRepairXP(dif * mcLoadProperties.xpGainMultiplier);
|
||||
} else {
|
||||
needMoreVespeneGas(is, player);
|
||||
}
|
||||
@ -86,7 +86,7 @@ public class mcRepair {
|
||||
dif = (short) (dif / 2);
|
||||
if(mcm.getInstance().isHoe(is))
|
||||
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
|
||||
/*
|
||||
* DIAMOND TOOLS
|
||||
@ -101,7 +101,7 @@ public class mcRepair {
|
||||
dif = (short) (dif / 2);
|
||||
if(mcm.getInstance().isHoe(is))
|
||||
dif = (short) (dif / 2);
|
||||
PP.addRepairGather(dif * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addRepairXP(dif * mcLoadProperties.xpGainMultiplier);
|
||||
} else if(isGoldTools(is) && hasGold(player)){
|
||||
player.getItemInHand().setDurability(getToolRepairAmount(is, player));
|
||||
removeGold(player);
|
||||
@ -114,7 +114,7 @@ public class mcRepair {
|
||||
dif = (short) (dif / 2);
|
||||
if(mcm.getInstance().isHoe(is))
|
||||
dif = (short) (dif / 2);
|
||||
PP.addRepairGather(dif * mcLoadProperties.xpGainMultiplier);
|
||||
PP.addRepairXP(dif * mcLoadProperties.xpGainMultiplier);
|
||||
} else {
|
||||
needMoreVespeneGas(is, player);
|
||||
}
|
||||
|
@ -342,14 +342,27 @@ public class mcSkills {
|
||||
}
|
||||
public void XpCheck(Player player){
|
||||
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
|
||||
*/
|
||||
if(player != null && PP.getAcrobaticsGatherInt() >= PP.getXpToLevel("acrobatics")){
|
||||
if(player != null && PP.getAcrobaticsXPInt() >= PP.getXpToLevel("acrobatics")){
|
||||
int skillups = 0;
|
||||
while(PP.getAcrobaticsGatherInt() >= PP.getXpToLevel("acrobatics")){
|
||||
while(PP.getAcrobaticsXPInt() >= PP.getXpToLevel("acrobatics")){
|
||||
skillups++;
|
||||
PP.removeAcrobaticsGather(PP.getXpToLevel("acrobatics"));
|
||||
PP.removeAcrobaticsXP(PP.getXpToLevel("acrobatics"));
|
||||
PP.skillUpAcrobatics(1);
|
||||
}
|
||||
if(player != null && PP.getAcrobatics() != null)
|
||||
@ -358,11 +371,11 @@ public class mcSkills {
|
||||
/*
|
||||
* ARCHERY
|
||||
*/
|
||||
if(PP.getArcheryGatherInt() >= PP.getXpToLevel("archery")){
|
||||
if(PP.getArcheryXPInt() >= PP.getXpToLevel("archery")){
|
||||
int skillups = 0;
|
||||
while(PP.getArcheryGatherInt() >= PP.getXpToLevel("archery")){
|
||||
while(PP.getArcheryXPInt() >= PP.getXpToLevel("archery")){
|
||||
skillups++;
|
||||
PP.removeArcheryGather(PP.getXpToLevel("archery"));
|
||||
PP.removeArcheryXP(PP.getXpToLevel("archery"));
|
||||
PP.skillUpArchery(1);
|
||||
}
|
||||
if(player != null && PP.getArchery() != null)
|
||||
@ -371,11 +384,11 @@ public class mcSkills {
|
||||
/*
|
||||
* SWORDS
|
||||
*/
|
||||
if(PP.getSwordsGatherInt() >= PP.getXpToLevel("swords")){
|
||||
if(PP.getSwordsXPInt() >= PP.getXpToLevel("swords")){
|
||||
int skillups = 0;
|
||||
while(PP.getSwordsGatherInt() >= PP.getXpToLevel("swords")){
|
||||
while(PP.getSwordsXPInt() >= PP.getXpToLevel("swords")){
|
||||
skillups++;
|
||||
PP.removeSwordsGather(PP.getXpToLevel("swords"));
|
||||
PP.removeSwordsXP(PP.getXpToLevel("swords"));
|
||||
PP.skillUpSwords(1);
|
||||
}
|
||||
if(player != null && PP.getSwords() != null)
|
||||
@ -384,11 +397,11 @@ public class mcSkills {
|
||||
/*
|
||||
* AXES
|
||||
*/
|
||||
if(PP.getAxesGatherInt() >= PP.getXpToLevel("axes")){
|
||||
if(PP.getAxesXPInt() >= PP.getXpToLevel("axes")){
|
||||
int skillups = 0;
|
||||
while(PP.getAxesGatherInt() >= PP.getXpToLevel("axes")){
|
||||
while(PP.getAxesXPInt() >= PP.getXpToLevel("axes")){
|
||||
skillups++;
|
||||
PP.removeAxesGather(PP.getXpToLevel("axes"));
|
||||
PP.removeAxesXP(PP.getXpToLevel("axes"));
|
||||
PP.skillUpAxes(1);
|
||||
}
|
||||
if(player != null && PP.getAxes() != null)
|
||||
@ -397,11 +410,11 @@ public class mcSkills {
|
||||
/*
|
||||
* UNARMED
|
||||
*/
|
||||
if(PP.getUnarmedGatherInt() >= PP.getXpToLevel("unarmed")){
|
||||
if(PP.getUnarmedXPInt() >= PP.getXpToLevel("unarmed")){
|
||||
int skillups = 0;
|
||||
while(PP.getUnarmedGatherInt() >= PP.getXpToLevel("unarmed")){
|
||||
while(PP.getUnarmedXPInt() >= PP.getXpToLevel("unarmed")){
|
||||
skillups++;
|
||||
PP.removeUnarmedGather(PP.getXpToLevel("unarmed"));
|
||||
PP.removeUnarmedXP(PP.getXpToLevel("unarmed"));
|
||||
PP.skillUpUnarmed(1);
|
||||
}
|
||||
if(player != null && PP.getUnarmed() != null)
|
||||
@ -410,11 +423,11 @@ public class mcSkills {
|
||||
/*
|
||||
* HERBALISM
|
||||
*/
|
||||
if(PP.getHerbalismGatherInt() >= PP.getXpToLevel("herbalism")){
|
||||
if(PP.getHerbalismXPInt() >= PP.getXpToLevel("herbalism")){
|
||||
int skillups = 0;
|
||||
while(PP.getHerbalismGatherInt() >= PP.getXpToLevel("herbalism")){
|
||||
while(PP.getHerbalismXPInt() >= PP.getXpToLevel("herbalism")){
|
||||
skillups++;
|
||||
PP.removeHerbalismGather(PP.getXpToLevel("herbalism"));
|
||||
PP.removeHerbalismXP(PP.getXpToLevel("herbalism"));
|
||||
PP.skillUpHerbalism(1);
|
||||
}
|
||||
if(player != null && PP.getHerbalism() != null)
|
||||
@ -423,11 +436,11 @@ public class mcSkills {
|
||||
/*
|
||||
* MINING
|
||||
*/
|
||||
if(player != null && PP.getMiningGatherInt() >= PP.getXpToLevel("mining")){
|
||||
if(player != null && PP.getMiningXPInt() >= PP.getXpToLevel("mining")){
|
||||
int skillups = 0;
|
||||
while(PP.getMiningGatherInt() >= PP.getXpToLevel("mining")){
|
||||
while(PP.getMiningXPInt() >= PP.getXpToLevel("mining")){
|
||||
skillups++;
|
||||
PP.removeMiningGather(PP.getXpToLevel("mining"));
|
||||
PP.removeMiningXP(PP.getXpToLevel("mining"));
|
||||
PP.skillUpMining(1);
|
||||
}
|
||||
if(player != null && PP.getMining() != null)
|
||||
@ -436,11 +449,11 @@ public class mcSkills {
|
||||
/*
|
||||
* WOODCUTTING
|
||||
*/
|
||||
if(player != null && PP.getWoodCuttingGatherInt() >= PP.getXpToLevel("woodcutting")){
|
||||
if(player != null && PP.getWoodCuttingXPInt() >= PP.getXpToLevel("woodcutting")){
|
||||
int skillups = 0;
|
||||
while(PP.getWoodCuttingGatherInt() >= PP.getXpToLevel("woodcutting")){
|
||||
while(PP.getWoodCuttingXPInt() >= PP.getXpToLevel("woodcutting")){
|
||||
skillups++;
|
||||
PP.removeWoodCuttingGather(PP.getXpToLevel("woodcutting"));
|
||||
PP.removeWoodCuttingXP(PP.getXpToLevel("woodcutting"));
|
||||
PP.skillUpWoodCutting(1);
|
||||
}
|
||||
if(player != null && PP.getWoodCutting() != null)
|
||||
@ -449,11 +462,11 @@ public class mcSkills {
|
||||
/*
|
||||
* REPAIR
|
||||
*/
|
||||
if(PP.getRepairGatherInt() >= PP.getXpToLevel("repair")){
|
||||
if(PP.getRepairXPInt() >= PP.getXpToLevel("repair")){
|
||||
int skillups = 0;
|
||||
while(PP.getRepairGatherInt() >= PP.getXpToLevel("repair")){
|
||||
while(PP.getRepairXPInt() >= PP.getXpToLevel("repair")){
|
||||
skillups++;
|
||||
PP.removeRepairGather(PP.getXpToLevel("repair"));
|
||||
PP.removeRepairXP(PP.getXpToLevel("repair"));
|
||||
PP.skillUpRepair(1);
|
||||
}
|
||||
if(player != null && PP.getRepair() != null)
|
||||
@ -462,11 +475,11 @@ public class mcSkills {
|
||||
/*
|
||||
* EXCAVATION
|
||||
*/
|
||||
if(PP.getExcavationGatherInt() >= PP.getXpToLevel("excavation")){
|
||||
if(PP.getExcavationXPInt() >= PP.getXpToLevel("excavation")){
|
||||
int skillups = 0;
|
||||
while(PP.getExcavationGatherInt() >= PP.getXpToLevel("excavation")){
|
||||
while(PP.getExcavationXPInt() >= PP.getXpToLevel("excavation")){
|
||||
skillups++;
|
||||
PP.removeExcavationGather(PP.getXpToLevel("excavation"));
|
||||
PP.removeExcavationXP(PP.getXpToLevel("excavation"));
|
||||
PP.skillUpExcavation(1);
|
||||
}
|
||||
if(player != null && PP.getExcavation() != null)
|
||||
@ -478,6 +491,9 @@ public class mcSkills {
|
||||
if(skillname.equals("all")){
|
||||
return true;
|
||||
}
|
||||
if(skillname.equals("taming")){
|
||||
return true;
|
||||
}
|
||||
if(skillname.equals("mining")){
|
||||
return true;
|
||||
}
|
||||
|
47
mcMMO/com/gmail/nossr50/mcTaming.java
Normal file
47
mcMMO/com/gmail/nossr50/mcTaming.java
Normal 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;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -77,9 +77,9 @@ public class mcWoodCutting {
|
||||
public void treeFeller(Block block, Player player){
|
||||
PlayerProfile PP = mcUsers.getProfile(player.getName());
|
||||
int radius = 1;
|
||||
if(PP.getWoodCuttingGatherInt() >= 500)
|
||||
if(PP.getWoodCuttingXPInt() >= 500)
|
||||
radius++;
|
||||
if(PP.getWoodCuttingGatherInt() >= 950)
|
||||
if(PP.getWoodCuttingXPInt() >= 950)
|
||||
radius++;
|
||||
ArrayList<Block> blocklist = new ArrayList<Block>();
|
||||
ArrayList<Block> toAdd = new ArrayList<Block>();
|
||||
|
@ -1,3 +1,3 @@
|
||||
name: mcMMO
|
||||
main: com.gmail.nossr50.mcMMO
|
||||
version: 0.9.27
|
||||
version: 0.9.30 WIP
|
Loading…
Reference in New Issue
Block a user