All changes up to 0.9.4

This commit is contained in:
nossr50 2011-03-20 11:53:24 -07:00
parent 85d698da0c
commit 8fc7c56c12
11 changed files with 199 additions and 61 deletions

View File

@ -1,5 +1,23 @@
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.4
Flowers won't drop wheat anymore
Signs won't trigger ability readiness anymore
Version 0.9.3
Bug stopping abilities from never wearing of may have been fixed
Changed color of "X Ability has worn off" to RED from GRAY
Super Breaker, Giga Drill Breaker, and Tree Feller now damage the tool significantly during use
Netherrack and Glowstone now give Mining XP
Netherrack and Glowstone are now effected by Super Breaker
Abilities will no longer be readied when you right click signs or beds
Chimaera Wings won't activate on blocks you can interact with and signs
Abilities now adjust their effects depending on tool quality
Superbreaker won't break things that tool couldn't normally break
Giga Drill Breaker will only give triple xp and triple drops for diamond tools, with a reduced effect for lesser tools
Skull Splitter now has a limit of opponents nearby it will strike based on your tool quality
Serrated Strikes now has a limit of opponents nearby it will strike based on your tool quality
Modified /mcmmo description to be a little bit more relevant.
Version 0.9.2 Version 0.9.2
Changed priority of some of the mcMMO listeners Changed priority of some of the mcMMO listeners
Now when certain abilities are activated it shouldn't say "You lower your x" Now when certain abilities are activated it shouldn't say "You lower your x"

View File

@ -37,7 +37,7 @@ public class mcBlockListener extends BlockListener {
Block block = event.getBlock(); Block block = event.getBlock();
Player player = event.getPlayer(); Player player = event.getPlayer();
ItemStack is = player.getItemInHand(); ItemStack is = player.getItemInHand();
if(mcPermissions.getInstance().unarmed(player) && player.getItemInHand().getTypeId() == 0 && mcm.getInstance().abilityBlockCheck(block)){ if(mcPermissions.getInstance().unarmed(player) && player.getItemInHand().getTypeId() == 0 && mcm.getInstance().abilityBlockCheck(block) && mcUsers.getProfile(player).getAbilityUse()){
mcSkills.getInstance().abilityActivationCheck(player, block); mcSkills.getInstance().abilityActivationCheck(player, block);
} }
if(block != null && player != null && mcPermissions.getInstance().repair(player) && event.getBlock().getTypeId() == 42){ if(block != null && player != null && mcPermissions.getInstance().repair(player) && event.getBlock().getTypeId() == 42){
@ -70,8 +70,11 @@ public class mcBlockListener extends BlockListener {
* GIGA DRILL BREAKER CHECKS * GIGA DRILL BREAKER CHECKS
*/ */
if(mcUsers.getProfile(player).getGigaDrillBreakerMode() && dmg == 0 && mcExcavation.getInstance().canBeGigaDrillBroken(block) && mcm.getInstance().isShovel(inhand)){ if(mcUsers.getProfile(player).getGigaDrillBreakerMode() && dmg == 0 && mcExcavation.getInstance().canBeGigaDrillBroken(block) && mcm.getInstance().isShovel(inhand)){
if(mcm.getInstance().getTier(player) >= 2)
mcExcavation.getInstance().excavationProcCheck(block, player); mcExcavation.getInstance().excavationProcCheck(block, player);
if(mcm.getInstance().getTier(player) >= 3)
mcExcavation.getInstance().excavationProcCheck(block, player); mcExcavation.getInstance().excavationProcCheck(block, player);
if(mcm.getInstance().getTier(player) >= 4)
mcExcavation.getInstance().excavationProcCheck(block, player); mcExcavation.getInstance().excavationProcCheck(block, player);
Material mat = Material.getMaterial(block.getTypeId()); Material mat = Material.getMaterial(block.getTypeId());
if(block.getTypeId() == 2) if(block.getTypeId() == 2)
@ -79,6 +82,7 @@ public class mcBlockListener extends BlockListener {
byte type = block.getData(); byte type = block.getData();
ItemStack item = new ItemStack(mat, 1, (byte)0, type); ItemStack item = new ItemStack(mat, 1, (byte)0, type);
block.setType(Material.AIR); block.setType(Material.AIR);
mcm.getInstance().damageTool(player, (short) 15);
block.getLocation().getWorld().dropItemNaturally(block.getLocation(), item); block.getLocation().getWorld().dropItemNaturally(block.getLocation(), item);
} }
/* /*
@ -166,6 +170,7 @@ public class mcBlockListener extends BlockListener {
blockx.setType(Material.AIR); blockx.setType(Material.AIR);
} }
} }
mcm.getInstance().damageTool(player, (short) 15);
/* /*
* NOTE TO SELF * NOTE TO SELF
* I NEED TO REMOVE TREE FELL BLOCKS FROM BEING WATCHED AFTER THIS CODE IS EXECUTED * I NEED TO REMOVE TREE FELL BLOCKS FROM BEING WATCHED AFTER THIS CODE IS EXECUTED

View File

@ -499,55 +499,65 @@ public class mcCombat {
return event.getDamage() + dmg; return event.getDamage() + dmg;
} }
public void applyAoeDamage(Player attacker, EntityDamageByEntityEvent event, Entity x){ public void applyAoeDamage(Player attacker, EntityDamageByEntityEvent event, Entity x){
int targets = 0;
targets = mcm.getInstance().getTier(attacker);
for(Entity derp : x.getWorld().getEntities()){ for(Entity derp : x.getWorld().getEntities()){
if(mcm.getInstance().getDistance(x.getLocation(), derp.getLocation()) < 5){ if(mcm.getInstance().getDistance(x.getLocation(), derp.getLocation()) < 5){
if(derp instanceof Player){ if(derp instanceof Player){
Player target = (Player)derp; Player target = (Player)derp;
if(mcParty.getInstance().inSameParty(attacker, target)) if(mcParty.getInstance().inSameParty(attacker, target))
continue; continue;
if(!target.getName().equals(attacker.getName())){ if(!target.getName().equals(attacker.getName()) && targets >= 1){
target.damage(event.getDamage() / 2); target.damage(event.getDamage() / 2);
target.sendMessage(ChatColor.DARK_RED+"Struck by CLEAVE!"); target.sendMessage(ChatColor.DARK_RED+"Struck by CLEAVE!");
targets--;
} }
} }
if(derp instanceof Monster){ if(derp instanceof Monster && targets >= 1){
Monster target = (Monster)derp; Monster target = (Monster)derp;
target.damage(event.getDamage() / 2); target.damage(event.getDamage() / 2);
targets--;
} }
if(derp instanceof Animals){ if(derp instanceof Animals && targets >= 1){
Animals target = (Animals)derp; Animals target = (Animals)derp;
target.damage(event.getDamage() / 2); target.damage(event.getDamage() / 2);
targets--;
} }
} }
} }
} }
public void applySerratedStrikes(Player attacker, EntityDamageByEntityEvent event, Entity x){ public void applySerratedStrikes(Player attacker, EntityDamageByEntityEvent event, Entity x){
int targets = 0;
targets = mcm.getInstance().getTier(attacker);
for(Entity derp : x.getWorld().getEntities()){ for(Entity derp : x.getWorld().getEntities()){
if(mcm.getInstance().getDistance(x.getLocation(), derp.getLocation()) < 5){ if(mcm.getInstance().getDistance(x.getLocation(), derp.getLocation()) < 5){
if(derp instanceof Player){ if(derp instanceof Player){
Player target = (Player)derp; Player target = (Player)derp;
if(mcParty.getInstance().inSameParty(attacker, target)) if(mcParty.getInstance().inSameParty(attacker, target))
continue; continue;
if(!target.getName().equals(attacker.getName())){ if(!target.getName().equals(attacker.getName()) && targets >= 1){
target.damage(event.getDamage() / 4); target.damage(event.getDamage() / 4);
target.sendMessage(ChatColor.DARK_RED+"Struck by Serrated Strikes!"); target.sendMessage(ChatColor.DARK_RED+"Struck by Serrated Strikes!");
if(!mcConfig.getInstance().isBleedTracked(derp)){ if(!mcConfig.getInstance().isBleedTracked(derp)){
mcConfig.getInstance().addBleedTrack(x); mcConfig.getInstance().addBleedTrack(x);
mcUsers.getProfile(target).setBleedTicks(12); mcUsers.getProfile(target).setBleedTicks(12);
} }
targets--;
} }
} }
if(derp instanceof Monster){ if(derp instanceof Monster && targets >= 1){
if(!mcConfig.getInstance().isBleedTracked(derp)) if(!mcConfig.getInstance().isBleedTracked(derp))
mcConfig.getInstance().addBleedTrack(x); mcConfig.getInstance().addBleedTrack(x);
Monster target = (Monster)derp; Monster target = (Monster)derp;
target.damage(event.getDamage() / 4); target.damage(event.getDamage() / 4);
targets--;
} }
if(derp instanceof Animals){ if(derp instanceof Animals && targets >= 1){
if(!mcConfig.getInstance().isBleedTracked(derp)) if(!mcConfig.getInstance().isBleedTracked(derp))
mcConfig.getInstance().addBleedTrack(x); mcConfig.getInstance().addBleedTrack(x);
Animals target = (Animals)derp; Animals target = (Animals)derp;
target.damage(event.getDamage() / 4); target.damage(event.getDamage() / 4);
targets--;
} }
} }
} }

View File

@ -49,7 +49,7 @@ public class mcHerbalism {
mcUsers.getProfile(player).addHerbalismGather(10); mcUsers.getProfile(player).addHerbalismGather(10);
} }
if(type == 37 || type == 38){ if(type == 37 || type == 38){
mat = Material.getMaterial(296); mat = Material.getMaterial(block.getTypeId());
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
if(player != null){ if(player != null){
if(Math.random() * 1000 <= mcUsers.getProfile(player).getHerbalismInt()){ if(Math.random() * 1000 <= mcUsers.getProfile(player).getHerbalismInt()){

View File

@ -26,7 +26,7 @@ public class mcItem {
public void chimaerawing(Player player){ public void chimaerawing(Player player){
ItemStack is = player.getItemInHand(); ItemStack is = player.getItemInHand();
Block block = player.getLocation().getBlock(); Block block = player.getLocation().getBlock();
if(mcPermissions.getInstance().chimaeraWing(player) && is.getTypeId() == 288){ if(mcPermissions.getInstance().chimaeraWing(player) && is.getTypeId() == 288 && mcm.getInstance().abilityBlockCheck(block)){
if(mcUsers.getProfile(player).getRecentlyHurt() == 0 && is.getAmount() >= mcLoadProperties.feathersConsumedByChimaeraWing){ if(mcUsers.getProfile(player).getRecentlyHurt() == 0 && is.getAmount() >= mcLoadProperties.feathersConsumedByChimaeraWing){
Block derp = player.getLocation().getBlock(); Block derp = player.getLocation().getBlock();
int y = derp.getY(); int y = derp.getY();

View File

@ -25,7 +25,6 @@ public class mcMining {
if(!mcm.getInstance().abilityBlockCheck(block)) if(!mcm.getInstance().abilityBlockCheck(block))
return; return;
} }
int miningticks = 2; int miningticks = 2;
if(mcUsers.getProfile(player).getMiningInt() >= 50) if(mcUsers.getProfile(player).getMiningInt() >= 50)
miningticks++; miningticks++;
@ -57,8 +56,13 @@ public class mcMining {
Material mat = Material.getMaterial(block.getTypeId()); Material mat = Material.getMaterial(block.getTypeId());
byte damage = 0; byte damage = 0;
ItemStack item = new ItemStack(mat, 1, (byte)0, damage); ItemStack item = new ItemStack(mat, 1, (byte)0, damage);
if(block.getTypeId() != 73 && block.getTypeId() != 74 && block.getTypeId() != 56 && block.getTypeId() != 21 && block.getTypeId() != 1 && block.getTypeId() != 16) if(block.getTypeId() != 89 && block.getTypeId() != 73 && block.getTypeId() != 74 && block.getTypeId() != 56 && block.getTypeId() != 21 && block.getTypeId() != 1 && block.getTypeId() != 16)
loc.getWorld().dropItemNaturally(loc, item); loc.getWorld().dropItemNaturally(loc, item);
if(block.getTypeId() == 89){
mat = Material.getMaterial(348);
item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item);
}
if(block.getTypeId() == 73 || block.getTypeId() == 74){ if(block.getTypeId() == 73 || block.getTypeId() == 74){
mat = Material.getMaterial(331); mat = Material.getMaterial(331);
item = new ItemStack(mat, 1, (byte)0, damage); item = new ItemStack(mat, 1, (byte)0, damage);
@ -106,6 +110,16 @@ public class mcMining {
mcUsers.getProfile(player).addMiningGather(3); mcUsers.getProfile(player).addMiningGather(3);
blockProcCheck(block, player); blockProcCheck(block, player);
} }
//NETHERRACK
if(block.getTypeId() == 87){
mcUsers.getProfile(player).addMiningGather(3);
blockProcCheck(block, player);
}
//GLOWSTONE
if(block.getTypeId() == 89){
mcUsers.getProfile(player).addMiningGather(3);
blockProcCheck(block, player);
}
//COAL //COAL
if(block.getTypeId() == 16){ if(block.getTypeId() == 16){
mcUsers.getProfile(player).addMiningGather(10); mcUsers.getProfile(player).addMiningGather(10);
@ -143,28 +157,53 @@ public class mcMining {
*/ */
public Boolean canBeSuperBroken(Block block){ public Boolean canBeSuperBroken(Block block){
int t = block.getTypeId(); int t = block.getTypeId();
if(t == 73 || t == 74 || t == 56 || t == 21 || t == 1 || t == 16 || t == 14 || t == 15){ if(t == 87 || t == 89 || t == 73 || t == 74 || t == 56 || t == 21 || t == 1 || t == 16 || t == 14 || t == 15){
return true; return true;
} else { } else {
return false; return false;
} }
} }
public void SuperBreakerBlockCheck(Player player, Block block){ public void SuperBreakerBlockCheck(Player player, Block block){
player.getItemInHand().setDurability((short) (player.getItemInHand().getDurability() + 1)); mcm.getInstance().damageTool(player, (short) 15);
Location loc = block.getLocation(); Location loc = block.getLocation();
Material mat = Material.getMaterial(block.getTypeId()); Material mat = Material.getMaterial(block.getTypeId());
byte damage = 0; byte damage = 0;
ItemStack item = new ItemStack(mat, 1, (byte)0, damage); ItemStack item = new ItemStack(mat, 1, (byte)0, damage);
if(block.getTypeId() != 73 && block.getTypeId() != 74 && block.getTypeId() != 56 && block.getTypeId() != 21 && block.getTypeId() != 1 && block.getTypeId() != 16)
loc.getWorld().dropItemNaturally(loc, item);
if(block.getTypeId() == 1 || block.getTypeId() == 24){ if(block.getTypeId() == 1 || block.getTypeId() == 24){
if(!mcConfig.getInstance().isBlockWatched(block)){ if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(3); mcUsers.getProfile(player).addMiningGather(3);
blockProcCheck(block, player); blockProcCheck(block, player);
} }
mat = Material.getMaterial(4); if(block.getTypeId() == 1){
mat = Material.COBBLESTONE;
} else {
mat = Material.SANDSTONE;
}
item = new ItemStack(mat, 1, (byte)0, damage); item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item); loc.getWorld().dropItemNaturally(loc, item);
block.setType(Material.AIR);
}
//NETHERRACK
if(block.getTypeId() == 87){
if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(3);
blockProcCheck(block, player);
}
mat = Material.getMaterial(87);
item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item);
block.setType(Material.AIR);
}
//GLOWSTONE
if(block.getTypeId() == 89){
if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(3);
blockProcCheck(block, player);
}
mat = Material.getMaterial(348);
item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item);
block.setType(Material.AIR);
} }
//COAL //COAL
if(block.getTypeId() == 16){ if(block.getTypeId() == 16){
@ -175,16 +214,18 @@ public class mcMining {
mat = Material.getMaterial(263); mat = Material.getMaterial(263);
item = new ItemStack(mat, 1, (byte)0, damage); item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item); loc.getWorld().dropItemNaturally(loc, item);
block.setType(Material.AIR);
} }
//GOLD //GOLD
if(block.getTypeId() == 14){ if(block.getTypeId() == 14 && mcm.getInstance().getTier(player) >= 3){
if(!mcConfig.getInstance().isBlockWatched(block)){ if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(35); mcUsers.getProfile(player).addMiningGather(35);
blockProcCheck(block, player); blockProcCheck(block, player);
} }
block.setType(Material.AIR);
} }
//DIAMOND //DIAMOND
if(block.getTypeId() == 56){ if(block.getTypeId() == 56 && mcm.getInstance().getTier(player) >= 3){
if(!mcConfig.getInstance().isBlockWatched(block)){ if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(75); mcUsers.getProfile(player).addMiningGather(75);
blockProcCheck(block, player); blockProcCheck(block, player);
@ -192,16 +233,18 @@ public class mcMining {
mat = Material.getMaterial(264); mat = Material.getMaterial(264);
item = new ItemStack(mat, 1, (byte)0, damage); item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item); loc.getWorld().dropItemNaturally(loc, item);
block.setType(Material.AIR);
} }
//IRON //IRON
if(block.getTypeId() == 15){ if(block.getTypeId() == 15 && mcm.getInstance().getTier(player) >= 2){
if(!mcConfig.getInstance().isBlockWatched(block)){ if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(25); mcUsers.getProfile(player).addMiningGather(25);
blockProcCheck(block, player); blockProcCheck(block, player);
} }
block.setType(Material.AIR);
} }
//REDSTONE //REDSTONE
if(block.getTypeId() == 73 || block.getTypeId() == 74){ if((block.getTypeId() == 73 || block.getTypeId() == 74) && mcm.getInstance().getTier(player) >= 4){
if(!mcConfig.getInstance().isBlockWatched(block)){ if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(15); mcUsers.getProfile(player).addMiningGather(15);
blockProcCheck(block, player); blockProcCheck(block, player);
@ -214,9 +257,10 @@ public class mcMining {
if(Math.random() * 10 > 5){ if(Math.random() * 10 > 5){
loc.getWorld().dropItemNaturally(loc, item); loc.getWorld().dropItemNaturally(loc, item);
} }
block.setType(Material.AIR);
} }
//LAPUS //LAPUS
if(block.getTypeId() == 21){ if(block.getTypeId() == 21 && mcm.getInstance().getTier(player) >= 3){
if(!mcConfig.getInstance().isBlockWatched(block)){ if(!mcConfig.getInstance().isBlockWatched(block)){
mcUsers.getProfile(player).addMiningGather(40); mcUsers.getProfile(player).addMiningGather(40);
blockProcCheck(block, player); blockProcCheck(block, player);
@ -227,8 +271,8 @@ public class mcMining {
loc.getWorld().dropItemNaturally(loc, item); loc.getWorld().dropItemNaturally(loc, item);
loc.getWorld().dropItemNaturally(loc, item); loc.getWorld().dropItemNaturally(loc, item);
loc.getWorld().dropItemNaturally(loc, item); loc.getWorld().dropItemNaturally(loc, item);
}
mcSkills.getInstance().XpCheck(player);
block.setType(Material.AIR); block.setType(Material.AIR);
} }
mcSkills.getInstance().XpCheck(player);
}
} }

View File

@ -73,7 +73,12 @@ public class mcPlayerListener extends PlayerListener {
/* /*
* ABILITY ACTIVATION CHECKS * ABILITY ACTIVATION CHECKS
*/ */
if(block != null){
if(mcm.getInstance().abilityBlockCheck(block))
mcSkills.getInstance().abilityActivationCheck(player, block); mcSkills.getInstance().abilityActivationCheck(player, block);
} else {
mcSkills.getInstance().abilityActivationCheck(player, block);
}
/* /*
* ITEM INTERACTIONS * ITEM INTERACTIONS
*/ */

View File

@ -221,6 +221,8 @@ public class mcSkills {
/* /*
* AXE PREPARATION MODE * AXE PREPARATION MODE
*/ */
if(mcUsers.getProfile(player) == null)
mcUsers.addUser(player);
if(mcUsers.getProfile(player).getAxePreparationMode()){ if(mcUsers.getProfile(player).getAxePreparationMode()){
mcUsers.getProfile(player).decreaseAxePreparationTicks(); mcUsers.getProfile(player).decreaseAxePreparationTicks();
if(mcUsers.getProfile(player).getAxePreparationTicks() <= 0){ if(mcUsers.getProfile(player).getAxePreparationTicks() <= 0){
@ -266,7 +268,7 @@ public class mcSkills {
if(mcUsers.getProfile(player).getSkullSplitterTicks() <= 0){ if(mcUsers.getProfile(player).getSkullSplitterTicks() <= 0){
mcUsers.getProfile(player).setSkullSplitterMode(false); mcUsers.getProfile(player).setSkullSplitterMode(false);
mcUsers.getProfile(player).setSkullSplitterCooldown(120); mcUsers.getProfile(player).setSkullSplitterCooldown(120);
player.sendMessage(ChatColor.GRAY+"**Skull Splitter has worn off**"); player.sendMessage(ChatColor.RED+"**Skull Splitter has worn off**");
} }
} }
} }
@ -279,7 +281,7 @@ public class mcSkills {
if(mcUsers.getProfile(player).getTreeFellerTicks() <= 0){ if(mcUsers.getProfile(player).getTreeFellerTicks() <= 0){
mcUsers.getProfile(player).setTreeFellerMode(false); mcUsers.getProfile(player).setTreeFellerMode(false);
mcUsers.getProfile(player).setTreeFellerCooldown(120); mcUsers.getProfile(player).setTreeFellerCooldown(120);
player.sendMessage(ChatColor.GRAY+"**Tree Feller has worn off**"); player.sendMessage(ChatColor.RED+"**Tree Feller has worn off**");
} }
} }
} }
@ -292,7 +294,7 @@ public class mcSkills {
if(mcUsers.getProfile(player).getSuperBreakerTicks() <= 0){ if(mcUsers.getProfile(player).getSuperBreakerTicks() <= 0){
mcUsers.getProfile(player).setSuperBreakerMode(false); mcUsers.getProfile(player).setSuperBreakerMode(false);
mcUsers.getProfile(player).setSuperBreakerCooldown(120); mcUsers.getProfile(player).setSuperBreakerCooldown(120);
player.sendMessage(ChatColor.GRAY+"**Super Breaker has worn off**"); player.sendMessage(ChatColor.RED+"**Super Breaker has worn off**");
} }
} }
} }
@ -305,7 +307,7 @@ public class mcSkills {
if(mcUsers.getProfile(player).getGigaDrillBreakerTicks() <= 0){ if(mcUsers.getProfile(player).getGigaDrillBreakerTicks() <= 0){
mcUsers.getProfile(player).setGigaDrillBreakerMode(false); mcUsers.getProfile(player).setGigaDrillBreakerMode(false);
mcUsers.getProfile(player).setGigaDrillBreakerCooldown(120); mcUsers.getProfile(player).setGigaDrillBreakerCooldown(120);
player.sendMessage(ChatColor.GRAY+"**You feel spiral energy leaving you**"); player.sendMessage(ChatColor.RED+"**You feel spiral energy leaving you**");
} }
} }
} }
@ -318,7 +320,7 @@ public class mcSkills {
if(mcUsers.getProfile(player).getSerratedStrikesTicks() <= 0){ if(mcUsers.getProfile(player).getSerratedStrikesTicks() <= 0){
mcUsers.getProfile(player).setSerratedStrikesMode(false); mcUsers.getProfile(player).setSerratedStrikesMode(false);
mcUsers.getProfile(player).setSerratedStrikesCooldown(120); mcUsers.getProfile(player).setSerratedStrikesCooldown(120);
player.sendMessage(ChatColor.GRAY+"**Serrated Strikes has worn off**"); player.sendMessage(ChatColor.RED+"**Serrated Strikes has worn off**");
} }
} }
} }
@ -331,7 +333,7 @@ public class mcSkills {
if(mcUsers.getProfile(player).getBerserkTicks() <= 0){ if(mcUsers.getProfile(player).getBerserkTicks() <= 0){
mcUsers.getProfile(player).setBerserkMode(false); mcUsers.getProfile(player).setBerserkMode(false);
mcUsers.getProfile(player).setBerserkCooldown(120); mcUsers.getProfile(player).setBerserkCooldown(120);
player.sendMessage(ChatColor.GRAY+"**Berserk has worn off**"); player.sendMessage(ChatColor.RED+"**Berserk has worn off**");
} }
} }
} }

View File

@ -16,6 +16,17 @@ public class mcTimer extends TimerTask{
public void run() { public void run() {
Player[] playerlist = plugin.getServer().getOnlinePlayers(); Player[] playerlist = plugin.getServer().getOnlinePlayers();
for(Player player : playerlist){ for(Player player : playerlist){
if(mcUsers.getProfile(player) == null)
mcUsers.addUser(player);
/*
* MONITOR SKILLS
*/
mcSkills.getInstance().monitorSkills(player);
/*
* COOLDOWN MONITORING
*/
mcSkills.getInstance().decreaseCooldowns(player);
if(mcPermissions.getInstance().regeneration(player)){ if(mcPermissions.getInstance().regeneration(player)){
if(thecount == 5 || thecount == 10 || thecount == 15 || thecount == 20){ if(thecount == 5 || thecount == 10 || thecount == 15 || thecount == 20){
if(player != null && if(player != null &&
@ -46,14 +57,6 @@ public class mcTimer extends TimerTask{
mcUsers.getProfile(player).decreaseLastHurt(); mcUsers.getProfile(player).decreaseLastHurt();
} }
} }
/*
* MONITOR SKILLS
*/
mcSkills.getInstance().monitorSkills(player);
/*
* COOLDOWN MONITORING
*/
mcSkills.getInstance().decreaseCooldowns(player);
} }
if(thecount < 20){ if(thecount < 20){
thecount++; thecount++;

View File

@ -30,6 +30,56 @@ public class mcm {
} }
return instance; return instance;
} }
public void damageTool(Player player, short damage){
if(player.getItemInHand().getTypeId() == 0)
return;
player.getItemInHand().setDurability((short) (player.getItemInHand().getDurability() + damage));
if(player.getItemInHand().getDurability() >= getMaxDurability(mcm.getInstance().getTier(player), player.getItemInHand())){
ItemStack[] inventory = player.getInventory().getContents();
for(ItemStack x : inventory){
if(x.getTypeId() == player.getItemInHand().getTypeId() && x.getDurability() == player.getItemInHand().getDurability()){
x.setTypeId(0);
x.setAmount(0);
player.getInventory().setContents(inventory);
return;
}
}
}
}
public Integer getTier(Player player){
int i = player.getItemInHand().getTypeId();
if(i == 268 || i == 269 || i == 270 || i == 271 || i == 290){
return 1; //WOOD
} else if (i == 272 || i == 273 || i == 274 || i == 275 || i == 291){
return 2; //STONE
} else if (i == 256 || i == 257 || i == 258 || i == 267 || i == 292){
return 3; //IRON
} else if (i == 283 || i == 284 || i == 285 || i == 286 || i == 294){
return 1; //GOLD
} else if (i == 276 || i == 277 || i == 278 || i == 279 || i == 293){
return 4; //DIAMOND
} else {
return 1; //UNRECOGNIZED
}
}
public Integer getMaxDurability(Integer tier, ItemStack item){
int id = item.getTypeId();
if(tier == 1){
if((id == 276 || id == 277 || id == 278 || id == 279 || id == 293)){
return 33;
} else {
return 60;
}
} else if (tier == 2){
return 132;
} else if (tier == 3){
return 251;
} else if (tier == 4){
return 1562;
} else {
return 0;
}
}
public double getDistance(Location loca, Location locb) public double getDistance(Location loca, Location locb)
{ {
return Math.sqrt(Math.pow(loca.getX() - locb.getX(), 2) + Math.pow(loca.getY() - locb.getY(), 2) return Math.sqrt(Math.pow(loca.getX() - locb.getX(), 2) + Math.pow(loca.getY() - locb.getY(), 2)
@ -37,7 +87,7 @@ public class mcm {
} }
public boolean abilityBlockCheck(Block block){ public boolean abilityBlockCheck(Block block){
int i = block.getTypeId(); int i = block.getTypeId();
if(i == 25 || i == 54 || i == 69 || i == 92 || i == 77 || i == 58 || i == 61 || i == 62 || i == 42 || i == 71 || i == 64 || i == 84 || i == 324 || i == 330){ if(i == 68 || i == 355 || i == 323 || i == 25 || i == 54 || i == 69 || i == 92 || i == 77 || i == 58 || i == 61 || i == 62 || i == 42 || i == 71 || i == 64 || i == 84 || i == 324 || i == 330){
return false; return false;
} else { } else {
return true; return true;
@ -503,23 +553,24 @@ public class mcm {
} }
if(split[0].equalsIgnoreCase("/"+mcLoadProperties.mcmmo)){ if(split[0].equalsIgnoreCase("/"+mcLoadProperties.mcmmo)){
event.setCancelled(true); event.setCancelled(true);
player.sendMessage(ChatColor.GRAY+"mcMMO is an RPG inspired plugin"); player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"mcMMO"+ChatColor.RED+"[]-----");
player.sendMessage(ChatColor.GRAY+"You can gain skills in several professions by"); player.sendMessage(ChatColor.YELLOW+"mcMMO is an RPG server mod for minecraft.");
player.sendMessage(ChatColor.GRAY+"doing things related to that profession."); player.sendMessage(ChatColor.YELLOW+"There are many skills added by mcMMO to minecraft.");
player.sendMessage(ChatColor.GRAY+"Mining for example will increase your mining XP."); player.sendMessage(ChatColor.YELLOW+"They can do anything from giving a chance");
player.sendMessage(ChatColor.GRAY+"Wood Cutting will increase Wood Cutting, etc..."); player.sendMessage(ChatColor.YELLOW+"for double drops to letting you break materials instantly.");
player.sendMessage(ChatColor.GRAY+"Repairing is simple in mcMMO"); player.sendMessage(ChatColor.YELLOW+"For example, by harvesting logs from trees you will gain");
player.sendMessage(ChatColor.GRAY+"Say you want to repair an iron shovel"); player.sendMessage(ChatColor.YELLOW+"Woodcutting xp and once you have enough xp you will gain");
player.sendMessage(ChatColor.GRAY+"start by making an anvil by combining 9 iron ingots"); player.sendMessage(ChatColor.YELLOW+"a skill level in Woodcutting. By raising this skill you will");
player.sendMessage(ChatColor.GRAY+"on a workbench. Place the anvil and while holding the shovel"); player.sendMessage(ChatColor.YELLOW+"be able to receive benefits like "+ChatColor.RED+"double drops");
player.sendMessage(ChatColor.GRAY+"right click the anvil to interact with it, If you have spare"); player.sendMessage(ChatColor.YELLOW+"and increase the effects of the "+ChatColor.RED+"\"Tree Felling\""+ChatColor.YELLOW+" ability.");
player.sendMessage(ChatColor.GRAY+"iron ingots in your inventory the item will be repaired."); player.sendMessage(ChatColor.YELLOW+"mcMMO has abilities related to the skill, skills normally");
player.sendMessage(ChatColor.GRAY+"You cannot hurt other party members"); player.sendMessage(ChatColor.YELLOW+"provide passive bonuses but they also have activated");
player.sendMessage(ChatColor.BLUE+"Set your own spawn with "+ChatColor.RED+"/"+mcLoadProperties.setmyspawn); player.sendMessage(ChatColor.YELLOW+"abilities too. Each ability is activated by holding");
player.sendMessage(ChatColor.GREEN+"Based on your skills you will get "+ChatColor.DARK_RED+"random procs "+ChatColor.GREEN+ "when"); player.sendMessage(ChatColor.YELLOW+"the appropriate tool and "+ChatColor.RED+"right clicking.");
player.sendMessage(ChatColor.GREEN+"using your profession, like "+ChatColor.DARK_RED+"double drops "+ChatColor.GREEN+"or "+ChatColor.DARK_RED+"better repairs"); player.sendMessage(ChatColor.YELLOW+"For example, if you hold a Mining Pick and right click");
player.sendMessage(ChatColor.GREEN+"Find out mcMMO commands with /"+mcLoadProperties.mcc); player.sendMessage(ChatColor.YELLOW+"you will ready your Pickaxe, attack mining materials");
player.sendMessage(ChatColor.GREEN+"Appreciate the mod? "); player.sendMessage(ChatColor.YELLOW+"and then "+ChatColor.RED+"Super Breaker "+ChatColor.YELLOW+"will activate.");
player.sendMessage(ChatColor.GREEN+"Find out mcMMO commands with "+ChatColor.DARK_AQUA+"/"+mcLoadProperties.mcc);
player.sendMessage(ChatColor.GREEN+"You can donate via paypal to"+ChatColor.DARK_RED+" nossr50@gmail.com"); player.sendMessage(ChatColor.GREEN+"You can donate via paypal to"+ChatColor.DARK_RED+" nossr50@gmail.com");
} }
if(split[0].equalsIgnoreCase("/"+mcLoadProperties.mcc)){ if(split[0].equalsIgnoreCase("/"+mcLoadProperties.mcc)){

View File

@ -1,3 +1,3 @@
name: mcMMO name: mcMMO
main: com.gmail.nossr50.mcMMO main: com.gmail.nossr50.mcMMO
version: 0.9.2 version: 0.9.4