From a33478720908c1516eb6b8b4b6c82b8227d52817 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 28 Nov 2011 05:17:01 -0800 Subject: [PATCH] Another WIP for 1.2.00, still a lot of work to be done. --- src/Changelog.txt | 8 + src/com/gmail/nossr50/Combat.java | 165 ++++++---------- src/com/gmail/nossr50/Item.java | 1 - src/com/gmail/nossr50/Leaderboard.java | 6 + src/com/gmail/nossr50/command/Commands.java | 36 +++- .../nossr50/datatypes/PlayerProfile.java | 39 ++++ .../gmail/nossr50/datatypes/SkillType.java | 3 + .../nossr50/listeners/mcPlayerListener.java | 25 ++- .../gmail/nossr50/locale/locale_de.properties | 22 ++- .../nossr50/locale/locale_en_us.properties | 22 ++- .../nossr50/locale/locale_es_es.properties | 22 ++- .../gmail/nossr50/locale/locale_fi.properties | 22 ++- .../gmail/nossr50/locale/locale_fr.properties | 22 ++- .../gmail/nossr50/locale/locale_nl.properties | 22 ++- .../gmail/nossr50/locale/locale_pl.properties | 22 ++- .../nossr50/locale/locale_pt_br.properties | 22 ++- .../gmail/nossr50/locale/locale_ru.properties | 22 ++- src/com/gmail/nossr50/mcMMO.java | 1 + src/com/gmail/nossr50/mcPermissions.java | 21 ++ src/com/gmail/nossr50/party/Party.java | 10 +- src/com/gmail/nossr50/skills/Alchemy.java | 5 + src/com/gmail/nossr50/skills/Enchanting.java | 5 + src/com/gmail/nossr50/skills/Fishing.java | 183 ++++++++++++++++++ src/com/gmail/nossr50/skills/Mining.java | 9 + src/com/gmail/nossr50/skills/Repair.java | 152 ++++++++++++++- src/com/gmail/nossr50/spout/mmoHelper.java | 2 +- src/plugin.yml | 31 +-- 27 files changed, 733 insertions(+), 167 deletions(-) create mode 100644 src/com/gmail/nossr50/skills/Alchemy.java create mode 100644 src/com/gmail/nossr50/skills/Enchanting.java create mode 100644 src/com/gmail/nossr50/skills/Fishing.java diff --git a/src/Changelog.txt b/src/Changelog.txt index 6e309db04..3bbf2035b 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -1,5 +1,12 @@ Changelog: #Versions without changelogs probably had very small misc fixes, like tweaks to the source code +Version 1.2.00 +New mobs added to xp tables +Party leaders can now give bonus xp to nearby party members when grouped provided they are more skilled than their underlings +Animals now give xp to combat skills (those poor sheep ;_;) +Removed unnecessary sorcery permissions from plugin.yml +Added 'Arcane Forging' subskill to Repair + Version 1.1.17 XP gained in combat is now softcapped by the remaining health of the entity you are damaging, preventing many exploits. Players in Creative mode no longer gain XP @@ -9,6 +16,7 @@ Enemies should no longer grant XP when hit during their death Fixed an exploit that led to unlimited ability use Possibly fixed a bug where the same player would be listed multiple times in mctop Added author and description to plugin.yml + /mmoedit and /addxp are useable from the console now Swearword's statistics tracking removed (He stopped the service, so its gone now.. On a positive note, I did find out 1000-1500 servers installed mcMMO a day) diff --git a/src/com/gmail/nossr50/Combat.java b/src/com/gmail/nossr50/Combat.java index 106128156..a0aaff6a5 100644 --- a/src/com/gmail/nossr50/Combat.java +++ b/src/com/gmail/nossr50/Combat.java @@ -122,42 +122,9 @@ public class Combat } } - if(event.getEntity() instanceof Monster && !pluginx.misc.mobSpawnerList.contains(event.getEntity())) + if(!pluginx.misc.mobSpawnerList.contains(event.getEntity())) { - //Prevent XP from being handed out if the Monster is dead - Monster monster = (Monster)event.getEntity(); - if(monster.getHealth() < 1) - return; - - //Prevent a ridiculous amount of XP being granted by capping it at the remaining health of the mob - int hpLeft = monster.getHealth(), xpinc = 0; - - if(hpLeft < event.getDamage()) - xpinc = event.getDamage(); - else - xpinc = hpLeft; - - int xp = 0; - if(event.getEntity() instanceof Enderman) - xp = (xpinc * 3); - if(event.getEntity() instanceof Creeper) - xp = (xpinc * 4); - if(event.getEntity() instanceof Silverfish) - xp = (xpinc * 3); - if(event.getEntity() instanceof CaveSpider) - xp = (xpinc * 3); - if(event.getEntity() instanceof Spider) - xp = (xpinc * 3); - if(event.getEntity() instanceof Skeleton) - xp = (xpinc * 2); - if(event.getEntity() instanceof Zombie) - xp = (xpinc * 2); - if(event.getEntity() instanceof PigZombie) - xp = (xpinc * 3); - if(event.getEntity() instanceof Slime) - xp = (xpinc * 3); - if(event.getEntity() instanceof Ghast) - xp = (xpinc * 3); + int xp = getXp(event.getEntity(), event); if(m.isSwords(attacker.getItemInHand()) && mcPermissions.getInstance().swords(attacker)) PPa.addXP(SkillType.SWORDS, xp*10, attacker); @@ -232,48 +199,13 @@ public class Combat } if(!event.getEntity().isDead() && !pluginx.misc.mobSpawnerList.contains(event.getEntity())) { - int xp = 0; - if(event.getEntity() instanceof Monster) - { - //Prevent XP from being handed out if the Monster is dead - Monster monster = (Monster)event.getEntity(); - if(monster.getHealth() < 1) - return; - - //Prevent a ridiculous amount of XP being granted by capping it at the remaining health of the mob - int hpLeft = monster.getHealth(), xpinc = 0; - - if(hpLeft < event.getDamage()) - xpinc = event.getDamage(); - else - xpinc = hpLeft; - - if(event.getEntity() instanceof Creeper) - xp = (xpinc * 6); - if(event.getEntity() instanceof Enderman) - xp = (xpinc * 5); - if(event.getEntity() instanceof Silverfish) - xp = (xpinc * 3); - if(event.getEntity() instanceof CaveSpider) - xp = (xpinc * 3); - if(event.getEntity() instanceof Spider) - xp = (xpinc * 5); - if(event.getEntity() instanceof Skeleton) - xp = (xpinc * 3); - if(event.getEntity() instanceof Zombie) - xp = (xpinc * 3); - if(event.getEntity() instanceof PigZombie) - xp = (xpinc * 4); - if(event.getEntity() instanceof Slime) - xp = (xpinc * 4); - if(event.getEntity() instanceof Ghast) - xp = (xpinc * 4); - Users.getProfile(master).addXP(SkillType.TAMING, xp*10, master); - } + int xp = getXp(event.getEntity(), event); + Users.getProfile(master).addXP(SkillType.TAMING, xp*10, master); + if(event.getEntity() instanceof Player) { xp = (event.getDamage() * 2); - Users.getProfile(master).addXP(SkillType.TAMING, xp*10, master); + Users.getProfile(master).addXP(SkillType.TAMING, (int)((xp*10)*1.5), master); } Skills.XpCheckSkill(SkillType.TAMING, master); } @@ -380,42 +312,10 @@ public class Combat /* * Defender is Monster */ - if(!pluginx.misc.mobSpawnerList.contains(x) && x instanceof Monster) + if(!pluginx.misc.mobSpawnerList.contains(x)) { - //Prevent XP from being handed out if the Monster is dead - Monster monster = (Monster)x; - if(monster.getHealth() < 1) - return; - - //Prevent a ridiculous amount of XP being granted by capping it at the remaining health of the mob - int hpLeft = monster.getHealth(), xpinc = 0; - - if(hpLeft < event.getDamage()) - xpinc = event.getDamage(); - else - xpinc = hpLeft; - - //XP - if(x instanceof Creeper) - PPa.addXP(SkillType.ARCHERY, (xpinc * 4)*10, attacker); - if(x instanceof Enderman) - PPa.addXP(SkillType.ARCHERY, (xpinc * 3)*10, attacker); - if(x instanceof Silverfish) - PPa.addXP(SkillType.ARCHERY, (xpinc * 2)*10, attacker); - if(x instanceof CaveSpider) - PPa.addXP(SkillType.ARCHERY, (xpinc * 3)*10, attacker); - if(x instanceof Spider) - PPa.addXP(SkillType.ARCHERY, (xpinc * 3)*10, attacker); - if(x instanceof Skeleton) - PPa.addXP(SkillType.ARCHERY, (xpinc * 2)*10, attacker); - if(x instanceof Zombie) - PPa.addXP(SkillType.ARCHERY, (xpinc * 2)*10, attacker); - if(x instanceof PigZombie) - PPa.addXP(SkillType.ARCHERY, (xpinc * 3)*10, attacker); - if(x instanceof Slime) - PPa.addXP(SkillType.ARCHERY, (xpinc * 3)*10, attacker); - if(x instanceof Ghast) - PPa.addXP(SkillType.ARCHERY, (xpinc * 3)*10, attacker); + int xp = getXp(event.getEntity(), event); + PPa.addXP(SkillType.ARCHERY, xp*10, attacker); } /* * Attacker is Player @@ -470,4 +370,51 @@ public class Combat //If it made it this far, pvp is enabled return true; } + public static int getXp(Entity entity, EntityDamageEvent event) + { + int xp = 0; + if(entity instanceof LivingEntity) + { + LivingEntity le = (LivingEntity)entity; + //Prevent a ridiculous amount of XP being granted by capping it at the remaining health of the entity + int hpLeft = le.getHealth(), xpinc = 0; + + if(hpLeft < event.getDamage()) + xpinc = event.getDamage(); + else + xpinc = hpLeft; + + if(entity instanceof Animals) + { + xp = (int) (xpinc * 1.5); + } else + { + if(entity instanceof Enderman) + xp = (xpinc * 3); + else if(entity instanceof Creeper) + xp = (xpinc * 4); + else if(entity instanceof Silverfish) + xp = (xpinc * 3); + else if(entity instanceof CaveSpider) + xp = (xpinc * 3); + else if(entity instanceof Spider) + xp = (xpinc * 3); + else if(entity instanceof Skeleton) + xp = (xpinc * 2); + else if(entity instanceof Zombie) + xp = (xpinc * 2); + else if(entity instanceof PigZombie) + xp = (xpinc * 3); + else if(entity instanceof Slime) + xp = (xpinc * 2); + else if(entity instanceof Ghast) + xp = (xpinc * 3); + else if(entity instanceof Blaze) + xp = (xpinc * 3); + else if(entity instanceof EnderDragon) + xp = (xpinc * 8); + } + } + return xp; + } } diff --git a/src/com/gmail/nossr50/Item.java b/src/com/gmail/nossr50/Item.java index 03410e946..573716f07 100644 --- a/src/com/gmail/nossr50/Item.java +++ b/src/com/gmail/nossr50/Item.java @@ -28,7 +28,6 @@ import com.gmail.nossr50.skills.*; import com.gmail.nossr50.datatypes.PlayerProfile; - public class Item { public static void itemchecks(Player player, Plugin plugin) diff --git a/src/com/gmail/nossr50/Leaderboard.java b/src/com/gmail/nossr50/Leaderboard.java index e65927f74..c3baea519 100644 --- a/src/com/gmail/nossr50/Leaderboard.java +++ b/src/com/gmail/nossr50/Leaderboard.java @@ -52,6 +52,9 @@ public class Leaderboard Tree Archery = new Tree(); Tree Unarmed = new Tree(); Tree Taming = new Tree(); + Tree Fishing = new Tree(); + Tree Enchanting = new Tree(); + Tree Alchemy = new Tree(); Tree PowerLevel = new Tree(); //Add Data To Trees @@ -139,6 +142,9 @@ public class Leaderboard leaderWrite(Axes.inOrder(), SkillType.AXES); //$NON-NLS-1$ leaderWrite(Acrobatics.inOrder(), SkillType.ACROBATICS); //$NON-NLS-1$ leaderWrite(Taming.inOrder(), SkillType.TAMING); //$NON-NLS-1$ + leaderWrite(Fishing.inOrder(), SkillType.FISHING); //$NON-NLS-1$ + leaderWrite(Alchemy.inOrder(), SkillType.ALCHEMY); //$NON-NLS-1$ + leaderWrite(Enchanting.inOrder(), SkillType.ENCHANTING); //$NON-NLS-1$ leaderWrite(PowerLevel.inOrder(), SkillType.ALL); //$NON-NLS-1$ } public static void leaderWrite(PlayerStat[] ps, SkillType skillType) diff --git a/src/com/gmail/nossr50/command/Commands.java b/src/com/gmail/nossr50/command/Commands.java index f4c4c71e1..caee3d638 100644 --- a/src/com/gmail/nossr50/command/Commands.java +++ b/src/com/gmail/nossr50/command/Commands.java @@ -42,6 +42,7 @@ import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.mcLocale; import com.gmail.nossr50.party.Party; +import com.gmail.nossr50.skills.Repair; import com.gmail.nossr50.skills.Skills; import com.gmail.nossr50.spout.SpoutStuff; @@ -311,10 +312,17 @@ public class Commands player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] {mcLocale.getString("m.EffectsRepair1_0"), mcLocale.getString("m.EffectsRepair1_1")})); player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] {mcLocale.getString("m.EffectsRepair2_0"), mcLocale.getString("m.EffectsRepair2_1")})); player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] {mcLocale.getString("m.EffectsRepair3_0"), mcLocale.getString("m.EffectsRepair3_1")})); - player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] {mcLocale.getString("m.EffectsRepair4_0", new Object[]{LoadProperties.repairdiamondlevel}), mcLocale.getString("m.EffectsRepair4_1")})); + player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] {mcLocale.getString("m.EffectsRepair4_0", new Object[]{LoadProperties.repairdiamondlevel}), mcLocale.getString("m.EffectsRepair4_1")})); + player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] {mcLocale.getString("m.EffectsRepair5_0"), mcLocale.getString("m.EffectsRepair5_1")})); player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] {mcLocale.getString("m.YourStats")})); player.sendMessage(mcLocale.getString("m.RepairRepairMastery", new Object[] {repairmastery})); player.sendMessage(mcLocale.getString("m.RepairSuperRepairChance", new Object[] {percentage})); + player.sendMessage(mcLocale.getString("m.ArcaneForgingRank", new Object[] {Repair.getArcaneForgingRank(PP)})); + player.sendMessage(mcLocale.getString("m.ArcaneEnchantKeepChance", new Object[] {Repair.getEnchantChance(Repair.getArcaneForgingRank(PP))})); + player.sendMessage(mcLocale.getString("m.ArcaneEnchantDowngradeChance", new Object[] {Repair.getDowngradeChance(Repair.getArcaneForgingRank(PP))})); + player.sendMessage(mcLocale.getString("m.ArcaneForgingMilestones")); + player.sendMessage(mcLocale.getString("m.ArcaneForgingMilestones2")); + } else if(label.equalsIgnoreCase("unarmed")){ String percentage, arrowpercentage; @@ -1040,6 +1048,8 @@ public class Commands player.sendMessage(ChatColor.GOLD+"-=GATHERING SKILLS=-"); if(mcPermissions.getInstance().excavation(target)) player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.ExcavationSkill"), PPt.getSkillLevel(SkillType.EXCAVATION), PPt.getSkillXpLevel(SkillType.EXCAVATION), PPt.getXpToLevel(SkillType.EXCAVATION))); + if(mcPermissions.getInstance().fishing(target)) + player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.FishingSkill"), PPt.getSkillLevel(SkillType.FISHING), PPt.getSkillXpLevel(SkillType.FISHING), PPt.getXpToLevel(SkillType.FISHING))); if(mcPermissions.getInstance().herbalism(target)) player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.HerbalismSkill"), PPt.getSkillLevel(SkillType.HERBALISM), PPt.getSkillXpLevel(SkillType.HERBALISM), PPt.getXpToLevel(SkillType.HERBALISM))); if(mcPermissions.getInstance().mining(target)) @@ -1064,6 +1074,10 @@ public class Commands player.sendMessage(ChatColor.GOLD+"-=MISC SKILLS=-"); if(mcPermissions.getInstance().acrobatics(target)) player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AcrobaticsSkill"), PPt.getSkillLevel(SkillType.ACROBATICS), PPt.getSkillXpLevel(SkillType.ACROBATICS), PPt.getXpToLevel(SkillType.ACROBATICS))); + if(mcPermissions.getInstance().alchemy(target)) + player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AlchemySkill"), PPt.getSkillLevel(SkillType.ALCHEMY), PPt.getSkillXpLevel(SkillType.ALCHEMY), PPt.getXpToLevel(SkillType.ALCHEMY))); + if(mcPermissions.getInstance().enchanting(target)) + player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.EnchantingSkill"), PPt.getSkillLevel(SkillType.ENCHANTING), PPt.getSkillXpLevel(SkillType.ENCHANTING), PPt.getXpToLevel(SkillType.ENCHANTING))); if(mcPermissions.getInstance().repair(target)) player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.RepairSkill"), PPt.getSkillLevel(SkillType.REPAIR), PPt.getSkillXpLevel(SkillType.REPAIR), PPt.getXpToLevel(SkillType.REPAIR))); @@ -1087,6 +1101,8 @@ public class Commands player.sendMessage(header+"-=GATHERING SKILLS=-"); if(mcPermissions.getInstance().excavation(player)) player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.ExcavationSkill"), PP.getSkillLevel(SkillType.EXCAVATION), PP.getSkillXpLevel(SkillType.EXCAVATION), PP.getXpToLevel(SkillType.EXCAVATION))); + if(mcPermissions.getInstance().fishing(player)) + player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.FishingSkill"), PP.getSkillLevel(SkillType.FISHING), PP.getSkillXpLevel(SkillType.FISHING), PP.getXpToLevel(SkillType.FISHING))); if(mcPermissions.getInstance().herbalism(player)) player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.HerbalismSkill"), PP.getSkillLevel(SkillType.HERBALISM), PP.getSkillXpLevel(SkillType.HERBALISM), PP.getXpToLevel(SkillType.HERBALISM))); if(mcPermissions.getInstance().mining(player)) @@ -1114,6 +1130,10 @@ public class Commands player.sendMessage(header+"-=MISC SKILLS=-"); if(mcPermissions.getInstance().acrobatics(player)) player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AcrobaticsSkill"), PP.getSkillLevel(SkillType.ACROBATICS), PP.getSkillXpLevel(SkillType.ACROBATICS), PP.getXpToLevel(SkillType.ACROBATICS))); + if(mcPermissions.getInstance().alchemy(player)) + player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AlchemySkill"), PP.getSkillLevel(SkillType.ALCHEMY), PP.getSkillXpLevel(SkillType.ALCHEMY), PP.getXpToLevel(SkillType.ALCHEMY))); + if(mcPermissions.getInstance().enchanting(player)) + player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.EnchantingSkill"), PP.getSkillLevel(SkillType.ENCHANTING), PP.getSkillXpLevel(SkillType.ENCHANTING), PP.getXpToLevel(SkillType.ENCHANTING))); if(mcPermissions.getInstance().repair(player)) player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.RepairSkill"), PP.getSkillLevel(SkillType.REPAIR), PP.getSkillXpLevel(SkillType.REPAIR), PP.getXpToLevel(SkillType.REPAIR))); } @@ -1204,7 +1224,7 @@ public class Commands { if(p != null && x+1 >= Pinstance.partyCount(player, Bukkit.getServer().getOnlinePlayers())) { - if(Pinstance.isPartyLeader(p, PP.getParty())) + if(Pinstance.isPartyLeader(p.getName(), PP.getParty())) { tempList+=ChatColor.GOLD+p.getName(); x++; @@ -1217,7 +1237,7 @@ public class Commands } if(p != null && x < Pinstance.partyCount(player, Bukkit.getServer().getOnlinePlayers())) { - if(Pinstance.isPartyLeader(p, PP.getParty())) + if(Pinstance.isPartyLeader(p.getName(), PP.getParty())) { tempList+=ChatColor.GOLD+p.getName()+", "; x++; @@ -1253,7 +1273,7 @@ public class Commands { if(PP.inParty()) { - if(Pinstance.isPartyLeader(player, PP.getParty())) + if(Pinstance.isPartyLeader(player.getName(), PP.getParty())) { Pinstance.lockParty(PP.getParty()); player.sendMessage(mcLocale.getString("Party.Locked")); @@ -1269,7 +1289,7 @@ public class Commands { if(PP.inParty()) { - if(Pinstance.isPartyLeader(player, PP.getParty())) + if(Pinstance.isPartyLeader(player.getName(), PP.getParty())) { Pinstance.unlockParty(PP.getParty()); player.sendMessage(mcLocale.getString("Party.Unlocked")); @@ -1297,7 +1317,7 @@ public class Commands { if(args[0].equalsIgnoreCase("password")) { - if(Pinstance.isPartyLeader(player, PP.getParty())) + if(Pinstance.isPartyLeader(player.getName(), PP.getParty())) { if(Pinstance.isPartyLocked(PP.getParty())) { @@ -1313,7 +1333,7 @@ public class Commands } } else if(args[0].equalsIgnoreCase("kick")) { - if(Pinstance.isPartyLeader(player, PP.getParty())) + if(Pinstance.isPartyLeader(player.getName(), PP.getParty())) { if(Pinstance.isPartyLocked(PP.getParty())) { @@ -1351,7 +1371,7 @@ public class Commands } } else if(args[0].equalsIgnoreCase("owner")) { - if(Pinstance.isPartyLeader(player, PP.getParty())) + if(Pinstance.isPartyLeader(player.getName(), PP.getParty())) { Player tPlayer = null; if(Bukkit.getServer().getPlayer(args[1]) != null) tPlayer = Bukkit.getServer().getPlayer(args[1]); diff --git a/src/com/gmail/nossr50/datatypes/PlayerProfile.java b/src/com/gmail/nossr50/datatypes/PlayerProfile.java index 3f0ab3eb4..9c0a311c6 100644 --- a/src/com/gmail/nossr50/datatypes/PlayerProfile.java +++ b/src/com/gmail/nossr50/datatypes/PlayerProfile.java @@ -27,10 +27,13 @@ import java.util.logging.Logger; import org.bukkit.Bukkit; +import org.bukkit.ChatColor; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.entity.Player; import com.gmail.nossr50.config.LoadProperties; +import com.gmail.nossr50.party.Party; +import com.gmail.nossr50.Users; import com.gmail.nossr50.m; import com.gmail.nossr50.mcMMO; @@ -954,6 +957,30 @@ public class PlayerProfile { if(thisplayer.getGameMode() == GameMode.CREATIVE) return; + + double bonusModifier = 0; + String leaderName = ""; + + if(inParty()) + { + for(Player x : Party.getInstance().getPartyMembers(thisplayer)) + { + if(x.isOnline() && !x.getName().equals(thisplayer.getName()) && Party.getInstance().isPartyLeader(x.getName(), this.getParty())) + { + leaderName = x.getName(); + if(m.getDistance(thisplayer.getLocation(), x.getLocation()) < 25) + { + PlayerProfile PartyLeader = Users.getProfile(x); + if(PartyLeader.getSkillLevel(skillType) >= this.getSkillLevel(skillType)) + { + int leaderLevel = PartyLeader.getSkillLevel(skillType); + int difference = leaderLevel - this.getSkillLevel(skillType); + bonusModifier = (difference*0.75D)/100D; + } + } + } + } + } if(skillType == SkillType.ALL) { for(SkillType x : SkillType.values()) @@ -1002,6 +1029,18 @@ public class PlayerProfile break; } xp=xp*LoadProperties.xpGainMultiplier; + + if(bonusModifier > 0) + { + if(bonusModifier >= 3) + bonusModifier = 3; + + double trueBonus = bonusModifier * xp; + double oldxp = xp; + xp+=trueBonus; + double percent = (trueBonus/oldxp)*100; + thisplayer.sendMessage(ChatColor.GREEN+"XP: "+oldxp+" Bonus XP: "+trueBonus+" Total: "+xp+ChatColor.GOLD+" [Master: "+leaderName+" " +" +"+(int)percent+"%]"); + } skillsXp.put(skillType, skillsXp.get(skillType)+xp); lastgained = skillType; } diff --git a/src/com/gmail/nossr50/datatypes/SkillType.java b/src/com/gmail/nossr50/datatypes/SkillType.java index ebaa5bdf4..c6d6d175a 100644 --- a/src/com/gmail/nossr50/datatypes/SkillType.java +++ b/src/com/gmail/nossr50/datatypes/SkillType.java @@ -19,10 +19,13 @@ package com.gmail.nossr50.datatypes; public enum SkillType { ACROBATICS, + ALCHEMY, ALL, //This one is just for convenience ARCHERY, AXES, EXCAVATION, + ENCHANTING, + FISHING, HERBALISM, MINING, REPAIR, diff --git a/src/com/gmail/nossr50/listeners/mcPlayerListener.java b/src/com/gmail/nossr50/listeners/mcPlayerListener.java index 4cc0179eb..7b79cf921 100644 --- a/src/com/gmail/nossr50/listeners/mcPlayerListener.java +++ b/src/com/gmail/nossr50/listeners/mcPlayerListener.java @@ -25,9 +25,14 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.craftbukkit.command.ColouredConsoleSender; +import org.bukkit.craftbukkit.entity.CraftItem; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Fish; import org.bukkit.entity.Player; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerChatEvent; +import org.bukkit.event.player.PlayerFishEvent; +import org.bukkit.event.player.PlayerFishEvent.State; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerListener; @@ -36,6 +41,7 @@ import org.bukkit.event.player.PlayerPickupItemEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.inventory.ItemStack; +import org.bukkit.material.MaterialData; import com.gmail.nossr50.Item; import com.gmail.nossr50.Users; @@ -50,6 +56,7 @@ import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.mcLocale; import com.gmail.nossr50.party.Party; +import com.gmail.nossr50.skills.Fishing; import com.gmail.nossr50.skills.Herbalism; import com.gmail.nossr50.skills.Repair; import com.gmail.nossr50.skills.Skills; @@ -66,6 +73,22 @@ public class mcPlayerListener extends PlayerListener plugin = instance; } + //Fishing stuff + public void onPlayerFish(PlayerFishEvent event) + { + Player player = event.getPlayer(); + if(mcPermissions.getInstance().fishing(player)) + { + if(event.getState() == State.CAUGHT_FISH) + { + if(event.getCaught() instanceof CraftItem) + { + Fishing.getFishingResults(player, event); + } + } + } + } + public void onPlayerPickupItem(PlayerPickupItemEvent event) { if(Users.getProfile(event.getPlayer()).getBerserkMode()) @@ -124,9 +147,7 @@ public class mcPlayerListener extends PlayerListener public void onPlayerJoin(PlayerJoinEvent event) { - Player player = event.getPlayer(); - if(mcPermissions.getInstance().motd(player) && LoadProperties.enableMotd) { player.sendMessage(mcLocale.getString("mcPlayerListener.MOTD", new Object[] {plugin.getDescription().getVersion(), LoadProperties.mcmmo})); diff --git a/src/com/gmail/nossr50/locale/locale_de.properties b/src/com/gmail/nossr50/locale/locale_de.properties index 01d226e89..8cf4f6151 100644 --- a/src/com/gmail/nossr50/locale/locale_de.properties +++ b/src/com/gmail/nossr50/locale/locale_de.properties @@ -354,4 +354,24 @@ Commands.xprate.started=[[GOLD]]XP EVENT FOR mcMMO HAS STARTED! Commands.xprate.started2=[[GOLD]]mcMMO XP RATE IS NOW {0}x!! Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}! Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]! -Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining \ No newline at end of file +Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining +m.SkillAlchemy=ALCHEMY +m.SkillEnchanting=ENCHANTING +m.SkillFishing=FISHING +mcPlayerListener.AlchemySkill=Alchemy: +mcPlayerListener.EnchantingSkill=Enchanting: +mcPlayerListener.FishingSkill=Fishing: +Skills.AlchemyUp=[[YELLOW]]Alchemy skill increased by {0}. Total ({1}) +Skills.EnchantingUp=[[YELLOW]]Enchanting skill increased by {0}. Total ({1}) +Skills.FishingUp=[[YELLOW]]Fishing skill increased by {0}. Total ({1}) +Repair.LostEnchants=[[RED]]You were not skilled enough to keep any enchantments. +Repair.ArcanePerfect=[[GREEN]]You have sustained the arcane energies in this item. +Repair.Downgraded=[[RED]]Arcane power has decreased for this item. +Repair.ArcaneFailed=[[RED]]Arcane power has permanently left the item. +m.EffectsRepair5_0=Arcane Forging +m.EffectsRepair5_1=Repair magic items +m.ArcaneForgingRank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4 +m.ArcaneEnchantKeepChance=[[GRAY]]AF Success Rate: [[YELLOW]]{0}% +m.ArcaneEnchantDowngradeChance=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}% +m.ArcaneForgingMilestones=[[GOLD]][TIP] AF Rank Ups: [[GRAY]]Rank 1 = 100+, Rank 2 = 250+, +m.ArcaneForgingMilestones2=[[GRAY]] Rank 3 = 500+, Rank 4 = 750+ \ No newline at end of file diff --git a/src/com/gmail/nossr50/locale/locale_en_us.properties b/src/com/gmail/nossr50/locale/locale_en_us.properties index df46ac746..888d140a7 100644 --- a/src/com/gmail/nossr50/locale/locale_en_us.properties +++ b/src/com/gmail/nossr50/locale/locale_en_us.properties @@ -348,4 +348,24 @@ Commands.xprate.started=[[GOLD]]XP EVENT FOR mcMMO HAS STARTED! Commands.xprate.started2=[[GOLD]]mcMMO XP RATE IS NOW {0}x!! Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}! Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]! -Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining \ No newline at end of file +Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining +m.SkillAlchemy=ALCHEMY +m.SkillEnchanting=ENCHANTING +m.SkillFishing=FISHING +mcPlayerListener.AlchemySkill=Alchemy: +mcPlayerListener.EnchantingSkill=Enchanting: +mcPlayerListener.FishingSkill=Fishing: +Skills.AlchemyUp=[[YELLOW]]Alchemy skill increased by {0}. Total ({1}) +Skills.EnchantingUp=[[YELLOW]]Enchanting skill increased by {0}. Total ({1}) +Skills.FishingUp=[[YELLOW]]Fishing skill increased by {0}. Total ({1}) +Repair.LostEnchants=[[RED]]You were not skilled enough to keep any enchantments. +Repair.ArcanePerfect=[[GREEN]]You have sustained the arcane energies in this item. +Repair.Downgraded=[[RED]]Arcane power has decreased for this item. +Repair.ArcaneFailed=[[RED]]Arcane power has permanently left the item. +m.EffectsRepair5_0=Arcane Forging +m.EffectsRepair5_1=Repair magic items +m.ArcaneForgingRank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4 +m.ArcaneEnchantKeepChance=[[GRAY]]AF Success Rate: [[YELLOW]]{0}% +m.ArcaneEnchantDowngradeChance=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}% +m.ArcaneForgingMilestones=[[GOLD]][TIP] AF Rank Ups: [[GRAY]]Rank 1 = 100+, Rank 2 = 250+, +m.ArcaneForgingMilestones2=[[GRAY]] Rank 3 = 500+, Rank 4 = 750+ \ No newline at end of file diff --git a/src/com/gmail/nossr50/locale/locale_es_es.properties b/src/com/gmail/nossr50/locale/locale_es_es.properties index a212f5c08..ce453a117 100644 --- a/src/com/gmail/nossr50/locale/locale_es_es.properties +++ b/src/com/gmail/nossr50/locale/locale_es_es.properties @@ -348,4 +348,24 @@ Commands.xprate.started=[[GOLD]]mcMMO XP EVENT COMENZO! Commands.xprate.started2=[[GOLD]]mcMMO XP RATE ES AHORA {0}x!! Commands.xplock.locked=[[GOLD]]Tu BARRA DE EXP esta bloqueada a {0}! Commands.xplock.unlocked=[[GOLD]]Tu BARRA DE EXP esta ahora [[GREEN]]DESBLOQUEADA[[GOLD]]! -Commands.xplock.invalid=[[RED]]Ese no es un nombre de habilidad valido! Try /xplock mining \ No newline at end of file +Commands.xplock.invalid=[[RED]]Ese no es un nombre de habilidad valido! Try /xplock mining +m.SkillAlchemy=ALCHEMY +m.SkillEnchanting=ENCHANTING +m.SkillFishing=FISHING +mcPlayerListener.AlchemySkill=Alchemy: +mcPlayerListener.EnchantingSkill=Enchanting: +mcPlayerListener.FishingSkill=Fishing: +Skills.AlchemyUp=[[YELLOW]]Alchemy skill increased by {0}. Total ({1}) +Skills.EnchantingUp=[[YELLOW]]Enchanting skill increased by {0}. Total ({1}) +Skills.FishingUp=[[YELLOW]]Fishing skill increased by {0}. Total ({1}) +Repair.LostEnchants=[[RED]]You were not skilled enough to keep any enchantments. +Repair.ArcanePerfect=[[GREEN]]You have sustained the arcane energies in this item. +Repair.Downgraded=[[RED]]Arcane power has decreased for this item. +Repair.ArcaneFailed=[[RED]]Arcane power has permanently left the item. +m.EffectsRepair5_0=Arcane Forging +m.EffectsRepair5_1=Repair magic items +m.ArcaneForgingRank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4 +m.ArcaneEnchantKeepChance=[[GRAY]]AF Success Rate: [[YELLOW]]{0}% +m.ArcaneEnchantDowngradeChance=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}% +m.ArcaneForgingMilestones=[[GOLD]][TIP] AF Rank Ups: [[GRAY]]Rank 1 = 100+, Rank 2 = 250+, +m.ArcaneForgingMilestones2=[[GRAY]] Rank 3 = 500+, Rank 4 = 750+ \ No newline at end of file diff --git a/src/com/gmail/nossr50/locale/locale_fi.properties b/src/com/gmail/nossr50/locale/locale_fi.properties index 219ca537c..42f0f84b6 100644 --- a/src/com/gmail/nossr50/locale/locale_fi.properties +++ b/src/com/gmail/nossr50/locale/locale_fi.properties @@ -327,4 +327,24 @@ Commands.xprate.started=[[GOLD]]XP EVENT FOR mcMMO HAS STARTED! Commands.xprate.started2=[[GOLD]]mcMMO XP RATE IS NOW {0}x!! Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}! Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]! -Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining \ No newline at end of file +Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining +m.SkillAlchemy=ALCHEMY +m.SkillEnchanting=ENCHANTING +m.SkillFishing=FISHING +mcPlayerListener.AlchemySkill=Alchemy: +mcPlayerListener.EnchantingSkill=Enchanting: +mcPlayerListener.FishingSkill=Fishing: +Skills.AlchemyUp=[[YELLOW]]Alchemy skill increased by {0}. Total ({1}) +Skills.EnchantingUp=[[YELLOW]]Enchanting skill increased by {0}. Total ({1}) +Skills.FishingUp=[[YELLOW]]Fishing skill increased by {0}. Total ({1}) +Repair.LostEnchants=[[RED]]You were not skilled enough to keep any enchantments. +Repair.ArcanePerfect=[[GREEN]]You have sustained the arcane energies in this item. +Repair.Downgraded=[[RED]]Arcane power has decreased for this item. +Repair.ArcaneFailed=[[RED]]Arcane power has permanently left the item. +m.EffectsRepair5_0=Arcane Forging +m.EffectsRepair5_1=Repair magic items +m.ArcaneForgingRank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4 +m.ArcaneEnchantKeepChance=[[GRAY]]AF Success Rate: [[YELLOW]]{0}% +m.ArcaneEnchantDowngradeChance=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}% +m.ArcaneForgingMilestones=[[GOLD]][TIP] AF Rank Ups: [[GRAY]]Rank 1 = 100+, Rank 2 = 250+, +m.ArcaneForgingMilestones2=[[GRAY]] Rank 3 = 500+, Rank 4 = 750+ \ No newline at end of file diff --git a/src/com/gmail/nossr50/locale/locale_fr.properties b/src/com/gmail/nossr50/locale/locale_fr.properties index cc1eeb354..b50d974e2 100644 --- a/src/com/gmail/nossr50/locale/locale_fr.properties +++ b/src/com/gmail/nossr50/locale/locale_fr.properties @@ -348,4 +348,24 @@ Commands.xprate.started=[[GOLD]]XP EVENT FOR mcMMO HAS STARTED! Commands.xprate.started2=[[GOLD]]mcMMO XP RATE IS NOW {0}x!! Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}! Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]! -Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining \ No newline at end of file +Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining +m.SkillAlchemy=ALCHEMY +m.SkillEnchanting=ENCHANTING +m.SkillFishing=FISHING +mcPlayerListener.AlchemySkill=Alchemy: +mcPlayerListener.EnchantingSkill=Enchanting: +mcPlayerListener.FishingSkill=Fishing: +Skills.AlchemyUp=[[YELLOW]]Alchemy skill increased by {0}. Total ({1}) +Skills.EnchantingUp=[[YELLOW]]Enchanting skill increased by {0}. Total ({1}) +Skills.FishingUp=[[YELLOW]]Fishing skill increased by {0}. Total ({1}) +Repair.LostEnchants=[[RED]]You were not skilled enough to keep any enchantments. +Repair.ArcanePerfect=[[GREEN]]You have sustained the arcane energies in this item. +Repair.Downgraded=[[RED]]Arcane power has decreased for this item. +Repair.ArcaneFailed=[[RED]]Arcane power has permanently left the item. +m.EffectsRepair5_0=Arcane Forging +m.EffectsRepair5_1=Repair magic items +m.ArcaneForgingRank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4 +m.ArcaneEnchantKeepChance=[[GRAY]]AF Success Rate: [[YELLOW]]{0}% +m.ArcaneEnchantDowngradeChance=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}% +m.ArcaneForgingMilestones=[[GOLD]][TIP] AF Rank Ups: [[GRAY]]Rank 1 = 100+, Rank 2 = 250+, +m.ArcaneForgingMilestones2=[[GRAY]] Rank 3 = 500+, Rank 4 = 750+ \ No newline at end of file diff --git a/src/com/gmail/nossr50/locale/locale_nl.properties b/src/com/gmail/nossr50/locale/locale_nl.properties index 6e6d95bf0..5c7c3f875 100644 --- a/src/com/gmail/nossr50/locale/locale_nl.properties +++ b/src/com/gmail/nossr50/locale/locale_nl.properties @@ -354,4 +354,24 @@ Commands.xprate.started=[[GOLD]]XP EVENT FOR mcMMO HAS STARTED! Commands.xprate.started2=[[GOLD]]mcMMO XP RATE IS NOW {0}x!! Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}! Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]! -Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining \ No newline at end of file +Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining +m.SkillAlchemy=ALCHEMY +m.SkillEnchanting=ENCHANTING +m.SkillFishing=FISHING +mcPlayerListener.AlchemySkill=Alchemy: +mcPlayerListener.EnchantingSkill=Enchanting: +mcPlayerListener.FishingSkill=Fishing: +Skills.AlchemyUp=[[YELLOW]]Alchemy skill increased by {0}. Total ({1}) +Skills.EnchantingUp=[[YELLOW]]Enchanting skill increased by {0}. Total ({1}) +Skills.FishingUp=[[YELLOW]]Fishing skill increased by {0}. Total ({1}) +Repair.LostEnchants=[[RED]]You were not skilled enough to keep any enchantments. +Repair.ArcanePerfect=[[GREEN]]You have sustained the arcane energies in this item. +Repair.Downgraded=[[RED]]Arcane power has decreased for this item. +Repair.ArcaneFailed=[[RED]]Arcane power has permanently left the item. +m.EffectsRepair5_0=Arcane Forging +m.EffectsRepair5_1=Repair magic items +m.ArcaneForgingRank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4 +m.ArcaneEnchantKeepChance=[[GRAY]]AF Success Rate: [[YELLOW]]{0}% +m.ArcaneEnchantDowngradeChance=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}% +m.ArcaneForgingMilestones=[[GOLD]][TIP] AF Rank Ups: [[GRAY]]Rank 1 = 100+, Rank 2 = 250+, +m.ArcaneForgingMilestones2=[[GRAY]] Rank 3 = 500+, Rank 4 = 750+ \ No newline at end of file diff --git a/src/com/gmail/nossr50/locale/locale_pl.properties b/src/com/gmail/nossr50/locale/locale_pl.properties index 53bcadd7c..ad2cadf85 100644 --- a/src/com/gmail/nossr50/locale/locale_pl.properties +++ b/src/com/gmail/nossr50/locale/locale_pl.properties @@ -348,4 +348,24 @@ Commands.xprate.started=[[GOLD]]XP EVENT FOR mcMMO HAS STARTED! Commands.xprate.started2=[[GOLD]]mcMMO XP RATE IS NOW {0}x!! Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}! Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]! -Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining \ No newline at end of file +Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining +m.SkillAlchemy=ALCHEMY +m.SkillEnchanting=ENCHANTING +m.SkillFishing=FISHING +mcPlayerListener.AlchemySkill=Alchemy: +mcPlayerListener.EnchantingSkill=Enchanting: +mcPlayerListener.FishingSkill=Fishing: +Skills.AlchemyUp=[[YELLOW]]Alchemy skill increased by {0}. Total ({1}) +Skills.EnchantingUp=[[YELLOW]]Enchanting skill increased by {0}. Total ({1}) +Skills.FishingUp=[[YELLOW]]Fishing skill increased by {0}. Total ({1}) +Repair.LostEnchants=[[RED]]You were not skilled enough to keep any enchantments. +Repair.ArcanePerfect=[[GREEN]]You have sustained the arcane energies in this item. +Repair.Downgraded=[[RED]]Arcane power has decreased for this item. +Repair.ArcaneFailed=[[RED]]Arcane power has permanently left the item. +m.EffectsRepair5_0=Arcane Forging +m.EffectsRepair5_1=Repair magic items +m.ArcaneForgingRank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4 +m.ArcaneEnchantKeepChance=[[GRAY]]AF Success Rate: [[YELLOW]]{0}% +m.ArcaneEnchantDowngradeChance=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}% +m.ArcaneForgingMilestones=[[GOLD]][TIP] AF Rank Ups: [[GRAY]]Rank 1 = 100+, Rank 2 = 250+, +m.ArcaneForgingMilestones2=[[GRAY]] Rank 3 = 500+, Rank 4 = 750+ \ No newline at end of file diff --git a/src/com/gmail/nossr50/locale/locale_pt_br.properties b/src/com/gmail/nossr50/locale/locale_pt_br.properties index a019dda06..799ac7f33 100644 --- a/src/com/gmail/nossr50/locale/locale_pt_br.properties +++ b/src/com/gmail/nossr50/locale/locale_pt_br.properties @@ -363,4 +363,24 @@ Commands.xprate.started=[[GOLD]]EVENTO DE XP COME Commands.xprate.started2=[[GOLD]]XP RATE AGORA й {0}x!! Commands.xplock.locked=[[GOLD]]Sua barra de XP BAR estб travada em {0}! Commands.xplock.unlocked=[[GOLD]]Sua barra de XP foi [[GREEN]]DESTRAVADA[[GOLD]]! -Commands.xplock.invalid=[[RED]]Nao existe habilidade com esse nome! Tente /xplock mining \ No newline at end of file +Commands.xplock.invalid=[[RED]]Nao existe habilidade com esse nome! Tente /xplock mining +m.SkillAlchemy=ALCHEMY +m.SkillEnchanting=ENCHANTING +m.SkillFishing=FISHING +mcPlayerListener.AlchemySkill=Alchemy: +mcPlayerListener.EnchantingSkill=Enchanting: +mcPlayerListener.FishingSkill=Fishing: +Skills.AlchemyUp=[[YELLOW]]Alchemy skill increased by {0}. Total ({1}) +Skills.EnchantingUp=[[YELLOW]]Enchanting skill increased by {0}. Total ({1}) +Skills.FishingUp=[[YELLOW]]Fishing skill increased by {0}. Total ({1}) +Repair.LostEnchants=[[RED]]You were not skilled enough to keep any enchantments. +Repair.ArcanePerfect=[[GREEN]]You have sustained the arcane energies in this item. +Repair.Downgraded=[[RED]]Arcane power has decreased for this item. +Repair.ArcaneFailed=[[RED]]Arcane power has permanently left the item. +m.EffectsRepair5_0=Arcane Forging +m.EffectsRepair5_1=Repair magic items +m.ArcaneForgingRank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4 +m.ArcaneEnchantKeepChance=[[GRAY]]AF Success Rate: [[YELLOW]]{0}% +m.ArcaneEnchantDowngradeChance=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}% +m.ArcaneForgingMilestones=[[GOLD]][TIP] AF Rank Ups: [[GRAY]]Rank 1 = 100+, Rank 2 = 250+, +m.ArcaneForgingMilestones2=[[GRAY]] Rank 3 = 500+, Rank 4 = 750+ \ No newline at end of file diff --git a/src/com/gmail/nossr50/locale/locale_ru.properties b/src/com/gmail/nossr50/locale/locale_ru.properties index 3516e8a44..0629f86a1 100644 --- a/src/com/gmail/nossr50/locale/locale_ru.properties +++ b/src/com/gmail/nossr50/locale/locale_ru.properties @@ -340,4 +340,24 @@ Party.PasswordSet=[[GREEN]] Party.CouldNotKick=[[DARK_RED]]Вы не можете убрать игрока из группы {0} Party.NotInYourParty=[[DARK_RED]]{0} не в группе Party.CouldNotSetOwner=[[DARK_RED]]Вы не можете отдать лидерство игроку {0} -mcMMO.Description=[[DARK_AQUA]]Q: Что это?,[[GOLD]]mcMMO это [[RED]]ОПЕН СУРС[[GOLD]] RPG мод для сервера Bukkit от пользователя [[BLUE]]nossr50,[[GOLD]]Здесь было добавлено много умений для Minecraft сервера.,[[GOLD]]Вы можете прокачать их разными способами,[[GOLD]]Вы хотите найти больше информации о умении [[GREEN]]/SKILLNAME[[GOLD]] ?,[[DARK_AQUA]]Q: Что я должен сделать?,[[GOLD]]Для примера... in [[DARK_AQUA]]Шахтёрство[[GOLD]] вы получите [[RED]]2-ой дроп[[GOLD]] или способность [[RED]]"Супер разрушитель"[[GOLD]] ,которая активируется [[GOLD]]нажатием правой кнопки мыши на некоторое время,[[GOLD]]связанное с вашим уровнем умения. Поднять уровень [[BLUE]]Шахтёрства,[[GOLD]]легко просто копайте руды и камни! \ No newline at end of file +mcMMO.Description=[[DARK_AQUA]]Q: Что это?,[[GOLD]]mcMMO это [[RED]]ОПЕН СУРС[[GOLD]] RPG мод для сервера Bukkit от пользователя [[BLUE]]nossr50,[[GOLD]]Здесь было добавлено много умений для Minecraft сервера.,[[GOLD]]Вы можете прокачать их разными способами,[[GOLD]]Вы хотите найти больше информации о умении [[GREEN]]/SKILLNAME[[GOLD]] ?,[[DARK_AQUA]]Q: Что я должен сделать?,[[GOLD]]Для примера... in [[DARK_AQUA]]Шахтёрство[[GOLD]] вы получите [[RED]]2-ой дроп[[GOLD]] или способность [[RED]]"Супер разрушитель"[[GOLD]] ,которая активируется [[GOLD]]нажатием правой кнопки мыши на некоторое время,[[GOLD]]связанное с вашим уровнем умения. Поднять уровень [[BLUE]]Шахтёрства,[[GOLD]]легко просто копайте руды и камни! +m.SkillAlchemy=ALCHEMY +m.SkillEnchanting=ENCHANTING +m.SkillFishing=FISHING +mcPlayerListener.AlchemySkill=Alchemy: +mcPlayerListener.EnchantingSkill=Enchanting: +mcPlayerListener.FishingSkill=Fishing: +Skills.AlchemyUp=[[YELLOW]]Alchemy skill increased by {0}. Total ({1}) +Skills.EnchantingUp=[[YELLOW]]Enchanting skill increased by {0}. Total ({1}) +Skills.FishingUp=[[YELLOW]]Fishing skill increased by {0}. Total ({1}) +Repair.LostEnchants=[[RED]]You were not skilled enough to keep any enchantments. +Repair.ArcanePerfect=[[GREEN]]You have sustained the arcane energies in this item. +Repair.Downgraded=[[RED]]Arcane power has decreased for this item. +Repair.ArcaneFailed=[[RED]]Arcane power has permanently left the item. +m.EffectsRepair5_0=Arcane Forging +m.EffectsRepair5_1=Repair magic items +m.ArcaneForgingRank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4 +m.ArcaneEnchantKeepChance=[[GRAY]]AF Success Rate: [[YELLOW]]{0}% +m.ArcaneEnchantDowngradeChance=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}% +m.ArcaneForgingMilestones=[[GOLD]][TIP] AF Rank Ups: [[GRAY]]Rank 1 = 100+, Rank 2 = 250+, +m.ArcaneForgingMilestones2=[[GRAY]] Rank 3 = 500+, Rank 4 = 750+ \ No newline at end of file diff --git a/src/com/gmail/nossr50/mcMMO.java b/src/com/gmail/nossr50/mcMMO.java index 39613dd70..b0404f24c 100644 --- a/src/com/gmail/nossr50/mcMMO.java +++ b/src/com/gmail/nossr50/mcMMO.java @@ -141,6 +141,7 @@ public class mcMMO extends JavaPlugin pm.registerEvent(Event.Type.PLAYER_INTERACT, playerListener, Priority.Monitor, this); pm.registerEvent(Event.Type.PLAYER_RESPAWN, playerListener, Priority.Normal, this); pm.registerEvent(Event.Type.PLAYER_PICKUP_ITEM, playerListener, Priority.Normal, this); + pm.registerEvent(Event.Type.PLAYER_FISH, playerListener, Priority.Normal, this); //Block Stuff pm.registerEvent(Event.Type.BLOCK_DAMAGE, blockListener, Priority.Highest, this); diff --git a/src/com/gmail/nossr50/mcPermissions.java b/src/com/gmail/nossr50/mcPermissions.java index 01c8f20ad..ed0a13247 100644 --- a/src/com/gmail/nossr50/mcPermissions.java +++ b/src/com/gmail/nossr50/mcPermissions.java @@ -265,6 +265,27 @@ public class mcPermissions return true; } } + public boolean fishing(Player player) { + if (permissionsEnabled) { + return permission(player, "mcmmo.skills.fishing"); + } else { + return true; + } + } + public boolean alchemy(Player player) { + if (permissionsEnabled) { + return permission(player, "mcmmo.skills.alchemy"); + } else { + return true; + } + } + public boolean enchanting(Player player) { + if (permissionsEnabled) { + return permission(player, "mcmmo.skills.enchanting"); + } else { + return true; + } + } public boolean woodcutting(Player player) { if (permissionsEnabled) { return permission(player, "mcmmo.skills.woodcutting"); diff --git a/src/com/gmail/nossr50/party/Party.java b/src/com/gmail/nossr50/party/Party.java index c0b9e5ec4..948d7e194 100644 --- a/src/com/gmail/nossr50/party/Party.java +++ b/src/com/gmail/nossr50/party/Party.java @@ -211,7 +211,7 @@ public class Party informPartyMembersQuit(player); String party = PP.getParty(); - if(isPartyLeader(player, party)) + if(isPartyLeader(player.getName(), party)) { if(isPartyLocked(party)) { unlockParty(party); @@ -376,7 +376,7 @@ public class Party } public boolean canInvite(Player player, PlayerProfile PP) { - return (isPartyLocked(PP.getParty()) && !isPartyLeader(player, PP.getParty())) ? false : true; + return (isPartyLocked(PP.getParty()) && !isPartyLeader(player.getName(), PP.getParty())) ? false : true; } public boolean isParty(String partyName) { @@ -387,11 +387,11 @@ public class Party return this.partyPlayers.get(partyName).isEmpty(); } - public boolean isPartyLeader(Player player, String partyName) { + public boolean isPartyLeader(String playerName, String partyName) { if(this.partyPlayers.get(partyName) != null) { - if(this.partyPlayers.get(partyName).get(player.getName()) == null) return false; - return this.partyPlayers.get(partyName).get(player.getName()); + if(this.partyPlayers.get(partyName).get(playerName) == null) return false; + return this.partyPlayers.get(partyName).get(playerName); } else return false; diff --git a/src/com/gmail/nossr50/skills/Alchemy.java b/src/com/gmail/nossr50/skills/Alchemy.java new file mode 100644 index 000000000..8ef844479 --- /dev/null +++ b/src/com/gmail/nossr50/skills/Alchemy.java @@ -0,0 +1,5 @@ +package com.gmail.nossr50.skills; + +public class Alchemy { + +} diff --git a/src/com/gmail/nossr50/skills/Enchanting.java b/src/com/gmail/nossr50/skills/Enchanting.java new file mode 100644 index 000000000..43c887062 --- /dev/null +++ b/src/com/gmail/nossr50/skills/Enchanting.java @@ -0,0 +1,5 @@ +package com.gmail.nossr50.skills; + +public class Enchanting { + +} diff --git a/src/com/gmail/nossr50/skills/Fishing.java b/src/com/gmail/nossr50/skills/Fishing.java new file mode 100644 index 000000000..d81e3433a --- /dev/null +++ b/src/com/gmail/nossr50/skills/Fishing.java @@ -0,0 +1,183 @@ +package com.gmail.nossr50.skills; + +import org.bukkit.Material; +import org.bukkit.craftbukkit.entity.CraftItem; +import org.bukkit.entity.Player; +import org.bukkit.event.player.PlayerFishEvent; +import org.bukkit.inventory.ItemStack; + +import com.gmail.nossr50.Users; +import com.gmail.nossr50.datatypes.PlayerProfile; +import com.gmail.nossr50.datatypes.SkillType; + +public class Fishing { + + //Return the fishing tier for the player + public static int getFishingLootTier(PlayerProfile PP) + { + int lvl = PP.getSkillLevel(SkillType.FISHING); + + if(lvl < 100) + { + return 1; + } else if (lvl >= 100 && lvl < 300) + { + return 2; + } else if (lvl >= 300 && lvl < 600) + { + return 3; + } else if (lvl >= 600 && lvl < 900) + { + return 4; + } else + { + return 5; + } + } + + public static short getItemMaxDurability(Material mat) + { + //Return the max durability of an item + + //KEY + //TOOLS + //GOLD = 33, WOOD = 60, STONE = 132, IRON = 251, DIAMOND = 1562 + //HELMETS + //LEATHER = 34, CHAINMAIL = 67, GOLD = 68, IRON = 136, DIAMOND = 272 + //CHESTPLATES + //LEATHER = 49, CHAINMAIL = 96, GOLD = 96, IRON = 192, DIAMOND = 384 + //LEGGINGS + //LEATHER = 46, CHAINMAIL = 92, GOLD = 92, IRON = 184, DIAMOND = 368 + //BOOTS + //LEATHER = 40, CHAINMAIL = 79, GOLD = 80, IRON = 160, DIAMOND = 320 + + + switch(mat) + { + //Leather Items + case LEATHER_BOOTS: + return (short) 40; + case LEATHER_LEGGINGS: + return (short) 46; + case LEATHER_HELMET: + return (short) 34; + case LEATHER_CHESTPLATE: + return (short) 49; + default: + return 0; + } + } + + public static void getFishingResults(Player player, PlayerFishEvent event) + { + switch(getFishingLootTier(Users.getProfile(player))) + { + case 1: + getFishingResultsTier1(player, event); + Users.getProfile(player).addXP(SkillType.FISHING, 200, player); + player.getWorld().dropItem(player.getLocation(), new ItemStack(Material.RAW_FISH, 1)); + break; + case 2: + getFishingResultsTier2(player, event); + Users.getProfile(player).addXP(SkillType.FISHING, 400, player); + player.getWorld().dropItem(player.getLocation(), new ItemStack(Material.RAW_FISH, 2)); + break; + case 3: + getFishingResultsTier3(player, event); + Users.getProfile(player).addXP(SkillType.FISHING, 600, player); + player.getWorld().dropItem(player.getLocation(), new ItemStack(Material.RAW_FISH, 3)); + break; + case 4: + getFishingResultsTier4(player, event); + Users.getProfile(player).addXP(SkillType.FISHING, 800, player); + player.getWorld().dropItem(player.getLocation(), new ItemStack(Material.RAW_FISH, 4)); + break; + case 5: + getFishingResultsTier5(player, event); + Users.getProfile(player).addXP(SkillType.FISHING, 1000, player); + player.getWorld().dropItem(player.getLocation(), new ItemStack(Material.RAW_FISH, 5)); + break; + } + Skills.XpCheckSkill(SkillType.FISHING, player); + } + + private static void getFishingResultsTier1(Player player, PlayerFishEvent event) + { + //About 12 items for Tier 1 + int randomNum = (int)(Math.random() * 14); + CraftItem theCatch = (CraftItem)event.getCaught(); + + switch(randomNum) + { + //Armors + case 1: + theCatch.setItemStack(new ItemStack(Material.LEATHER_BOOTS, 1)); + break; + case 2: + theCatch.setItemStack(new ItemStack(Material.LEATHER_HELMET, 1)); + break; + case 3: + theCatch.setItemStack(new ItemStack(Material.LEATHER_LEGGINGS, 1)); + break; + case 4: + theCatch.setItemStack(new ItemStack(Material.LEATHER_CHESTPLATE, 1)); + break; + //Tools + //WOOD TOOLS + case 5: + theCatch.setItemStack(new ItemStack(Material.WOOD_AXE, 1)); + break; + case 6: + theCatch.setItemStack(new ItemStack(Material.WOOD_PICKAXE, 1)); + break; + case 7: + theCatch.setItemStack(new ItemStack(Material.WOOD_SWORD, 1)); + break; + case 8: + theCatch.setItemStack(new ItemStack(Material.WOOD_HOE, 1)); + break; + case 9: + theCatch.setItemStack(new ItemStack(Material.WOOD_SPADE, 1)); + break; + //STONE TOOLS + case 10: + theCatch.setItemStack(new ItemStack(Material.STONE_AXE, 1)); + break; + case 11: + theCatch.setItemStack(new ItemStack(Material.STONE_PICKAXE, 1)); + break; + case 12: + theCatch.setItemStack(new ItemStack(Material.STONE_SWORD, 1)); + break; + case 13: + theCatch.setItemStack(new ItemStack(Material.STONE_HOE, 1)); + break; + case 14: + theCatch.setItemStack(new ItemStack(Material.STONE_SPADE, 1)); + break; + } + //Change durability to random value + theCatch.getItemStack().setDurability((short) (Math.random() * Fishing.getItemMaxDurability(theCatch.getItemStack().getType()))); //Change the damage value + + } + + private static void getFishingResultsTier2(Player player, PlayerFishEvent event) + { + + } + + private static void getFishingResultsTier3(Player player, PlayerFishEvent event) + { + + } + + private static void getFishingResultsTier4(Player player, PlayerFishEvent event) + { + + } + + private static void getFishingResultsTier5(Player player, PlayerFishEvent event) + { + + } +} diff --git a/src/com/gmail/nossr50/skills/Mining.java b/src/com/gmail/nossr50/skills/Mining.java index 0469d8197..6ec3e2004 100644 --- a/src/com/gmail/nossr50/skills/Mining.java +++ b/src/com/gmail/nossr50/skills/Mining.java @@ -16,6 +16,8 @@ */ package com.gmail.nossr50.skills; +import net.minecraft.server.Enchantment; + import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Statistic; @@ -254,7 +256,14 @@ public class Mining { PlayerProfile PP = Users.getProfile(player); if(LoadProperties.toolsLoseDurabilityFromAbilities) + { + if(player.getItemInHand().getEnchantments().containsKey(Enchantment.DURABILITY)) + { + + } m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss); + } + Location loc = block.getLocation(); Material mat = Material.getMaterial(block.getTypeId()); int xp = 0; diff --git a/src/com/gmail/nossr50/skills/Repair.java b/src/com/gmail/nossr50/skills/Repair.java index 446fbc7f1..9c209d470 100644 --- a/src/com/gmail/nossr50/skills/Repair.java +++ b/src/com/gmail/nossr50/skills/Repair.java @@ -19,6 +19,7 @@ package com.gmail.nossr50.skills; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.block.Block; +import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -55,6 +56,21 @@ public class Repair { short durabilityBefore = player.getItemInHand().getDurability(); short durabilityAfter = 0; short dif = 0; + + //Stuff for keeping enchants + Enchantment[] enchants = new Enchantment[is.getEnchantments().size()]; + int[] enchantsLevel = new int[is.getEnchantments().size()]; + + int pos = 0; + for(Enchantment x : is.getEnchantments().keySet()) + { + enchants[pos] = x; + enchantsLevel[pos] = is.getEnchantmentLevel(x); + pos++; + } + + System.out.println("[mcMMO] Enchantments stored!"); + if(block != null && mcPermissions.getInstance().repair(player)){ if(player.getItemInHand().getDurability() > 0 && player.getItemInHand().getAmount() < 2){ /* @@ -66,7 +82,9 @@ public class Repair { */ if(isDiamondArmor(is) && hasItem(player, rDiamond) && PP.getSkillLevel(SkillType.REPAIR) >= LoadProperties.repairdiamondlevel){ removeItem(player, rDiamond); + player.getItemInHand().setDurability(getRepairAmount(is, player)); + durabilityAfter = player.getItemInHand().getDurability(); dif = (short) (durabilityBefore - durabilityAfter); dif = (short) (dif * 6); //Boost XP @@ -81,7 +99,9 @@ public class Repair { * IRON ARMOR */ removeItem(player, rIron); - player.getItemInHand().setDurability(getRepairAmount(is, player)); + + player.getItemInHand().setDurability(getRepairAmount(is, player)); + durabilityAfter = player.getItemInHand().getDurability(); dif = (short) (durabilityBefore - durabilityAfter); dif = (short) (dif * 2); //Boost XP @@ -93,7 +113,9 @@ public class Repair { //GOLD ARMOR } else if (isGoldArmor(is) && hasItem(player, rGold)){ removeItem(player, rGold); + player.getItemInHand().setDurability(getRepairAmount(is, player)); + durabilityAfter = player.getItemInHand().getDurability(); dif = (short) (durabilityBefore - durabilityAfter); dif = (short) (dif * 4); //Boost XP of Gold to around Iron @@ -123,7 +145,9 @@ public class Repair { /* * Repair Durability and calculate dif */ - player.getItemInHand().setDurability(getRepairAmount(is, player)); + + player.getItemInHand().setDurability(getRepairAmount(is, player)); + durabilityAfter = player.getItemInHand().getDurability(); dif = (short) (durabilityBefore - durabilityAfter); if(m.isShovel(is)) @@ -141,7 +165,8 @@ public class Repair { /* * Repair Durability and calculate dif */ - player.getItemInHand().setDurability(getRepairAmount(is, player)); + player.getItemInHand().setDurability(getRepairAmount(is, player)); + durabilityAfter = player.getItemInHand().getDurability(); dif = (short) (durabilityBefore - durabilityAfter); if(m.isShovel(is)) @@ -160,6 +185,7 @@ public class Repair { * Repair Durability and calculate dif */ player.getItemInHand().setDurability(getRepairAmount(is, player)); + durabilityAfter = (short) (player.getItemInHand().getDurability()-getRepairAmount(is, player)); dif = (short) (durabilityBefore - durabilityAfter); if(m.isShovel(is)) @@ -178,6 +204,7 @@ public class Repair { * DIAMOND TOOLS */ player.getItemInHand().setDurability(getRepairAmount(is, player)); + removeItem(player, rDiamond); durabilityAfter = player.getItemInHand().getDurability(); dif = (short) (durabilityBefore - durabilityAfter); @@ -194,6 +221,7 @@ public class Repair { SpoutStuff.playRepairNoise(player); } else if(isGoldTools(is) && hasItem(player, rGold)){ player.getItemInHand().setDurability(getRepairAmount(is, player)); + removeItem(player, rGold); durabilityAfter = player.getItemInHand().getDurability(); dif = (short) (durabilityBefore - durabilityAfter); @@ -212,6 +240,15 @@ public class Repair { } else { needMoreVespeneGas(is, player); } + + //This will solve the issue with swords not repairing properly + if(is.getType() == Material.WOOD_SWORD || is.getType() == Material.STONE_SWORD || is.getType() == Material.IRON_SWORD || + is.getType() == Material.GOLD_SWORD || is.getType() == Material.DIAMOND_SWORD) + { + player.getItemInHand().getData().setData((byte)player.getItemInHand().getDurability()); + } + + player.sendMessage("Current Durability Value: "+player.getItemInHand().getDurability()); } } else { @@ -222,8 +259,113 @@ public class Repair { * GIVE SKILL IF THERE IS ENOUGH XP */ Skills.XpCheckSkill(SkillType.REPAIR, player); + addEnchants(player.getItemInHand(), enchants, enchantsLevel, PP, player); } } + public static int getArcaneForgingRank(PlayerProfile PP) + { + int rank = 0; + + if(PP.getSkillLevel(SkillType.REPAIR) >= 750) + { + rank = 4; + } else if (PP.getSkillLevel(SkillType.REPAIR) >= 500) + { + rank = 3; + } else if(PP.getSkillLevel(SkillType.REPAIR) >= 250) + { + rank = 2; + } else if (PP.getSkillLevel(SkillType.REPAIR) >= 100) + { + rank = 1; + } + return rank; + } + public static void addEnchants(ItemStack is, Enchantment[] enchants, int[] enchantsLvl, PlayerProfile PP, Player player) + { + if(is.getEnchantments().keySet().size() == 0) + return; + + int pos = 0; + int rank = getArcaneForgingRank(PP); + + if(rank == 0) + { + player.sendMessage(mcLocale.getString("Repair.LostEnchants")); + return; + } + + boolean failure = false, downgrade = false; + + for(Enchantment x : enchants) + { + if(x.canEnchantItem(is)) + { + if(Math.random() * 100 <= getEnchantChance(rank)) + { + if(enchantsLvl[pos] > 1) + { + if(Math.random() * 100 <= getDowngradeChance(rank)) + { + is.addEnchantment(x, enchantsLvl[pos]-1); + downgrade = true; + } else + { + is.addEnchantment(x, enchantsLvl[pos]); + } + } + else { + is.addEnchantment(x, enchantsLvl[pos]); + } + } else { + failure = true; + } + } + pos++; + } + + if(failure == false && downgrade == false) + { + player.sendMessage(mcLocale.getString("Repair.ArcanePerfect")); + } else { + if(failure == false) + player.sendMessage("Repair.ArcaneFailed"); + if(downgrade == false) + player.sendMessage("Repair.Downgraded"); + } + } + public static int getEnchantChance(int rank) + { + switch(rank) + { + case 4: + return 40; + case 3: + return 30; + case 2: + return 20; + case 1: + return 10; + default: + return 0; + } + } + public static int getDowngradeChance(int rank) + { + switch(rank) + { + case 4: + return 15; + case 3: + return 25; + case 2: + return 50; + case 1: + return 75; + default: + return 100; + } + } public static boolean isArmor(ItemStack is){ return is.getTypeId() == 306 || is.getTypeId() == 307 ||is.getTypeId() == 308 ||is.getTypeId() == 309 || is.getTypeId() == 310 ||is.getTypeId() == 311 ||is.getTypeId() == 312 ||is.getTypeId() == 313 || @@ -488,7 +630,7 @@ public class Repair { player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.GOLD+ nGold); } else if (is.getAmount() > 1) player.sendMessage(mcLocale.getString("Skills.StackedItems")); - } + } public static boolean checkPlayerProcRepair(Player player) { PlayerProfile PP = Users.getProfile(player); @@ -502,4 +644,4 @@ public class Repair { } return false; } -} +} \ No newline at end of file diff --git a/src/com/gmail/nossr50/spout/mmoHelper.java b/src/com/gmail/nossr50/spout/mmoHelper.java index 951ca4157..09a088b6a 100644 --- a/src/com/gmail/nossr50/spout/mmoHelper.java +++ b/src/com/gmail/nossr50/spout/mmoHelper.java @@ -226,7 +226,7 @@ public class mmoHelper } else { bar = (GenericLivingEntity)bars[index]; } - bar.setEntity(name, Party.getInstance().isPartyLeader(Bukkit.getServer().getPlayer(name), Users.getProfile(Bukkit.getServer().getPlayer(name)).getParty()) ? ChatColor.GREEN + "@" : ""); + bar.setEntity(name, Party.getInstance().isPartyLeader(name, Users.getProfile(Bukkit.getServer().getPlayer(name)).getParty()) ? ChatColor.GREEN + "@" : ""); //bar.setTargets(show_pets ? getPets(Bukkit.getServer().getPlayer(name)) : null); index++; } diff --git a/src/plugin.yml b/src/plugin.yml index 6224a0b2a..bedbbbe63 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: mcMMO main: com.gmail.nossr50.mcMMO -version: 1.1.17 +version: 1.2.00 WIP #1 softdepend: [Spout] author: nossr50 description: mcMMO takes core Minecraft game mechanics and expands them to add an extensive RPG experience, the goal of the project has always been a quality RPG experience. Everything in mcMMO is carefully thought out and is constantly improving. mcMMO adds eleven skills to train in and level in, while also offering a high level of customization for server admins. There are countless features, including custom sounds, graphical elements, and more added when running mcMMO in conjunction with Spout. I carefully read feedback and evaluate the mechanics of mcMMO in every update to provide an ever-evolving experience. @@ -196,8 +196,9 @@ permissions: mcmmo.skills.*: description: Implies all mcmmo.skills permissions. children: - mcmmo.skills.sorcery.*: true - mcmmo.skills.curative.*: true + mcmmo.skills.alchemy: true + mcmmo.skills.enchanting: true + mcmmo.skills.fishing: true mcmmo.skills.taming: true mcmmo.skills.mining: true mcmmo.skills.woodcutting: true @@ -209,30 +210,6 @@ permissions: mcmmo.skills.swords: true mcmmo.skills.axes: true mcmmo.skills.acrobatics: true - mcmmo.skills.sorcery.*: - description: Implies all mcmmo.skills.sorcery permissions. - children: - mcmmo.skills.sorcery: true - mcmmo.skills.sorcery.water: true - mcmmo.skills.sorcery.water.thunder: true - mcmmo.skills.curative.*: - description: Implies all mcmmo.skills.curative permissions. - children: - mcmmo.skills.curative: true - mcmmo.skills.curative.heal.other: true - mcmmo.skills.curative.heal.self: true - mcmmo.skills.sorcery: - description: - mcmmo.skills.sorcery.water: - description: - mcmmo.skills.sorcery.water.thunder: - description: - mcmmo.skills.curative: - description: - mcmmo.skills.curative.heal.other: - description: - mcmmo.skills.curative.heal.self: - description: mcmmo.skills.taming: description: mcmmo.skills.mining: