diff --git a/Changelog.txt b/Changelog.txt index 9c6895650..aa3731851 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -13,6 +13,7 @@ Version 2.2.0 You can now specify multiple repair-items for an item (such as specifying that a wooden sword can be repaired by all types of planks) Repair config has been rewritten and expanded to support much more complex settings Fixed a bug where salvage anvil noises wouldn't play for a player that lacked repair permissions nodes + Sharpened Claws now has settings to change its damage for PVE or PVP instead of a flat setting that applied to both Removed the following Repair/Salvage permissions mcmmo.ability.repair.stonerepair mcmmo.ability.repair.stringrepair @@ -196,8 +197,116 @@ Version 2.2.0 Added API method to grab the level cap of a skill by its PrimarySkillType ENUM definition Added API method to check if a skill was being level capped Added 'UndefinedSkillBehaviour' for trying to use a method that has no behaviour defined for the provided skill +Version 2.1.97 + Fixed a NPE that could occur if a pet participated in combat and its master's mcMMO data was not available + +Version 2.1.96 + Added the setting 'Skills.General.LimitBreak.AllowPVE' to advanced.yml to allow Limit Break damage bonus to apply in PVE again, defaults to false + Updated Limit Break locale strings + Fixed a few more places where 'Archaeology' was misspelled in the locale + Added the setting 'ExploitFix.PistonCheating' to experience.yml at the request of a user + Added a missing 's' to Nether_Bricks (thanks Sikatsu) in experience.yml + + NOTES: + The Skill Tooltips are a bit limited right now, in the future they will be more flexible. In order to reflect that Limit Break doesn't always work in PVE (now up to server settings) I added a crappy note to its hover window tip. I'll be fixing this in the future. + You shouldn't need to update you config entry for Nether_Bricks, I believe that file updates automatically (the old config system is a bit janky, some stuff updates, some other stuff doesn't.) + PistonCheating prevents blocks from being marked "natural" once they've been moved, we've never had an option for this before. + A discord user requested it, its a strange request but I added it anyways. + Of course, it defaults to "true" which prevents cheating with pistons. + +Version 2.1.95 + Added missing Chorus_Fruit & Chorus_Plant entries to Herbalism's Bonus Drops in config.yml (See notes) + Limit Break now does dramatically less damage to players with lower grades of armor + Limit Break damage bonuses now only apply to Players + Updated in game text to reflect changes to Limit Break + Fixed a bug where opponents used your stats instead of their own to activate Iron Grip + Fixed a bug preventing Wandering Traders from granting XP + Fixed a bug that prevented Chorus Tree's from giving full XP if you broke anything other than the bottom block + Fixed a bug which could cause Large Fern's to reward less XP + Fixed a bug where certain herbalism crops could have fewer than intended bonus drops + Fixed a bug involving Ender Pearl and Acrobatics + Added some protection to Acrobatics to prevent gaining too much XP in one Roll. + Added 'Carrots, Cocoa, Potatoes, Wheat, Beetroots, Nether_Wart' to Herbalism in experience.yml (See notes) + Removed the _Ripe entries from experience.yml (no longer used) + Updated locale string 'Swords.SubSkill.SwordsLimitBreak.Description' & 'Swords.SubSkill.SwordsLimitBreak.Stat' + Added missing 'Chorus_Flower' entry to herbalism in experience.yml + Added some debug messages about XP gains if you are in debug mode + Added some debug messages for Acrobatics if you are in debug mode + Added some debug messages for Herbalism if you are in debug mode + + NOTES: + Add 'Chorus_Fruit' and 'Chorus_Plant' under Bonus_Drops.Herbalism in config.yml or you will not be getting double drops for Chorus Fruit. + You shouldn't need to add "Chorus_Flower, Carrots, Cocoa, Potatoes, Wheat, Beetroots, Nether_Wart" to your experience file, it seems that config file updates automatically for missing entries. + +Version 2.1.94 + 2 new devs have joined the mcMMO team (electronicboy, kashike), bringing the active dev team to 3 including myself! Strings relating to authors of mcMMO have been updated to reflect this + Fixed a bug where 2 people using Tree Feller could result in the tree being rejected for being too big + New command /mmodebug (or /mcmmodebugmode) - Prints useful information when players punch blocks while they are in debug mode + mcMMO no longer prints debug information when you attack stuff with the debug stick, use the new command (/mmodebug) instead + Added locale string 'mcMMO.Description.FormerDevs' + Added locale string 'mcMMO.Template.Prefix' + Added locale string 'Commands.Mmodebug.Toggle' + Added locale string 'Commands.Description.mmodebug' + Tweaked locale string 'mcMMO.Description' + Updated Japanese locale (thanks snake) + Updated hu_HU locale (thanks andris155) + +Version 2.1.93 + Fixed a bug where players would be told they could not breed summoned animals when the animals weren't summoned (bug didn't actually do anything besides send you a message) + +Version 2.1.92 + Call Of The Wild (COTW) no longer cares if entities of the same type are nearby when attempting to summon a new entity + Fixed a bug where COTW summon limit was global instead of per player + If you are playing in 1.14 mcMMO will now summon cats instead of ocelots + The default summon limit for COTW is now per player instead of global which is how it should be, for wolves this defaults to 2, for other entities it defaults to 1 + The COTW setting named Summon_Max_Amount in config.yml has been renamed to Per_Player_Limit + By default players are no longer allowed to breed COTW summoned animals with other animals, you can turn this off (see the notes) + If a player tries to breed animals with a COTW animal and the server settings prevent this, they are informed via a message that it is not allowed + If the COTW summon has a lifespan, players are now informed about this lifespan when the entity is first summoned + COTW entities now send the player a message when they die, time out, or get removed through other means + COTW summons now have their name prefixed with some colored text to to make it easier to identify them. + COTW summons now despawn if their owner logs out + There is now a small 150ms window in which you cannot summon an entity via COTW to prevent accidentally summoning extra entities + COTW Horses, Cats, and Wolves now always spawn in as adults + Changed the sound effect for COTW (Fireworks -> Pop) + Most COTW messages have been tweaked and new COTW messages have been added + Added new setting to experience.yml 'ExploitFix.COTWBreeding' - Prevents breeding with COTW summoned entities when set to true, defaults to true + Removed the 'mcmmo.ability.taming.callofthewild.renamepets' permission node as it is seen as unnecessary + + Removed locale strings + Taming.Summon.Fail.Ocelot + Taming.Summon.Fail.Wolf + Taming.Summon.Fail.Horse + Taming.Summon.Fail.TooMany + Taming.Summon.Lifespan + Added new locale strings + Taming.Summon.COTW.NeedMoreItems + Taming.Summon.COTW.BreedingDisallowed + Taming.Summon.COTW.Success.WithLifespan + Taming.Summon.COTW.Success.WithoutLifespan + Taming.Summon.COTW.Limit + Taming.Summon.COTW.TimeExpired + Tweaked locale string + Taming.Summon.Name.Format + + NOTES: + I plan to rework Call of The Wild (COTW) significantly in the upcoming content patch, until then I have made several tweaks to it. + + COTW Summoning Requirement Changes + It is intentional that you are not supposed to be able to COTW summon something that you already have tamed, but mcMMO was not checking this properly. + So previous to this patch, if you tried to summon a wolf and wolves were nearby, it would fail. This is not intentional behaviour and was a bug. + The correct behaviour is that if you try to summon a wolf and you already have wolves, it should fail. + I was fixing this bug when it occurred to me, why do we even care if nearby tamed wolves owned by you exist if you are trying to summon a temporary one? + As a result of this train of thought, I have removed this restriction on COTW and several other tweaks have been made as a result of this line of thinking. + There was also an issue involving how many COTW entities could be out at once, for some reason the limit was applied globally and defaulted to 10, so if 10 players had COTW entities out no one else would be able to summon anything. I have fixed this. + You can set the lifespan to 0 in the config to make it so that COTW entities last until a server restart or the player logs out. + + COTW Breeding Change + It was never intentional for COTW summoned entities to be breedable, by default they will not be. You can change this by setting 'ExploitFix.COTWBreeding' to false in experience.yml + Version 2.1.91 mcMMO is now more compatible with plugins that spawn arrows in unexpected ways, this fixes some NPE in mcMMO when using certain plugins + Fixed a bug where Unarmed was using the same CD timer for every player in the server (thanks slop_me) Version 2.1.90 Salvaged items now travel much slower towards the player diff --git a/README.md b/README.md index dc8f66c28..64ac62516 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ # mcMMO -## The RPG lovers mod +## The #1 RPG Mod for Minecraft ## Website I'm working on a brand new website for mcMMO You can check it out here http://www.mcmmo.org -Spigot Resource: https://www.spigotmc.org/resources/official-mcmmo-original-author-returns.64348/ + +Spigot Resource: https://spigot.mcmmo.org I plan to post links to our new wiki (its still under development), downloads, and dev blogs there. - ### Builds Currently, you can obtain our builds via the Spigot resource page: http://spigot.mcmmo.org @@ -17,16 +17,16 @@ Currently, you can obtain our builds via the Spigot resource page: http://spigot The goal of mcMMO is to take core Minecraft game mechanics and expand them into an extensive and quality RPG experience. Everything in mcMMO has been carefully thought out and is constantly being improved upon. Currently, mcMMO adds fourteen unique skills to train and level in. Each of these skills is highly customizable through our configuration files, allowing server admins to tweak mcMMO to best suit the needs of his or her server. Know that the mcMMO team is dedicated to providing an ever-evolving experience, and that we carefully read all feedback and bug reports in order to evaluate and balance the mechanics of mcMMO in every update. ## About the Team -In December 2018 nossr50 returned as project lead for mcMMO once again to develop and improve mcMMO. -The mcMMO team currently has two members, nossr50 (lead) and t00thpick1 (classic maintainer). -mcMMO is currently developed almost entirely by nossr50, many thanks go out to the many developers who have worked on the project over the years. - -### Project Lead & Founder +In December 2018, the original author and creator of mcMMO (nossr50) returned and took over the role of project lead once again, to develop and improve mcMMO. +#### Project Lead & Founder [![nossr50](http://www.gravatar.com/avatar/f2ee41eedfd645fb4a3a2c8f6cb1b18c.png)](https://github.com/nossr50) -Other mcMMO Projects +#### mcMMO Devs +[![nossr50](http://www.gravatar.com/avatar/f2ee41eedfd645fb4a3a2c8f6cb1b18c.png)](https://github.com/nossr50) +[![kashike](https://secure.gravatar.com/avatar/b5e86d6d443b957fd5cdee55501f3799.png)](https://github.com/kashike) +[![electronicboy](https://secure.gravatar.com/avatar/44759c38d311ce09596de6a2d5b88036.png)](https://github.com/electronicboy) -### Classic Maintainer +#### Classic Maintainer [![t00thpick1](http://www.gravatar.com/avatar/ee23c7794a0c40120c3474287c7bce06.png)](https://github.com/t00thpick1) ## Former Team Members @@ -50,10 +50,13 @@ mcMMO uses Maven 3 to manage dependencies, packaging, and shading of necessary c The typical command used to build mcMMO is: `mvn clean package install` Required Libraries: -* Bukkit +* Spigot * JUnit * WorldGuard 7 * bStats Bukkit -http://spigot.mcmmo.org for more up to date information. +https://spigot.mcmmo.org for more up to date information. + +Resource Page + https://www.spigotmc.org/resources/official-mcmmo-original-author-returns.64348/ diff --git a/pom.xml b/pom.xml index a00faf891..5256fc255 100755 --- a/pom.xml +++ b/pom.xml @@ -217,7 +217,7 @@ org.spigotmc spigot - 1.13.2-R0.1-SNAPSHOT + 1.14.3-R0.1-SNAPSHOT diff --git a/src/main/java/com/gmail/nossr50/commands/AbilityToggleCommand.java b/src/main/java/com/gmail/nossr50/commands/AbilityToggleCommand.java index 1029a200d..747d1e95f 100644 --- a/src/main/java/com/gmail/nossr50/commands/AbilityToggleCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/AbilityToggleCommand.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import org.bukkit.command.CommandSender; public class AbilityToggleCommand extends ToggleCommand { @@ -13,12 +12,12 @@ public class AbilityToggleCommand extends ToggleCommand { @Override protected boolean hasOtherPermission(CommandSender sender) { - return Permissions.mcabilityOthers(sender); + return pluginRef.getPermissionTools().mcabilityOthers(sender); } @Override protected boolean hasSelfPermission(CommandSender sender) { - return Permissions.mcability(sender); + return pluginRef.getPermissionTools().mcability(sender); } @Override diff --git a/src/main/java/com/gmail/nossr50/commands/ExperienceRateCommand.java b/src/main/java/com/gmail/nossr50/commands/ExperienceRateCommand.java index c9e7ebdef..702de81fd 100644 --- a/src/main/java/com/gmail/nossr50/commands/ExperienceRateCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/ExperienceRateCommand.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.datatypes.notifications.SensitiveCommandType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.StringUtils; import com.google.common.collect.ImmutableList; import org.bukkit.ChatColor; @@ -30,7 +29,7 @@ public class ExperienceRateCommand implements TabExecutor { return false; } - if (!Permissions.xprateReset(sender)) { + if (!pluginRef.getPermissionTools().xprateReset(sender)) { sender.sendMessage(command.getPermissionMessage()); return true; } @@ -63,7 +62,7 @@ public class ExperienceRateCommand implements TabExecutor { return true; } - if (!Permissions.xprateSet(sender)) { + if (!pluginRef.getPermissionTools().xprateSet(sender)) { sender.sendMessage(command.getPermissionMessage()); return true; } diff --git a/src/main/java/com/gmail/nossr50/commands/GodModeCommand.java b/src/main/java/com/gmail/nossr50/commands/GodModeCommand.java index 0d8de4ada..5fe16e2c4 100644 --- a/src/main/java/com/gmail/nossr50/commands/GodModeCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/GodModeCommand.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import org.bukkit.command.CommandSender; public class GodModeCommand extends ToggleCommand { @@ -13,12 +12,12 @@ public class GodModeCommand extends ToggleCommand { @Override protected boolean hasOtherPermission(CommandSender sender) { - return Permissions.mcgodOthers(sender); + return pluginRef.getPermissionTools().mcgodOthers(sender); } @Override protected boolean hasSelfPermission(CommandSender sender) { - return Permissions.mcgod(sender); + return pluginRef.getPermissionTools().mcgod(sender); } @Override diff --git a/src/main/java/com/gmail/nossr50/commands/McMMOCommand.java b/src/main/java/com/gmail/nossr50/commands/McMMOCommand.java index 3c1c1dec4..0ddeee4c4 100644 --- a/src/main/java/com/gmail/nossr50/commands/McMMOCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/McMMOCommand.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.commands.party.PartySubcommandType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -20,7 +19,7 @@ public class McMMOCommand implements CommandExecutor { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { switch (args.length) { case 0: - if (!Permissions.mcmmoDescription(sender)) { + if (!pluginRef.getPermissionTools().mcmmoDescription(sender)) { sender.sendMessage(command.getPermissionMessage()); return true; } @@ -28,6 +27,7 @@ public class McMMOCommand implements CommandExecutor { String description = pluginRef.getLocaleManager().getString("mcMMO.Description"); String[] mcSplit = description.split(","); sender.sendMessage(mcSplit); + sender.sendMessage(LocaleLoader.getString("mcMMO.Description.FormerDevs")); if (pluginRef.getConfigManager().getConfigAds().isShowDonationInfo()) { sender.sendMessage(pluginRef.getLocaleManager().getString("MOTD.Donate")); @@ -41,7 +41,7 @@ public class McMMOCommand implements CommandExecutor { case 1: if (args[0].equalsIgnoreCase("?") || args[0].equalsIgnoreCase("help") || args[0].equalsIgnoreCase("commands")) { - if (!Permissions.mcmmoHelp(sender)) { + if (!pluginRef.getPermissionTools().mcmmoHelp(sender)) { sender.sendMessage(command.getPermissionMessage()); return true; } @@ -63,54 +63,54 @@ public class McMMOCommand implements CommandExecutor { sender.sendMessage(ChatColor.DARK_AQUA + " /" + pluginRef.getLocaleManager().getString("Commands.SkillInfo")); sender.sendMessage(ChatColor.DARK_AQUA + " /mctop " + pluginRef.getLocaleManager().getString("Commands.Leaderboards")); - if (Permissions.inspect(sender)) { + if (pluginRef.getPermissionTools().inspect(sender)) { sender.sendMessage(ChatColor.DARK_AQUA + " /inspect " + pluginRef.getLocaleManager().getString("Commands.Inspect")); } - if (Permissions.mcability(sender)) { + if (pluginRef.getPermissionTools().mcability(sender)) { sender.sendMessage(ChatColor.DARK_AQUA + " /mcability " + pluginRef.getLocaleManager().getString("Commands.ToggleAbility")); } } private void displayOtherCommands(CommandSender sender) { //Don't show them this category if they have none of the permissions - if (!Permissions.skillreset(sender) && !Permissions.mmoedit(sender) && !Permissions.adminChat(sender) && !Permissions.mcgod(sender)) + if (!pluginRef.getPermissionTools().skillreset(sender) && !pluginRef.getPermissionTools().mmoedit(sender) && !pluginRef.getPermissionTools().adminChat(sender) && !pluginRef.getPermissionTools().mcgod(sender)) return; sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Other")); - if (Permissions.skillreset(sender)) { + if (pluginRef.getPermissionTools().skillreset(sender)) { sender.sendMessage(ChatColor.DARK_AQUA + " /skillreset " + pluginRef.getLocaleManager().getString("Commands.Reset")); } - if (Permissions.mmoedit(sender)) { + if (pluginRef.getPermissionTools().mmoedit(sender)) { sender.sendMessage(ChatColor.DARK_AQUA + " /mmoedit " + pluginRef.getLocaleManager().getString("Commands.mmoedit")); } - if (Permissions.adminChat(sender)) { + if (pluginRef.getPermissionTools().adminChat(sender)) { sender.sendMessage(ChatColor.DARK_AQUA + " /adminchat " + pluginRef.getLocaleManager().getString("Commands.AdminToggle")); } - if (Permissions.mcgod(sender)) { + if (pluginRef.getPermissionTools().mcgod(sender)) { sender.sendMessage(ChatColor.DARK_AQUA + " /mcgod " + pluginRef.getLocaleManager().getString("Commands.mcgod")); } } private void displayPartyCommands(CommandSender sender) { - if (Permissions.party(sender)) { + if (pluginRef.getPermissionTools().party(sender)) { sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Commands")); sender.sendMessage(ChatColor.DARK_AQUA + " /party create <" + pluginRef.getLocaleManager().getString("Commands.Usage.PartyName") + "> " + pluginRef.getLocaleManager().getString("Commands.Party1")); sender.sendMessage(ChatColor.DARK_AQUA + " /party join <" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "> " + pluginRef.getLocaleManager().getString("Commands.Party2")); sender.sendMessage(ChatColor.DARK_AQUA + " /party quit " + pluginRef.getLocaleManager().getString("Commands.Party.Quit")); - if (Permissions.partyChat(sender)) { + if (pluginRef.getPermissionTools().partyChat(sender)) { sender.sendMessage(ChatColor.DARK_AQUA + " /party chat " + pluginRef.getLocaleManager().getString("Commands.Party.Toggle")); } sender.sendMessage(ChatColor.DARK_AQUA + " /party invite <" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "> " + pluginRef.getLocaleManager().getString("Commands.Party.Invite")); sender.sendMessage(ChatColor.DARK_AQUA + " /party accept " + pluginRef.getLocaleManager().getString("Commands.Party.Accept")); - if (Permissions.partySubcommand(sender, PartySubcommandType.TELEPORT)) { + if (pluginRef.getPermissionTools().partySubcommand(sender, PartySubcommandType.TELEPORT)) { sender.sendMessage(ChatColor.DARK_AQUA + " /party teleport <" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "> " + pluginRef.getLocaleManager().getString("Commands.Party.Teleport")); } } diff --git a/src/main/java/com/gmail/nossr50/commands/RefreshCooldownsCommand.java b/src/main/java/com/gmail/nossr50/commands/RefreshCooldownsCommand.java index e50981a8f..581f9afeb 100644 --- a/src/main/java/com/gmail/nossr50/commands/RefreshCooldownsCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/RefreshCooldownsCommand.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import org.bukkit.command.CommandSender; public class RefreshCooldownsCommand extends ToggleCommand { @@ -13,12 +12,12 @@ public class RefreshCooldownsCommand extends ToggleCommand { @Override protected boolean hasOtherPermission(CommandSender sender) { - return Permissions.mcrefreshOthers(sender); + return pluginRef.getPermissionTools().mcrefreshOthers(sender); } @Override protected boolean hasSelfPermission(CommandSender sender) { - return Permissions.mcrefresh(sender); + return pluginRef.getPermissionTools().mcrefresh(sender); } @Override diff --git a/src/main/java/com/gmail/nossr50/commands/admin/PlayerDebugCommand.java b/src/main/java/com/gmail/nossr50/commands/admin/PlayerDebugCommand.java new file mode 100644 index 000000000..e5b4f47e3 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/commands/admin/PlayerDebugCommand.java @@ -0,0 +1,24 @@ +package com.gmail.nossr50.commands.admin; + +import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.util.player.UserManager; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +public class PlayerDebugCommand implements CommandExecutor { + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if(sender instanceof Player) { + McMMOPlayer mcMMOPlayer = UserManager.getPlayer((Player) sender); + mcMMOPlayer.toggleDebugMode(); //Toggle debug mode + pluginRef.getNotificationManager().sendPlayerInformationChatOnlyPrefixed(mcMMOPlayer.getPlayer(), "Commands.Mmodebug.Toggle", String.valueOf(mcMMOPlayer.isDebugMode())); + return true; + } else { + return false; + } + } + +} diff --git a/src/main/java/com/gmail/nossr50/commands/admin/ReloadLocaleCommand.java b/src/main/java/com/gmail/nossr50/commands/admin/ReloadLocaleCommand.java index ee29cbe5f..206378d78 100644 --- a/src/main/java/com/gmail/nossr50/commands/admin/ReloadLocaleCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/admin/ReloadLocaleCommand.java @@ -1,7 +1,6 @@ package com.gmail.nossr50.commands.admin; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -20,7 +19,7 @@ public final class ReloadLocaleCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (args.length == 0) { - if (!Permissions.reloadlocale(sender)) { + if (!pluginRef.getPermissionTools().reloadlocale(sender)) { if(command.getPermissionMessage() != null) sender.sendMessage(command.getPermissionMessage()); diff --git a/src/main/java/com/gmail/nossr50/commands/chat/ChatSpyCommand.java b/src/main/java/com/gmail/nossr50/commands/chat/ChatSpyCommand.java index c6db79d73..cce15f5f1 100644 --- a/src/main/java/com/gmail/nossr50/commands/chat/ChatSpyCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/chat/ChatSpyCommand.java @@ -3,7 +3,6 @@ package com.gmail.nossr50.commands.chat; import com.gmail.nossr50.commands.ToggleCommand; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import org.bukkit.command.CommandSender; public class ChatSpyCommand extends ToggleCommand { @@ -14,12 +13,12 @@ public class ChatSpyCommand extends ToggleCommand { @Override protected boolean hasOtherPermission(CommandSender sender) { - return Permissions.adminChatSpyOthers(sender); + return pluginRef.getPermissionTools().adminChatSpyOthers(sender); } @Override protected boolean hasSelfPermission(CommandSender sender) { - return Permissions.adminChatSpy(sender); + return pluginRef.getPermissionTools().adminChatSpy(sender); } @Override diff --git a/src/main/java/com/gmail/nossr50/commands/experience/AddLevelsCommand.java b/src/main/java/com/gmail/nossr50/commands/experience/AddLevelsCommand.java index 50ebe5616..0ae11eaaa 100644 --- a/src/main/java/com/gmail/nossr50/commands/experience/AddLevelsCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/experience/AddLevelsCommand.java @@ -4,7 +4,6 @@ import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.player.PlayerProfile; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -16,12 +15,12 @@ public class AddLevelsCommand extends ExperienceCommand { @Override protected boolean permissionsCheckSelf(CommandSender sender) { - return Permissions.addlevels(sender); + return pluginRef.getPermissionTools().addlevels(sender); } @Override protected boolean permissionsCheckOthers(CommandSender sender) { - return Permissions.addlevelsOthers(sender); + return pluginRef.getPermissionTools().addlevelsOthers(sender); } @Override diff --git a/src/main/java/com/gmail/nossr50/commands/experience/AddXPCommand.java b/src/main/java/com/gmail/nossr50/commands/experience/AddXPCommand.java index 1b787c080..e8359987f 100644 --- a/src/main/java/com/gmail/nossr50/commands/experience/AddXPCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/experience/AddXPCommand.java @@ -5,7 +5,6 @@ import com.gmail.nossr50.datatypes.experience.XPGainSource; import com.gmail.nossr50.datatypes.player.PlayerProfile; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -17,12 +16,12 @@ public class AddXPCommand extends ExperienceCommand { @Override protected boolean permissionsCheckSelf(CommandSender sender) { - return Permissions.addxp(sender); + return pluginRef.getPermissionTools().addxp(sender); } @Override protected boolean permissionsCheckOthers(CommandSender sender) { - return Permissions.addxpOthers(sender); + return pluginRef.getPermissionTools().addxpOthers(sender); } @Override diff --git a/src/main/java/com/gmail/nossr50/commands/experience/SkillEditCommand.java b/src/main/java/com/gmail/nossr50/commands/experience/SkillEditCommand.java index 5f9e673d5..8fe5b484a 100644 --- a/src/main/java/com/gmail/nossr50/commands/experience/SkillEditCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/experience/SkillEditCommand.java @@ -4,7 +4,6 @@ import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.player.PlayerProfile; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -15,12 +14,12 @@ public class SkillEditCommand extends ExperienceCommand { @Override protected boolean permissionsCheckSelf(CommandSender sender) { - return Permissions.mmoedit(sender); + return pluginRef.getPermissionTools().mmoedit(sender); } @Override protected boolean permissionsCheckOthers(CommandSender sender) { - return Permissions.mmoeditOthers(sender); + return pluginRef.getPermissionTools().mmoeditOthers(sender); } @Override diff --git a/src/main/java/com/gmail/nossr50/commands/experience/SkillResetCommand.java b/src/main/java/com/gmail/nossr50/commands/experience/SkillResetCommand.java index 0d4f8ab9d..92ce08b61 100644 --- a/src/main/java/com/gmail/nossr50/commands/experience/SkillResetCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/experience/SkillResetCommand.java @@ -5,7 +5,6 @@ import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.PlayerProfile; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import com.google.common.collect.ImmutableList; import org.bukkit.OfflinePlayer; import org.bukkit.command.Command; @@ -138,11 +137,11 @@ public class SkillResetCommand implements TabExecutor { } protected boolean permissionsCheckSelf(CommandSender sender) { - return Permissions.skillreset(sender); + return pluginRef.getPermissionTools().skillreset(sender); } protected boolean permissionsCheckOthers(CommandSender sender) { - return Permissions.skillresetOthers(sender); + return pluginRef.getPermissionTools().skillresetOthers(sender); } protected void handlePlayerMessageAll(Player player) { diff --git a/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java b/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java index eba92a875..c8de01ee1 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java @@ -7,7 +7,6 @@ import com.gmail.nossr50.commands.party.teleport.PtpCommand; import com.gmail.nossr50.datatypes.party.Party; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -95,7 +94,7 @@ public class PartyCommand implements TabExecutor { return true; } - if (!Permissions.party(sender)) { + if (!pluginRef.getPermissionTools().party(sender)) { sender.sendMessage(command.getPermissionMessage()); return true; } @@ -129,7 +128,7 @@ public class PartyCommand implements TabExecutor { } // Can't use this for lock/unlock since they're handled by the same command - if (subcommand != PartySubcommandType.LOCK && subcommand != PartySubcommandType.UNLOCK && !Permissions.partySubcommand(sender, subcommand)) { + if (subcommand != PartySubcommandType.LOCK && subcommand != PartySubcommandType.UNLOCK && !pluginRef.getPermissionTools().partySubcommand(sender, subcommand)) { sender.sendMessage(command.getPermissionMessage()); return true; } diff --git a/src/main/java/com/gmail/nossr50/commands/party/PartyLockCommand.java b/src/main/java/com/gmail/nossr50/commands/party/PartyLockCommand.java index 5924af9c8..b2994e3d4 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/PartyLockCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/PartyLockCommand.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.datatypes.party.Party; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -63,7 +62,7 @@ public class PartyLockCommand implements CommandExecutor { Party party = pluginRef.getUserManager().getPlayer((Player) sender).getParty(); - if (!Permissions.partySubcommand(sender, lock ? PartySubcommandType.LOCK : PartySubcommandType.UNLOCK)) { + if (!pluginRef.getPermissionTools().partySubcommand(sender, lock ? PartySubcommandType.LOCK : PartySubcommandType.UNLOCK)) { sender.sendMessage(pluginRef.getLocaleManager().getString("mcMMO.NoPermission")); return; } diff --git a/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptAnyCommand.java b/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptAnyCommand.java index be6f8108d..349a3fd6c 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptAnyCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptAnyCommand.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.commands.party.teleport; import com.gmail.nossr50.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -16,7 +15,7 @@ public class PtpAcceptAnyCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!Permissions.partyTeleportAcceptAll(sender)) { + if (!pluginRef.getPermissionTools().partyTeleportAcceptAll(sender)) { sender.sendMessage(command.getPermissionMessage()); return true; } diff --git a/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java b/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java index 9794aadd9..2c52b1c89 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.commands.party.teleport; import com.gmail.nossr50.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import org.bukkit.World; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -19,7 +18,7 @@ public class PtpAcceptCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!Permissions.partyTeleportAccept(sender)) { + if (!pluginRef.getPermissionTools().partyTeleportAccept(sender)) { sender.sendMessage(command.getPermissionMessage()); return true; } @@ -54,11 +53,11 @@ public class PtpAcceptCommand implements CommandExecutor { World targetWorld = target.getWorld(); World playerWorld = player.getWorld(); - if (!Permissions.partyTeleportAllWorlds(target)) { - if (!Permissions.partyTeleportWorld(target, targetWorld)) { + if (!pluginRef.getPermissionTools().partyTeleportAllWorlds(target)) { + if (!pluginRef.getPermissionTools().partyTeleportWorld(target, targetWorld)) { target.sendMessage(pluginRef.getLocaleManager().getString("Commands.ptp.NoWorldPermissions", targetWorld.getName())); return true; - } else if (targetWorld != playerWorld && !Permissions.partyTeleportWorld(target, playerWorld)) { + } else if (targetWorld != playerWorld && !pluginRef.getPermissionTools().partyTeleportWorld(target, playerWorld)) { target.sendMessage(pluginRef.getLocaleManager().getString("Commands.ptp.NoWorldPermissions", playerWorld.getName())); return true; } diff --git a/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java b/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java index d67104ddc..84c47c031 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java @@ -7,7 +7,6 @@ import com.gmail.nossr50.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.worldguard.WorldGuardUtils; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; @@ -102,7 +101,7 @@ public class PtpCommand implements TabExecutor { return ptpAcceptCommand.onCommand(sender, command, label, args); } - if (!Permissions.partyTeleportSend(sender)) { + if (!pluginRef.getPermissionTools().partyTeleportSend(sender)) { sender.sendMessage(command.getPermissionMessage()); return true; } diff --git a/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpToggleCommand.java b/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpToggleCommand.java index da7ede6a6..b2b325143 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpToggleCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpToggleCommand.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.commands.party.teleport; import com.gmail.nossr50.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -17,7 +16,7 @@ public class PtpToggleCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!Permissions.partyTeleportToggle(sender)) { + if (!pluginRef.getPermissionTools().partyTeleportToggle(sender)) { sender.sendMessage(command.getPermissionMessage()); return true; } diff --git a/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java b/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java index 8c4f67683..8592dd970 100644 --- a/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java @@ -4,7 +4,6 @@ import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.PlayerProfile; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -68,11 +67,11 @@ public class InspectCommand implements TabExecutor { } else { Player target = mcMMOPlayer.getPlayer(); - if (pluginRef.getCommandTools().hidden(sender, target, Permissions.inspectHidden(sender))) { + if (pluginRef.getCommandTools().hidden(sender, target, pluginRef.getPermissionTools().inspectHidden(sender))) { sender.sendMessage(pluginRef.getLocaleManager().getString("Inspect.Offline")); return true; } - else if (pluginRef.getCommandTools().tooFar(sender, target, Permissions.inspectFar(sender))) { + else if (pluginRef.getCommandTools().tooFar(sender, target, pluginRef.getPermissionTools().inspectFar(sender))) { return true; } diff --git a/src/main/java/com/gmail/nossr50/commands/player/LeaderboardCommand.java b/src/main/java/com/gmail/nossr50/commands/player/LeaderboardCommand.java index 8dab345ca..302b8788f 100644 --- a/src/main/java/com/gmail/nossr50/commands/player/LeaderboardCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/player/LeaderboardCommand.java @@ -5,7 +5,6 @@ import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.commands.LeaderboardsCommandAsyncTask; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.StringUtils; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; @@ -80,7 +79,7 @@ public class LeaderboardCommand implements TabExecutor { } private void display(int page, PrimarySkillType skill, CommandSender sender, Command command) { - if (skill != null && !Permissions.mctop(sender, skill)) { + if (skill != null && !pluginRef.getPermissionTools().mctop(sender, skill)) { sender.sendMessage(command.getPermissionMessage()); return; } diff --git a/src/main/java/com/gmail/nossr50/commands/player/RankCommand.java b/src/main/java/com/gmail/nossr50/commands/player/RankCommand.java index a8a1aeecc..a01fa1c11 100644 --- a/src/main/java/com/gmail/nossr50/commands/player/RankCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/player/RankCommand.java @@ -4,7 +4,6 @@ import com.gmail.nossr50.core.MetadataConstants; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.commands.RankCommandAsyncTask; -import com.gmail.nossr50.util.Permissions; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -32,7 +31,7 @@ public class RankCommand implements TabExecutor { return true; } - if (!Permissions.mcrank(sender)) { + if (!pluginRef.getPermissionTools().mcrank(sender)) { sender.sendMessage(command.getPermissionMessage()); return true; } @@ -46,7 +45,7 @@ public class RankCommand implements TabExecutor { return true; case 1: - if (!Permissions.mcrankOthers(sender)) { + if (!pluginRef.getPermissionTools().mcrankOthers(sender)) { sender.sendMessage(command.getPermissionMessage()); return true; } @@ -62,7 +61,7 @@ public class RankCommand implements TabExecutor { Player player = mcMMOPlayer.getPlayer(); playerName = player.getName(); - if (pluginRef.getCommandTools().tooFar(sender, player, Permissions.mcrankFar(sender))) { + if (pluginRef.getCommandTools().tooFar(sender, player, pluginRef.getPermissionTools().mcrankFar(sender))) { return true; } } diff --git a/src/main/java/com/gmail/nossr50/commands/server/ReloadPluginCommand.java b/src/main/java/com/gmail/nossr50/commands/server/ReloadPluginCommand.java index 00ada34d4..1b823e209 100644 --- a/src/main/java/com/gmail/nossr50/commands/server/ReloadPluginCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/server/ReloadPluginCommand.java @@ -1,7 +1,6 @@ package com.gmail.nossr50.commands.server; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import org.bukkit.Bukkit; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -20,7 +19,7 @@ public class ReloadPluginCommand implements CommandExecutor { @Override public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) { if (sender instanceof Player) { - if (!Permissions.reload(sender)) + if (!pluginRef.getPermissionTools().reload(sender)) return false; } diff --git a/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java index dddde2544..a36ae5ae3 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java @@ -74,7 +74,11 @@ public class ArcheryCommand extends SkillCommand { if (canUseSubskill(player, SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK)) { messages.add(getStatMessage(SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK, +<<<<<<< HEAD String.valueOf(pluginRef.getCombatTools().getLimitBreakDamage(player, SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK)))); +======= + String.valueOf(CombatUtils.getLimitBreakDamageAgainstQuality(player, SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK, 1000)))); +>>>>>>> 308e3a4b1f46e9e3de28d6d540dd055a540ed4d5 } return messages; diff --git a/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java index fa349c5bc..c560545b0 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java @@ -4,7 +4,6 @@ import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.axes.Axes; -import com.gmail.nossr50.util.Permissions; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; @@ -58,7 +57,7 @@ public class AxesCommand extends SkillCommand { @Override protected void permissionsCheck(Player player) { - canSkullSplitter = Permissions.skullSplitter(player) && pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.AXES_SKULL_SPLITTER); + canSkullSplitter = pluginRef.getPermissionTools().skullSplitter(player) && pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.AXES_SKULL_SPLITTER); canCritical = canUseSubskill(player, SubSkillType.AXES_CRITICAL_STRIKES); canAxeMastery = canUseSubskill(player, SubSkillType.AXES_AXE_MASTERY); canImpact = canUseSubskill(player, SubSkillType.AXES_ARMOR_IMPACT); @@ -93,7 +92,11 @@ public class AxesCommand extends SkillCommand { if (canUseSubskill(player, SubSkillType.AXES_AXES_LIMIT_BREAK)) { messages.add(getStatMessage(SubSkillType.AXES_AXES_LIMIT_BREAK, +<<<<<<< HEAD String.valueOf(pluginRef.getCombatTools().getLimitBreakDamage(player, SubSkillType.AXES_AXES_LIMIT_BREAK)))); +======= + String.valueOf(CombatUtils.getLimitBreakDamageAgainstQuality(player, SubSkillType.AXES_AXES_LIMIT_BREAK, 1000)))); +>>>>>>> 308e3a4b1f46e9e3de28d6d540dd055a540ed4d5 } return messages; diff --git a/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java index 713a64641..308e7ee2e 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java @@ -4,7 +4,6 @@ import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.excavation.ExcavationManager; -import com.gmail.nossr50.util.Permissions; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; @@ -34,7 +33,7 @@ public class ExcavationCommand extends SkillCommand { @Override protected void permissionsCheck(Player player) { - canGigaDrill = Permissions.gigaDrillBreaker(player) && pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.EXCAVATION_GIGA_DRILL_BREAKER); + canGigaDrill = pluginRef.getPermissionTools().gigaDrillBreaker(player) && pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.EXCAVATION_GIGA_DRILL_BREAKER); canTreasureHunt = canUseSubskill(player, SubSkillType.EXCAVATION_ARCHAEOLOGY); } diff --git a/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java index 1c754edcd..26f2fac80 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java @@ -8,7 +8,6 @@ import com.gmail.nossr50.datatypes.treasure.Rarity; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.fishing.Fishing; import com.gmail.nossr50.skills.fishing.FishingManager; -import com.gmail.nossr50.util.Permissions; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.Location; import org.bukkit.entity.EntityType; @@ -107,7 +106,7 @@ public class FishingCommand extends SkillCommand { rawBiteChance = rawBiteChance * AdvancedConfig.getInstance().getMasterAnglerBoatModifier(); } - double luckyModifier = Permissions.lucky(player, PrimarySkillType.FISHING) ? 1.333D : 1.0D; + double luckyModifier = pluginRef.getPermissionTools().lucky(player, PrimarySkillType.FISHING) ? 1.333D : 1.0D; biteChance = percent.format((rawBiteChance * 100.0D) * luckyModifier); } diff --git a/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java index 8b4a2e2c3..98df0ded0 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java @@ -3,7 +3,6 @@ package com.gmail.nossr50.commands.skills; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -86,9 +85,9 @@ public class HerbalismCommand extends SkillCommand { @Override protected void permissionsCheck(Player player) { hasHylianLuck = canUseSubskill(player, SubSkillType.HERBALISM_HYLIAN_LUCK); - canGreenTerra = Permissions.greenTerra(player); - canGreenThumbPlants = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.HERBALISM_GREEN_THUMB) && (Permissions.greenThumbPlant(player, Material.WHEAT) || Permissions.greenThumbPlant(player, Material.CARROT) || Permissions.greenThumbPlant(player, Material.POTATO) || Permissions.greenThumbPlant(player, Material.BEETROOT) || Permissions.greenThumbPlant(player, Material.NETHER_WART) || Permissions.greenThumbPlant(player, Material.COCOA)); - canGreenThumbBlocks = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.HERBALISM_GREEN_THUMB) && (Permissions.greenThumbBlock(player, Material.DIRT) || Permissions.greenThumbBlock(player, Material.COBBLESTONE) || Permissions.greenThumbBlock(player, Material.COBBLESTONE_WALL) || Permissions.greenThumbBlock(player, Material.STONE_BRICKS)); + canGreenTerra = pluginRef.getPermissionTools().greenTerra(player); + canGreenThumbPlants = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.HERBALISM_GREEN_THUMB) && (pluginRef.getPermissionTools().greenThumbPlant(player, Material.WHEAT) || pluginRef.getPermissionTools().greenThumbPlant(player, Material.CARROT) || pluginRef.getPermissionTools().greenThumbPlant(player, Material.POTATO) || pluginRef.getPermissionTools().greenThumbPlant(player, Material.BEETROOT) || pluginRef.getPermissionTools().greenThumbPlant(player, Material.NETHER_WART) || pluginRef.getPermissionTools().greenThumbPlant(player, Material.COCOA)); + canGreenThumbBlocks = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.HERBALISM_GREEN_THUMB) && (pluginRef.getPermissionTools().greenThumbBlock(player, Material.DIRT) || pluginRef.getPermissionTools().greenThumbBlock(player, Material.COBBLESTONE) || pluginRef.getPermissionTools().greenThumbBlock(player, Material.COBBLESTONE_WALL) || pluginRef.getPermissionTools().greenThumbBlock(player, Material.STONE_BRICKS)); canFarmersDiet = canUseSubskill(player, SubSkillType.HERBALISM_FARMERS_DIET); canDoubleDrop = canUseSubskill(player, SubSkillType.HERBALISM_DOUBLE_DROPS); canShroomThumb = canUseSubskill(player, SubSkillType.HERBALISM_SHROOM_THUMB); diff --git a/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java index 6b8db8003..eea3b5fad 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java @@ -4,7 +4,6 @@ import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.mining.MiningManager; -import com.gmail.nossr50.util.Permissions; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; @@ -65,11 +64,11 @@ public class MiningCommand extends SkillCommand { @Override protected void permissionsCheck(Player player) { - canBiggerBombs = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.MINING_BIGGER_BOMBS) && Permissions.biggerBombs(player); - canBlast = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.MINING_BLAST_MINING) && Permissions.remoteDetonation(player); - canDemoExpert = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.MINING_DEMOLITIONS_EXPERTISE) && Permissions.demolitionsExpertise(player); + canBiggerBombs = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.MINING_BIGGER_BOMBS) && pluginRef.getPermissionTools().biggerBombs(player); + canBlast = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.MINING_BLAST_MINING) && pluginRef.getPermissionTools().remoteDetonation(player); + canDemoExpert = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.MINING_DEMOLITIONS_EXPERTISE) && pluginRef.getPermissionTools().demolitionsExpertise(player); canDoubleDrop = canUseSubskill(player, SubSkillType.MINING_DOUBLE_DROPS); - canSuperBreaker = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.MINING_SUPER_BREAKER) && Permissions.superBreaker(player); + canSuperBreaker = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.MINING_SUPER_BREAKER) && pluginRef.getPermissionTools().superBreaker(player); } @Override diff --git a/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java index 2e62feddb..e4a686222 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java @@ -5,7 +5,6 @@ import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.listeners.InteractionManager; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -37,7 +36,7 @@ public class MmoInfoCommand implements TabExecutor { return false; Player player = (Player) commandSender; - if (Permissions.mmoinfo(player)) { + if (pluginRef.getPermissionTools().mmoinfo(player)) { if (args == null || args[0] == null) return false; diff --git a/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java index 7eab0d5fb..afea29b3c 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java @@ -5,7 +5,6 @@ import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.repair.RepairManager; import com.gmail.nossr50.skills.repair.repairables.Repairable; -import com.gmail.nossr50.util.Permissions; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -81,7 +80,7 @@ public class RepairCommand extends SkillCommand { // canRepairString = Permissions.repairMaterialType(player, ItemMaterialCategory.STRING); // canRepairLeather = Permissions.repairMaterialType(player, ItemMaterialCategory.LEATHER); // canRepairWood = Permissions.repairMaterialType(player, ItemMaterialCategory.WOOD); - arcaneBypass = (Permissions.arcaneBypass(player) || Permissions.hasRepairEnchantBypassPerk(player)); + arcaneBypass = (pluginRef.getPermissionTools().arcaneBypass(player) || pluginRef.getPermissionTools().hasRepairEnchantBypassPerk(player)); } @Override diff --git a/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java index bb3d30a91..f7df74420 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java @@ -5,7 +5,6 @@ import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.child.FamilyTree; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.skills.SkillActivationType; import com.google.common.collect.ImmutableList; @@ -66,7 +65,7 @@ public abstract class SkillCommand implements TabExecutor { Player player = (Player) sender; McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player); - boolean isLucky = Permissions.lucky(player, skill); + boolean isLucky = pluginRef.getPermissionTools().lucky(player, skill); boolean hasEndurance = pluginRef.getSkillTools().getEnduranceLength(player) > 0; double skillValue = mcMMOPlayer.getSkillLevel(skill); @@ -231,7 +230,19 @@ public abstract class SkillCommand implements TabExecutor { } } +<<<<<<< HEAD protected abstract void dataCalculations(Player player, double skillValue); +======= + protected String getLimitBreakDescriptionParameter() { + if(AdvancedConfig.getInstance().canApplyLimitBreakPVE()) { + return "(PVP/PVE)"; + } else { + return "(PVP)"; + } + } + + protected abstract void dataCalculations(Player player, float skillValue); +>>>>>>> 308e3a4b1f46e9e3de28d6d540dd055a540ed4d5 protected abstract void permissionsCheck(Player player); @@ -249,6 +260,6 @@ public abstract class SkillCommand implements TabExecutor { * @return true if the player has permission and has the skill unlocked */ protected boolean canUseSubskill(Player player, SubSkillType subSkillType) { - return Permissions.isSubSkillEnabled(player, subSkillType) && pluginRef.getRankTools().hasUnlockedSubskill(player, subSkillType); + return pluginRef.getPermissionTools().isSubSkillEnabled(player, subSkillType) && pluginRef.getRankTools().hasUnlockedSubskill(player, subSkillType); } } diff --git a/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java index 923f10245..56f81f7f5 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java @@ -3,7 +3,6 @@ package com.gmail.nossr50.commands.skills; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; @@ -53,7 +52,7 @@ public class SmeltingCommand extends SkillCommand { canFuelEfficiency = canUseSubskill(player, SubSkillType.SMELTING_FUEL_EFFICIENCY); canSecondSmelt = canUseSubskill(player, SubSkillType.SMELTING_SECOND_SMELT); //canFluxMine = canUseSubskill(player, SubSkillType.SMELTING_FLUX_MINING); - canUnderstandTheArt = Permissions.vanillaXpBoost(player, skill) && pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.SMELTING_UNDERSTANDING_THE_ART); + canUnderstandTheArt = pluginRef.getPermissionTools().vanillaXpBoost(player, skill) && pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.SMELTING_UNDERSTANDING_THE_ART); } @Override diff --git a/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java index 12b6c83d1..d2c239eb9 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java @@ -3,7 +3,6 @@ package com.gmail.nossr50.commands.skills; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; @@ -57,7 +56,7 @@ public class SwordsCommand extends SkillCommand { protected void permissionsCheck(Player player) { canBleed = canUseSubskill(player, SubSkillType.SWORDS_RUPTURE); canCounter = canUseSubskill(player, SubSkillType.SWORDS_COUNTER_ATTACK); - canSerratedStrike = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.SWORDS_SERRATED_STRIKES) && Permissions.serratedStrikes(player); + canSerratedStrike = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.SWORDS_SERRATED_STRIKES) && pluginRef.getPermissionTools().serratedStrikes(player); } @Override @@ -99,7 +98,11 @@ public class SwordsCommand extends SkillCommand { if (canUseSubskill(player, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK)) { messages.add(getStatMessage(SubSkillType.SWORDS_SWORDS_LIMIT_BREAK, +<<<<<<< HEAD String.valueOf(pluginRef.getCombatTools().getLimitBreakDamage(player, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK)))); +======= + String.valueOf(CombatUtils.getLimitBreakDamageAgainstQuality(player, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK, 1000)))); +>>>>>>> 308e3a4b1f46e9e3de28d6d540dd055a540ed4d5 } return messages; diff --git a/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java index 5fd09e558..b7c27f45a 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java @@ -4,7 +4,6 @@ import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.taming.Taming; -import com.gmail.nossr50.util.Permissions; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; @@ -42,7 +41,7 @@ public class TamingCommand extends SkillCommand { @Override protected void permissionsCheck(Player player) { canBeastLore = canUseSubskill(player, SubSkillType.TAMING_BEAST_LORE); - canCallWild = Permissions.callOfTheWild(player, EntityType.HORSE) || Permissions.callOfTheWild(player, EntityType.WOLF) || Permissions.callOfTheWild(player, EntityType.OCELOT); + canCallWild = pluginRef.getPermissionTools().callOfTheWild(player, EntityType.HORSE) || pluginRef.getPermissionTools().callOfTheWild(player, EntityType.WOLF) || pluginRef.getPermissionTools().callOfTheWild(player, EntityType.OCELOT); canEnvironmentallyAware = canUseSubskill(player, SubSkillType.TAMING_ENVIRONMENTALLY_AWARE); canFastFood = canUseSubskill(player, SubSkillType.TAMING_FAST_FOOD_SERVICE); canGore = canUseSubskill(player, SubSkillType.TAMING_GORE); diff --git a/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java index 6715d3575..e12500fae 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java @@ -3,7 +3,6 @@ package com.gmail.nossr50.commands.skills; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; @@ -69,7 +68,7 @@ public class UnarmedCommand extends SkillCommand { @Override protected void permissionsCheck(Player player) { - canBerserk = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.UNARMED_BERSERK) && Permissions.berserk(player); + canBerserk = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.UNARMED_BERSERK) && pluginRef.getPermissionTools().berserk(player); canIronArm = canUseSubskill(player, SubSkillType.UNARMED_IRON_ARM_STYLE); canDeflect = canUseSubskill(player, SubSkillType.UNARMED_ARROW_DEFLECT); canDisarm = canUseSubskill(player, SubSkillType.UNARMED_DISARM); @@ -111,7 +110,11 @@ public class UnarmedCommand extends SkillCommand { if (canUseSubskill(player, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK)) { messages.add(getStatMessage(SubSkillType.UNARMED_UNARMED_LIMIT_BREAK, +<<<<<<< HEAD String.valueOf(pluginRef.getCombatTools().getLimitBreakDamage(player, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK)))); +======= + String.valueOf(CombatUtils.getLimitBreakDamageAgainstQuality(player, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK, 1000)))); +>>>>>>> 308e3a4b1f46e9e3de28d6d540dd055a540ed4d5 } return messages; diff --git a/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java index 15a652c01..3751522d0 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java @@ -3,7 +3,6 @@ package com.gmail.nossr50.commands.skills; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; @@ -50,7 +49,7 @@ public class WoodcuttingCommand extends SkillCommand { @Override protected void permissionsCheck(Player player) { - canTreeFell = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.WOODCUTTING_TREE_FELLER) && Permissions.treeFeller(player); + canTreeFell = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.WOODCUTTING_TREE_FELLER) && pluginRef.getPermissionTools().treeFeller(player); canDoubleDrop = canUseSubskill(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) && pluginRef.getRankTools().getRank(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) >= 1; canLeafBlow = canUseSubskill(player, SubSkillType.WOODCUTTING_LEAF_BLOWER); /*canSplinter = canUseSubskill(player, SubSkillType.WOODCUTTING_SPLINTER); diff --git a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java new file mode 100644 index 000000000..13c88d329 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java @@ -0,0 +1,340 @@ +package com.gmail.nossr50.config.experience; + +import com.gmail.nossr50.config.AutoUpdateConfigLoader; +import com.gmail.nossr50.datatypes.experience.FormulaType; +import com.gmail.nossr50.datatypes.skills.MaterialType; +import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +import com.gmail.nossr50.datatypes.skills.alchemy.PotionStage; +import com.gmail.nossr50.util.StringUtils; +import org.bukkit.Material; +import org.bukkit.block.data.BlockData; +import org.bukkit.boss.BarColor; +import org.bukkit.boss.BarStyle; +import org.bukkit.entity.EntityType; + +import java.util.ArrayList; +import java.util.List; + +public class ExperienceConfig extends AutoUpdateConfigLoader { + private static ExperienceConfig instance; + + private ExperienceConfig() { + super("experience.yml"); + validate(); + } + + public static ExperienceConfig getInstance() { + if (instance == null) { + instance = new ExperienceConfig(); + } + + return instance; + } + + @Override + protected void loadKeys() {} + + @Override + protected boolean validateKeys() { + List reason = new ArrayList(); + + /* + * FORMULA SETTINGS + */ + + /* Curve values */ + if (getMultiplier(FormulaType.EXPONENTIAL) <= 0) { + reason.add("Experience_Formula.Exponential_Values.multiplier should be greater than 0!"); + } + + if (getMultiplier(FormulaType.LINEAR) <= 0) { + reason.add("Experience_Formula.Linear_Values.multiplier should be greater than 0!"); + } + + if (getExponent(FormulaType.EXPONENTIAL) <= 0) { + reason.add("Experience_Formula.Exponential_Values.exponent should be greater than 0!"); + } + + /* Global modifier */ + if (getExperienceGainsGlobalMultiplier() <= 0) { + reason.add("Experience_Formula.Multiplier.Global should be greater than 0!"); + } + + /* PVP modifier */ + if (getPlayerVersusPlayerXP() < 0) { + reason.add("Experience_Formula.Multiplier.PVP should be at least 0!"); + } + + /* Spawned Mob modifier */ + if (getSpawnedMobXpMultiplier() < 0) { + reason.add("Experience_Formula.Mobspawners.Multiplier should be at least 0!"); + } + + /* Bred Mob modifier */ + if (getBredMobXpMultiplier() < 0) { + reason.add("Experience_Formula.Breeding.Multiplier should be at least 0!"); + } + + /* Conversion */ + if (getExpModifier() <= 0) { + reason.add("Conversion.Exp_Modifier should be greater than 0!"); + } + + /* + * XP SETTINGS + */ + + /* Alchemy */ + for (PotionStage potionStage : PotionStage.values()) { + if (getPotionXP(potionStage) < 0) { + reason.add("Experience_Values.Alchemy.Potion_Stage_" + potionStage.toNumerical() + " should be at least 0!"); + } + } + + /* Archery */ + if (getArcheryDistanceMultiplier() < 0) { + reason.add("Experience_Values.Archery.Distance_Multiplier should be at least 0!"); + } + + /* Combat XP Multipliers */ + if (getAnimalsXP() < 0) { + reason.add("Experience_Values.Combat.Multiplier.Animals should be at least 0!"); + } + + if (getDodgeXPModifier() < 0) { + reason.add("Skills.Acrobatics.Dodge_XP_Modifier should be at least 0!"); + } + + if (getRollXPModifier() < 0) { + reason.add("Skills.Acrobatics.Roll_XP_Modifier should be at least 0!"); + } + + if (getFallXPModifier() < 0) { + reason.add("Skills.Acrobatics.Fall_XP_Modifier should be at least 0!"); + } + + /* Fishing */ + // TODO: Add validation for each fish type once enum is available. + + if (getFishingShakeXP() <= 0) { + reason.add("Experience_Values.Fishing.Shake should be greater than 0!"); + } + + /* Repair */ + if (getRepairXPBase() <= 0) { + reason.add("Experience_Values.Repair.Base should be greater than 0!"); + } + + /* Taming */ + if (getTamingXP(EntityType.WOLF) <= 0) { + reason.add("Experience_Values.Taming.Animal_Taming.Wolf should be greater than 0!"); + } + + if (getTamingXP(EntityType.OCELOT) <= 0) { + reason.add("Experience_Values.Taming.Animal_Taming.Ocelot should be greater than 0!"); + } + + return noErrorsInConfig(reason); + } + + public boolean isEarlyGameBoostEnabled() { return config.getBoolean("EarlyGameBoost.Enabled", true); } + + /* + * FORMULA SETTINGS + */ + + /* EXPLOIT TOGGLES */ + public boolean isEndermanEndermiteFarmingPrevented() { return config.getBoolean("ExploitFix.EndermanEndermiteFarms", true); } + public boolean isPistonCheatingPrevented() { return config.getBoolean("ExploitFix.PistonCheating", true); } + public boolean isPistonExploitPrevented() { return config.getBoolean("ExploitFix.Pistons", false); } + public boolean allowUnsafeEnchantments() { return config.getBoolean("ExploitFix.UnsafeEnchantments", false); } + public boolean isCOTWBreedingPrevented() { return config.getBoolean("ExploitFix.COTWBreeding", true); } + + public boolean isFishingExploitingPrevented() { return config.getBoolean("ExploitFix.Fishing", true); } + public boolean isAcrobaticsExploitingPrevented() { return config.getBoolean("ExploitFix.Acrobatics", true); } + public boolean isTreeFellerXPReduced() { return config.getBoolean("ExploitFix.TreeFellerReducedXP", true); } + + /* Curve settings */ + public FormulaType getFormulaType() { return FormulaType.getFormulaType(config.getString("Experience_Formula.Curve")); } + public boolean getCumulativeCurveEnabled() { return config.getBoolean("Experience_Formula.Cumulative_Curve", false); } + + /* Curve values */ + public double getMultiplier(FormulaType type) { return config.getDouble("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.multiplier"); } + public int getBase(FormulaType type) { return config.getInt("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.base"); } + public double getExponent(FormulaType type) { return config.getDouble("Experience_Formula." + StringUtils.getCapitalized(type.toString()) + "_Values.exponent"); } + + /* Global modifier */ + public double getExperienceGainsGlobalMultiplier() { return config.getDouble("Experience_Formula.Multiplier.Global", 1.0); } + public void setExperienceGainsGlobalMultiplier(double value) { config.set("Experience_Formula.Multiplier.Global", value); } + + /* PVP modifier */ + public double getPlayerVersusPlayerXP() { return config.getDouble("Experience_Formula.Multiplier.PVP", 1.0); } + + /* Spawned Mob modifier */ + public double getSpawnedMobXpMultiplier() { return config.getDouble("Experience_Formula.Mobspawners.Multiplier", 0.0); } + public double getBredMobXpMultiplier() { return config.getDouble("Experience_Formula.Breeding.Multiplier", 1.0); } + + /* Skill modifiers */ + public double getFormulaSkillModifier(PrimarySkillType skill) { return config.getDouble("Experience_Formula.Modifier." + StringUtils.getCapitalized(skill.toString())); } + + /* Custom XP perk */ + public double getCustomXpPerkBoost() { return config.getDouble("Experience_Formula.Custom_XP_Perk.Boost", 1.25); } + + /* Diminished Returns */ + public float getDiminishedReturnsCap() { return (float) config.getDouble("Dimished_Returns.Guaranteed_Minimum_Percentage", 0.05D); } + public boolean getDiminishedReturnsEnabled() { return config.getBoolean("Diminished_Returns.Enabled", false); } + public int getDiminishedReturnsThreshold(PrimarySkillType skill) { return config.getInt("Diminished_Returns.Threshold." + StringUtils.getCapitalized(skill.toString()), 20000); } + public int getDiminishedReturnsTimeInterval() { return config.getInt("Diminished_Returns.Time_Interval", 10); } + + /* Conversion */ + public double getExpModifier() { return config.getDouble("Conversion.Exp_Modifier", 1); } + + /* + * XP SETTINGS + */ + + /* General Settings */ + public boolean getExperienceGainsPlayerVersusPlayerEnabled() { return config.getBoolean("Experience_Values.PVP.Rewards", true); } + + /* Combat XP Multipliers */ + public double getCombatXP(EntityType entity) { return config.getDouble("Experience_Values.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); } + public double getAnimalsXP(EntityType entity) { return config.getDouble("Experience_Values.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_"), getAnimalsXP()); } + public double getAnimalsXP() { return config.getDouble("Experience_Values.Combat.Multiplier.Animals", 1.0); } + public boolean hasCombatXP(EntityType entity) {return config.contains("Experience_Values.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); } + + /* Materials */ + public int getXp(PrimarySkillType skill, Material data) + { + String baseString = "Experience_Values." + StringUtils.getCapitalized(skill.toString()) + "."; + String explicitString = baseString + StringUtils.getExplicitConfigMaterialString(data); + if (config.contains(explicitString)) + return config.getInt(explicitString); + String friendlyString = baseString + StringUtils.getFriendlyConfigMaterialString(data); + if (config.contains(friendlyString)) + return config.getInt(friendlyString); + String wildcardString = baseString + StringUtils.getWildcardConfigMaterialString(data); + if (config.contains(wildcardString)) + return config.getInt(wildcardString); + return 0; + } + + /* Materials */ + public int getXp(PrimarySkillType skill, BlockData data) + { + String baseString = "Experience_Values." + StringUtils.getCapitalized(skill.toString()) + "."; + String explicitString = baseString + StringUtils.getExplicitConfigBlockDataString(data); + if (config.contains(explicitString)) + return config.getInt(explicitString); + String friendlyString = baseString + StringUtils.getFriendlyConfigBlockDataString(data); + if (config.contains(friendlyString)) + return config.getInt(friendlyString); + String wildcardString = baseString + StringUtils.getWildcardConfigBlockDataString(data); + if (config.contains(wildcardString)) + return config.getInt(wildcardString); + return 0; + } + + public boolean doesBlockGiveSkillXP(PrimarySkillType skill, Material data) + { + String baseString = "Experience_Values." + StringUtils.getCapitalized(skill.toString()) + "."; + String explicitString = baseString + StringUtils.getExplicitConfigMaterialString(data); + if (config.contains(explicitString)) + return true; + String friendlyString = baseString + StringUtils.getFriendlyConfigMaterialString(data); + if (config.contains(friendlyString)) + return true; + String wildcardString = baseString + StringUtils.getWildcardConfigMaterialString(data); + return config.contains(wildcardString); + } + + public boolean doesBlockGiveSkillXP(PrimarySkillType skill, BlockData data) + { + String baseString = "Experience_Values." + StringUtils.getCapitalized(skill.toString()) + "."; + String explicitString = baseString + StringUtils.getExplicitConfigBlockDataString(data); + if (config.contains(explicitString)) + return true; + String friendlyString = baseString + StringUtils.getFriendlyConfigBlockDataString(data); + if (config.contains(friendlyString)) + return true; + String wildcardString = baseString + StringUtils.getWildcardConfigBlockDataString(data); + return config.contains(wildcardString); + } + + /* + * Experience Bar Stuff + */ + + public boolean isPartyExperienceBarsEnabled() + { + return config.getBoolean("Experience_Bars.Update.Party", true); + } + + public boolean isPassiveGainsExperienceBarsEnabled() + { + return config.getBoolean("Experience_Bars.Update.Passive", true); + } + + public boolean getDoExperienceBarsAlwaysUpdateTitle() + { + return config.getBoolean("Experience_Bars.ThisMayCauseLag.AlwaysUpdateTitlesWhenXPIsGained.Enable", false) || getAddExtraDetails(); + } + + public boolean getAddExtraDetails() { return config.getBoolean("Experience_Bars.ThisMayCauseLag.AlwaysUpdateTitlesWhenXPIsGained.ExtraDetails", false);} + public boolean isExperienceBarsEnabled() { return config.getBoolean("Experience_Bars.Enable", true); } + public boolean isExperienceBarEnabled(PrimarySkillType primarySkillType) { return config.getBoolean("Experience_Bars."+StringUtils.getCapitalized(primarySkillType.toString())+".Enable", true);} + + public BarColor getExperienceBarColor(PrimarySkillType primarySkillType) + { + String colorValueFromConfig = config.getString("Experience_Bars."+StringUtils.getCapitalized(primarySkillType.toString())+".Color"); + + for(BarColor barColor : BarColor.values()) + { + if(barColor.toString().equalsIgnoreCase(colorValueFromConfig)) + return barColor; + } + + //In case the value is invalid + return BarColor.WHITE; + } + + public BarStyle getExperienceBarStyle(PrimarySkillType primarySkillType) + { + String colorValueFromConfig = config.getString("Experience_Bars."+StringUtils.getCapitalized(primarySkillType.toString())+".BarStyle"); + + for(BarStyle barStyle : BarStyle.values()) + { + if(barStyle.toString().equalsIgnoreCase(colorValueFromConfig)) + return barStyle; + } + + //In case the value is invalid + return BarStyle.SOLID; + } + + /* Acrobatics */ + public int getDodgeXPModifier() { return config.getInt("Experience_Values.Acrobatics.Dodge", 120); } + public int getRollXPModifier() { return config.getInt("Experience_Values.Acrobatics.Roll", 80); } + public int getFallXPModifier() { return config.getInt("Experience_Values.Acrobatics.Fall", 120); } + + public double getFeatherFallXPModifier() { return config.getDouble("Experience_Values.Acrobatics.FeatherFall_Multiplier", 2.0); } + + /* Alchemy */ + public double getPotionXP(PotionStage stage) { return config.getDouble("Experience_Values.Alchemy.Potion_Stage_" + stage.toNumerical(), 10D); } + + /* Archery */ + public double getArcheryDistanceMultiplier() { return config.getDouble("Experience_Values.Archery.Distance_Multiplier", 0.025); } + + public int getFishingShakeXP() { return config.getInt("Experience_Values.Fishing.Shake", 50); } + + /* Repair */ + public double getRepairXPBase() { return config.getDouble("Experience_Values.Repair.Base", 1000.0); } + public double getRepairXP(MaterialType repairMaterialType) { return config.getDouble("Experience_Values.Repair." + StringUtils.getCapitalized(repairMaterialType.toString())); } + + /* Taming */ + public int getTamingXP(EntityType type) + { + return config.getInt("Experience_Values.Taming.Animal_Taming." + StringUtils.getPrettyEntityTypeString(type)); + } + + public boolean preventStoneLavaFarming() { return config.getBoolean("ExploitFix.LavaStoneAndCobbleFarming", true);} +} diff --git a/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigExploitPrevention.java b/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigExploitPrevention.java index dde48be6e..9404b8e15 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigExploitPrevention.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigExploitPrevention.java @@ -111,4 +111,12 @@ public class ConfigExploitPrevention { public ConfigSectionExploitSalvage getConfigSectionExploitSalvage() { return configSectionExploitSkills.getConfigSectionExploitSalvage(); } + + public boolean areSummonsBreedable() { + return configSectionExploitSkills.areSummonsBreedable(); + } + + public ConfigSectionExploitTaming getConfigSectionExploitTaming() { + return configSectionExploitSkills.getConfigSectionExploitTaming(); + } } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigSectionExploitSkills.java b/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigSectionExploitSkills.java index 8a0a4e0f7..3a12c4cfc 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigSectionExploitSkills.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigSectionExploitSkills.java @@ -23,6 +23,9 @@ public class ConfigSectionExploitSkills { @Setting(value = "Salvage", comment = "Exploit settings related to Salvage") private ConfigSectionExploitSalvage configSectionExploitSalvage = new ConfigSectionExploitSalvage(); + @Setting(value = "Taming", comment = "Exploit settings related to Taming") + private ConfigSectionExploitTaming configSectionExploitTaming = new ConfigSectionExploitTaming(); + public ConfigSectionExploitAcrobatics getConfigSectionExploitAcrobatics() { return configSectionExploitAcrobatics; } @@ -43,6 +46,10 @@ public class ConfigSectionExploitSkills { return configSectionExploitMining.isPreventCobblestoneStoneGeneratorXP(); } + public boolean areSummonsBreedable() { + return configSectionExploitTaming.areSummonsBreedable(); + } + public boolean isPreventVehicleAutoFarming() { return configSectionExploitHerbalism.isPreventVehicleAutoFarming(); } @@ -90,4 +97,8 @@ public class ConfigSectionExploitSkills { public ConfigSectionExploitSalvage getConfigSectionExploitSalvage() { return configSectionExploitSalvage; } + + public ConfigSectionExploitTaming getConfigSectionExploitTaming() { + return configSectionExploitTaming; + } } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigSectionExploitTaming.java b/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigSectionExploitTaming.java new file mode 100644 index 000000000..c2d403391 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/config/hocon/antiexploit/ConfigSectionExploitTaming.java @@ -0,0 +1,15 @@ +package com.gmail.nossr50.config.hocon.antiexploit; + +import ninja.leaping.configurate.objectmapping.Setting; +import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; + +@ConfigSerializable +public class ConfigSectionExploitTaming { + + @Setting(value = "Breedable-Summons", comment = "Whether or not players can breed the temporary summons from Call Of The Wild.") + private boolean breedableSummons = false; + + public boolean areSummonsBreedable() { + return breedableSummons; + } +} diff --git a/src/main/java/com/gmail/nossr50/config/hocon/serializers/MaterialSerializer.java b/src/main/java/com/gmail/nossr50/config/hocon/serializers/MaterialSerializer.java new file mode 100644 index 000000000..571c9bca4 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/config/hocon/serializers/MaterialSerializer.java @@ -0,0 +1,33 @@ +package com.gmail.nossr50.config.hocon.serializers; + +import com.google.common.reflect.TypeToken; +import ninja.leaping.configurate.ConfigurationNode; +import ninja.leaping.configurate.objectmapping.ObjectMappingException; +import ninja.leaping.configurate.objectmapping.serialize.TypeSerializer; +import org.bukkit.Material; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; + +public class MaterialSerializer implements TypeSerializer { + + private static final String FULLY_QUALIFIED_NAME = "Fully-Qualified-Name"; + + @Nullable + @Override + public Material deserialize(@NonNull TypeToken type, @NonNull ConfigurationNode value) throws ObjectMappingException { + Material material = null; + + try { + material = Material.matchMaterial(value.getNode(FULLY_QUALIFIED_NAME).getValue(TypeToken.of(String.class))); + } catch (ObjectMappingException | NullPointerException e) { + e.printStackTrace(); + } + + return material; + } + + @Override + public void serialize(@NonNull TypeToken type, @Nullable Material obj, @NonNull ConfigurationNode value) throws ObjectMappingException { + value.getNode(FULLY_QUALIFIED_NAME).setValue(obj.getKey().toString()); + } +} diff --git a/src/main/java/com/gmail/nossr50/config/hocon/serializers/MinecraftMaterialWrapperSerializer.java b/src/main/java/com/gmail/nossr50/config/hocon/serializers/MinecraftMaterialWrapperSerializer.java index 20e54ec1a..1cade8c21 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/serializers/MinecraftMaterialWrapperSerializer.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/serializers/MinecraftMaterialWrapperSerializer.java @@ -7,6 +7,9 @@ import ninja.leaping.configurate.objectmapping.ObjectMappingException; import ninja.leaping.configurate.objectmapping.serialize.TypeSerializer; import org.bukkit.Material; +/** + * Class is for example purposes + */ public class MinecraftMaterialWrapperSerializer implements TypeSerializer { private static final String FULLY_QUALIFIED_NAME = "Fully-Qualified-Name"; diff --git a/src/main/java/com/gmail/nossr50/config/hocon/serializers/TamingSummonSerializer.java b/src/main/java/com/gmail/nossr50/config/hocon/serializers/TamingSummonSerializer.java new file mode 100644 index 000000000..3217c167b --- /dev/null +++ b/src/main/java/com/gmail/nossr50/config/hocon/serializers/TamingSummonSerializer.java @@ -0,0 +1,33 @@ +package com.gmail.nossr50.config.hocon.serializers; + +import com.gmail.nossr50.datatypes.skills.subskills.taming.TamingSummon; +import com.google.common.reflect.TypeToken; +import ninja.leaping.configurate.ConfigurationNode; +import ninja.leaping.configurate.objectmapping.ObjectMappingException; +import ninja.leaping.configurate.objectmapping.serialize.TypeSerializer; +import org.bukkit.Material; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; + +public class TamingSummonSerializer implements TypeSerializer { + @Nullable + @Override + public TamingSummon deserialize(@NonNull TypeToken type, @NonNull ConfigurationNode value) throws ObjectMappingException { + /* + private Material itemType; + private int itemAmountRequired; + private int entitiesSummoned; + private int summonLifespan; + private int summonCap; + private CallOfTheWildType callOfTheWildType; + private EntityType entityType; + */ + + Material itemType = value.getNode("Item-Material").getValue(TypeToken.of(Material.class)); + } + + @Override + public void serialize(@NonNull TypeToken type, @Nullable TamingSummon obj, @NonNull ConfigurationNode value) throws ObjectMappingException { + + } +} diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTaming.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTaming.java index 109476948..b4a6f99a5 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTaming.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTaming.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.config.hocon.skills.taming; import com.gmail.nossr50.config.ConfigConstants; +import com.gmail.nossr50.datatypes.skills.subskills.taming.CallOfTheWildType; import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; @@ -13,4 +14,48 @@ public class ConfigTaming { public ConfigTamingSubSkills getSubSkills() { return subSkills; } + + public ConfigTamingGore getGore() { + return subSkills.getGore(); + } + + public ConfigTamingCallOfTheWild getCallOfTheWild() { + return subSkills.getCallOfTheWild(); + } + + public ConfigTamingSharpenedClaws getSharpenedClaws() { + return subSkills.getSharpenedClaws(); + } + + public ConfigTamingShockProof getShockProof() { + return subSkills.getShockProof(); + } + + public ConfigTamingThickFur getThickFur() { + return subSkills.getThickFur(); + } + + public ConfigTamingEnvironmentallyAware getEnvironmentallyAware() { + return subSkills.getEnvironmentallyAware(); + } + + public ConfigTamingFastFoodService getFastFoodService() { + return subSkills.getFastFoodService(); + } + + public ConfigTamingPummel getPummel() { + return subSkills.getPummel(); + } + + public String getItemString(CallOfTheWildType callOfTheWildType) { + return subSkills.getItemString(callOfTheWildType); + } + + public double getMinHorseJumpStrength() { + return subSkills.getMinHorseJumpStrength(); + } + + public double getMaxHorseJumpStrength() { + return subSkills.getMaxHorseJumpStrength(); + } } \ No newline at end of file diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingCallOfTheWild.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingCallOfTheWild.java index 5ebeb724f..c8adc1d0e 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingCallOfTheWild.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingCallOfTheWild.java @@ -1,26 +1,54 @@ package com.gmail.nossr50.config.hocon.skills.taming; +import com.gmail.nossr50.datatypes.skills.subskills.taming.CallOfTheWildType; +import com.gmail.nossr50.datatypes.skills.subskills.taming.TamingSummon; import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; +import org.bukkit.Material; + +import java.util.HashMap; @ConfigSerializable public class ConfigTamingCallOfTheWild { + private static final double MIN_HORSE_DEFAULT = 0.7D; + private static final double MAX_HORSE_DEFAULT = 2.0D; + private static final HashMap TAMING_SUMMON_DEFAULT_MAP; - @Setting(value = "Cat-Summon-Item-Name", comment = "The name of the item used to summon cats.") - private String cotwCatItem = "minecraft:raw_cod"; - private String cotwWolfItem = "minecraft:bone"; - private String cotwHorseItem = "minecraft:apple"; - - public String getCotwCatItem() { - return cotwCatItem; + static { + TAMING_SUMMON_DEFAULT_MAP = new HashMap<>(); + TAMING_SUMMON_DEFAULT_MAP.put(CallOfTheWildType.CAT, new TamingSummon(CallOfTheWildType.CAT, Material.COD, 10, 1, 240, 1)); + TAMING_SUMMON_DEFAULT_MAP.put(CallOfTheWildType.WOLF, new TamingSummon(CallOfTheWildType.WOLF, Material.BONE, 10, 1, 240, 2)); + TAMING_SUMMON_DEFAULT_MAP.put(CallOfTheWildType.HORSE, new TamingSummon(CallOfTheWildType.HORSE, Material.APPLE, 10, 1, 240, 1)); } - public String getCotwWolfItem() { - return cotwWolfItem; + //TODO: Set this up for custom item stuff after NBT support is done + + @Setting(value = "Taming-Summons", comment = "Taming summon settings.") + private HashMap tamingSummonHashMap = TAMING_SUMMON_DEFAULT_MAP; + + @Setting(value = "Minimum-Horse-Jump-Strength", comment = "The minimum value of jump strength a summoned COTW horse can have." + + "\nDefault value: "+MIN_HORSE_DEFAULT) + private double minHorseJumpStrength = MIN_HORSE_DEFAULT; + + @Setting(value = "Maximum-Horse-Jump-Strength", comment = "The maximum value of jump strength a summoned COTW horse can have." + + "\nDefault value: "+MAX_HORSE_DEFAULT) + private double maxHorseJumpStrength = MAX_HORSE_DEFAULT; + + public double getMinHorseJumpStrength() { + return minHorseJumpStrength; } - public String getCotwHorseItem() { - return cotwHorseItem; + public double getMaxHorseJumpStrength() { + return maxHorseJumpStrength; + } + + public TamingSummon getCOTWSummon(CallOfTheWildType callOfTheWildType) { + if(tamingSummonHashMap.get(callOfTheWildType) == null) { + System.out.println("mcMMO - Could not find summon config entry for CallOfTheWildType, using default instead - "+callOfTheWildType.toString()); + return TAMING_SUMMON_DEFAULT_MAP.get(callOfTheWildType); + } else { + return tamingSummonHashMap.get(callOfTheWildType); + } } } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingEnvironmentalllyAware.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingEnvironmentallyAware.java similarity index 75% rename from src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingEnvironmentalllyAware.java rename to src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingEnvironmentallyAware.java index 3d52ada4a..39d91915a 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingEnvironmentalllyAware.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingEnvironmentallyAware.java @@ -3,5 +3,6 @@ package com.gmail.nossr50.config.hocon.skills.taming; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; @ConfigSerializable -public class ConfigTamingEnvironmentalllyAware { +public class ConfigTamingEnvironmentallyAware { + } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingGore.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingGore.java index cc96a2647..3e7b4eee3 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingGore.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingGore.java @@ -12,6 +12,9 @@ public class ConfigTamingGore { @Setting(value = ConfigConstants.MAX_CHANCE_FIELD_NAME, comment = ConfigConstants.MAX_CHANCE_FIELD_DESCRIPTION) private double maxChance = 50.0; + @Setting(value = "Gore-Bleed-Tick-Length", comment = "How many times to apply the bleed DOT from gore before it wears off.") + private int goreBleedTicks = 2; + @Setting(value = ConfigConstants.MAX_BONUS_LEVEL_FIELD_NAME, comment = ConfigConstants.MAX_BONUS_LEVEL_DESCRIPTION) private MaxBonusLevel maxBonusLevel = new AbstractMaxBonusLevel(100); @@ -29,4 +32,8 @@ public class ConfigTamingGore { public double getGoreMofifier() { return goreMofifier; } + + public int getGoreBleedTicks() { + return goreBleedTicks; + } } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingSharpenedClaws.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingSharpenedClaws.java index 53a850cbb..973160903 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingSharpenedClaws.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingSharpenedClaws.java @@ -1,7 +1,16 @@ package com.gmail.nossr50.config.hocon.skills.taming; +import com.gmail.nossr50.datatypes.skills.properties.AbstractDamageProperty; +import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; @ConfigSerializable public class ConfigTamingSharpenedClaws { + + @Setting(value = "Bonus-Damage", comment = "The amount of bonus damage Sharpened Claws will add.") + private AbstractDamageProperty bonusDamage; + + public AbstractDamageProperty getBonusDamage() { + return bonusDamage; + } } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingSubSkills.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingSubSkills.java index 1952c00c7..edfee1679 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingSubSkills.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/taming/ConfigTamingSubSkills.java @@ -1,5 +1,6 @@ package com.gmail.nossr50.config.hocon.skills.taming; +import com.gmail.nossr50.datatypes.skills.subskills.taming.CallOfTheWildType; import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; @@ -22,7 +23,7 @@ public class ConfigTamingSubSkills { private ConfigTamingThickFur thickFur = new ConfigTamingThickFur(); @Setting(value = "Environmentally-Aware") - private ConfigTamingEnvironmentalllyAware environmentalllyAware = new ConfigTamingEnvironmentalllyAware(); + private ConfigTamingEnvironmentallyAware environmentallyAware = new ConfigTamingEnvironmentallyAware(); @Setting(value = "Fast-Food-Service") private ConfigTamingFastFoodService fastFoodService = new ConfigTamingFastFoodService(); @@ -50,8 +51,8 @@ public class ConfigTamingSubSkills { return thickFur; } - public ConfigTamingEnvironmentalllyAware getEnvironmentalllyAware() { - return environmentalllyAware; + public ConfigTamingEnvironmentallyAware getEnvironmentallyAware() { + return environmentallyAware; } public ConfigTamingFastFoodService getFastFoodService() { @@ -61,4 +62,16 @@ public class ConfigTamingSubSkills { public ConfigTamingPummel getPummel() { return pummel; } + + public String getItemString(CallOfTheWildType callOfTheWildType) { + return callOfTheWild.getItemString(callOfTheWildType); + } + + public double getMinHorseJumpStrength() { + return callOfTheWild.getMinHorseJumpStrength(); + } + + public double getMaxHorseJumpStrength() { + return callOfTheWild.getMaxHorseJumpStrength(); + } } diff --git a/src/main/java/com/gmail/nossr50/core/DynamicSettingsManager.java b/src/main/java/com/gmail/nossr50/core/DynamicSettingsManager.java index 7cc3652fa..dbcb8e0a6 100644 --- a/src/main/java/com/gmail/nossr50/core/DynamicSettingsManager.java +++ b/src/main/java/com/gmail/nossr50/core/DynamicSettingsManager.java @@ -43,9 +43,11 @@ public class DynamicSettingsManager { private HashMap partyItemWeights; private HashMap partyFeatureUnlocks; - /* Skill Behaviours */ + /* Misc Managers*/ //TODO: This class is a band-aid fix for a large problem with mcMMO code, they will be removed once the new skill system is in place private SkillBehaviourManager skillBehaviourManager; + //TODO: Generify and better cross version support + private TamingItemManager tamingItemManager; public DynamicSettingsManager(mcMMO pluginRef) { @@ -74,15 +76,23 @@ public class DynamicSettingsManager { } /** - * Misc managers + * Misc managers init */ private void initMiscManagers() { //Init Skill Behaviour Manager - skillBehaviourManager = new SkillBehaviourManager(pluginRef); - - initExperienceManager(); initWorldBlackList(); + initExperienceManager(); + initSkillBehaviourManager(); + initTamingItemManager(); + } + + private void initSkillBehaviourManager() { + skillBehaviourManager = new SkillBehaviourManager(pluginRef); + } + + private void initTamingItemManager() { + tamingItemManager = new TamingItemManager(pluginRef); } private void initWorldBlackList() { @@ -136,7 +146,7 @@ public class DynamicSettingsManager { /** * Registers bonus drops from several skill configs */ - public void registerBonusDrops() { + private void registerBonusDrops() { bonusDropManager.addToWhitelistByNameID(pluginRef.getConfigManager().getConfigMining().getBonusDrops()); bonusDropManager.addToWhitelistByNameID(pluginRef.getConfigManager().getConfigHerbalism().getBonusDrops()); // bonusDropManager.addToWhitelistByNameID(mcMMO.getConfigManager().getConfigWoodcutting().getBonusDrops()); @@ -190,6 +200,10 @@ public class DynamicSettingsManager { return worldBlackListManager; } + public TamingItemManager getTamingItemManager() { + return tamingItemManager; + } + public boolean isWorldBlacklisted(String worldName) { return getWorldBlackListManager().isWorldBlacklisted(worldName); } diff --git a/src/main/java/com/gmail/nossr50/core/MaterialMapStore.java b/src/main/java/com/gmail/nossr50/core/MaterialMapStore.java index 544b28bd4..72cb4241c 100644 --- a/src/main/java/com/gmail/nossr50/core/MaterialMapStore.java +++ b/src/main/java/com/gmail/nossr50/core/MaterialMapStore.java @@ -19,7 +19,7 @@ public class MaterialMapStore { private HashSet herbalismAbilityBlackList; private HashSet blockCrackerWhiteList; private HashSet canMakeShroomyWhiteList; - private HashSet multiBlockEntities; + private HashSet multiBlockPlant; private HashSet foodItemWhiteList; public MaterialMapStore() { @@ -30,14 +30,15 @@ public class MaterialMapStore { herbalismAbilityBlackList = new HashSet<>(); blockCrackerWhiteList = new HashSet<>(); canMakeShroomyWhiteList = new HashSet<>(); - multiBlockEntities = new HashSet<>(); + multiBlockPlant = new HashSet<>(); foodItemWhiteList = new HashSet<>(); fillHardcodedHashSets(); } - public boolean isMultiBlock(Material material) { - return multiBlockEntities.contains(material.getKey().getKey()); + public boolean isMultiBlockPlant(Material material) + { + return multiBlockPlant.contains(material.getKey().getKey()); } public boolean isAbilityActivationBlackListed(Material material) { @@ -70,7 +71,7 @@ public class MaterialMapStore { private void fillHardcodedHashSets() { fillAbilityBlackList(); - filltoolBlackList(); + fillToolBlackList(); fillMossyWhiteList(); fillLeavesWhiteList(); fillHerbalismAbilityBlackList(); @@ -124,14 +125,17 @@ public class MaterialMapStore { } private void fillMultiBlockEntitiesList() { - multiBlockEntities.add("cactus"); - multiBlockEntities.add("chorus_plant"); - multiBlockEntities.add("sugar_cane"); - multiBlockEntities.add("kelp_plant"); - multiBlockEntities.add("kelp"); - multiBlockEntities.add("tall_seagrass"); - multiBlockEntities.add("tall_grass"); - multiBlockEntities.add("bamboo"); + //Multi-Block Plants + multiBlockPlant.add("cactus"); + multiBlockPlant.add("chorus_plant"); + multiBlockPlant.add("chorus_flower"); + multiBlockPlant.add("sugar_cane"); + multiBlockPlant.add("kelp_plant"); + multiBlockPlant.add("kelp"); + multiBlockPlant.add("tall_seagrass"); + multiBlockPlant.add("large_fern"); + multiBlockPlant.add("tall_grass"); + multiBlockPlant.add("bamboo"); } private void fillShroomyWhiteList() { @@ -268,8 +272,8 @@ public class MaterialMapStore { abilityBlackList.add("wall_sign"); //1.13 and lower? abilityBlackList.add("sign"); //1.13 and lower? } - - private void filltoolBlackList() { + private void fillToolBlackList() + { //TODO: Add anvils / missing logs toolBlackList.add("black_bed"); toolBlackList.add("blue_bed"); diff --git a/src/main/java/com/gmail/nossr50/core/MetadataConstants.java b/src/main/java/com/gmail/nossr50/core/MetadataConstants.java index efcd1ee25..2238dd99a 100644 --- a/src/main/java/com/gmail/nossr50/core/MetadataConstants.java +++ b/src/main/java/com/gmail/nossr50/core/MetadataConstants.java @@ -29,6 +29,7 @@ public class MetadataConstants { public final static String GREEN_THUMB_METAKEY = "mcMMO: Green Thumb"; public final static String DATABASE_PROCESSING_COMMAND_METAKEY = "mcMMO: Processing Database Command"; public final static String PETS_ANIMAL_TRACKING_METAKEY = "mcMMO: Pet Animal"; + public static final String COTW_TEMPORARY_SUMMON = "mcMMO: COTW Entity"; public static FixedMetadataValue metadataValue; //Gains value in onEnable diff --git a/src/main/java/com/gmail/nossr50/core/SkillPropertiesManager.java b/src/main/java/com/gmail/nossr50/core/SkillPropertiesManager.java index bae7bbe62..2cf4bdceb 100644 --- a/src/main/java/com/gmail/nossr50/core/SkillPropertiesManager.java +++ b/src/main/java/com/gmail/nossr50/core/SkillPropertiesManager.java @@ -84,7 +84,7 @@ public class SkillPropertiesManager { if(subSkillCategoryNode != null) { //Check all the "children" of this skill, this will need to be rewritten in the future - for (SubSkillType subSkillType : primarySkillType.getSkillAbilities()) { + for (SubSkillType subSkillType : pluginRef.getSkillTools().getSkillAbilities(primarySkillType)) { //HOCON friendly subskill name String hoconFriendlySubskillName = subSkillType.getHoconFriendlyConfigName(); diff --git a/src/main/java/com/gmail/nossr50/core/TamingItemManager.java b/src/main/java/com/gmail/nossr50/core/TamingItemManager.java new file mode 100644 index 000000000..cac7e3f70 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/core/TamingItemManager.java @@ -0,0 +1,85 @@ +package com.gmail.nossr50.core; + +import com.gmail.nossr50.datatypes.skills.subskills.taming.CallOfTheWildType; +import com.gmail.nossr50.mcMMO; +import org.bukkit.Material; + +import java.util.HashMap; + +//TODO: 2.2 - Need better cross-version support +public class TamingItemManager { + private HashMap cotwToSummonItemMap; + private HashMap summonItemToCotwMap; + private final mcMMO pluginRef; + + public TamingItemManager(mcMMO pluginRef) { + this.pluginRef = pluginRef; + initMaps(); + } + + private void initMaps() { + cotwToSummonItemMap = new HashMap<>(); + summonItemToCotwMap = new HashMap<>(); + + registerCatSummonItem(); + registerWolfSummonItem(); + registerHorseSummonItem(); + } + + private void registerCatSummonItem() { + //TODO: Remove the ENUM, use string only + registerSummonItemRelationships(CallOfTheWildType.CAT, Material.COD); + } + + private void registerWolfSummonItem() { + //TODO: Remove the ENUM, use string only + registerSummonItemRelationships(CallOfTheWildType.WOLF, Material.BONE); + } + + private void registerHorseSummonItem() { + //TODO: Remove the ENUM, use string only + registerSummonItemRelationships(CallOfTheWildType.HORSE, Material.APPLE); + } + + public void registerSummonItemRelationships(CallOfTheWildType callOfTheWildType, Material defaultType) { + String materialString = pluginRef.getConfigManager().getConfigTaming().getSubSkills().getCallOfTheWild().getItemString(callOfTheWildType); + pluginRef.getLogger().info("Registering COTW Summon Item - "+callOfTheWildType.toString()+" | "+materialString); + Material material = Material.matchMaterial(materialString); + + if(material != null) { + summonItemToCotwMap.put(material, callOfTheWildType); + cotwToSummonItemMap.put(callOfTheWildType, material); + } else { + pluginRef.getLogger().severe("Item not found for COTW summon! Reverting to backup named: "+defaultType.toString()); + summonItemToCotwMap.put(defaultType, callOfTheWildType); + cotwToSummonItemMap.put(callOfTheWildType, defaultType); + } + + } + + public Material getEntitySummonItem(CallOfTheWildType callOfTheWildType) { + return cotwToSummonItemMap.get(callOfTheWildType); + } + + public CallOfTheWildType getCallType(Material material) { + //TODO: Remove the ENUM, use string only + //TODO: Remove the ENUM, use string only + //TODO: Remove the ENUM, use string only + //TODO: Remove the ENUM, use string only + //TODO: Remove the ENUM, use string only + //TODO: Remove the ENUM, use string only + //TODO: Remove the ENUM, use string only + //TODO: Remove the ENUM, use string only + //TODO: Remove the ENUM, use string only + //TODO: Remove the ENUM, use string only + //TODO: Remove the ENUM, use string only + //TODO: Remove the ENUM, use string only + //TODO: Remove the ENUM, use string only + + return summonItemToCotwMap.get(material); + } + + public boolean isCOTWItem(Material material) { + return summonItemToCotwMap.get(material) != null; + } +} diff --git a/src/main/java/com/gmail/nossr50/database/FlatFileDatabaseManager.java b/src/main/java/com/gmail/nossr50/database/FlatFileDatabaseManager.java index 5cb88f440..754c88a8d 100644 --- a/src/main/java/com/gmail/nossr50/database/FlatFileDatabaseManager.java +++ b/src/main/java/com/gmail/nossr50/database/FlatFileDatabaseManager.java @@ -81,7 +81,7 @@ public final class FlatFileDatabaseManager implements DatabaseManager { /*if (mcMMO.getUpgradeManager().shouldUpgrade(UpgradeType.ADD_UUIDS)) { - new UUIDUpdateAsyncTask(mcMMO.p, getStoredUsers()).runTaskAsynchronously(mcMMO.p); + new UUIDUpdateAsyncTask(mcMMO.p, getStoredUsers()).runTaskAsynchronously(pluginRef); }*/ } diff --git a/src/main/java/com/gmail/nossr50/datatypes/BlockSnapshot.java b/src/main/java/com/gmail/nossr50/datatypes/BlockSnapshot.java new file mode 100644 index 000000000..83e572b41 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/datatypes/BlockSnapshot.java @@ -0,0 +1,30 @@ +package com.gmail.nossr50.datatypes; + +import org.bukkit.Material; +import org.bukkit.block.Block; + +/** + * Contains a snapshot of a block at a specific moment in time + * Used to check before/after type stuff + */ +public class BlockSnapshot { + private final Material oldType; + private Block blockRef; + + public BlockSnapshot(Material oldType, Block blockRef) { + this.oldType = oldType; + this.blockRef = blockRef; + } + + public Material getOldType() { + return oldType; + } + + public Block getBlockRef() { + return blockRef; + } + + public boolean hasChangedType() { + return oldType != blockRef.getState().getType(); + } +} diff --git a/src/main/java/com/gmail/nossr50/datatypes/party/PartyFeature.java b/src/main/java/com/gmail/nossr50/datatypes/party/PartyFeature.java index f51987591..e5090bdc8 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/party/PartyFeature.java +++ b/src/main/java/com/gmail/nossr50/datatypes/party/PartyFeature.java @@ -1,7 +1,6 @@ package com.gmail.nossr50.datatypes.party; import com.gmail.nossr50.commands.party.PartySubcommandType; -import com.gmail.nossr50.util.Permissions; import org.bukkit.entity.Player; public enum PartyFeature { @@ -33,6 +32,6 @@ public enum PartyFeature { return false; } - return Permissions.partySubcommand(player, partySubCommandType); + return pluginRef.getPermissionTools().partySubcommand(player, partySubCommandType); } } diff --git a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java index 790547e44..4ccce8c74 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java @@ -31,7 +31,6 @@ import com.gmail.nossr50.skills.taming.TamingManager; import com.gmail.nossr50.skills.unarmed.UnarmedManager; import com.gmail.nossr50.skills.woodcutting.WoodcuttingManager; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.experience.ExperienceBarManager; import com.gmail.nossr50.util.skills.PerksUtils; import com.gmail.nossr50.util.sounds.SoundManager; @@ -67,6 +66,8 @@ public class McMMOPlayer { private boolean partyChatMode; private boolean adminChatMode; private boolean displaySkillNotifications = true; + private boolean debugMode; + private boolean abilityUse = true; private boolean godMode; private boolean chatSpy = false; //Off by default @@ -106,6 +107,7 @@ public class McMMOPlayer { } experienceBarManager = new ExperienceBarManager(pluginRef,this); + debugMode = false; //Debug mode helps solve support issues, players can toggle it on or off fillPersonalXPModifiers(); //Cache players XP rates } @@ -499,6 +501,18 @@ public class McMMOPlayer { chatSpy = !chatSpy; } + /* + * Debug Mode Flags + */ + + public boolean isDebugMode() { + return debugMode; + } + + public void toggleDebugMode() { + debugMode = !debugMode; + } + /* * Skill notifications */ @@ -863,7 +877,7 @@ public class McMMOPlayer { } public void checkGodMode() { - if (godMode && !Permissions.mcgod(player) + if (godMode && !pluginRef.getPermissionTools().mcgod(player) || godMode && pluginRef.getDynamicSettingsManager().isWorldBlacklisted(player.getWorld().getName())) { toggleGodMode(); player.sendMessage(pluginRef.getLocaleManager().getString("Commands.GodMode.Forbidden")); @@ -871,7 +885,7 @@ public class McMMOPlayer { } public void checkParty() { - if (inParty() && !Permissions.party(player)) { + if (inParty() && !pluginRef.getPermissionTools().party(player)) { removeParty(); player.sendMessage(pluginRef.getLocaleManager().getString("Party.Forbidden")); } @@ -1063,6 +1077,7 @@ public class McMMOPlayer { Player thisPlayer = getPlayer(); resetAbilityMode(); pluginRef.getBleedTimerTask().bleedOut(thisPlayer); + cleanup(); if (syncSave) { getProfile().save(true); @@ -1082,4 +1097,15 @@ public class McMMOPlayer { //Remove user from cache pluginRef.getDatabaseManager().cleanupUser(thisPlayer.getUniqueId()); } + + /** + * Cleanup various things related to this player + * Such as temporary summons.. + * Turning off abilities... + * Etc... + */ + public void cleanup() { + resetAbilityMode(); + getTamingManager().cleanupAllSummons(); + } } diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/SuperAbilityType.java b/src/main/java/com/gmail/nossr50/datatypes/skills/SuperAbilityType.java index 320dd2bdb..ec1edbe81 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/SuperAbilityType.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/SuperAbilityType.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.datatypes.skills; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.StringUtils; import org.bukkit.Material; import org.bukkit.block.BlockState; @@ -159,28 +158,28 @@ public enum SuperAbilityType { public boolean getPermissions(Player player) { switch (this) { case BERSERK: - return Permissions.berserk(player); + return pluginRef.getPermissionTools().berserk(player); case BLAST_MINING: - return Permissions.remoteDetonation(player); + return pluginRef.getPermissionTools().remoteDetonation(player); case GIGA_DRILL_BREAKER: - return Permissions.gigaDrillBreaker(player); + return pluginRef.getPermissionTools().gigaDrillBreaker(player); case GREEN_TERRA: - return Permissions.greenTerra(player); + return pluginRef.getPermissionTools().greenTerra(player); case SERRATED_STRIKES: - return Permissions.serratedStrikes(player); + return pluginRef.getPermissionTools().serratedStrikes(player); case SKULL_SPLITTER: - return Permissions.skullSplitter(player); + return pluginRef.getPermissionTools().skullSplitter(player); case SUPER_BREAKER: - return Permissions.superBreaker(player); + return pluginRef.getPermissionTools().superBreaker(player); case TREE_FELLER: - return Permissions.treeFeller(player); + return pluginRef.getPermissionTools().treeFeller(player); default: return false; diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/behaviours/FishingBehaviour.java b/src/main/java/com/gmail/nossr50/datatypes/skills/behaviours/FishingBehaviour.java index f636b1f22..7b1af1744 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/behaviours/FishingBehaviour.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/behaviours/FishingBehaviour.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.datatypes.skills.behaviours; -import com.gmail.nossr50.config.treasure.FishingTreasureConfig; import com.gmail.nossr50.datatypes.treasure.ShakeTreasure; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/behaviours/HerbalismBehaviour.java b/src/main/java/com/gmail/nossr50/datatypes/skills/behaviours/HerbalismBehaviour.java index a73e0f76c..4aeadb38e 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/behaviours/HerbalismBehaviour.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/behaviours/HerbalismBehaviour.java @@ -2,14 +2,9 @@ package com.gmail.nossr50.datatypes.skills.behaviours; import com.gmail.nossr50.core.MetadataConstants; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.skills.herbalism.HerbalismManager; import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; import org.bukkit.block.BlockState; -import java.util.HashSet; - /** * These behaviour classes are a band-aid fix for a larger problem * Until the new skill system for mcMMO is finished/implemented, there is no good place to store the hardcoded behaviours for each skill @@ -55,141 +50,6 @@ public class HerbalismBehaviour { } } - private int calculateChorusPlantDrops(Block target, boolean triple, HerbalismManager herbalismManager) { - return calculateChorusPlantDropsRecursive(target, new HashSet<>(), triple, herbalismManager); - } - - private int calculateChorusPlantDropsRecursive(Block target, HashSet traversed, boolean triple, HerbalismManager herbalismManager) { - if (target.getType() != Material.CHORUS_PLANT) - return 0; - - // Prevent any infinite loops, who needs more than 64 chorus anyways - if (traversed.size() > 64) - return 0; - - if (!traversed.add(target)) - return 0; - - int dropAmount = 0; - - if (pluginRef.getPlaceStore().isTrue(target)) - pluginRef.getPlaceStore().setFalse(target); - else { - dropAmount++; - - if (herbalismManager.checkDoubleDrop(target.getState())) - pluginRef.getBlockTools().markDropsAsBonus(target.getState(), triple); - } - - for (BlockFace blockFace : new BlockFace[]{BlockFace.UP, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST, BlockFace.WEST}) - dropAmount += calculateChorusPlantDropsRecursive(target.getRelative(blockFace, 1), traversed, triple, herbalismManager); - - return dropAmount; - } - - /** - * Calculate the drop amounts for multi block plants based on the blocks - * relative to them. - * - * @param blockState The {@link BlockState} of the bottom block of the plant - * @return the number of bonus drops to award from the blocks in this plant - */ - public int countAndMarkDoubleDropsMultiBlockPlant(BlockState blockState, boolean triple, HerbalismManager herbalismManager) { - Block block = blockState.getBlock(); - Material blockType = blockState.getType(); - int dropAmount = 0; - int bonusDropAmount = 0; - int bonusAdd = triple ? 2 : 1; - - if (blockType == Material.CHORUS_PLANT) { - dropAmount = 1; - - if (block.getRelative(BlockFace.DOWN, 1).getType() == Material.END_STONE) { - dropAmount = calculateChorusPlantDrops(block, triple, herbalismManager); - } - } else { - //Check the block itself first - if (!pluginRef.getPlaceStore().isTrue(block)) { - dropAmount++; - - if (herbalismManager.checkDoubleDrop(blockState)) - bonusDropAmount += bonusAdd; - } else { - pluginRef.getPlaceStore().setFalse(blockState); - } - - // Handle the two blocks above it - cacti & sugar cane can only grow 3 high naturally - for (int y = 1; y < 255; y++) { - Block relativeBlock = block.getRelative(BlockFace.UP, y); - - if (relativeBlock.getType() != blockType) { - break; - } - - if (pluginRef.getPlaceStore().isTrue(relativeBlock)) { - pluginRef.getPlaceStore().setFalse(relativeBlock); - } else { - dropAmount++; - - if (herbalismManager.checkDoubleDrop(relativeBlock.getState())) - bonusDropAmount += bonusAdd; - } - } - } - - //Mark the original block for bonus drops - pluginRef.getBlockTools().markDropsAsBonus(blockState, bonusDropAmount); - - return dropAmount; - } - - /** - * Calculate the drop amounts for kelp plants based on the blocks - * relative to them. - * - * @param blockState The {@link BlockState} of the bottom block of the plant - * @return the number of bonus drops to award from the blocks in this plant - */ - public int countAndMarkDoubleDropsKelp(BlockState blockState, boolean triple, HerbalismManager herbalismManager) { - Block block = blockState.getBlock(); - - int kelpMaxHeight = 255; - int amount = 1; - - // Handle the two blocks above it - cacti & sugar cane can only grow 3 high naturally - for (int y = 1; y < kelpMaxHeight; y++) { - Block relativeUpBlock = block.getRelative(BlockFace.UP, y); - - if (!isKelp(relativeUpBlock)) - break; - - amount += 1; - - if (herbalismManager.checkDoubleDrop(relativeUpBlock.getState())) - pluginRef.getBlockTools().markDropsAsBonus(relativeUpBlock.getState(), triple); - - } - - return amount; - } - - private int addKelpDrops(int dropAmount, Block relativeBlock) { - if (isKelp(relativeBlock) && !pluginRef.getPlaceStore().isTrue(relativeBlock)) { - dropAmount++; - } else { - pluginRef.getPlaceStore().setFalse(relativeBlock); - } - - return dropAmount; - } - - private boolean isKelp(Block relativeBlock) { - Material kelptype_1 = Material.KELP_PLANT; - Material kelptype_2 = Material.KELP; - - return relativeBlock.getType() == kelptype_1 || relativeBlock.getType() == kelptype_2; - } - /** * Convert blocks affected by the Green Thumb & Green Terra abilities. * diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/behaviours/SkillBehaviourManager.java b/src/main/java/com/gmail/nossr50/datatypes/skills/behaviours/SkillBehaviourManager.java index 64213d61d..55773980c 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/behaviours/SkillBehaviourManager.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/behaviours/SkillBehaviourManager.java @@ -5,8 +5,11 @@ import com.gmail.nossr50.mcMMO; /** * These behaviour classes are a band-aid fix for a larger problem * Until the new skill system for mcMMO is finished/implemented, there is no good place to store the hardcoded behaviours for each skill + * * These behaviour classes server this purpose, they act as a bad solution to a bad problem * These classes will be removed when the new skill system is in place + * + * All per player state will be held in SkillManager classes, and should not be stored in behaviour classes */ @Deprecated public class SkillBehaviourManager { diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/behaviours/TamingBehaviour.java b/src/main/java/com/gmail/nossr50/datatypes/skills/behaviours/TamingBehaviour.java index 17ac10293..e64521d96 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/behaviours/TamingBehaviour.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/behaviours/TamingBehaviour.java @@ -1,6 +1,12 @@ package com.gmail.nossr50.datatypes.skills.behaviours; +import com.gmail.nossr50.datatypes.skills.subskills.taming.CallOfTheWildType; +import com.gmail.nossr50.datatypes.skills.subskills.taming.TamingSummon; import com.gmail.nossr50.mcMMO; +import org.bukkit.Material; +import sun.security.krb5.Config; + +import java.util.HashMap; /** * These behaviour classes are a band-aid fix for a larger problem @@ -12,9 +18,14 @@ import com.gmail.nossr50.mcMMO; public class TamingBehaviour { private final mcMMO pluginRef; + private HashMap cotwSummonDataProperties; public TamingBehaviour(mcMMO pluginRef) { this.pluginRef = pluginRef; } + public TamingSummon getSummon(CallOfTheWildType callOfTheWildType) { + return pluginRef.getConfigManager().getConfigTaming().getCallOfTheWild().getCOTWSummon(callOfTheWildType); + } + } diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java b/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java index 7ca7a40fd..8fa7c231b 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java @@ -6,7 +6,7 @@ import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.PlayerProfile; import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.random.RandomChanceSkill; import com.gmail.nossr50.util.skills.PerksUtils; import com.gmail.nossr50.util.skills.SkillActivationType; @@ -23,6 +23,10 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.inventory.ItemStack; +<<<<<<>>>>>>308e3a4b1f46e9e3de28d6d540dd055a540ed4d5 + public class Roll extends AcrobaticsSubSkill { private final mcMMO pluginRef; @@ -109,7 +113,7 @@ public class Roll extends AcrobaticsSubSkill { */ @Override public boolean hasPermission(Player player) { - return Permissions.isSubSkillEnabled(player, this); + return pluginRef.getPermissionTools().isSubSkillEnabled(player, this); } /** @@ -125,7 +129,7 @@ public class Roll extends AcrobaticsSubSkill { /* Values related to the player */ PlayerProfile playerProfile = pluginRef.getUserManager().getPlayer(player).getProfile(); float skillValue = playerProfile.getSkillLevel(getPrimarySkill()); - boolean isLucky = Permissions.lucky(player, getPrimarySkill()); + boolean isLucky = pluginRef.getPermissionTools().lucky(player, getPrimarySkill()); String[] rollStrings = pluginRef.getRandomChanceTools().calculateAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.ACROBATICS_ROLL); rollChance = rollStrings[0]; @@ -180,7 +184,7 @@ public class Roll extends AcrobaticsSubSkill { } private boolean canRoll(Player player) { - return pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.ACROBATICS_ROLL) && Permissions.isSubSkillEnabled(player, SubSkillType.ACROBATICS_ROLL); + return pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.ACROBATICS_ROLL) && pluginRef.getPermissionTools().isSubSkillEnabled(player, SubSkillType.ACROBATICS_ROLL); } /** @@ -273,21 +277,39 @@ public class Roll extends AcrobaticsSubSkill { return false; } - if (player.getInventory().getItemInMainHand().getType() == Material.ENDER_PEARL || player.isInsideVehicle()) { + McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); + + if (ItemUtils.hasItemInEitherHand(player, Material.ENDER_PEARL) || player.isInsideVehicle()) { + if(mcMMOPlayer.isDebugMode()) { + mcMMOPlayer.getPlayer().sendMessage("Acrobatics XP Prevented: Ender Pearl or Inside Vehicle"); + } return true; } +<<<<<<< HEAD //Teleport CD if (System.currentTimeMillis() < pluginRef.getUserManager().getPlayer(player).getTeleportATS()) return true; if (pluginRef.getUserManager().getPlayer(player).getAcrobaticsManager().hasFallenInLocationBefore(getBlockLocation(player))) +======= + if(UserManager.getPlayer(player).getAcrobaticsManager().hasFallenInLocationBefore(getBlockLocation(player))) + { + if(mcMMOPlayer.isDebugMode()) { + mcMMOPlayer.getPlayer().sendMessage("Acrobatics XP Prevented: Fallen in location before"); + } + +>>>>>>> 308e3a4b1f46e9e3de28d6d540dd055a540ed4d5 return true; + } return false; } private float calculateRollXP(Player player, double damage, boolean isRoll) { + //Clamp Damage to account for insane DRs + damage = Math.min(40, damage); + ItemStack boots = player.getInventory().getBoots(); float xp = (float) (damage * (isRoll ? pluginRef.getConfigManager().getConfigExperience().getRollXP() : pluginRef.getConfigManager().getConfigExperience().getFallXP())); diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/taming/CallOfTheWildType.java b/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/taming/CallOfTheWildType.java new file mode 100644 index 000000000..9a88fc295 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/taming/CallOfTheWildType.java @@ -0,0 +1,26 @@ +package com.gmail.nossr50.datatypes.skills.subskills.taming; + +import com.gmail.nossr50.util.StringUtils; +import org.bukkit.entity.EntityType; + +public enum CallOfTheWildType { + WOLF, + CAT, + HORSE; + + //TODO: This is a hacky fix to make the COTW code in 2.1 more bearable, this will be removed upon the rework planned for COTW + public String getConfigEntityTypeEntry() { + + switch(this) { + case CAT: + return StringUtils.getPrettyEntityTypeString(EntityType.OCELOT); //Even though cats will be summoned in 1.14, we specify Ocelot here. This will be gone in 2.2 + case WOLF: + return StringUtils.getPrettyEntityTypeString(EntityType.WOLF); + case HORSE: + return StringUtils.getPrettyEntityTypeString(EntityType.HORSE); + } + + return null; + } + +} diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/taming/TamingSummon.java b/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/taming/TamingSummon.java new file mode 100644 index 000000000..ebb2a5690 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/taming/TamingSummon.java @@ -0,0 +1,87 @@ +package com.gmail.nossr50.datatypes.skills.subskills.taming; + +import org.bukkit.Material; +import org.bukkit.entity.EntityType; + +/** + * Data Container for properties used in summoning an entity via COTW + */ +public class TamingSummon { + + private Material itemType; + private int itemAmountRequired; + private int entitiesSummoned; + private int summonLifespan; + private int summonCap; + private CallOfTheWildType callOfTheWildType; + private EntityType entityType; + + public TamingSummon(CallOfTheWildType callOfTheWildType, Material itemType, int itemAmountRequired, int entitiesSummoned, int summonLifespan, int summonCap) { + this.callOfTheWildType = callOfTheWildType; + this.itemType = itemType; + this.itemAmountRequired = Math.max(itemAmountRequired, 1); + this.entitiesSummoned = Math.max(entitiesSummoned, 1); + this.summonLifespan = summonLifespan; + this.summonCap = Math.max(summonCap, 1); + + initEntityType(); + } + + private void initEntityType() { + switch(callOfTheWildType) { + case WOLF: + entityType = EntityType.WOLF; + break; + case HORSE: + entityType = EntityType.HORSE; + break; + case CAT: + if(shouldSpawnCatInsteadOfOcelot()) { + //Server is on 1.14 or above + entityType = EntityType.CAT; + } else { + //Server is not on 1.14 or above + entityType = EntityType.OCELOT; + } + } + } + + private boolean shouldSpawnCatInsteadOfOcelot() { + try { + Class clazz = Class.forName("org.bukkit.entity.Panda"); + //Panda exists which means this is at least 1.14, so we should spawn a cat instead of ocelot + return true; + } catch (ClassNotFoundException e) { + /*e.printStackTrace();*/ + return false; + } + } + + public EntityType getEntityType() { + return entityType; + } + + public Material getItemType() { + return itemType; + } + + public int getItemAmountRequired() { + return itemAmountRequired; + } + + public int getEntitiesSummoned() { + return entitiesSummoned; + } + + public int getSummonLifespan() { + return summonLifespan; + } + + public int getSummonCap() { + return summonCap; + } + + public CallOfTheWildType getCallOfTheWildType() { + return callOfTheWildType; + } +} diff --git a/src/main/java/com/gmail/nossr50/dumpster/AlchemyPotionBrewer.java b/src/main/java/com/gmail/nossr50/dumpster/AlchemyPotionBrewer.java index 3835ce522..9f985bdce 100644 --- a/src/main/java/com/gmail/nossr50/dumpster/AlchemyPotionBrewer.java +++ b/src/main/java/com/gmail/nossr50/dumpster/AlchemyPotionBrewer.java @@ -238,13 +238,13 @@ // } // // public static void scheduleCheck(Player player, BrewingStand brewingStand) { -// new AlchemyBrewCheckTask(player, brewingStand).runTask(mcMMO.p); +// new AlchemyBrewCheckTask(player, brewingStand).runTask(pluginRef); // } // // public static void scheduleUpdate(Inventory inventory) { // for (HumanEntity humanEntity : inventory.getViewers()) { // if (humanEntity instanceof Player) { -// new PlayerUpdateInventoryTask((Player) humanEntity).runTask(mcMMO.p); +// new PlayerUpdateInventoryTask((Player) humanEntity).runTask(pluginRef); // } // } // } diff --git a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index ca01b4d4e..69f382db7 100644 --- a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -13,10 +13,10 @@ import com.gmail.nossr50.skills.excavation.ExcavationManager; import com.gmail.nossr50.skills.herbalism.HerbalismManager; import com.gmail.nossr50.skills.mining.MiningManager; import com.gmail.nossr50.skills.woodcutting.WoodcuttingManager; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.sounds.SoundManager; import com.gmail.nossr50.util.sounds.SoundType; import com.gmail.nossr50.worldguard.WorldGuardUtils; +import org.bukkit.ChatColor; import org.bukkit.GameMode; import org.bukkit.Material; import org.bukkit.Tag; @@ -78,6 +78,9 @@ public class BlockListener implements Listener { if (pluginRef.getDynamicSettingsManager().isWorldBlacklisted(event.getBlock().getWorld().getName())) return; + if(!pluginRef.getConfigManager().getConfigExploitPrevention().doPistonsMarkBlocksUnnatural()) + return; + BlockFace direction = event.getDirection(); Block movedBlock = event.getBlock(); // movedBlock = movedBlock.getRelative(direction, 2); @@ -86,8 +89,7 @@ public class BlockListener implements Listener { if (pluginRef.getBlockTools().shouldBeWatched(b.getState())) { movedBlock = b.getRelative(direction); - if (pluginRef.getConfigManager().getConfigExploitPrevention().doPistonsMarkBlocksUnnatural()) - pluginRef.getPlaceStore().setTrue(movedBlock); + pluginRef.getPlaceStore().setTrue(movedBlock); } } } @@ -103,6 +105,10 @@ public class BlockListener implements Listener { if (pluginRef.getDynamicSettingsManager().isWorldBlacklisted(event.getBlock().getWorld().getName())) return; + if(!pluginRef.getConfigManager().getConfigExploitPrevention().doPistonsMarkBlocksUnnatural()) { + return; + } + // Get opposite direction so we get correct block BlockFace direction = event.getDirection(); Block movedBlock = event.getBlock().getRelative(direction); @@ -291,7 +297,7 @@ public class BlockListener implements Listener { * Instead, we check it inside the drops handler. */ if (pluginRef.getSkillTools().doesPlayerHaveSkillPermission(PrimarySkillType.HERBALISM, player)) { - herbalismManager.herbalismBlockCheck(blockState); + herbalismManager.processHerbalismBlockBreakEvent(event); } } @@ -433,15 +439,15 @@ public class BlockListener implements Listener { if (pluginRef.getBlockTools().canActivateAbilities(blockState)) { ItemStack heldItem = player.getInventory().getItemInMainHand(); - if (mcMMOPlayer.getToolPreparationMode(ToolType.HOE) && pluginRef.getItemTools().isHoe(heldItem) && (pluginRef.getBlockTools().affectedByGreenTerra(blockState) || pluginRef.getBlockTools().canMakeMossy(blockState)) && Permissions.greenTerra(player)) { + if (mcMMOPlayer.getToolPreparationMode(ToolType.HOE) && pluginRef.getItemTools().isHoe(heldItem) && (pluginRef.getBlockTools().affectedByGreenTerra(blockState) || pluginRef.getBlockTools().canMakeMossy(blockState)) && pluginRef.getPermissionTools().greenTerra(player)) { mcMMOPlayer.checkAbilityActivation(PrimarySkillType.HERBALISM); - } else if (mcMMOPlayer.getToolPreparationMode(ToolType.AXE) && pluginRef.getItemTools().isAxe(heldItem) && pluginRef.getBlockTools().isLog(blockState) && Permissions.treeFeller(player)) { + } else if (mcMMOPlayer.getToolPreparationMode(ToolType.AXE) && pluginRef.getItemTools().isAxe(heldItem) && pluginRef.getBlockTools().isLog(blockState) && pluginRef.getPermissionTools().treeFeller(player)) { mcMMOPlayer.checkAbilityActivation(PrimarySkillType.WOODCUTTING); - } else if (mcMMOPlayer.getToolPreparationMode(ToolType.PICKAXE) && pluginRef.getItemTools().isPickaxe(heldItem) && pluginRef.getBlockTools().affectedBySuperBreaker(blockState) && Permissions.superBreaker(player)) { + } else if (mcMMOPlayer.getToolPreparationMode(ToolType.PICKAXE) && pluginRef.getItemTools().isPickaxe(heldItem) && pluginRef.getBlockTools().affectedBySuperBreaker(blockState) && pluginRef.getPermissionTools().superBreaker(player)) { mcMMOPlayer.checkAbilityActivation(PrimarySkillType.MINING); - } else if (mcMMOPlayer.getToolPreparationMode(ToolType.SHOVEL) && pluginRef.getItemTools().isShovel(heldItem) && pluginRef.getBlockTools().affectedByGigaDrillBreaker(blockState) && Permissions.gigaDrillBreaker(player)) { + } else if (mcMMOPlayer.getToolPreparationMode(ToolType.SHOVEL) && pluginRef.getItemTools().isShovel(heldItem) && pluginRef.getBlockTools().affectedByGigaDrillBreaker(blockState) && pluginRef.getPermissionTools().gigaDrillBreaker(player)) { mcMMOPlayer.checkAbilityActivation(PrimarySkillType.EXCAVATION); - } else if (mcMMOPlayer.getToolPreparationMode(ToolType.FISTS) && heldItem.getType() == Material.AIR && (pluginRef.getBlockTools().affectedByGigaDrillBreaker(blockState) || blockState.getType() == Material.SNOW || pluginRef.getBlockTools().affectedByBlockCracker(blockState) && Permissions.berserk(player))) { + } else if (mcMMOPlayer.getToolPreparationMode(ToolType.FISTS) && heldItem.getType() == Material.AIR && (pluginRef.getBlockTools().affectedByGigaDrillBreaker(blockState) || blockState.getType() == Material.SNOW || pluginRef.getBlockTools().affectedByBlockCracker(blockState) && pluginRef.getPermissionTools().berserk(player))) { mcMMOPlayer.checkAbilityActivation(PrimarySkillType.UNARMED); } } @@ -508,7 +514,7 @@ public class BlockListener implements Listener { * We don't need to check permissions here because they've already been checked for the ability to even activate. */ if (mcMMOPlayer.getAbilityMode(SuperAbilityType.GREEN_TERRA) && pluginRef.getBlockTools().canMakeMossy(blockState)) { - if (mcMMOPlayer.getHerbalismManager().processGreenTerra(blockState)) { + if (mcMMOPlayer.getHerbalismManager().processGreenTerraBlockConversion(blockState)) { blockState.update(true); } } else if (mcMMOPlayer.getAbilityMode(SuperAbilityType.BERSERK) && heldItem.getType() == Material.AIR) { @@ -540,18 +546,19 @@ public class BlockListener implements Listener { } } - public void debugStickDump(Player player, BlockState blockState) { - - if (pluginRef.getPlaceStore().isTrue(blockState)) - player.sendMessage("[mcMMO DEBUG] This block is not natural and does not reward treasures/XP"); - else { - player.sendMessage("[mcMMO DEBUG] This block is considered natural by mcMMO"); - pluginRef.getUserManager().getPlayer(player).getExcavationManager().printExcavationDebug(player, blockState); + //TODO: Rewrite this + //TODO: Convert into locale strings + private void debugStickDump(Player player, BlockState blockState) { + //Profile not loaded + if(pluginRef.getUserManager().getPlayer(player) == null) + { + return; } - if (WorldGuardUtils.isWorldGuardLoaded()) { - if (pluginRef.getWorldGuardManager().hasMainFlag(player)) - player.sendMessage("[mcMMO DEBUG] World Guard main flag is permitted for this player in this region"); + if(pluginRef.getUserManager().getPlayer(player).isDebugMode()) + { + if(pluginRef.getPlaceStore().isTrue(blockState)) + player.sendMessage("[mcMMO DEBUG] This block is not natural and does not reward treasures/XP"); else player.sendMessage("[mcMMO DEBUG] World Guard main flag is DENIED for this player in this region"); @@ -569,8 +576,14 @@ public class BlockListener implements Listener { if (furnacePlayer != null) { player.sendMessage("[mcMMO DEBUG] This furnace is owned by player " + furnacePlayer.getName()); } - } else - player.sendMessage("[mcMMO DEBUG] This furnace does not have a registered owner"); + else + player.sendMessage("[mcMMO DEBUG] This furnace does not have a registered owner"); + } + + if(pluginRef.getConfigManager().getConfigLeveling().getConfigExperienceBars().isEnableXPBars()) + player.sendMessage("[mcMMO DEBUG] XP bars are enabled, however you should check per-skill settings to make sure those are enabled."); + + player.sendMessage(ChatColor.RED+"You can turn this debug info off by typing "+ ChatColor.GOLD+"/mmodebug"); } if (pluginRef.getConfigManager().getConfigLeveling().isEnableXPBars()) diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 2a223a45f..374feef67 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -13,7 +13,6 @@ import com.gmail.nossr50.skills.taming.Taming; import com.gmail.nossr50.skills.taming.TamingManager; import com.gmail.nossr50.skills.unarmed.UnarmedManager; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.skills.SkillActivationType; import com.gmail.nossr50.worldguard.WorldGuardUtils; import org.bukkit.Material; @@ -64,8 +63,7 @@ public class EntityListener implements Listener { //Prevent entities from giving XP if they target endermite if (event.getTarget() instanceof Endermite) { - if (event.getEntity().hasMetadata(MetadataConstants.UNNATURAL_MOB_METAKEY) - || event.getEntity().getMetadata(MetadataConstants.UNNATURAL_MOB_METAKEY).size() <= 0) + if (event.getEntity().hasMetadata(MetadataConstants.UNNATURAL_MOB_METAKEY)) event.getEntity().setMetadata(MetadataConstants.UNNATURAL_MOB_METAKEY, MetadataConstants.metadataValue); } } @@ -174,11 +172,8 @@ public class EntityListener implements Listener { } else if (isTracked) { pluginRef.getPlaceStore().setTrue(block); } - } else if ((block.getType() == Material.REDSTONE_ORE)) { - } else { - if (pluginRef.getPlaceStore().isTrue(block)) { - pluginRef.getPlaceStore().setFalse(block); - } + } else if(pluginRef.getPlaceStore().isTrue(block)) { + pluginRef.getPlaceStore().setFalse(block); } } @@ -257,13 +252,15 @@ public class EntityListener implements Listener { Projectile projectile = (Projectile) event.getCombuster(); if(projectile.getShooter() instanceof Player) { Player attacker = (Player) projectile.getShooter(); - if(checkParties(event, defender, attacker)) - return; + + //Don't Ignite party members + event.setCancelled(checkParties(event, defender, attacker)); } } else if(event.getCombuster() instanceof Player) { Player attacker = (Player) event.getCombuster(); - if(checkParties(event, defender, attacker)) - return; + + //Don't Ignite party members + event.setCancelled(checkParties(event, defender, attacker)); } } } @@ -432,9 +429,8 @@ public class EntityListener implements Listener { if(!pluginRef.getConfigManager().getConfigParty().isPartyFriendlyFireEnabled()) if ((pluginRef.getPartyManager().inSameParty(defendingPlayer, attackingPlayer) || pluginRef.getPartyManager().areAllies(defendingPlayer, attackingPlayer)) - && !(Permissions.friendlyFire(attackingPlayer) - && Permissions.friendlyFire(defendingPlayer))) { - event.setCancelled(true); + && !(pluginRef.getPermissionTools().friendlyFire(attackingPlayer) + && pluginRef.getPermissionTools().friendlyFire(defendingPlayer))) { return true; } return false; @@ -644,7 +640,7 @@ public class EntityListener implements Listener { * * @param event The event to watch */ - @EventHandler(priority = EventPriority.MONITOR) + @EventHandler(ignoreCancelled = true) public void onEntityDeath(EntityDeathEvent event) { /* WORLD BLACKLIST CHECK */ if (pluginRef.getDynamicSettingsManager().isWorldBlacklisted(event.getEntity().getWorld().getName())) @@ -695,6 +691,29 @@ public class EntityListener implements Listener { } } + @EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST) + public void onEntityBreed(EntityBreedEvent event) { + if(pluginRef.getConfigManager().getConfigExploitPrevention().areSummonsBreedable()) { + //TODO: Change to NBT + if(event.getFather().hasMetadata(MetadataConstants.COTW_TEMPORARY_SUMMON) || event.getMother().hasMetadata(MetadataConstants.COTW_TEMPORARY_SUMMON)) { + event.setCancelled(true); + Animals mom = (Animals) event.getMother(); + Animals father = (Animals) event.getFather(); + + //Prevent love mode spam + mom.setLoveModeTicks(0); + father.setLoveModeTicks(0); + + //Inform the player + if(event.getBreeder() instanceof Player) { + Player player = (Player) event.getBreeder(); + pluginRef.getNotificationManager().sendPlayerInformationChatOnly(player, "Taming.Summon.COTW.BreedingDisallowed"); + } + } + + } + } + /** * Handle ExplosionPrime events that involve modifying the event. * @@ -892,7 +911,7 @@ public class EntityListener implements Listener { * @ 1000 */ case POTATO: /* RESTORES 1/2 HUNGER - RESTORES 2 HUNGER @ 1000 */ - if (Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_FARMERS_DIET)) { + if (pluginRef.getPermissionTools().isSubSkillEnabled(player, SubSkillType.HERBALISM_FARMERS_DIET)) { event.setFoodLevel(pluginRef.getUserManager().getPlayer(player).getHerbalismManager().farmersDiet(newFoodLevel)); } return; @@ -901,7 +920,7 @@ public class EntityListener implements Listener { case TROPICAL_FISH: case COOKED_COD: case COOKED_SALMON: - if (Permissions.isSubSkillEnabled(player, SubSkillType.FISHING_FISHERMANS_DIET)) { + if (pluginRef.getPermissionTools().isSubSkillEnabled(player, SubSkillType.FISHING_FISHERMANS_DIET)) { event.setFoodLevel(pluginRef.getUserManager().getPlayer(player).getFishingManager().handleFishermanDiet(newFoodLevel)); } return; @@ -988,7 +1007,7 @@ public class EntityListener implements Listener { // isFriendlyPet ensures that the Tameable is: Tamed, owned by a player, // and the owner is in the same party // So we can make some assumptions here, about our casting and our check - if (!(Permissions.friendlyFire(player) && Permissions.friendlyFire((Player) tameable.getOwner()))) { + if (!(pluginRef.getPermissionTools().friendlyFire(player) && pluginRef.getPermissionTools().friendlyFire((Player) tameable.getOwner()))) { event.setCancelled(true); } } diff --git a/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java b/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java index 8c52b1e5f..829d1b273 100644 --- a/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java @@ -5,7 +5,6 @@ import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.player.PlayerUpdateInventoryTask; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.worldguard.WorldGuardUtils; import org.bukkit.block.Block; import org.bukkit.block.BlockState; @@ -99,7 +98,7 @@ public class InventoryListener implements Listener { return; } - if (!pluginRef.getUserManager().hasPlayerDataKey(player) || !Permissions.isSubSkillEnabled(player, SubSkillType.SMELTING_FUEL_EFFICIENCY)) { + if (!pluginRef.getUserManager().hasPlayerDataKey(player) || !pluginRef.getPermissionTools().isSubSkillEnabled(player, SubSkillType.SMELTING_FUEL_EFFICIENCY)) { return; } @@ -164,7 +163,7 @@ public class InventoryListener implements Listener { return; } - if (!pluginRef.getUserManager().hasPlayerDataKey(player) || !Permissions.vanillaXpBoost(player, PrimarySkillType.SMELTING)) { + if (!pluginRef.getUserManager().hasPlayerDataKey(player) || !pluginRef.getPermissionTools().vanillaXpBoost(player, PrimarySkillType.SMELTING)) { return; } diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 1d4574abc..bd8211699 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.listeners; import com.gmail.nossr50.chat.ChatManager; -import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.core.MetadataConstants; import com.gmail.nossr50.datatypes.chat.ChatMode; import com.gmail.nossr50.datatypes.party.Party; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.datatypes.skills.subskills.taming.CallOfTheWildType; import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask; @@ -17,7 +17,10 @@ import com.gmail.nossr50.skills.mining.MiningManager; import com.gmail.nossr50.skills.repair.RepairManager; import com.gmail.nossr50.skills.salvage.SalvageManager; import com.gmail.nossr50.skills.taming.TamingManager; -import com.gmail.nossr50.util.*; +import com.gmail.nossr50.util.ChimaeraWing; +import com.gmail.nossr50.util.HardcoreManager; +import com.gmail.nossr50.util.Misc; +import com.gmail.nossr50.util.Motd; import com.gmail.nossr50.util.sounds.SoundManager; import com.gmail.nossr50.util.sounds.SoundType; import com.gmail.nossr50.worldguard.WorldGuardUtils; @@ -141,7 +144,7 @@ public class PlayerListener implements Listener { Player killedPlayer = event.getEntity(); - if (!killedPlayer.hasMetadata(MetadataConstants.PLAYER_DATA_METAKEY) || Permissions.hardcoreBypass(killedPlayer)) { + if (!killedPlayer.hasMetadata(MetadataConstants.PLAYER_DATA_METAKEY) || pluginRef.getPermissionTools().hardcoreBypass(killedPlayer)) { return; } @@ -274,7 +277,7 @@ public class PlayerListener implements Listener { } } - if (Permissions.isSubSkillEnabled(player, SubSkillType.FISHING_INNER_PEACE)) { + if (pluginRef.getPermissionTools().isSubSkillEnabled(player, SubSkillType.FISHING_INNER_PEACE)) { //Don't modify XP below vanilla values if (fishingManager.addInnerPeaceVanillaXPBoost(event.getExpToDrop()) > 1) event.setExpToDrop(fishingManager.addInnerPeaceVanillaXPBoost(event.getExpToDrop())); @@ -811,11 +814,18 @@ public class PlayerListener implements Listener { Material type = heldItem.getType(); TamingManager tamingManager = mcMMOPlayer.getTamingManager(); - if (type == MainConfig.getInstance().getTamingCOTWMaterial(EntityType.WOLF)) { + + switch(type) { + case + } + + if (type == ) { tamingManager.summonWolf(); - } else if (type == MainConfig.getInstance().getTamingCOTWMaterial(EntityType.OCELOT)) { + } + else if (type == Config.getInstance().getTamingCOTWMaterial(CallOfTheWildType.CAT.getConfigEntityTypeEntry())) { tamingManager.summonOcelot(); - } else if (type == MainConfig.getInstance().getTamingCOTWMaterial(EntityType.HORSE)) { + } + else if (type == Config.getInstance().getTamingCOTWMaterial(CallOfTheWildType.HORSE.getConfigEntityTypeEntry())) { tamingManager.summonHorse(); } diff --git a/src/main/java/com/gmail/nossr50/listeners/SelfListener.java b/src/main/java/com/gmail/nossr50/listeners/SelfListener.java index f73fc6c88..e49fe3a9c 100644 --- a/src/main/java/com/gmail/nossr50/listeners/SelfListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/SelfListener.java @@ -7,7 +7,6 @@ import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent; import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent; import com.gmail.nossr50.events.skills.abilities.McMMOPlayerAbilityActivateEvent; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.player.PlayerLevelTools; import com.gmail.nossr50.worldguard.WorldGuardUtils; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -31,7 +30,7 @@ public class SelfListener implements Listener { for (int i = 0; i < event.getLevelsGained(); i++) { int previousLevelGained = event.getSkillLevel() - i; //Send player skill unlock notifications - pluginRef.getUserManager().getPlayer(player).processUnlockNotifications(pluginRef, event.getSkill(), previousLevelGained); + pluginRef.getUserManager().getPlayer(player).processUnlockNotifications(event.getSkill(), previousLevelGained); } //Reset the delay timer @@ -63,6 +62,11 @@ public class SelfListener implements Listener { McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player); PrimarySkillType primarySkillType = event.getSkill(); + if(mcMMOPlayer.isDebugMode()) { + mcMMOPlayer.getPlayer().sendMessage(event.getSkill().toString() + " XP Gained"); + mcMMOPlayer.getPlayer().sendMessage("Incoming Raw XP: "+event.getRawXpGained()); + } + //WorldGuard XP Check if (event.getXpGainReason() == XPGainReason.PVE || event.getXpGainReason() == XPGainReason.PVP || @@ -72,6 +76,10 @@ public class SelfListener implements Listener { if (!pluginRef.getWorldGuardManager().hasXPFlag(player)) { event.setRawXpGained(0); event.setCancelled(true); + + if(mcMMOPlayer.isDebugMode()) { + mcMMOPlayer.getPlayer().sendMessage("No WG XP Flag - New Raw XP: "+event.getRawXpGained()); + } } } } @@ -85,7 +93,7 @@ public class SelfListener implements Listener { int earlyGameBonusXP = 0; //Give some bonus XP for low levels - if(PlayerLevelTools.qualifiesForEarlyGameBoost(mcMMOPlayer, primarySkillType)) + if(pluginRef.getPlayerLevelTools().qualifiesForEarlyGameBoost(mcMMOPlayer, primarySkillType)) { earlyGameBonusXP += (mcMMOPlayer.getXpToLevel(primarySkillType) * 0.05); event.setRawXpGained(event.getRawXpGained() + earlyGameBonusXP); @@ -95,6 +103,9 @@ public class SelfListener implements Listener { int threshold = pluginRef.getConfigManager().getConfigLeveling().getSkillThreshold(primarySkillType); if (threshold <= 0 || !pluginRef.getConfigManager().getConfigLeveling().getConfigLevelingDiminishedReturns().isDiminishedReturnsEnabled()) { + if(mcMMOPlayer.isDebugMode()) { + mcMMOPlayer.getPlayer().sendMessage("Final Raw XP: "+event.getRawXpGained()); + } // Diminished returns is turned off return; } @@ -137,6 +148,10 @@ public class SelfListener implements Listener { } } + + if(mcMMOPlayer.isDebugMode()) { + mcMMOPlayer.getPlayer().sendMessage("Final Raw XP: "+event.getRawXpGained()); + } } diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index b26409e39..ec00e019c 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -96,6 +96,7 @@ public class mcMMO extends JavaPlugin { private RandomChanceTools randomChanceTools; private RankTools rankTools; private ItemTools itemTools; + private PermissionTools permissionTools; /* Never-Ending tasks */ private BleedTimerTask bleedTimerTask; @@ -121,11 +122,19 @@ public class mcMMO extends JavaPlugin { public void onEnable() { try { getLogger().setFilter(new LogFilter(this)); + + //TODO: Disgusting... MetadataConstants.metadataValue = new FixedMetadataValue(this, true); + PluginManager pluginManager = getServer().getPluginManager(); healthBarPluginEnabled = pluginManager.getPlugin("HealthBar") != null; + + //Init Locale Manager localeManager = new LocaleManager(this); + //Init Permission Tools + permissionTools = new PermissionTools(this); + //upgradeManager = new UpgradeManager(); setupFilePaths(); @@ -190,7 +199,7 @@ public class mcMMO extends JavaPlugin { placeStore = ChunkManagerFactory.getChunkManager(); // Get our ChunkletManager if (getConfigManager().getConfigParty().getPTP().isPtpWorldBasedPermissions()) { - Permissions.generateWorldTeleportPermissions(); + pluginRef.getPermissionTools().generateWorldTeleportPermissions(); } //Init Rank Tools @@ -785,4 +794,8 @@ public class mcMMO extends JavaPlugin { public ItemTools getItemTools() { return itemTools; } + + public PermissionTools getPermissionTools() { + return permissionTools; + } } diff --git a/src/main/java/com/gmail/nossr50/party/PartyManager.java b/src/main/java/com/gmail/nossr50/party/PartyManager.java index 876c005b6..941e80e9a 100644 --- a/src/main/java/com/gmail/nossr50/party/PartyManager.java +++ b/src/main/java/com/gmail/nossr50/party/PartyManager.java @@ -10,7 +10,6 @@ import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.items.TeleportationWarmup; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.sounds.SoundManager; import com.gmail.nossr50.util.sounds.SoundType; import org.bukkit.OfflinePlayer; @@ -131,7 +130,7 @@ public final class PartyManager { * @return true if party is full and cannot be joined */ public boolean isPartyFull(Player player, Party targetParty) { - return !Permissions.partySizeBypass(player) + return !pluginRef.getPermissionTools().partySizeBypass(player) && targetParty.getMembers().size() >= pluginRef.getConfigManager().getConfigParty().getPartySizeLimit(); } diff --git a/src/main/java/com/gmail/nossr50/runnables/skills/DelayedHerbalismXPCheckTask.java b/src/main/java/com/gmail/nossr50/runnables/skills/DelayedHerbalismXPCheckTask.java new file mode 100644 index 000000000..3ecc03747 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/runnables/skills/DelayedHerbalismXPCheckTask.java @@ -0,0 +1,23 @@ +package com.gmail.nossr50.runnables.skills; + +import com.gmail.nossr50.datatypes.BlockSnapshot; +import com.gmail.nossr50.datatypes.player.McMMOPlayer; +import org.bukkit.scheduler.BukkitRunnable; + +import java.util.ArrayList; + +public class DelayedHerbalismXPCheckTask extends BukkitRunnable { + + private final McMMOPlayer mcMMOPlayer; + private final ArrayList chorusBlocks; + + public DelayedHerbalismXPCheckTask(McMMOPlayer mcMMOPlayer, ArrayList chorusBlocks) { + this.mcMMOPlayer = mcMMOPlayer; + this.chorusBlocks = chorusBlocks; + } + + @Override + public void run() { + mcMMOPlayer.getHerbalismManager().awardXPForBlockSnapshots(chorusBlocks); + } +} diff --git a/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java b/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java index 28fbc06c3..0b80365d7 100644 --- a/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java +++ b/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java @@ -10,7 +10,6 @@ import com.gmail.nossr50.datatypes.skills.behaviours.AcrobaticsBehaviour; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.skills.ParticleEffectUtils; import com.gmail.nossr50.util.skills.SkillActivationType; import org.bukkit.Location; @@ -64,7 +63,7 @@ public class AcrobaticsManager extends SkillManager { if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.ACROBATICS_DODGE)) return false; - if (Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.ACROBATICS_DODGE)) { + if (pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.ACROBATICS_DODGE)) { /*if (damager instanceof LightningStrike && Acrobatics.dodgeLightningDisabled) { return false; }*/ diff --git a/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java b/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java index c6e14db8a..812de62c6 100644 --- a/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java +++ b/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java @@ -9,7 +9,6 @@ import com.gmail.nossr50.datatypes.skills.behaviours.ArcheryBehaviour; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.skills.SkillActivationType; import org.bukkit.Location; import org.bukkit.entity.Entity; @@ -34,21 +33,21 @@ public class ArcheryManager extends SkillManager { if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.ARCHERY_DAZE)) return false; - return target instanceof Player && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.ARCHERY_DAZE); + return target instanceof Player && pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.ARCHERY_DAZE); } public boolean canSkillShot() { if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.ARCHERY_SKILL_SHOT)) return false; - return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.ARCHERY_SKILL_SHOT); + return pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.ARCHERY_SKILL_SHOT); } public boolean canRetrieveArrows() { if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.ARCHERY_ARROW_RETRIEVAL)) return false; - return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.ARCHERY_ARROW_RETRIEVAL); + return pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.ARCHERY_ARROW_RETRIEVAL); } /** diff --git a/src/main/java/com/gmail/nossr50/skills/axes/AxesManager.java b/src/main/java/com/gmail/nossr50/skills/axes/AxesManager.java index d6886284f..56a719978 100644 --- a/src/main/java/com/gmail/nossr50/skills/axes/AxesManager.java +++ b/src/main/java/com/gmail/nossr50/skills/axes/AxesManager.java @@ -9,7 +9,6 @@ import com.gmail.nossr50.datatypes.skills.ToolType; import com.gmail.nossr50.datatypes.skills.behaviours.AxesBehaviour; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.SkillManager; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.skills.ParticleEffectUtils; import com.gmail.nossr50.util.skills.SkillActivationType; import org.bukkit.entity.LivingEntity; @@ -32,39 +31,39 @@ public class AxesManager extends SkillManager { if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_AXE_MASTERY)) return false; - return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.AXES_AXE_MASTERY); + return pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.AXES_AXE_MASTERY); } public boolean canCriticalHit(LivingEntity target) { if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_CRITICAL_STRIKES)) return false; - return target.isValid() && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.AXES_CRITICAL_STRIKES); + return target.isValid() && pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.AXES_CRITICAL_STRIKES); } public boolean canImpact(LivingEntity target) { if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_ARMOR_IMPACT)) return false; - return target.isValid() && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.AXES_ARMOR_IMPACT) && axesBehaviour.hasArmor(target); + return target.isValid() && pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.AXES_ARMOR_IMPACT) && axesBehaviour.hasArmor(target); } public boolean canGreaterImpact(LivingEntity target) { if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_GREATER_IMPACT)) return false; - return target.isValid() && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.AXES_GREATER_IMPACT) && !axesBehaviour.hasArmor(target); + return target.isValid() && pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.AXES_GREATER_IMPACT) && !axesBehaviour.hasArmor(target); } public boolean canUseSkullSplitter(LivingEntity target) { if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_SKULL_SPLITTER)) return false; - return target.isValid() && mcMMOPlayer.getAbilityMode(SuperAbilityType.SKULL_SPLITTER) && Permissions.skullSplitter(getPlayer()); + return target.isValid() && mcMMOPlayer.getAbilityMode(SuperAbilityType.SKULL_SPLITTER) && pluginRef.getPermissionTools().skullSplitter(getPlayer()); } public boolean canActivateAbility() { - return mcMMOPlayer.getToolPreparationMode(ToolType.AXE) && Permissions.skullSplitter(getPlayer()); + return mcMMOPlayer.getToolPreparationMode(ToolType.AXE) && pluginRef.getPermissionTools().skullSplitter(getPlayer()); } /** diff --git a/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java b/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java index e5b6e2177..51a2c0bff 100644 --- a/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java +++ b/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java @@ -9,7 +9,6 @@ import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; import org.bukkit.Location; import org.bukkit.block.BlockState; import org.bukkit.entity.EntityType; @@ -35,7 +34,7 @@ public class ExcavationManager extends SkillManager { public void excavationBlockCheck(BlockState blockState) { int xp = excavationBehaviour.getBlockXP(blockState); - if (Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.EXCAVATION_ARCHAEOLOGY)) { + if (pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.EXCAVATION_ARCHAEOLOGY)) { List treasures = excavationBehaviour.getTreasures(blockState); if (!treasures.isEmpty()) { @@ -76,7 +75,7 @@ public class ExcavationManager extends SkillManager { public void printExcavationDebug(Player player, BlockState blockState) { - if (Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.EXCAVATION_ARCHAEOLOGY)) { + if (pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.EXCAVATION_ARCHAEOLOGY)) { List treasures = excavationBehaviour.getTreasures(blockState); if (!treasures.isEmpty()) { diff --git a/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java b/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java index 5619a1bd3..e695e3c1b 100644 --- a/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java +++ b/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java @@ -1,7 +1,6 @@ package com.gmail.nossr50.skills.fishing; import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.config.treasure.FishingTreasureConfig; import com.gmail.nossr50.core.MetadataConstants; import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.interactions.NotificationType; @@ -18,7 +17,6 @@ import com.gmail.nossr50.events.skills.fishing.McMMOPlayerShakeEvent; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.random.RandomChanceSkillStatic; import com.gmail.nossr50.util.sounds.SoundManager; import com.gmail.nossr50.util.sounds.SoundType; @@ -62,11 +60,11 @@ public class FishingManager extends SkillManager { } public boolean canShake(Entity target) { - return target instanceof LivingEntity && pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.FISHING_SHAKE) && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.FISHING_SHAKE); + return target instanceof LivingEntity && pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.FISHING_SHAKE) && pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.FISHING_SHAKE); } public boolean canMasterAngler() { - return getSkillLevel() >= pluginRef.getRankTools().getUnlockLevel(SubSkillType.FISHING_MASTER_ANGLER) && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.FISHING_MASTER_ANGLER); + return getSkillLevel() >= pluginRef.getRankTools().getUnlockLevel(SubSkillType.FISHING_MASTER_ANGLER) && pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.FISHING_MASTER_ANGLER); } public void setFishingRodCastTimestamp() { @@ -146,7 +144,7 @@ public class FishingManager extends SkillManager { if (overFishCount == 2) { for (Player player : Bukkit.getOnlinePlayers()) { - if (player.isOp() || Permissions.adminChat(player)) { + if (player.isOp() || pluginRef.getPermissionTools().adminChat(player)) { player.sendMessage(pluginRef.getLocaleManager().getString("Fishing.OverFishingDetected", getPlayer().getDisplayName())); } } @@ -180,7 +178,7 @@ public class FishingManager extends SkillManager { Player player = getPlayer(); - if (!Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.FISHING_ICE_FISHING)) { + if (!pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.FISHING_ICE_FISHING)) { return false; } @@ -262,7 +260,7 @@ public class FishingManager extends SkillManager { public boolean isMagicHunterEnabled() { return pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.FISHING_MAGIC_HUNTER) && pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.FISHING_TREASURE_HUNTER) - && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.FISHING_TREASURE_HUNTER); + && pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.FISHING_TREASURE_HUNTER); } /** @@ -277,7 +275,7 @@ public class FishingManager extends SkillManager { FishingTreasure treasure = null; if (pluginRef.getConfigManager().getConfigFishing().isAllowCustomDrops() - && Permissions.isSubSkillEnabled(player, SubSkillType.FISHING_TREASURE_HUNTER)) { + && pluginRef.getPermissionTools().isSubSkillEnabled(player, SubSkillType.FISHING_TREASURE_HUNTER)) { treasure = getFishingTreasure(); } diff --git a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java index 86d0a96c7..d57a84223 100644 --- a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java +++ b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java @@ -1,8 +1,9 @@ package com.gmail.nossr50.skills.herbalism; -import com.gmail.nossr50.config.treasure.HerbalismTreasureConfig; import com.gmail.nossr50.core.MetadataConstants; +import com.gmail.nossr50.datatypes.BlockSnapshot; import com.gmail.nossr50.datatypes.experience.XPGainReason; +import com.gmail.nossr50.datatypes.experience.XPGainSource; import com.gmail.nossr50.datatypes.interactions.NotificationType; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; @@ -12,22 +13,29 @@ import com.gmail.nossr50.datatypes.skills.ToolType; import com.gmail.nossr50.datatypes.skills.behaviours.HerbalismBehaviour; import com.gmail.nossr50.datatypes.treasure.HylianTreasure; import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.runnables.skills.DelayedHerbalismXPCheckTask; import com.gmail.nossr50.runnables.skills.HerbalismBlockUpdaterTask; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.random.RandomChanceSkillStatic; import com.gmail.nossr50.util.skills.SkillActivationType; import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; import org.bukkit.block.BlockState; import org.bukkit.block.data.Ageable; +import org.bukkit.block.data.BlockData; import org.bukkit.entity.Player; +import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; import org.bukkit.metadata.FixedMetadataValue; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; import java.util.List; public class HerbalismManager extends SkillManager { @@ -50,7 +58,7 @@ public class HerbalismManager extends SkillManager { Player player = getPlayer(); ItemStack item = player.getInventory().getItemInMainHand(); - return item.getAmount() > 0 && item.getType() == Material.WHEAT_SEEDS && pluginRef.getBlockTools().canMakeMossy(blockState) && Permissions.greenThumbBlock(player, blockState.getType()); + return item.getAmount() > 0 && item.getType() == Material.WHEAT_SEEDS && pluginRef.getBlockTools().canMakeMossy(blockState) && pluginRef.getPermissionTools().greenThumbBlock(player, blockState.getType()); } public boolean canUseShroomThumb(BlockState blockState) { @@ -61,14 +69,14 @@ public class HerbalismManager extends SkillManager { PlayerInventory inventory = player.getInventory(); Material itemType = inventory.getItemInMainHand().getType(); - return (itemType == Material.BROWN_MUSHROOM || itemType == Material.RED_MUSHROOM) && inventory.contains(Material.BROWN_MUSHROOM, 1) && inventory.contains(Material.RED_MUSHROOM, 1) && pluginRef.getBlockTools().canMakeShroomy(blockState) && Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_SHROOM_THUMB); + return (itemType == Material.BROWN_MUSHROOM || itemType == Material.RED_MUSHROOM) && inventory.contains(Material.BROWN_MUSHROOM, 1) && inventory.contains(Material.RED_MUSHROOM, 1) && pluginRef.getBlockTools().canMakeShroomy(blockState) && pluginRef.getPermissionTools().isSubSkillEnabled(player, SubSkillType.HERBALISM_SHROOM_THUMB); } public boolean canUseHylianLuck() { if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.HERBALISM_HYLIAN_LUCK)) return false; - return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.HERBALISM_HYLIAN_LUCK); + return pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.HERBALISM_HYLIAN_LUCK); } public boolean canGreenTerraBlock(BlockState blockState) { @@ -76,10 +84,10 @@ public class HerbalismManager extends SkillManager { } public boolean canActivateAbility() { - return mcMMOPlayer.getToolPreparationMode(ToolType.HOE) && Permissions.greenTerra(getPlayer()); + return mcMMOPlayer.getToolPreparationMode(ToolType.HOE) && pluginRef.getPermissionTools().greenTerra(getPlayer()); } - public boolean canGreenTerraPlant() { + public boolean isGreenTerraActive() { return mcMMOPlayer.getAbilityMode(SuperAbilityType.GREEN_TERRA); } @@ -99,10 +107,10 @@ public class HerbalismManager extends SkillManager { * @param blockState The {@link BlockState} to check ability activation for * @return true if the ability was successful, false otherwise */ - public boolean processGreenTerra(BlockState blockState) { + public boolean processGreenTerraBlockConversion(BlockState blockState) { Player player = getPlayer(); - if (!Permissions.greenThumbBlock(player, blockState.getType())) { + if (!pluginRef.getPermissionTools().greenThumbBlock(player, blockState.getType())) { return false; } @@ -121,62 +129,399 @@ public class HerbalismManager extends SkillManager { } /** - * @param blockState The {@link BlockState} to check ability activation for + * Handles herbalism abilities and XP rewards from a BlockBreakEvent + * @param blockBreakEvent The Block Break Event to process */ - public void herbalismBlockCheck(BlockState blockState) { + public void processHerbalismBlockBreakEvent(BlockBreakEvent blockBreakEvent) { Player player = getPlayer(); - Material material = blockState.getType(); - boolean oneBlockPlant = isOneBlockPlant(material); - // Prevents placing and immediately breaking blocks for exp - if (oneBlockPlant && pluginRef.getPlaceStore().isTrue(blockState)) { + if (pluginRef.getConfigManager().getConfigExploitPrevention().getConfigSectionExploitHerbalism().isPreventVehicleAutoFarming() && player.isInsideVehicle()) { return; } - if (!canBlockCheck()) { - return; - } + /* + * There are single-block plants and multi-block plants in Minecraft + * In order to give out proper rewards, we need to collect all blocks that would be broken from this event + */ - int amount; - int xp; - boolean greenTerra = mcMMOPlayer.getAbilityMode(skill.getSuperAbility()); + //Grab all broken blocks + HashSet brokenBlocks = getBrokenHerbalismBlocks(blockBreakEvent); -// if (mcMMO.getModManager().isCustomHerbalismBlock(blockState)) { -// CustomBlock customBlock = mcMMO.getModManager().getBlock(blockState); -// xp = customBlock.getXpGain(); -// -// if (Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_DOUBLE_DROPS) && customBlock.isDoubleDropEnabled()) { -// drops = blockState.getBlock().getDrops(); -// } -// } -// else { - xp = pluginRef.getDynamicSettingsManager().getExperienceManager().getHerbalismXp(blockState.getType()); - - if (!oneBlockPlant) { - //Kelp is actually two blocks mixed together - if (material == Material.KELP_PLANT || material == Material.KELP) { - amount = herbalismBehaviour.countAndMarkDoubleDropsKelp(blockState, greenTerra, this); - } else { - amount = herbalismBehaviour.countAndMarkDoubleDropsMultiBlockPlant(blockState, greenTerra, this); - } - - xp *= amount; - } else { - /* MARK SINGLE BLOCK CROP FOR DOUBLE DROP */ - if (checkDoubleDrop(blockState)) - pluginRef.getBlockTools().markDropsAsBonus(blockState, greenTerra); - } - - if (Permissions.greenThumbPlant(player, material)) { - processGreenThumbPlants(blockState, greenTerra); - } - //} mod config close - - applyXpGain(xp, XPGainReason.PVE); + //Handle rewards, xp, ability interactions, etc + processHerbalismOnBlocksBroken(blockBreakEvent, brokenBlocks); } - public boolean isOneBlockPlant(Material material) { - return !pluginRef.getMaterialMapStore().isMultiBlock(material); + /** + * Process rewards for a set of plant blocks for Herbalism + * @param blockBreakEvent the block break event + * @param brokenPlants plant blocks to process + */ + private void processHerbalismOnBlocksBroken(BlockBreakEvent blockBreakEvent, HashSet brokenPlants) { + BlockState originalBreak = blockBreakEvent.getBlock().getState(); + + //TODO: The design of Green Terra needs to change, this is a mess + if(pluginRef.getPermissionTools().greenThumbPlant(getPlayer(), originalBreak.getType())) { + processGreenThumbPlants(originalBreak, isGreenTerraActive()); + } + + /* + * Mark blocks for double drops + * Be aware of the hacky interactions we are doing with Chorus Plants + */ + checkDoubleDropsOnBrokenPlants(brokenPlants); + + //It would take an expensive algorithm to predict which parts of a Chorus Tree will break as a result of root break + //So this hacky method is used instead + ArrayList delayedChorusBlocks = new ArrayList<>(); //Blocks that will be checked in future ticks + HashSet noDelayPlantBlocks = new HashSet<>(); //Blocks that will be checked immediately + + for(Block brokenPlant : brokenPlants) { + /* + * This check is to make XP bars appear to work properly with Chorus Trees by giving XP for the originalBreak immediately instead of later + */ + if(brokenPlant.getLocation().equals(originalBreak.getBlock().getLocation())) { + //If its the same block as the original, we are going to directly check it for being a valid XP gain and add it to the nonChorusBlocks list even if its a chorus block + //This stops a delay from happening when bringing up the XP bar for chorus trees + if(!pluginRef.getPlaceStore().isTrue(originalBreak)) { + //Even if its a chorus block, the original break will be moved to nonChorusBlocks for immediate XP rewards + noDelayPlantBlocks.add(brokenPlant); + } else { + if(isChorusTree(brokenPlant.getType())) { + //If its a chorus tree AND it was marked as true in the placestore then we add this block to the list of chorus blocks + delayedChorusBlocks.add(new BlockSnapshot(brokenPlant.getType(), brokenPlant)); + } else { + noDelayPlantBlocks.add(brokenPlant); //If its not a chorus plant that was marked as unnatural but it was marked unnatural, put it in the nodelay list to be handled + } + } + } else if(isChorusTree(brokenPlant.getType())) { + //Chorus Blocks get checked for XP several ticks later to avoid expensive calculations + delayedChorusBlocks.add(new BlockSnapshot(brokenPlant.getType(), brokenPlant)); + } else { + noDelayPlantBlocks.add(brokenPlant); + } + } + + //Give out XP to the non-chorus blocks + if(noDelayPlantBlocks.size() > 0) { + //Note: Will contain 1 chorus block if the original block was a chorus block, this is to prevent delays for the XP bar + awardXPForPlantBlocks(noDelayPlantBlocks); + } + + if(delayedChorusBlocks.size() > 0) { + //Check XP for chorus blocks + DelayedHerbalismXPCheckTask delayedHerbalismXPCheckTask = new DelayedHerbalismXPCheckTask(mcMMOPlayer, delayedChorusBlocks); + + //Large delay because the tree takes a while to break + delayedHerbalismXPCheckTask.runTaskLater(pluginRef, 20); //Calculate Chorus XP + Bonus Drops 1 tick later + } + } + + public void checkDoubleDropsOnBrokenPlants(Collection brokenPlants) { + for(Block brokenPlant : brokenPlants) { + BlockState brokenPlantState = brokenPlant.getState(); + BlockData plantData = brokenPlantState.getBlockData(); + + //Check for double drops + if(!pluginRef.getPlaceStore().isTrue(brokenPlant)) { + + /* + * + * Natural Blocks + * + * + * + */ + + //Not all things that are natural should give double drops, make sure its fully mature as well + if(plantData instanceof Ageable) { + Ageable ageable = (Ageable) plantData; + + if(isAgeableMature(ageable) || isBizarreAgeable(plantData)) { + markForBonusDrops(brokenPlantState); + } + } else if(checkDoubleDrop(brokenPlantState)) { + //Add metadata to mark this block for double or triple drops + markForBonusDrops(brokenPlantState); + } + } else { + + /* + * + * Unnatural Blocks + * + */ + + //If its a Crop we need to reward XP when its fully grown + if(isAgeableAndFullyMature(plantData) && !isBizarreAgeable(plantData)) { + //Add metadata to mark this block for double or triple drops + markForBonusDrops(brokenPlantState); + } + } + } + } + + /** + * Checks if BlockData is ageable and we can trust that age for Herbalism rewards/XP reasons + * The age of Cactus and sugar canes seems to be useless to use, hence they are bizarre + * @param blockData target BlockData + * @return returns true if the ageable is trustworthy for Herbalism XP / Rewards + */ + public boolean isBizarreAgeable(BlockData blockData) { + if(blockData instanceof Ageable) { + //Catcus and Sugar Canes cannot be trusted + switch(blockData.getMaterial()) { + case CACTUS: + case SUGAR_CANE: + return true; + default: + return false; + } + } + + return false; + } + + public void markForBonusDrops(BlockState brokenPlantState) { + //Add metadata to mark this block for double or triple drops + boolean awardTriple = mcMMOPlayer.getAbilityMode(SuperAbilityType.GREEN_TERRA); + pluginRef.getBlockTools().markDropsAsBonus(brokenPlantState, awardTriple); + } + + /** + * Checks if a block is an ageable and if that ageable is fully mature + * @param plantData target plant + * @return returns true if the block is both an ageable and fully mature + */ + public boolean isAgeableAndFullyMature(BlockData plantData) { + return plantData instanceof Ageable && isAgeableMature((Ageable) plantData); + } + + public void awardXPForPlantBlocks(HashSet brokenPlants) { + int xpToReward = 0; + + for(Block brokenPlantBlock : brokenPlants) { + BlockState brokenBlockNewState = brokenPlantBlock.getState(); + BlockData plantData = brokenBlockNewState.getBlockData(); + + if(pluginRef.getPlaceStore().isTrue(brokenBlockNewState)) { + /* + * + * Unnatural Blocks + * + * + */ + + //If its a Crop we need to reward XP when its fully grown + if(isAgeableAndFullyMature(plantData) && !isBizarreAgeable(plantData)) { + xpToReward += pluginRef.getDynamicSettingsManager().getExperienceManager().getHerbalismXp(brokenBlockNewState.getType()); + } + + //Mark it as natural again as it is being broken + pluginRef.getPlaceStore().setFalse(brokenBlockNewState); + } else { + /* + * + * Natural Blocks + * + * + */ + + //Calculate XP + if(plantData instanceof Ageable) { + Ageable plantAgeable = (Ageable) plantData; + if(isAgeableMature(plantAgeable) || isBizarreAgeable(plantData)) { + xpToReward += pluginRef.getDynamicSettingsManager().getExperienceManager().getHerbalismXp(brokenBlockNewState.getType()); + } + } else { + xpToReward += pluginRef.getDynamicSettingsManager().getExperienceManager().getHerbalismXp(brokenPlantBlock.getType()); + } + } + } + + if(mcMMOPlayer.isDebugMode()) { + mcMMOPlayer.getPlayer().sendMessage("Plants processed: "+brokenPlants.size()); + } + + //Reward XP + if(xpToReward > 0) { + applyXpGain(xpToReward, XPGainReason.PVE, XPGainSource.SELF); + } + } + + public boolean isAgeableMature(Ageable ageable) { + return ageable.getAge() == ageable.getMaximumAge() + && ageable.getAge() != 0; + } + + /** + * Award XP for any blocks that used to be something else but are now AIR + * @param brokenPlants snapshot of broken blocks + */ + public void awardXPForBlockSnapshots(ArrayList brokenPlants) { + /* + * This handles XP for blocks that we need to check are broken after the fact + * This only applies to chorus trees right now + */ + int xpToReward = 0; + int blocksGivingXP = 0; + + for(BlockSnapshot blockSnapshot : brokenPlants) { + BlockState brokenBlockNewState = blockSnapshot.getBlockRef().getState(); + + //Remove metadata from the snapshot of blocks + if(brokenBlockNewState.hasMetadata(MetadataConstants.BONUS_DROPS_METAKEY)) { + brokenBlockNewState.removeMetadata(MetadataConstants.BONUS_DROPS_METAKEY, pluginRef); + } + + //If the block is not AIR that means it wasn't broken + if(brokenBlockNewState.getType() != Material.AIR) { + continue; + } + + if(pluginRef.getPlaceStore().isTrue(brokenBlockNewState)) { + //Mark it as natural again as it is being broken + pluginRef.getPlaceStore().setFalse(brokenBlockNewState); + } else { + //TODO: Do we care about chorus flower age? + //Calculate XP for the old type + xpToReward += pluginRef.getDynamicSettingsManager().getExperienceManager().getHerbalismXp(blockSnapshot.getOldType()); + blocksGivingXP++; + } + } + + if(mcMMOPlayer.isDebugMode()) { + mcMMOPlayer.getPlayer().sendMessage("Chorus Plants checked for XP: "+brokenPlants.size()); + mcMMOPlayer.getPlayer().sendMessage("Valid Chorus Plant XP Gains: "+blocksGivingXP); + } + + //Reward XP + if(xpToReward > 0) { + applyXpGain(xpToReward, XPGainReason.PVE, XPGainSource.SELF); + } + } + + /** + * Process and return plant blocks from a BlockBreakEvent + * @param blockBreakEvent target event + * @return a set of plant-blocks that were broken as a result of this event + */ + private HashSet getBrokenHerbalismBlocks(BlockBreakEvent blockBreakEvent) { + //Get an updated capture of this block + BlockState originalBlockBlockState = blockBreakEvent.getBlock().getState(); + Material originalBlockMaterial = originalBlockBlockState.getType(); + HashSet blocksBroken = new HashSet<>(); //Blocks broken + + //Check if this block is a one block plant or not + boolean oneBlockPlant = isOneBlockPlant(originalBlockMaterial); + + if(oneBlockPlant) { + //If the block is a one-block plant return only that + blocksBroken.add(originalBlockBlockState.getBlock()); + } else { + //If the block is a multi-block structure, capture a set of all blocks broken and return that + blocksBroken = getBrokenBlocksMultiBlockPlants(originalBlockBlockState, blockBreakEvent); + } + + //Return all broken plant-blocks + return blocksBroken; + } + + private HashSet getBrokenChorusBlocks(BlockState originalBreak) { + HashSet traversedBlocks = grabChorusTreeBrokenBlocksRecursive(originalBreak.getBlock(), new HashSet<>()); + return traversedBlocks; + } + + private HashSet grabChorusTreeBrokenBlocksRecursive(Block currentBlock, HashSet traversed) { + if (!isChorusTree(currentBlock.getType())) + return traversed; + + // Prevent any infinite loops, who needs more than 256 chorus anyways + if (traversed.size() > 256) + return traversed; + + if (!traversed.add(currentBlock)) + return traversed; + + //Grab all Blocks in the Tree + for (BlockFace blockFace : new BlockFace[] { BlockFace.UP, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST ,BlockFace.WEST}) + grabChorusTreeBrokenBlocksRecursive(currentBlock.getRelative(blockFace, 1), traversed); + + traversed.add(currentBlock); + + return traversed; + } + + /** + * Grab a set of all plant blocks that are broken as a result of this event + * The method to grab these blocks is a bit hacky and does not hook into the API + * Basically we expect the blocks to be broken if this event is not cancelled and we determine which block are broken on our end rather than any event state captures + * + * @param blockBreakEvent target event + * @return a set of plant-blocks broken from this event + */ + protected HashSet getBrokenBlocksMultiBlockPlants(BlockState originalBlockBroken, BlockBreakEvent blockBreakEvent) { + //Track the broken blocks + HashSet brokenBlocks; + + if (isChorusBranch(originalBlockBroken.getType())) { + brokenBlocks = getBrokenChorusBlocks(originalBlockBroken); + } else { + brokenBlocks = getBlocksBrokenAbove(originalBlockBroken); + } + + return brokenBlocks; + } + + private boolean isChorusBranch(Material blockType) { + return blockType == Material.CHORUS_PLANT; + } + + private boolean isChorusTree(Material blockType) { + return blockType == Material.CHORUS_PLANT || blockType == Material.CHORUS_FLOWER; + } + + /** + * Grabs blocks upwards from a target block + * A lot of Plants/Crops in Herbalism only break vertically from a broken block + * The vertical search returns early if it runs into anything that is not a multi-block plant + * Multi-block plants are hard-coded and kept in {@link com.gmail.nossr50.core.MaterialMapStore} + * + * @param breakPointBlockState The point of the "break" + * @return A set of blocks above the target block which can be assumed to be broken + */ + private HashSet getBlocksBrokenAbove(BlockState breakPointBlockState) { + HashSet brokenBlocks = new HashSet<>(); + Block block = breakPointBlockState.getBlock(); + + //Add the initial block to the set + brokenBlocks.add(block); + + //Limit our search + int maxHeight = 255; + + // Search vertically for multi-block plants, exit early if any non-multi block plants + for (int y = 1; y < maxHeight; y++) { + //TODO: Should this grab state? It would be more expensive.. + Block relativeUpBlock = block.getRelative(BlockFace.UP, y); + + //Abandon our search if the block isn't multi + if(!pluginRef.getMaterialMapStore().isMultiBlockPlant(relativeUpBlock.getType())) + break; + + brokenBlocks.add(relativeUpBlock); + } + + return brokenBlocks; + } + + /** + * If the plant is considered a one block plant + * This is determined by seeing if it exists in a hard-coded collection of Multi-Block plants + * @param material target plant material + * @return true if the block is not contained in the collection of multi-block plants + */ + private boolean isOneBlockPlant(Material material) { + return !pluginRef.getMaterialMapStore().isMultiBlockPlant(material); } /** @@ -324,7 +669,7 @@ public class HerbalismManager extends SkillManager { return; } - if (!handleBlockState(blockState, greenTerra)) { + if (!processGrowingPlants(blockState, greenTerra)) { return; } @@ -340,7 +685,7 @@ public class HerbalismManager extends SkillManager { new HerbalismBlockUpdaterTask(blockState).runTaskLater(pluginRef, 0); } - private boolean handleBlockState(BlockState blockState, boolean greenTerra) { + private boolean processGrowingPlants(BlockState blockState, boolean greenTerra) { int greenThumbStage = getGreenThumbStage(); blockState.setMetadata(MetadataConstants.GREEN_THUMB_METAKEY, new FixedMetadataValue(pluginRef, (int) (System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR))); diff --git a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java index 372280e99..43db928b9 100644 --- a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java +++ b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java @@ -12,7 +12,6 @@ import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.skills.AbilityCooldownTask; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockState; @@ -51,7 +50,7 @@ public class MiningManager extends SkillManager { if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.MINING_DEMOLITIONS_EXPERTISE)) return false; - return getSkillLevel() >= miningBehaviour.getDemolitionExpertUnlockLevel() && Permissions.demolitionsExpertise(getPlayer()); + return getSkillLevel() >= miningBehaviour.getDemolitionExpertUnlockLevel() && pluginRef.getPermissionTools().demolitionsExpertise(getPlayer()); } public boolean canDetonate() { @@ -59,7 +58,7 @@ public class MiningManager extends SkillManager { return canUseBlastMining() && player.isSneaking() && miningBehaviour.isDetonator(player.getInventory().getItemInMainHand()) - && Permissions.remoteDetonation(player); + && pluginRef.getPermissionTools().remoteDetonation(player); } public boolean canUseBlastMining() { @@ -71,11 +70,11 @@ public class MiningManager extends SkillManager { if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.MINING_BIGGER_BOMBS)) return false; - return getSkillLevel() >= miningBehaviour.getBiggerBombsUnlockLevel() && Permissions.biggerBombs(getPlayer()); + return getSkillLevel() >= miningBehaviour.getBiggerBombsUnlockLevel() && pluginRef.getPermissionTools().biggerBombs(getPlayer()); } public boolean canDoubleDrop() { - return pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.MINING_DOUBLE_DROPS) && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.MINING_DOUBLE_DROPS); + return pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.MINING_DOUBLE_DROPS) && pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.MINING_DOUBLE_DROPS); } /** diff --git a/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java b/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java index b060da386..7d85913ce 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java @@ -7,7 +7,6 @@ import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.random.RandomChanceSkillStatic; import com.gmail.nossr50.util.skills.SkillActivationType; import com.gmail.nossr50.util.sounds.SoundManager; @@ -233,7 +232,7 @@ public class RepairManager extends SkillManager { private short repairCalculate(short durability, int repairAmount) { Player player = getPlayer(); - if (Permissions.isSubSkillEnabled(player, SubSkillType.REPAIR_REPAIR_MASTERY) + if (pluginRef.getPermissionTools().isSubSkillEnabled(player, SubSkillType.REPAIR_REPAIR_MASTERY) && pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.REPAIR_REPAIR_MASTERY)) { double maxBonusCalc = pluginRef.getDynamicSettingsManager().getSkillPropertiesManager().getMaxBonus(SubSkillType.REPAIR_REPAIR_MASTERY) / 100.0D; @@ -243,7 +242,7 @@ public class RepairManager extends SkillManager { repairAmount += bonus; } - if (Permissions.isSubSkillEnabled(player, SubSkillType.REPAIR_SUPER_REPAIR) && checkPlayerProcRepair()) { + if (pluginRef.getPermissionTools().isSubSkillEnabled(player, SubSkillType.REPAIR_SUPER_REPAIR) && checkPlayerProcRepair()) { repairAmount *= 2.0D; } @@ -285,12 +284,12 @@ public class RepairManager extends SkillManager { return; } - if (Permissions.arcaneBypass(player)) { + if (pluginRef.getPermissionTools().arcaneBypass(player)) { pluginRef.getNotificationManager().sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Repair.Arcane.Perfect"); return; } - if (getArcaneForgingRank() == 0 || !Permissions.isSubSkillEnabled(player, SubSkillType.REPAIR_ARCANE_FORGING)) { + if (getArcaneForgingRank() == 0 || !pluginRef.getPermissionTools().isSubSkillEnabled(player, SubSkillType.REPAIR_ARCANE_FORGING)) { for (Enchantment enchant : enchants.keySet()) { item.removeEnchantment(enchant); } diff --git a/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java b/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java index 648f78b00..364885683 100644 --- a/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java +++ b/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java @@ -9,7 +9,6 @@ import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.skills.salvage.salvageables.Salvageable; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.random.RandomChanceSkillStatic; import com.gmail.nossr50.util.sounds.SoundManager; @@ -66,12 +65,12 @@ public class SalvageManager extends SkillManager { } // Permissions checks on material and item types - if (!Permissions.salvageItemType(player, salvageable.getSalvageItemType())) { + if (!pluginRef.getPermissionTools().salvageItemType(player, salvageable.getSalvageItemType())) { pluginRef.getNotificationManager().sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission"); return; } - if (!Permissions.salvageMaterialType(player, salvageable.getSalvageItemMaterialCategory())) { + if (!pluginRef.getPermissionTools().salvageMaterialType(player, salvageable.getSalvageItemMaterialCategory())) { pluginRef.getNotificationManager().sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission"); return; } @@ -203,7 +202,7 @@ public class SalvageManager extends SkillManager { }*/ public double getExtractFullEnchantChance() { - if (Permissions.hasSalvageEnchantBypassPerk(getPlayer())) + if (pluginRef.getPermissionTools().hasSalvageEnchantBypassPerk(getPlayer())) return 100.0D; return pluginRef.getConfigManager().getConfigSalvage().getConfigArcaneSalvage().getExtractFullEnchantChance().get(getArcaneSalvageRank()); @@ -216,7 +215,7 @@ public class SalvageManager extends SkillManager { private ItemStack arcaneSalvageCheck(Map enchants) { Player player = getPlayer(); - if (!pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.SALVAGE_ARCANE_SALVAGE) || !Permissions.arcaneSalvage(player)) { + if (!pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.SALVAGE_ARCANE_SALVAGE) || !pluginRef.getPermissionTools().arcaneSalvage(player)) { pluginRef.getNotificationManager().sendPlayerInformationChatOnly(player, "Salvage.Skills.ArcaneFailed"); return null; } @@ -238,7 +237,7 @@ public class SalvageManager extends SkillManager { } if (!salvageBehaviour.isArcaneSalvageEnchantLoss() - || Permissions.hasSalvageEnchantBypassPerk(player) + || pluginRef.getPermissionTools().hasSalvageEnchantBypassPerk(player) || pluginRef.getRandomChanceTools().checkRandomChanceExecutionSuccess(new RandomChanceSkillStatic(getExtractFullEnchantChance(), getPlayer(), SubSkillType.SALVAGE_ARCANE_SALVAGE))) { enchantMeta.addStoredEnchant(enchant.getKey(), enchantLevel, true); diff --git a/src/main/java/com/gmail/nossr50/skills/smelting/SmeltingManager.java b/src/main/java/com/gmail/nossr50/skills/smelting/SmeltingManager.java index 88237fbe1..93ac6df92 100644 --- a/src/main/java/com/gmail/nossr50/skills/smelting/SmeltingManager.java +++ b/src/main/java/com/gmail/nossr50/skills/smelting/SmeltingManager.java @@ -7,7 +7,6 @@ import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.SkillManager; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.skills.SkillActivationType; import org.bukkit.event.inventory.FurnaceBurnEvent; import org.bukkit.inventory.ItemStack; @@ -18,7 +17,7 @@ public class SmeltingManager extends SkillManager { } public boolean isSecondSmeltSuccessful() { - return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.SMELTING_SECOND_SMELT) + return pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.SMELTING_SECOND_SMELT) && pluginRef.getRandomChanceTools().isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.SMELTING_SECOND_SMELT, getPlayer()); } diff --git a/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java b/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java index b25fee70b..bdedcfe75 100644 --- a/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java +++ b/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java @@ -8,7 +8,6 @@ import com.gmail.nossr50.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.datatypes.skills.ToolType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.SkillManager; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.skills.SkillActivationType; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; @@ -24,22 +23,22 @@ public class SwordsManager extends SkillManager { } public boolean canActivateAbility() { - return mcMMOPlayer.getToolPreparationMode(ToolType.SWORD) && Permissions.serratedStrikes(getPlayer()); + return mcMMOPlayer.getToolPreparationMode(ToolType.SWORD) && pluginRef.getPermissionTools().serratedStrikes(getPlayer()); } public boolean canUseStab() { - return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.SWORDS_STAB) && pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.SWORDS_STAB); + return pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.SWORDS_STAB) && pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.SWORDS_STAB); } public boolean canUseRupture() { - return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.SWORDS_RUPTURE) && pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.SWORDS_RUPTURE); + return pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.SWORDS_RUPTURE) && pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.SWORDS_RUPTURE); } public boolean canUseCounterAttack(Entity target) { if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.SWORDS_COUNTER_ATTACK)) return false; - return target instanceof LivingEntity && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.SWORDS_COUNTER_ATTACK); + return target instanceof LivingEntity && pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.SWORDS_COUNTER_ATTACK); } public boolean canUseSerratedStrike() { diff --git a/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java b/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java index 05e80e732..9b26950f3 100644 --- a/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java +++ b/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java @@ -1,22 +1,25 @@ package com.gmail.nossr50.skills.taming; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.MetadataConstants; import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.interactions.NotificationType; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.events.fake.FakeEntityTameEvent; +import com.gmail.nossr50.datatypes.skills.behaviours.TamingBehaviour; +import com.gmail.nossr50.datatypes.skills.subskills.taming.CallOfTheWildType; +import com.gmail.nossr50.datatypes.skills.subskills.taming.TamingSummon; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.random.RandomChanceSkillStatic; import com.gmail.nossr50.util.skills.ParticleEffectUtils; import com.gmail.nossr50.util.skills.SkillActivationType; +import com.gmail.nossr50.util.sounds.SoundManager; +import com.gmail.nossr50.util.sounds.SoundType; import org.bukkit.Location; -import org.bukkit.Sound; import org.bukkit.entity.*; import org.bukkit.inventory.ItemStack; @@ -25,72 +28,79 @@ import java.util.HashMap; import java.util.List; public class TamingManager extends SkillManager { - private HashMap> summonedEntities = new HashMap<>(); + //TODO: Temporary cache, will be changed in 2.2 + private long lastSummonTimeStamp; + private TamingBehaviour tamingBehaviour; + + private HashMap> playerSummonedEntities; public TamingManager(mcMMO pluginRef, McMMOPlayer mcMMOPlayer) { super(pluginRef, mcMMOPlayer, PrimarySkillType.TAMING); + init(); } - protected void addToTracker(LivingEntity livingEntity) { - TrackedTamingEntity trackedEntity = new TrackedTamingEntity(livingEntity); + //TODO: Hacky stuff for 2.1, will be cleaned up in 2.2 + private void init() { + //Init Behaviour + tamingBehaviour = new TamingBehaviour(pluginRef); - if (!summonedEntities.containsKey(livingEntity.getType())) { - summonedEntities.put(livingEntity.getType(), new ArrayList<>()); + //prevents accidentally summoning too many things when holding down left click + lastSummonTimeStamp = 0L; + + //Init per-player tracking of summoned entities + initPerPlayerSummonTracking(); + } + + private void initPerPlayerSummonTracking() { + playerSummonedEntities = new HashMap<>(); + + for(CallOfTheWildType callOfTheWildType : CallOfTheWildType.values()) { + playerSummonedEntities.put(callOfTheWildType, new ArrayList()); } - - summonedEntities.get(livingEntity.getType()).add(trackedEntity); - } - - protected List getTrackedEntities(EntityType entityType) { - return summonedEntities.get(entityType); - } - - protected void removeFromTracker(TrackedTamingEntity trackedEntity) { - summonedEntities.get(trackedEntity.getLivingEntity().getType()).remove(trackedEntity); } public boolean canUseThickFur() { return pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_THICK_FUR) - && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_THICK_FUR); + && pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_THICK_FUR); } public boolean canUseEnvironmentallyAware() { return pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_ENVIRONMENTALLY_AWARE) - && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_ENVIRONMENTALLY_AWARE); + && pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_ENVIRONMENTALLY_AWARE); } public boolean canUseShockProof() { return pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_SHOCK_PROOF) - && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_SHOCK_PROOF); + && pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_SHOCK_PROOF); } public boolean canUseHolyHound() { return pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_ENVIRONMENTALLY_AWARE) - && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_HOLY_HOUND); + && pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_HOLY_HOUND); } public boolean canUseFastFoodService() { return pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_FAST_FOOD_SERVICE) - && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_FAST_FOOD_SERVICE); + && pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_FAST_FOOD_SERVICE); } public boolean canUseSharpenedClaws() { return pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_SHARPENED_CLAWS) - && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_SHARPENED_CLAWS); + && pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_SHARPENED_CLAWS); } public boolean canUseGore() { - if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_GORE)) + if(!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_GORE)) return false; - return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_GORE); + return pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_GORE); } public boolean canUseBeastLore() { - if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_BEAST_LORE)) + if(!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_BEAST_LORE)) return false; - return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_BEAST_LORE); + return pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_BEAST_LORE); } /** @@ -99,17 +109,16 @@ public class TamingManager extends SkillManager { * @param entity The LivingEntity to award XP for */ public void awardTamingXP(LivingEntity entity) { - applyXpGain(pluginRef.getDynamicSettingsManager().getExperienceManager().getTamingXp(entity.getType()), XPGainReason.PVE); + applyXpGain(ExperienceConfig.getInstance().getTamingXP(entity.getType()), XPGainReason.PVE); } /** * Apply the Fast Food Service ability. * - * @param wolf The wolf using the ability + * @param wolf The wolf using the ability * @param damage The damage being absorbed by the wolf */ public void fastFoodService(Wolf wolf, double damage) { - //chance (3rd param) if (!pluginRef.getRandomChanceTools().isActivationSuccessful(SkillActivationType.RANDOM_STATIC_CHANCE, SubSkillType.TAMING_FAST_FOOD_SERVICE, getPlayer())) { return; } @@ -134,62 +143,66 @@ public class TamingManager extends SkillManager { return 0; } - pluginRef.getBleedTimerTask().add(target, getPlayer(), Taming.getInstance().getGoreBleedTicks(), 1, 2); + pluginRef.getBleedTimerTask().add(target, getPlayer(), pluginRef.getConfigManager().getConfigTaming().getSubSkills().getGore().getGoreBleedTicks(), 1, 2); if (target instanceof Player) { - pluginRef.getNotificationManager().sendPlayerInformation((Player) target, NotificationType.SUBSKILL_MESSAGE, "Combat.StruckByGore"); + pluginRef.getNotificationManager().sendPlayerInformation((Player)target, NotificationType.SUBSKILL_MESSAGE, "Combat.StruckByGore"); } pluginRef.getNotificationManager().sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Combat.Gore"); - damage = (damage * Taming.getInstance().getGoreModifier()) - damage; + damage = (damage * pluginRef.getConfigManager().getConfigTaming().getSubSkills().getGore().getGoreMofifier()) - damage; return damage; } - public double getSharpenedClawsDamage() { - return Taming.getInstance().getSharpenedClawsBonusDamage(); + //TODO: Add tooltips to /taming for this + public double sharpenedClaws(boolean PVE) { + if(PVE) + return pluginRef.getConfigManager().getConfigTaming().getSubSkills().getSharpenedClaws().getBonusDamage().getPVEModifier(); + else + return pluginRef.getConfigManager().getConfigTaming().getSubSkills().getSharpenedClaws().getBonusDamage().getPVPModifier(); } /** * Summon an ocelot to your side. */ public void summonOcelot() { - if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD)) + if(!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD)) return; - if (!Permissions.callOfTheWild(getPlayer(), EntityType.OCELOT)) { + if (!pluginRef.getPermissionTools().callOfTheWild(getPlayer(), EntityType.OCELOT)) { return; } - callOfTheWild(EntityType.OCELOT, MainConfig.getInstance().getTamingCOTWCost(EntityType.OCELOT)); + processCallOfTheWild(); } /** * Summon a wolf to your side. */ public void summonWolf() { - if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD)) + if(!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD)) return; - if (!Permissions.callOfTheWild(getPlayer(), EntityType.WOLF)) { + if (!pluginRef.getPermissionTools().callOfTheWild(getPlayer(), EntityType.WOLF)) { return; } - callOfTheWild(EntityType.WOLF, MainConfig.getInstance().getTamingCOTWCost(EntityType.WOLF)); + processCallOfTheWild(); } /** * Summon a horse to your side. */ public void summonHorse() { - if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD)) + if(!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD)) return; - if (!Permissions.callOfTheWild(getPlayer(), EntityType.HORSE)) { + if (!pluginRef.getPermissionTools().callOfTheWild(getPlayer(), EntityType.HORSE)) { return; } - callOfTheWild(EntityType.HORSE, MainConfig.getInstance().getTamingCOTWCost(EntityType.HORSE)); + processCallOfTheWild(); } /** @@ -223,10 +236,10 @@ public class TamingManager extends SkillManager { } public void pummel(LivingEntity target, Wolf wolf) { - if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_PUMMEL)) + if(!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_PUMMEL)) return; - if (!pluginRef.getRandomChanceTools().checkRandomChanceExecutionSuccess(new RandomChanceSkillStatic(AdvancedConfig.getInstance().getPummelChance(), getPlayer(), SubSkillType.TAMING_PUMMEL))) + if(!pluginRef.getRandomChanceTools().checkRandomChanceExecutionSuccess(new RandomChanceSkillStatic(pluginRef, pluginRef.getDynamicSettingsManager().getSkillPropertiesManager().getStaticChance(SubSkillType.TAMING_PUMMEL), getPlayer(), SubSkillType.TAMING_PUMMEL))) return; ParticleEffectUtils.playGreaterImpactEffect(target); @@ -242,9 +255,11 @@ public class TamingManager extends SkillManager { } public void attackTarget(LivingEntity target) { - if (target instanceof Tameable) { + if(target instanceof Tameable) + { Tameable tameable = (Tameable) target; - if (tameable.getOwner() == getPlayer()) { + if(tameable.getOwner() == getPlayer()) + { return; } } @@ -266,133 +281,258 @@ public class TamingManager extends SkillManager { } } + + private void processCallOfTheWild() { + //Prevent summoning too many things accidentally if a player holds down the button + if(lastSummonTimeStamp + 150 > System.currentTimeMillis()) { + return; + } else { + lastSummonTimeStamp = System.currentTimeMillis(); + } + + Player player = getPlayer(); + ItemStack itemInMainHand = player.getInventory().getItemInMainHand(); + + //Check if the item the player is currently holding is a COTW item + if(isCOTWItem(itemInMainHand)) { + //Get the summoning type + CallOfTheWildType callOfTheWildType = pluginRef.getDynamicSettingsManager().getTamingItemManager().getCallType(itemInMainHand.getType()); + TamingSummon tamingSummon = tamingBehaviour.getSummon(callOfTheWildType); + + //Players will pay for the cost if at least one thing was summoned + int amountSummoned = 0; + + //Check to see if players have the correct amount of the item required to summon + if(itemInMainHand.getAmount() >= tamingSummon.getItemAmountRequired()) { + //Initial Spawn location + Location spawnLocation = Misc.getLocationOffset(player.getLocation(), 1); + + //COTW can summon multiple entities per usage + for (int i = 0; i < tamingSummon.getEntitiesSummoned(); i++) { + + if (getAmountCurrentlySummoned(callOfTheWildType) >= tamingSummon.getSummonCap()) { + pluginRef.getNotificationManager().sendPlayerInformationChatOnly(player, "Taming.Summon.COTW.Limit", + String.valueOf(tamingSummon.getSummonCap()), + StringUtils.getCapitalized(callOfTheWildType.toString())); + break; + } + + spawnLocation = Misc.getLocationOffset(spawnLocation, 1); + spawnCOTWEntity(callOfTheWildType, spawnLocation, tamingSummon.getEntityType()); + + //Inform the player about what they have just done + if (tamingSummon.getSummonLifespan() > 0) { + pluginRef.getNotificationManager().sendPlayerInformationChatOnly(player, "Taming.Summon.COTW.Success.WithLifespan", + StringUtils.getCapitalized(callOfTheWildType.toString()), String.valueOf(tamingSummon.getSummonLifespan())); + } else { + pluginRef.getNotificationManager().sendPlayerInformationChatOnly(player, "Taming.Summon.COTW.Success.WithoutLifespan", StringUtils.getCapitalized(callOfTheWildType.toString())); + } + + //Send Sound + SoundManager.sendSound(player, player.getLocation(), SoundType.ABILITY_ACTIVATED_GENERIC); + + amountSummoned++; + } + + //Remove items from the player if they had at least one entity summoned successfully + if(amountSummoned >= 1) { + //Remove the items used to summon + int itemAmountAfterPayingCost = itemInMainHand.getAmount() - tamingSummon.getItemAmountRequired(); + itemInMainHand.setAmount(itemAmountAfterPayingCost); + player.updateInventory(); + } + + } else { + //Player did not have enough of the item in their main hand + int difference = tamingSummon.getItemAmountRequired() - itemInMainHand.getAmount(); + pluginRef.getNotificationManager().sendPlayerInformationChatOnly(player, "Taming.Summon.COTW.NeedMoreItems", String.valueOf(difference), StringUtils.getPrettyItemString(itemInMainHand.getType())); + } + } + } + + private void spawnCOTWEntity(CallOfTheWildType callOfTheWildType, Location spawnLocation, EntityType entityType) { + switch(callOfTheWildType) { + case CAT: + //Entity type is needed for cats because in 1.13 and below we spawn ocelots, in 1.14 and above we spawn cats + spawnCat(spawnLocation, entityType); + break; + case HORSE: + spawnHorse(spawnLocation); + break; + case WOLF: + spawnWolf(spawnLocation); + break; + } + } + + private void spawnWolf(Location spawnLocation) { + LivingEntity callOfWildEntity = (LivingEntity) getPlayer().getWorld().spawnEntity(spawnLocation, EntityType.WOLF); + + //This is used to prevent XP gains for damaging this entity + applyMetaDataToCOTWEntity(callOfWildEntity); + + setBaseCOTWEntityProperties(callOfWildEntity); + + ((Wolf) callOfWildEntity).setAdult(); + addToTracker(callOfWildEntity, CallOfTheWildType.WOLF); + + //Setup wolf stats + callOfWildEntity.setMaxHealth(20.0); + callOfWildEntity.setHealth(callOfWildEntity.getMaxHealth()); + + callOfWildEntity.setCustomName(pluginRef.getLocaleManager().getString("Taming.Summon.Name.Format", getPlayer().getName(), StringUtils.getPrettyEntityTypeString(EntityType.WOLF))); + } + + private void spawnCat(Location spawnLocation, EntityType entityType) { + LivingEntity callOfWildEntity = (LivingEntity) getPlayer().getWorld().spawnEntity(spawnLocation, entityType); + + //This is used to prevent XP gains for damaging this entity + applyMetaDataToCOTWEntity(callOfWildEntity); + + setBaseCOTWEntityProperties(callOfWildEntity); + + addToTracker(callOfWildEntity, CallOfTheWildType.CAT); + + //Randomize the cat + if(callOfWildEntity instanceof Ocelot) { + int numberOfTypes = Ocelot.Type.values().length; + ((Ocelot) callOfWildEntity).setCatType(Ocelot.Type.values()[Misc.getRandom().nextInt(numberOfTypes)]); + ((Ocelot) callOfWildEntity).setAdult(); + } else if(callOfWildEntity instanceof Cat) { + int numberOfTypes = Cat.Type.values().length; + ((Cat) callOfWildEntity).setCatType(Cat.Type.values()[Misc.getRandom().nextInt(numberOfTypes)]); + ((Cat) callOfWildEntity).setAdult(); + } + + callOfWildEntity.setCustomName(pluginRef.getLocaleManager().getString("Taming.Summon.Name.Format", getPlayer().getName(), StringUtils.getPrettyEntityTypeString(entityType))); + + //Particle effect + ParticleEffectUtils.playCallOfTheWildEffect(callOfWildEntity); + } + + private void spawnHorse(Location spawnLocation) { + LivingEntity callOfWildEntity = (LivingEntity) getPlayer().getWorld().spawnEntity(spawnLocation, EntityType.HORSE); + applyMetaDataToCOTWEntity(callOfWildEntity); + + setBaseCOTWEntityProperties(callOfWildEntity); + + addToTracker(callOfWildEntity, CallOfTheWildType.HORSE); + + //Randomize Horse + Horse horse = (Horse) callOfWildEntity; + + callOfWildEntity.setMaxHealth(15.0 + (Misc.getRandom().nextDouble() * 15)); + callOfWildEntity.setHealth(callOfWildEntity.getMaxHealth()); + horse.setColor(Horse.Color.values()[Misc.getRandom().nextInt(Horse.Color.values().length)]); + horse.setStyle(Horse.Style.values()[Misc.getRandom().nextInt(Horse.Style.values().length)]); + horse.setJumpStrength(Math.max(pluginRef.getConfigManager().getConfigTaming().getMinHorseJumpStrength(), + Math.min(Math.min(Misc.getRandom().nextDouble(), Misc.getRandom().nextDouble()) * 2, pluginRef.getConfigManager().getConfigTaming().getMaxHorseJumpStrength()))); + horse.setAdult(); + + //TODO: setSpeed, once available + + callOfWildEntity.setCustomName(pluginRef.getLocaleManager().getString("Taming.Summon.Name.Format", getPlayer().getName(), StringUtils.getPrettyEntityTypeString(EntityType.HORSE))); + + //Particle effect + ParticleEffectUtils.playCallOfTheWildEffect(callOfWildEntity); + } + + private void setBaseCOTWEntityProperties(LivingEntity callOfWildEntity) { + ((Tameable) callOfWildEntity).setOwner(getPlayer()); + callOfWildEntity.setRemoveWhenFarAway(false); + } + + private void applyMetaDataToCOTWEntity(LivingEntity callOfWildEntity) { + //This is used to prevent XP gains for damaging this entity + callOfWildEntity.setMetadata(MetadataConstants.UNNATURAL_MOB_METAKEY, MetadataConstants.metadataValue); + + //This helps identify the entity as being summoned by COTW + callOfWildEntity.setMetadata(MetadataConstants.COTW_TEMPORARY_SUMMON, MetadataConstants.metadataValue); + } + /** - * Handle the Call of the Wild ability. - * - * @param type The type of entity to summon. - * @param summonAmount The amount of material needed to summon the entity + * Whether or not the itemstack is used for COTW + * @param itemStack target ItemStack + * @return true if it is used for any COTW */ - private void callOfTheWild(EntityType type, int summonAmount) { - Player player = getPlayer(); - - ItemStack heldItem = player.getInventory().getItemInMainHand(); - int heldItemAmount = heldItem.getAmount(); - Location location = player.getLocation(); - - if (heldItemAmount < summonAmount) { - int moreAmount = summonAmount - heldItemAmount; - pluginRef.getNotificationManager().sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Item.NotEnough", String.valueOf(moreAmount), StringUtils.getPrettyItemString(heldItem.getType())); - return; - } - - if (!rangeCheck(type)) { - return; - } - - int amount = MainConfig.getInstance().getTamingCOTWAmount(type); - int tamingCOTWLength = MainConfig.getInstance().getTamingCOTWLength(type); - - for (int i = 0; i < amount; i++) { - if (!summonAmountCheck(type)) { - return; - } - - location = Misc.getLocationOffset(location, 1); - LivingEntity callOfWildEntity = (LivingEntity) player.getWorld().spawnEntity(location, type); - - FakeEntityTameEvent event = new FakeEntityTameEvent(callOfWildEntity, player); - pluginRef.getServer().getPluginManager().callEvent(event); - - if (event.isCancelled()) { - continue; - } - - callOfWildEntity.setMetadata(MetadataConstants.UNNATURAL_MOB_METAKEY, MetadataConstants.metadataValue); - ((Tameable) callOfWildEntity).setOwner(player); - callOfWildEntity.setRemoveWhenFarAway(false); - - addToTracker(callOfWildEntity); - - switch (type) { - case OCELOT: - ((Ocelot) callOfWildEntity).setCatType(Ocelot.Type.values()[1 + Misc.getRandom().nextInt(3)]); - break; - - case WOLF: - callOfWildEntity.setMaxHealth(20.0); - callOfWildEntity.setHealth(callOfWildEntity.getMaxHealth()); - break; - - case HORSE: - Horse horse = (Horse) callOfWildEntity; - - callOfWildEntity.setMaxHealth(15.0 + (Misc.getRandom().nextDouble() * 15)); - callOfWildEntity.setHealth(callOfWildEntity.getMaxHealth()); - horse.setColor(Horse.Color.values()[Misc.getRandom().nextInt(Horse.Color.values().length)]); - horse.setStyle(Horse.Style.values()[Misc.getRandom().nextInt(Horse.Style.values().length)]); - horse.setJumpStrength(Math.max(AdvancedConfig.getInstance().getMinHorseJumpStrength(), Math.min(Math.min(Misc.getRandom().nextDouble(), Misc.getRandom().nextDouble()) * 2, AdvancedConfig.getInstance().getMaxHorseJumpStrength()))); - //TODO: setSpeed, once available - break; - - default: - break; - } - - if (Permissions.renamePets(player)) { - callOfWildEntity.setCustomName(pluginRef.getLocaleManager().getString("Taming.Summon.Name.Format", player.getName(), StringUtils.getPrettyEntityTypeString(type))); - } - - ParticleEffectUtils.playCallOfTheWildEffect(callOfWildEntity); - } - - ItemStack leftovers = new ItemStack(heldItem); - leftovers.setAmount(heldItemAmount - summonAmount); - player.getInventory().setItemInMainHand(heldItemAmount == summonAmount ? null : leftovers); - - String lifeSpan = ""; - if (tamingCOTWLength > 0) { - lifeSpan = pluginRef.getLocaleManager().getString("Taming.Summon.Lifespan", tamingCOTWLength); - } - - pluginRef.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Taming.Summon.Complete", lifeSpan); - player.playSound(location, Sound.ENTITY_FIREWORK_ROCKET_BLAST_FAR, 1F, 0.5F); + public boolean isCOTWItem(ItemStack itemStack) { + return pluginRef.getDynamicSettingsManager().getTamingItemManager().isCOTWItem(itemStack.getType()); } - private boolean rangeCheck(EntityType type) { - double range = MainConfig.getInstance().getTamingCOTWRange(); - Player player = getPlayer(); + //TODO: The way this tracker was written is garbo, I should just rewrite it, I'll save that for a future update + private int getAmountCurrentlySummoned(CallOfTheWildType callOfTheWildType) { + //The tracker is unreliable so validate its contents first + recalibrateTracker(); - if (range == 0) { - return true; + return playerSummonedEntities.get(callOfTheWildType).size(); + } + + //TODO: The way this tracker was written is garbo, I should just rewrite it, I'll save that for a future update + private void addToTracker(LivingEntity livingEntity, CallOfTheWildType callOfTheWildType) { + TrackedTamingEntity trackedEntity = new TrackedTamingEntity(pluginRef, livingEntity, callOfTheWildType, this); + + playerSummonedEntities.get(callOfTheWildType).add(trackedEntity); + } + + //TODO: The way this tracker was written is garbo, I should just rewrite it, I'll save that for a future update + public List getTrackedEntities(CallOfTheWildType callOfTheWildType) { + return playerSummonedEntities.get(callOfTheWildType); + } + + //TODO: The way this tracker was written is garbo, I should just rewrite it, I'll save that for a future update + public void removeFromTracker(TrackedTamingEntity trackedEntity) { + if(playerSummonedEntities.get(trackedEntity.getCallOfTheWildType()).contains(trackedEntity)) + playerSummonedEntities.get(trackedEntity.getCallOfTheWildType()).remove(trackedEntity); + + pluginRef.getNotificationManager().sendPlayerInformationChatOnly(getPlayer(), "Taming.Summon.COTW.TimeExpired", StringUtils.getPrettyEntityTypeString(trackedEntity.getLivingEntity().getType())); + } + + /** + * Builds a new tracked list by determining which tracked things are still valid + */ + //TODO: The way this tracker was written is garbo, I should just rewrite it, I'll save that for a future update + private void recalibrateTracker() { + for(CallOfTheWildType callOfTheWildType : CallOfTheWildType.values()) { + ArrayList validEntities = getValidTrackedEntities(callOfTheWildType); + playerSummonedEntities.put(callOfTheWildType, validEntities); //Replace the old list with the new list } + } - for (Entity entity : player.getNearbyEntities(range, range, range)) { - if (entity.getType() == type) { - pluginRef.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, Taming.getInstance().getCallOfTheWildFailureMessage(type)); - return false; + //TODO: The way this tracker was written is garbo, I should just rewrite it, I'll save that for a future update + private ArrayList getValidTrackedEntities(CallOfTheWildType callOfTheWildType) { + ArrayList validTrackedEntities = new ArrayList<>(); + + for(TrackedTamingEntity trackedTamingEntity : getTrackedEntities(callOfTheWildType)) { + LivingEntity livingEntity = trackedTamingEntity.getLivingEntity(); + + //Remove from existence + if(livingEntity != null && livingEntity.isValid()) { + validTrackedEntities.add(trackedTamingEntity); } } - return true; + return validTrackedEntities; } - private boolean summonAmountCheck(EntityType entityType) { - Player player = getPlayer(); + /** + * Remove all tracked entities from existence if they currently exist + * Clear the tracked entity lists afterwards + */ + //TODO: The way this tracker was written is garbo, I should just rewrite it, I'll save that for a future update + public void cleanupAllSummons() { + for(List trackedTamingEntities : playerSummonedEntities.values()) { + for(TrackedTamingEntity trackedTamingEntity : trackedTamingEntities) { + LivingEntity livingEntity = trackedTamingEntity.getLivingEntity(); - int maxAmountSummons = MainConfig.getInstance().getTamingCOTWMaxAmount(entityType); + //Remove from existence + if(livingEntity != null && livingEntity.isValid()) { + livingEntity.setHealth(0); + livingEntity.remove(); + } + } - if (maxAmountSummons <= 0) { - return true; + //Clear the list + trackedTamingEntities.clear(); } - - List trackedEntities = getTrackedEntities(entityType); - int summonAmount = trackedEntities == null ? 0 : trackedEntities.size(); - - if (summonAmount >= maxAmountSummons) { - pluginRef.getNotificationManager().sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Taming.Summon.Fail.TooMany", String.valueOf(maxAmountSummons)); - return false; - } - - return true; } } diff --git a/src/main/java/com/gmail/nossr50/skills/taming/TrackedTamingEntity.java b/src/main/java/com/gmail/nossr50/skills/taming/TrackedTamingEntity.java index ed02f9b86..dd5c56ce2 100644 --- a/src/main/java/com/gmail/nossr50/skills/taming/TrackedTamingEntity.java +++ b/src/main/java/com/gmail/nossr50/skills/taming/TrackedTamingEntity.java @@ -1,26 +1,31 @@ package com.gmail.nossr50.skills.taming; -import com.gmail.nossr50.config.MainConfig; +import com.gmail.nossr50.datatypes.skills.subskills.taming.CallOfTheWildType; +import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.skills.ParticleEffectUtils; import org.bukkit.Location; import org.bukkit.Sound; import org.bukkit.entity.LivingEntity; -import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.scheduler.BukkitRunnable; import java.util.UUID; public class TrackedTamingEntity extends BukkitRunnable { private LivingEntity livingEntity; + private final CallOfTheWildType callOfTheWildType; private UUID id; private int length; + private final TamingManager tamingManagerRef; + private final mcMMO pluginRef; - protected TrackedTamingEntity(LivingEntity livingEntity) { + protected TrackedTamingEntity(mcMMO pluginRef, LivingEntity livingEntity, CallOfTheWildType callOfTheWildType, TamingManager tamingManagerRef) { + this.tamingManagerRef = tamingManagerRef; + this.callOfTheWildType = callOfTheWildType; this.livingEntity = livingEntity; this.id = livingEntity.getUniqueId(); - int tamingCOTWLength = MainConfig.getInstance().getTamingCOTWLength(livingEntity.getType()); + int tamingCOTWLength = pluginRef.getConfigManager().getConfigTaming().getSubSkills().getCallOfTheWild()..getTamingCOTWLength(livingEntity.getType()); if (tamingCOTWLength > 0) { this.length = tamingCOTWLength * Misc.TICK_CONVERSION_FACTOR; @@ -35,17 +40,26 @@ public class TrackedTamingEntity extends BukkitRunnable { location.getWorld().playSound(location, Sound.BLOCK_FIRE_EXTINGUISH, 0.8F, 0.8F); ParticleEffectUtils.playCallOfTheWildEffect(livingEntity); pluginRef.getCombatTools().dealDamage(livingEntity, livingEntity.getMaxHealth(), DamageCause.SUICIDE, livingEntity); + + if(tamingManagerRef != null) + tamingManagerRef.removeFromTracker(this); + + livingEntity.setHealth(0); + livingEntity.remove(); } - TamingManager.removeFromTracker(this); this.cancel(); } - protected LivingEntity getLivingEntity() { + public CallOfTheWildType getCallOfTheWildType() { + return callOfTheWildType; + } + + public LivingEntity getLivingEntity() { return livingEntity; } - protected UUID getID() { + public UUID getID() { return id; } } diff --git a/src/main/java/com/gmail/nossr50/skills/unarmed/Unarmed.java b/src/main/java/com/gmail/nossr50/skills/unarmed/Unarmed.java index 2f6290884..f0f9197ba 100644 --- a/src/main/java/com/gmail/nossr50/skills/unarmed/Unarmed.java +++ b/src/main/java/com/gmail/nossr50/skills/unarmed/Unarmed.java @@ -9,8 +9,6 @@ import org.bukkit.inventory.ItemStack; public class Unarmed { // public static boolean blockCrackerSmoothBrick = MainConfig.getInstance().getUnarmedBlockCrackerSmoothbrickToCracked(); public static double berserkDamageModifier = 1.5; - public static long lastAttacked = 0; - public static long attackInterval = 750; public static void handleItemPickup(Player player, EntityPickupItemEvent event) { ItemStack[] storageContents = player.getInventory().getStorageContents(); diff --git a/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java b/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java index 598ff7521..0518e34db 100644 --- a/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java +++ b/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java @@ -10,30 +10,40 @@ import com.gmail.nossr50.datatypes.skills.ToolType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.skills.SkillActivationType; import org.bukkit.Material; import org.bukkit.block.BlockState; -import org.bukkit.block.data.BlockData; import org.bukkit.entity.Item; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; public class UnarmedManager extends SkillManager { + private long lastAttacked; + private long attackInterval; + public UnarmedManager(mcMMO pluginRef, McMMOPlayer mcMMOPlayer) { super(pluginRef, mcMMOPlayer, PrimarySkillType.UNARMED); + initUnarmedPerPlayerVars(); + } + + /** + * Inits variables used for each player for unarmed + */ + private void initUnarmedPerPlayerVars() { + lastAttacked = 0; + attackInterval = 750; } public boolean canActivateAbility() { - return mcMMOPlayer.getToolPreparationMode(ToolType.FISTS) && Permissions.berserk(getPlayer()); + return mcMMOPlayer.getToolPreparationMode(ToolType.FISTS) && pluginRef.getPermissionTools().berserk(getPlayer()); } public boolean canUseIronArm() { if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.UNARMED_IRON_ARM_STYLE)) return false; - return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.UNARMED_IRON_ARM_STYLE); + return pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.UNARMED_IRON_ARM_STYLE); } public boolean canUseBerserk() { @@ -44,7 +54,7 @@ public class UnarmedManager extends SkillManager { if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.UNARMED_DISARM)) return false; - return target instanceof Player && ((Player) target).getInventory().getItemInMainHand().getType() != Material.AIR && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.UNARMED_DISARM); + return target instanceof Player && ((Player) target).getInventory().getItemInMainHand().getType() != Material.AIR && pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.UNARMED_DISARM); } public boolean canDeflect() { @@ -53,14 +63,14 @@ public class UnarmedManager extends SkillManager { Player player = getPlayer(); - return pluginRef.getItemTools().isUnarmed(player.getInventory().getItemInMainHand()) && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.UNARMED_ARROW_DEFLECT); + return pluginRef.getItemTools().isUnarmed(player.getInventory().getItemInMainHand()) && pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.UNARMED_ARROW_DEFLECT); } public boolean canUseBlockCracker() { if (!pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.UNARMED_BLOCK_CRACKER)) return false; - return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.UNARMED_BLOCK_CRACKER); + return pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.UNARMED_BLOCK_CRACKER); } public boolean blockCrackerCheck(BlockState blockState) { @@ -68,8 +78,6 @@ public class UnarmedManager extends SkillManager { return false; } - BlockData data = blockState.getBlockData(); - switch (blockState.getType()) { case STONE_BRICKS: /*if (!Unarmed.blockCrackerSmoothBrick) { @@ -144,7 +152,7 @@ public class UnarmedManager extends SkillManager { } public boolean isPunchingCooldownOver() { - return (Unarmed.lastAttacked + Unarmed.attackInterval) <= System.currentTimeMillis(); + return (lastAttacked + attackInterval) <= System.currentTimeMillis(); } public double getIronArmDamage() { @@ -164,8 +172,9 @@ public class UnarmedManager extends SkillManager { * @return true if the defender was not disarmed, false otherwise */ private boolean hasIronGrip(Player defender) { - if (!Misc.isNPCEntityExcludingVillagers(defender) && Permissions.isSubSkillEnabled(defender, SubSkillType.UNARMED_IRON_GRIP) - && pluginRef.getRandomChanceTools().isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.UNARMED_IRON_GRIP, getPlayer())) { + if (!Misc.isNPCEntityExcludingVillagers(defender) + && pluginRef.getPermissionTools().isSubSkillEnabled(defender, SubSkillType.UNARMED_IRON_GRIP) + && pluginRef.getRandomChanceTools().isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.UNARMED_IRON_GRIP, defender)) { pluginRef.getNotificationManager().sendPlayerInformation(defender, NotificationType.SUBSKILL_MESSAGE, "Unarmed.Ability.IronGrip.Defender"); pluginRef.getNotificationManager().sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Unarmed.Ability.IronGrip.Attacker"); @@ -174,4 +183,20 @@ public class UnarmedManager extends SkillManager { return false; } + + public long getLastAttacked() { + return lastAttacked; + } + + public void setLastAttacked(long lastAttacked) { + this.lastAttacked = lastAttacked; + } + + public long getAttackInterval() { + return attackInterval; + } + + public void setAttackInterval(long attackInterval) { + this.attackInterval = attackInterval; + } } diff --git a/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java b/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java index 5ed9b9379..0010f8c6c 100644 --- a/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java +++ b/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java @@ -10,7 +10,6 @@ import com.gmail.nossr50.datatypes.skills.behaviours.WoodcuttingBehaviour; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.skills.SkillActivationType; import org.bukkit.Material; import org.bukkit.block.Block; @@ -36,7 +35,7 @@ public class WoodcuttingManager extends SkillManager { } public boolean canUseLeafBlower(ItemStack heldItem) { - return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.WOODCUTTING_LEAF_BLOWER) + return pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.WOODCUTTING_LEAF_BLOWER) && pluginRef.getRankTools().hasUnlockedSubskill(getPlayer(), SubSkillType.WOODCUTTING_LEAF_BLOWER) && pluginRef.getItemTools().isAxe(heldItem); } @@ -46,8 +45,8 @@ public class WoodcuttingManager extends SkillManager { && pluginRef.getItemTools().isAxe(heldItem); } - public boolean canGetDoubleDrops() { - return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.WOODCUTTING_HARVEST_LUMBER) + private boolean canGetDoubleDrops() { + return pluginRef.getPermissionTools().isSubSkillEnabled(getPlayer(), SubSkillType.WOODCUTTING_HARVEST_LUMBER) && pluginRef.getRankTools().hasReachedRank(1, getPlayer(), SubSkillType.WOODCUTTING_HARVEST_LUMBER) && pluginRef.getRandomChanceTools().isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.WOODCUTTING_HARVEST_LUMBER, getPlayer()); } @@ -108,7 +107,7 @@ public class WoodcuttingManager extends SkillManager { return; } - dropBlocks(treeFellerBlocks); + dropTreeFellerLootFromBlocks(treeFellerBlocks); treeFellerReachedThreshold = false; // Reset the value after we're done with Tree Feller each time. } @@ -247,7 +246,7 @@ public class WoodcuttingManager extends SkillManager { * * @param treeFellerBlocks List of blocks to be dropped */ - private void dropBlocks(Set treeFellerBlocks) { + private void dropTreeFellerLootFromBlocks(Set treeFellerBlocks) { Player player = getPlayer(); int xp = 0; int processedLogCount = 0; diff --git a/src/main/java/com/gmail/nossr50/util/BlockTools.java b/src/main/java/com/gmail/nossr50/util/BlockTools.java index e922ea2a6..ffa71b655 100644 --- a/src/main/java/com/gmail/nossr50/util/BlockTools.java +++ b/src/main/java/com/gmail/nossr50/util/BlockTools.java @@ -52,7 +52,7 @@ public final class BlockTools { * @return true if the player succeeded in the check */ public boolean checkDoubleDrops(Player player, BlockState blockState, SubSkillType subSkillType) { - if (pluginRef.getDynamicSettingsManager().isBonusDropsEnabled(blockState.getType()) && Permissions.isSubSkillEnabled(player, subSkillType)) { + if (pluginRef.getDynamicSettingsManager().isBonusDropsEnabled(blockState.getType()) && pluginRef.getPermissionTools().isSubSkillEnabled(player, subSkillType)) { return pluginRef.getRandomChanceTools().checkRandomChanceExecutionSuccess(new RandomChanceSkill(pluginRef, player, subSkillType, true)); } diff --git a/src/main/java/com/gmail/nossr50/util/ChimaeraWing.java b/src/main/java/com/gmail/nossr50/util/ChimaeraWing.java index f4ec2cc29..7c619e223 100644 --- a/src/main/java/com/gmail/nossr50/util/ChimaeraWing.java +++ b/src/main/java/com/gmail/nossr50/util/ChimaeraWing.java @@ -36,7 +36,7 @@ public final class ChimaeraWing { return; } - if (!Permissions.chimaeraWing(player)) { + if (!pluginRef.getPermissionTools().chimaeraWing(player)) { pluginRef.getNotificationManager().sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission"); return; } diff --git a/src/main/java/com/gmail/nossr50/util/ItemTools.java b/src/main/java/com/gmail/nossr50/util/ItemTools.java index ef007fd88..6a1dab3bc 100644 --- a/src/main/java/com/gmail/nossr50/util/ItemTools.java +++ b/src/main/java/com/gmail/nossr50/util/ItemTools.java @@ -5,6 +5,7 @@ import com.gmail.nossr50.datatypes.skills.ItemType; import com.gmail.nossr50.mcMMO; import org.bukkit.ChatColor; import org.bukkit.Material; +import org.bukkit.entity.Player; import org.bukkit.inventory.FurnaceRecipe; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.Recipe; @@ -114,6 +115,10 @@ public final class ItemTools { } } + public static boolean hasItemInEitherHand(Player player, Material material) { + return player.getInventory().getItemInMainHand().getType() == material || player.getInventory().getItemInOffHand().getType() == material; + } + /** * Checks if the item is a sword. * diff --git a/src/main/java/com/gmail/nossr50/util/Misc.java b/src/main/java/com/gmail/nossr50/util/Misc.java index c125e056a..37ac503ee 100644 --- a/src/main/java/com/gmail/nossr50/util/Misc.java +++ b/src/main/java/com/gmail/nossr50/util/Misc.java @@ -36,17 +36,42 @@ public final class Misc { private Misc() { } + /** + * Determines if an entity is an NPC but not a villager + * This method aims to establish compatibility between mcMMO and other plugins which create "NPCs" + * + * It does this by checking the following + * 1) The entity is not a Villager + * 2) The entity can be considered an NPC + * + * In this context, an NPC is a bit hard to define. Various plugins determine what an NPC is in different ways. + * @see Misc::isNPCIncludingVillagers + * @param entity target entity + * @return true if the entity is not a Villager and is not a "NPC" + */ public static boolean isNPCEntityExcludingVillagers(Entity entity) { - return (entity == null - || (entity.hasMetadata("NPC") && !(entity instanceof Villager)) - || (entity instanceof NPC && !(entity instanceof Villager)) - || entity.getClass().getName().equalsIgnoreCase("cofh.entity.PlayerFake")); + return (!isVillager(entity) + && isNPCIncludingVillagers(entity)); //Compatibility with some mod.. } - public static boolean isNPCIncludingVillagers(Player entity) { + public static boolean isNPCClassType(Entity entity) { + return entity instanceof NPC; + } + + public static boolean hasNPCMetadataTag(Entity entity) { + return entity.hasMetadata("NPC"); + } + + public static boolean isVillager(Entity entity) { + String entityType = entity.getType().toString(); + //This weird code is for 1.13 & 1.14 compatibility + return entityType.equalsIgnoreCase("wandering_trader") || entity instanceof Villager; + } + + public static boolean isNPCIncludingVillagers(Entity entity) { return (entity == null - || (entity.hasMetadata("NPC")) - || (entity instanceof NPC) + || (hasNPCMetadataTag(entity)) + || (isNPCClassType(entity)) || entity.getClass().getName().equalsIgnoreCase("cofh.entity.PlayerFake")); } diff --git a/src/main/java/com/gmail/nossr50/util/Motd.java b/src/main/java/com/gmail/nossr50/util/Motd.java index 11b1f80eb..cc6b61b6e 100644 --- a/src/main/java/com/gmail/nossr50/util/Motd.java +++ b/src/main/java/com/gmail/nossr50/util/Motd.java @@ -31,7 +31,7 @@ public final class Motd { * @param version Plugin version */ public static void displayVersion(Player player, String version) { - if (Permissions.showversion(player)) { + if (pluginRef.getPermissionTools().showversion(player)) { player.sendMessage(pluginRef.getLocaleManager().getString("MOTD.Version.Overhaul", version)); } } @@ -124,7 +124,7 @@ public final class Motd { */ public static void displayLuckyPerks(Player player) { for (PrimarySkillType skill : PrimarySkillType.values()) { - if (Permissions.lucky(player, skill)) { + if (pluginRef.getPermissionTools().lucky(player, skill)) { player.sendMessage(PERK_PREFIX + pluginRef.getLocaleManager().getString("Effects.Template", pluginRef.getLocaleManager().getString("Perks.Lucky.Name"), pluginRef.getLocaleManager().getString("Perks.Lucky.Desc.Login"))); return; } diff --git a/src/main/java/com/gmail/nossr50/util/Permissions.java b/src/main/java/com/gmail/nossr50/util/PermissionTools.java similarity index 60% rename from src/main/java/com/gmail/nossr50/util/Permissions.java rename to src/main/java/com/gmail/nossr50/util/PermissionTools.java index b1352765c..b2ef809c1 100644 --- a/src/main/java/com/gmail/nossr50/util/Permissions.java +++ b/src/main/java/com/gmail/nossr50/util/PermissionTools.java @@ -7,6 +7,7 @@ import com.gmail.nossr50.datatypes.skills.ItemType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.mcMMO; import org.bukkit.Material; import org.bukkit.Server; import org.bukkit.World; @@ -17,52 +18,55 @@ import org.bukkit.permissions.PermissionDefault; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.SimplePluginManager; -public final class Permissions { - private Permissions() { +public final class PermissionTools { + private final mcMMO pluginRef; + + public PermissionTools(mcMMO pluginRef) { + this.pluginRef = pluginRef; } /* * GENERAL */ - public static boolean motd(Permissible permissible) { + public boolean motd(Permissible permissible) { return permissible.hasPermission("mcmmo.motd"); } - public static boolean mobHealthDisplay(Permissible permissible) { + public boolean mobHealthDisplay(Permissible permissible) { return permissible.hasPermission("mcmmo.mobhealthdisplay"); } - public static boolean updateNotifications(Permissible permissible) { + public boolean updateNotifications(Permissible permissible) { return permissible.hasPermission("mcmmo.tools.updatecheck"); } - public static boolean chimaeraWing(Permissible permissible) { + public boolean chimaeraWing(Permissible permissible) { return permissible.hasPermission("mcmmo.item.chimaerawing"); } - public static boolean showversion(Permissible permissible) { + public boolean showversion(Permissible permissible) { return permissible.hasPermission("mcmmo.showversion"); } /* BYPASS */ - public static boolean hardcoreBypass(Permissible permissible) { + public boolean hardcoreBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.hardcoremode"); } - public static boolean arcaneBypass(Permissible permissible) { + public boolean arcaneBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.arcanebypass"); } - public static boolean trapsBypass(Permissible permissible) { + public boolean trapsBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.fishingtraps"); } /* CHAT */ - public static boolean partyChat(Permissible permissible) { + public boolean partyChat(Permissible permissible) { return permissible.hasPermission("mcmmo.chat.partychat"); } - public static boolean adminChat(Permissible permissible) { + public boolean adminChat(Permissible permissible) { return permissible.hasPermission("mcmmo.chat.adminchat"); } @@ -70,171 +74,171 @@ public final class Permissions { * COMMANDS */ - public static boolean mmoinfo(Permissible permissible) { + public boolean mmoinfo(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmoinfo"); } - public static boolean addlevels(Permissible permissible) { + public boolean addlevels(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.addlevels"); } - public static boolean addlevelsOthers(Permissible permissible) { + public boolean addlevelsOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.addlevels.others"); } - public static boolean addxp(Permissible permissible) { + public boolean addxp(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.addxp"); } - public static boolean addxpOthers(Permissible permissible) { + public boolean addxpOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.addxp.others"); } - public static boolean hardcoreModify(Permissible permissible) { + public boolean hardcoreModify(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.hardcore.modify"); } - public static boolean hardcoreToggle(Permissible permissible) { + public boolean hardcoreToggle(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.hardcore.toggle"); } - public static boolean inspect(Permissible permissible) { + public boolean inspect(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect")); } - public static boolean inspectFar(Permissible permissible) { + public boolean inspectFar(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect.far")); } - public static boolean inspectHidden(Permissible permissible) { + public boolean inspectHidden(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect.hidden")); } - public static boolean inspectOffline(Permissible permissible) { + public boolean inspectOffline(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect.offline")); } - public static boolean mcability(Permissible permissible) { + public boolean mcability(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcability")); } - public static boolean mcabilityOthers(Permissible permissible) { + public boolean mcabilityOthers(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcability.others")); } - public static boolean adminChatSpy(Permissible permissible) { + public boolean adminChatSpy(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcchatspy"); } - public static boolean adminChatSpyOthers(Permissible permissible) { + public boolean adminChatSpyOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcchatspy.others"); } - public static boolean mcgod(Permissible permissible) { + public boolean mcgod(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcgod"); } - public static boolean mcgodOthers(Permissible permissible) { + public boolean mcgodOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcgod.others"); } - public static boolean mcmmoDescription(Permissible permissible) { + public boolean mcmmoDescription(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcmmo.description"); } - public static boolean mcmmoHelp(Permissible permissible) { + public boolean mcmmoHelp(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcmmo.help"); } - public static boolean mcrank(Permissible permissible) { + public boolean mcrank(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrank")); } - public static boolean mcrankOthers(Permissible permissible) { + public boolean mcrankOthers(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrank.others")); } - public static boolean mcrankFar(Permissible permissible) { + public boolean mcrankFar(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrank.others.far")); } - public static boolean mcrankOffline(Permissible permissible) { + public boolean mcrankOffline(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrank.others.offline")); } - public static boolean mcrefresh(Permissible permissible) { + public boolean mcrefresh(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrefresh")); } - public static boolean mcrefreshOthers(Permissible permissible) { + public boolean mcrefreshOthers(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrefresh.others")); } - public static boolean mctop(Permissible permissible, PrimarySkillType skill) { + public boolean mctop(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.mctop." + skill.toString().toLowerCase()); } - public static boolean mmoedit(Permissible permissible) { + public boolean mmoedit(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmoedit"); } - public static boolean reload(Permissible permissible) { + public boolean reload(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.reload"); } - public static boolean mmoeditOthers(Permissible permissible) { + public boolean mmoeditOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmoedit.others"); } - public static boolean skillreset(Permissible permissible) { + public boolean skillreset(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.skillreset"); } - public static boolean skillreset(Permissible permissible, PrimarySkillType skill) { + public boolean skillreset(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.skillreset." + skill.toString().toLowerCase()); } - public static boolean skillresetOthers(Permissible permissible) { + public boolean skillresetOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.skillreset.others"); } - public static boolean skillresetOthers(Permissible permissible, PrimarySkillType skill) { + public boolean skillresetOthers(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.skillreset.others." + skill.toString().toLowerCase()); } - public static boolean xplock(Permissible permissible, PrimarySkillType skill) { + public boolean xplock(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.xplock." + skill.toString().toLowerCase()); } - public static boolean xprateSet(Permissible permissible) { + public boolean xprateSet(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.xprate.set"); } - public static boolean xprateReset(Permissible permissible) { + public boolean xprateReset(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.xprate.reset"); } - public static boolean vampirismModify(Permissible permissible) { + public boolean vampirismModify(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.vampirism.modify"); } - public static boolean vampirismToggle(Permissible permissible) { + public boolean vampirismToggle(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.vampirism.toggle"); } - public static boolean mcpurge(Permissible permissible) { + public boolean mcpurge(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcpurge"); } - public static boolean mcremove(Permissible permissible) { + public boolean mcremove(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcremove"); } - public static boolean mmoupdate(Permissible permissible) { + public boolean mmoupdate(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmoupdate"); } - public static boolean reloadlocale(Permissible permissible) { + public boolean reloadlocale(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.reloadlocale"); } @@ -244,70 +248,70 @@ public final class Permissions { /* BYPASS PERKS */ - public static boolean hasRepairEnchantBypassPerk(Permissible permissible) { + public boolean hasRepairEnchantBypassPerk(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.bypass.repairenchant"); } - public static boolean hasSalvageEnchantBypassPerk(Permissible permissible) { + public boolean hasSalvageEnchantBypassPerk(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.bypass.salvageenchant"); } - public static boolean lucky(Permissible permissible, PrimarySkillType skill) { + public boolean lucky(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.lucky." + skill.toString().toLowerCase()); } /* XP PERKS */ - public static boolean quadrupleXp(Permissible permissible, PrimarySkillType skill) { + public boolean quadrupleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.quadruple." + skill.toString().toLowerCase()); } - public static boolean tripleXp(Permissible permissible, PrimarySkillType skill) { + public boolean tripleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.triple." + skill.toString().toLowerCase()); } - public static boolean doubleAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { + public boolean doubleAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.150percentboost." + skill.toString().toLowerCase()); } - public static boolean doubleXp(Permissible permissible, PrimarySkillType skill) { + public boolean doubleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.double." + skill.toString().toLowerCase()); } - public static boolean oneAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { + public boolean oneAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.50percentboost." + skill.toString().toLowerCase()); } - public static boolean oneAndOneTenthXp(Permissible permissible, PrimarySkillType skill) { + public boolean oneAndOneTenthXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.10percentboost." + skill.toString().toLowerCase()); } - public static boolean hasCustomXPPerk(Permissible permissible, CustomXPPerk customXPPerk) { + public boolean hasCustomXPPerk(Permissible permissible, CustomXPPerk customXPPerk) { return permissible.hasPermission(customXPPerk.getPerkPermissionAddress()); } /* ACTIVATION PERKS */ - public static boolean twelveSecondActivationBoost(Permissible permissible) { + public boolean twelveSecondActivationBoost(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.activationtime.twelveseconds"); } - public static boolean eightSecondActivationBoost(Permissible permissible) { + public boolean eightSecondActivationBoost(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.activationtime.eightseconds"); } - public static boolean fourSecondActivationBoost(Permissible permissible) { + public boolean fourSecondActivationBoost(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.activationtime.fourseconds"); } /* COOLDOWN PERKS */ - public static boolean halvedCooldowns(Permissible permissible) { + public boolean halvedCooldowns(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.cooldowns.halved"); } - public static boolean thirdedCooldowns(Permissible permissible) { + public boolean thirdedCooldowns(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.cooldowns.thirded"); } - public static boolean quarteredCooldowns(Permissible permissible) { + public boolean quarteredCooldowns(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.cooldowns.quartered"); } @@ -315,201 +319,197 @@ public final class Permissions { * SKILLS */ - public static boolean skillEnabled(Permissible permissible, PrimarySkillType skill) { + public boolean skillEnabled(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.skills." + skill.toString().toLowerCase()); } - public static boolean vanillaXpBoost(Permissible permissible, PrimarySkillType skill) { + public boolean vanillaXpBoost(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase() + ".vanillaxpboost"); } - public static boolean isSubSkillEnabled(Permissible permissible, SubSkillType subSkillType) { - return permissible.hasPermission(subSkillType.getPermissionNodeAddress()); + public boolean isSubSkillEnabled(Permissible permissible, SubSkillType subSkillType) { + return permissible.hasPermission(subSkillType.getPermissionNodeAddress(pluginRef)); } - public static boolean isSubSkillEnabled(Permissible permissible, AbstractSubSkill abstractSubSkill) { + public boolean isSubSkillEnabled(Permissible permissible, AbstractSubSkill abstractSubSkill) { return permissible.hasPermission(abstractSubSkill.getPermissionNode()); } - public static boolean bonusDamage(Permissible permissible, PrimarySkillType skill) { + public boolean bonusDamage(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase() + ".bonusdamage"); } /* ACROBATICS */ - public static boolean dodge(Permissible permissible) { + public boolean dodge(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.acrobatics.dodge"); } - public static boolean gracefulRoll(Permissible permissible) { + public boolean gracefulRoll(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.acrobatics.gracefulroll"); } - public static boolean roll(Permissible permissible) { + public boolean roll(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.acrobatics.roll"); } /* ALCHEMY */ - public static boolean catalysis(Permissible permissible) { + public boolean catalysis(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.alchemy.catalysis"); } - public static boolean concoctions(Permissible permissible) { + public boolean concoctions(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.alchemy.concoctions"); } /* ARCHERY */ - public static boolean arrowRetrieval(Permissible permissible) { + public boolean arrowRetrieval(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.archery.trackarrows"); } - public static boolean daze(Permissible permissible) { + public boolean daze(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.archery.daze"); } /* AXES */ - public static boolean skullSplitter(Permissible permissible) { + public boolean skullSplitter(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.axes.skullsplitter"); } /* EXCAVATION */ - public static boolean gigaDrillBreaker(Permissible permissible) { + public boolean gigaDrillBreaker(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.excavation.gigadrillbreaker"); } /* HERBALISM */ - public static boolean greenTerra(Permissible permissible) { + public boolean greenTerra(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.herbalism.greenterra"); } - public static boolean greenThumbBlock(Permissible permissible, Material material) { + public boolean greenThumbBlock(Permissible permissible, Material material) { return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.blocks." + material.toString().replace("_", "").toLowerCase()); } - public static boolean greenThumbPlant(Permissible permissible, Material material) { + public boolean greenThumbPlant(Permissible permissible, Material material) { return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.plants." + material.toString().replace("_", "").toLowerCase()); } /* MINING */ - public static boolean biggerBombs(Permissible permissible) { + public boolean biggerBombs(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.blastmining.biggerbombs"); } - public static boolean demolitionsExpertise(Permissible permissible) { + public boolean demolitionsExpertise(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.blastmining.demolitionsexpertise"); } - public static boolean remoteDetonation(Permissible permissible) { + public boolean remoteDetonation(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.blastmining.detonate"); } - public static boolean superBreaker(Permissible permissible) { + public boolean superBreaker(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.superbreaker"); } /* REPAIR */ - public static boolean repairItemType(Permissible permissible, ItemType repairItemType) { + public boolean repairItemType(Permissible permissible, ItemType repairItemType) { return permissible.hasPermission("mcmmo.ability.repair." + repairItemType.toString().toLowerCase() + "repair"); } - public static boolean repairMaterialType(Permissible permissible, ItemMaterialCategory repairItemMaterialCategory) { + public boolean repairMaterialType(Permissible permissible, ItemMaterialCategory repairItemMaterialCategory) { return permissible.hasPermission("mcmmo.ability.repair." + repairItemMaterialCategory.toString().toLowerCase() + "repair"); } /* SALVAGE */ - public static boolean advancedSalvage(Permissible permissible) { + public boolean advancedSalvage(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.salvage.advancedsalvage"); } - public static boolean arcaneSalvage(Permissible permissible) { + public boolean arcaneSalvage(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.salvage.arcanesalvage"); } - public static boolean salvageItemType(Permissible permissible, ItemType salvageItemType) { + public boolean salvageItemType(Permissible permissible, ItemType salvageItemType) { return permissible.hasPermission("mcmmo.ability.salvage." + salvageItemType.toString().toLowerCase() + "salvage"); } - public static boolean salvageMaterialType(Permissible permissible, ItemMaterialCategory salvageItemMaterialCategory) { + public boolean salvageMaterialType(Permissible permissible, ItemMaterialCategory salvageItemMaterialCategory) { return permissible.hasPermission("mcmmo.ability.salvage." + salvageItemMaterialCategory.toString().toLowerCase() + "salvage"); } /* SMELTING */ - public static boolean fluxMining(Permissible permissible) { + public boolean fluxMining(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.smelting.fluxmining"); } - public static boolean fuelEfficiency(Permissible permissible) { + public boolean fuelEfficiency(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.smelting.fuelefficiency"); } /* SWORDS */ - public static boolean serratedStrikes(Permissible permissible) { + public boolean serratedStrikes(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.swords.serratedstrikes"); } /* TAMING */ - public static boolean callOfTheWild(Permissible permissible, EntityType type) { + public boolean callOfTheWild(Permissible permissible, EntityType type) { return permissible.hasPermission("mcmmo.ability.taming.callofthewild." + type.toString().toLowerCase()); } - public static boolean renamePets(Permissible permissible) { - return permissible.hasPermission("mcmmo.ability.taming.callofthewild.renamepets"); - } - /* UNARMED */ - public static boolean berserk(Permissible permissible) { + public boolean berserk(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.unarmed.berserk"); } /* WOODCUTTING */ - public static boolean treeFeller(Permissible permissible) { + public boolean treeFeller(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.woodcutting.treefeller"); } /* * PARTY */ - public static boolean partySizeBypass(Permissible permissible) { + public boolean partySizeBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.partylimit"); } - public static boolean party(Permissible permissible) { + public boolean party(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.party"); } - public static boolean partySubcommand(Permissible permissible, PartySubcommandType subcommand) { + public boolean partySubcommand(Permissible permissible, PartySubcommandType subcommand) { return permissible.hasPermission("mcmmo.commands.party." + subcommand.toString().toLowerCase()); } - public static boolean friendlyFire(Permissible permissible) { + public boolean friendlyFire(Permissible permissible) { return permissible.hasPermission("mcmmo.party.friendlyfire"); } /* TELEPORT */ - public static boolean partyTeleportSend(Permissible permissible) { + public boolean partyTeleportSend(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.send"); } - public static boolean partyTeleportAccept(Permissible permissible) { + public boolean partyTeleportAccept(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.accept"); } - public static boolean partyTeleportAcceptAll(Permissible permissible) { + public boolean partyTeleportAcceptAll(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.acceptall"); } - public static boolean partyTeleportToggle(Permissible permissible) { + public boolean partyTeleportToggle(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.toggle"); } - public static boolean partyTeleportAllWorlds(Permissible permissible) { + public boolean partyTeleportAllWorlds(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.world.all"); } - public static boolean partyTeleportWorld(Permissible permissible, World world) { + public boolean partyTeleportWorld(Permissible permissible, World world) { return permissible.hasPermission("mcmmo.commands.ptp.world." + world.getName()); } - public static void generateWorldTeleportPermissions() { + public void generateWorldTeleportPermissions() { Server server = pluginRef.getServer(); PluginManager pluginManager = server.getPluginManager(); @@ -522,7 +522,7 @@ public final class Permissions { * XP Perks are defined by user config files and are not known until runtime * This method registers Permissions with the server software as needed */ - public static void addCustomXPPerks() { + public void addCustomXPPerks() { pluginRef.getLogger().info("Registering custom XP perks with server software..."); PluginManager pluginManager = pluginRef.getServer().getPluginManager(); @@ -539,7 +539,7 @@ public final class Permissions { } } - private static void addDynamicPermission(String permissionName, PluginManager pluginManager) { + private void addDynamicPermission(String permissionName, PluginManager pluginManager) { Permission permission = new Permission(permissionName); permission.setDefault(PermissionDefault.OP); pluginManager.addPermission(permission); diff --git a/src/main/java/com/gmail/nossr50/util/TextComponentFactory.java b/src/main/java/com/gmail/nossr50/util/TextComponentFactory.java index 108b1100f..371f1d100 100644 --- a/src/main/java/com/gmail/nossr50/util/TextComponentFactory.java +++ b/src/main/java/com/gmail/nossr50/util/TextComponentFactory.java @@ -517,7 +517,7 @@ public class TextComponentFactory { public void getSubSkillTextComponents(Player player, List textComponents, PrimarySkillType parentSkill) { for (SubSkillType subSkillType : SubSkillType.values()) { if (subSkillType.getParentSkill() == parentSkill) { - if (Permissions.isSubSkillEnabled(player, subSkillType)) { + if (pluginRef.getPermissionTools().isSubSkillEnabled(player, subSkillType)) { if (!InteractionManager.hasSubSkill(subSkillType)) textComponents.add(pluginRef.getTextComponentFactory().getSubSkillTextComponent(player, subSkillType)); } @@ -527,7 +527,7 @@ public class TextComponentFactory { /* NEW SKILL SYSTEM */ for (AbstractSubSkill abstractSubSkill : InteractionManager.getSubSkillList()) { if (abstractSubSkill.getPrimarySkill() == parentSkill) { - if (Permissions.isSubSkillEnabled(player, abstractSubSkill)) + if (pluginRef.getPermissionTools().isSubSkillEnabled(player, abstractSubSkill)) textComponents.add(pluginRef.getTextComponentFactory().getSubSkillTextComponent(player, abstractSubSkill)); } } diff --git a/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java b/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java index e095d9802..31a64751b 100644 --- a/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java +++ b/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.util.commands; import com.gmail.nossr50.commands.*; +import com.gmail.nossr50.commands.admin.PlayerDebugCommand; import com.gmail.nossr50.commands.admin.ReloadLocaleCommand; import com.gmail.nossr50.commands.chat.AdminChatCommand; import com.gmail.nossr50.commands.chat.ChatSpyCommand; @@ -151,6 +152,16 @@ public final class CommandRegistrationManager { command.setExecutor(new MmoInfoCommand(pluginRef)); } + + private void registerMmoDebugCommand() { + PluginCommand command = pluginRef.getCommand("mmodebug"); + command.setDescription(pluginRef.getLocaleManager().getString("Commands.Description.mmodebug")); + command.setPermission(null); //No perm required to save support headaches + command.setPermissionMessage(permissionsMessage); + command.setUsage(pluginRef.getLocaleManager().getString("Commands.Usage.0", "mmodebug")); + command.setExecutor(new PlayerDebugCommand()); + } + private void registerMcChatSpyCommand() { PluginCommand command = pluginRef.getCommand("mcchatspy"); command.setDescription(pluginRef.getLocaleManager().getString("Commands.Description.mcchatspy")); @@ -415,6 +426,7 @@ public final class CommandRegistrationManager { public void registerCommands() { // Generic Commands registerMmoInfoCommand(); + registerMmoDebugCommand(); registerMcabilityCommand(); registerMcgodCommand(); registerMcChatSpyCommand(); diff --git a/src/main/java/com/gmail/nossr50/util/player/NotificationManager.java b/src/main/java/com/gmail/nossr50/util/player/NotificationManager.java index bd26af3f0..598adb4f6 100644 --- a/src/main/java/com/gmail/nossr50/util/player/NotificationManager.java +++ b/src/main/java/com/gmail/nossr50/util/player/NotificationManager.java @@ -8,7 +8,6 @@ import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.events.skills.McMMOPlayerNotificationEvent; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.sounds.SoundManager; import com.gmail.nossr50.util.sounds.SoundType; import net.md_5.bungee.api.ChatMessageType; @@ -115,6 +114,16 @@ public class NotificationManager { player.sendMessage(preColoredString); } + public void sendPlayerInformationChatOnlyPrefixed(Player player, String key, String... values) + { + if(pluginRef.getUserManager().getPlayer(player) == null || !pluginRef.getUserManager().getPlayer(player).useChatNotifications()) + return; + + String preColoredString = pluginRef.getLocaleManager().getString(key, (Object[]) values); + String prefixFormattedMessage = pluginRef.getLocaleManager().getString("mcMMO.Template.Prefix", preColoredString); + player.sendMessage(prefixFormattedMessage); + } + public void sendPlayerInformation(Player player, NotificationType notificationType, String key, String... values) { if(pluginRef.getUserManager().getPlayer(player) == null || !pluginRef.getUserManager().getPlayer(player).useChatNotifications()) @@ -228,7 +237,7 @@ public class NotificationManager { return; for (Player player : Bukkit.getServer().getOnlinePlayers()) { - if (player.isOp() || Permissions.adminChat(player)) { + if (player.isOp() || pluginRef.getPermissionTools().adminChat(player)) { player.sendMessage(pluginRef.getLocaleManager().getString("Notifications.Admin.Format.Others", msg)); } } diff --git a/src/main/java/com/gmail/nossr50/util/player/PlayerLevelTools.java b/src/main/java/com/gmail/nossr50/util/player/PlayerLevelTools.java index f273fdb81..2df315aba 100644 --- a/src/main/java/com/gmail/nossr50/util/player/PlayerLevelTools.java +++ b/src/main/java/com/gmail/nossr50/util/player/PlayerLevelTools.java @@ -4,7 +4,6 @@ import com.gmail.nossr50.datatypes.experience.CustomXPPerk; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import org.bukkit.entity.Player; import java.util.Collections; @@ -24,7 +23,7 @@ public class PlayerLevelTools { * Register our custom permission perks with bukkit */ private void registerCustomPerkPermissions() { - Permissions.addCustomXPPerks(); + pluginRef.getPermissionTools().addCustomXPPerks(); } /** @@ -58,7 +57,7 @@ public class PlayerLevelTools { //Check all registered XP Perk nodes for this player for (CustomXPPerk customXPPerk : customXpPerkNodes) { - if (Permissions.hasCustomXPPerk(player, customXPPerk)) { + if (pluginRef.getPermissionTools().hasCustomXPPerk(player, customXPPerk)) { enabledXPPerks.add(customXPPerk); } } @@ -92,17 +91,17 @@ public class PlayerLevelTools { } //Disgusting legacy support start - if (Permissions.quadrupleXp(player, skill)) { + if (pluginRef.getPermissionTools().quadrupleXp(player, skill)) { xpPerkValues.add(4.0); - } else if (Permissions.tripleXp(player, skill)) { + } else if (pluginRef.getPermissionTools().tripleXp(player, skill)) { xpPerkValues.add(3.0); - } else if (Permissions.doubleAndOneHalfXp(player, skill)) { + } else if (pluginRef.getPermissionTools().doubleAndOneHalfXp(player, skill)) { xpPerkValues.add(2.5); - } else if (Permissions.doubleXp(player, skill)) { + } else if (pluginRef.getPermissionTools().doubleXp(player, skill)) { xpPerkValues.add(2.0); - } else if (Permissions.oneAndOneHalfXp(player, skill)) { + } else if (pluginRef.getPermissionTools().oneAndOneHalfXp(player, skill)) { xpPerkValues.add(1.5); - } else if (Permissions.oneAndOneTenthXp(player, skill)) { + } else if (pluginRef.getPermissionTools().oneAndOneTenthXp(player, skill)) { xpPerkValues.add(1.1); } //Disgusting legacy support end diff --git a/src/main/java/com/gmail/nossr50/util/player/UserManager.java b/src/main/java/com/gmail/nossr50/util/player/UserManager.java index 077cbd3bd..bdedafd8f 100644 --- a/src/main/java/com/gmail/nossr50/util/player/UserManager.java +++ b/src/main/java/com/gmail/nossr50/util/player/UserManager.java @@ -51,9 +51,11 @@ public final class UserManager { public void remove(Player player) { McMMOPlayer mcMMOPlayer = getPlayer(player); player.removeMetadata(MetadataConstants.PLAYER_DATA_METAKEY, pluginRef); + mcMMOPlayer.cleanup(); - if(playerDataSet != null && playerDataSet.contains(mcMMOPlayer)) + if(playerDataSet != null && playerDataSet.contains(mcMMOPlayer)) { playerDataSet.remove(mcMMOPlayer); //Clear sync save tracking + } } /** diff --git a/src/main/java/com/gmail/nossr50/util/random/RandomChanceSkill.java b/src/main/java/com/gmail/nossr50/util/random/RandomChanceSkill.java index 2190f2943..9eb22d8da 100644 --- a/src/main/java/com/gmail/nossr50/util/random/RandomChanceSkill.java +++ b/src/main/java/com/gmail/nossr50/util/random/RandomChanceSkill.java @@ -3,7 +3,6 @@ package com.gmail.nossr50.util.random; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import org.bukkit.entity.Player; public class RandomChanceSkill implements RandomChanceExecution { @@ -28,7 +27,7 @@ public class RandomChanceSkill implements RandomChanceExecution { this.skillLevel = 0; if (player != null) - isLucky = Permissions.lucky(player, primarySkillType); + isLucky = pluginRef.getPermissionTools().lucky(player, primarySkillType); else isLucky = false; } @@ -50,7 +49,7 @@ public class RandomChanceSkill implements RandomChanceExecution { this.skillLevel = 0; if (player != null) - isLucky = Permissions.lucky(player, primarySkillType); + isLucky = pluginRef.getPermissionTools().lucky(player, primarySkillType); else isLucky = false; } diff --git a/src/main/java/com/gmail/nossr50/util/random/RandomChanceTools.java b/src/main/java/com/gmail/nossr50/util/random/RandomChanceTools.java index 164cdad64..f8d8d2c25 100644 --- a/src/main/java/com/gmail/nossr50/util/random/RandomChanceTools.java +++ b/src/main/java/com/gmail/nossr50/util/random/RandomChanceTools.java @@ -6,7 +6,6 @@ import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.events.skills.secondaryabilities.SubSkillEvent; import com.gmail.nossr50.events.skills.secondaryabilities.SubSkillRandomCheckEvent; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.skills.SkillActivationType; import org.bukkit.entity.Player; @@ -249,7 +248,7 @@ public class RandomChanceTools { double successChance = getActivationChance(skillActivationType, subSkillType, player); String[] displayValues = new String[2]; - boolean isLucky = Permissions.lucky(player, subSkillType.getParentSkill(pluginRef)); + boolean isLucky = pluginRef.getPermissionTools().lucky(player, subSkillType.getParentSkill(pluginRef)); displayValues[0] = percent.format(Math.min(successChance, 100.0D) / 100.0D); displayValues[1] = isLucky ? percent.format(Math.min(successChance * 1.3333D, 100.0D) / 100.0D) : null; @@ -266,7 +265,7 @@ public class RandomChanceTools { String[] displayValues = new String[2]; - boolean isLucky = Permissions.lucky(player, primarySkillType); + boolean isLucky = pluginRef.getPermissionTools().lucky(player, primarySkillType); displayValues[0] = percent.format(Math.min(successChance, 100.0D) / 100.0D); displayValues[1] = isLucky ? percent.format(Math.min(successChance_lucky, 100.0D) / 100.0D) : null; @@ -281,7 +280,7 @@ public class RandomChanceTools { //TODO: Account for lucky in this - boolean isLucky = Permissions.lucky(player, subSkillType.getParentSkill(pluginRef)); + boolean isLucky = pluginRef.getPermissionTools().lucky(player, subSkillType.getParentSkill(pluginRef)); displayValues[0] = percent.format(Math.min(successChance, 100.0D) / 100.0D); displayValues[1] = isLucky ? percent.format(Math.min(successChance * 1.3333D, 100.0D) / 100.0D) : null; @@ -290,7 +289,7 @@ public class RandomChanceTools { } public double addLuck(Player player, PrimarySkillType primarySkillType, double chance) { - if (Permissions.lucky(player, primarySkillType)) + if (pluginRef.getPermissionTools().lucky(player, primarySkillType)) return chance * 1.333D; else return chance; diff --git a/src/main/java/com/gmail/nossr50/util/skills/CombatTools.java b/src/main/java/com/gmail/nossr50/util/skills/CombatTools.java index 3d5d10170..c32d22ba8 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatTools.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatTools.java @@ -1,5 +1,6 @@ package com.gmail.nossr50.util.skills; +import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.core.MetadataConstants; import com.gmail.nossr50.datatypes.experience.SpecialXPKey; import com.gmail.nossr50.datatypes.experience.XPGainReason; @@ -17,10 +18,8 @@ import com.gmail.nossr50.skills.archery.ArcheryManager; import com.gmail.nossr50.skills.axes.AxesManager; import com.gmail.nossr50.skills.swords.SwordsManager; import com.gmail.nossr50.skills.taming.TamingManager; -import com.gmail.nossr50.skills.unarmed.Unarmed; import com.gmail.nossr50.skills.unarmed.UnarmedManager; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; import com.google.common.collect.ImmutableMap; import org.bukkit.GameMode; import org.bukkit.Material; @@ -76,8 +75,9 @@ public final class CombatTools { swordsManager.serratedStrikes(target, initialDamage, modifiers); } - if (canUseLimitBreak(player, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK)) { - finalDamage += getLimitBreakDamage(player, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK); + if(canUseLimitBreak(player, target, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK)) + { + finalDamage+=getLimitBreakDamage(player, target, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK); } applyScaledModifiers(initialDamage, finalDamage, event); @@ -118,8 +118,9 @@ public final class CombatTools { finalDamage += axesManager.criticalHit(target, finalDamage); } - if (canUseLimitBreak(player, SubSkillType.AXES_AXES_LIMIT_BREAK)) { - finalDamage += getLimitBreakDamage(player, SubSkillType.AXES_AXES_LIMIT_BREAK); + if(canUseLimitBreak(player, target, SubSkillType.AXES_AXES_LIMIT_BREAK)) + { + finalDamage+=getLimitBreakDamage(player, target, SubSkillType.AXES_AXES_LIMIT_BREAK); } applyScaledModifiers(initialDamage, finalDamage, event); @@ -155,39 +156,54 @@ public final class CombatTools { unarmedManager.disarmCheck((Player) target); } - if (canUseLimitBreak(player, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK)) { - finalDamage += getLimitBreakDamage(player, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK); + if(canUseLimitBreak(player, target, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK)) + { + finalDamage+=getLimitBreakDamage(player, target, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK); } } applyScaledModifiers(initialDamage, finalDamage, event); startGainXp(mcMMOPlayer, target, PrimarySkillType.UNARMED); - Unarmed.lastAttacked = System.currentTimeMillis(); //Track how often the player is punching + unarmedManager.setLastAttacked(System.currentTimeMillis()); //Track how often the player is punching } private void processTamingCombat(LivingEntity target, Player master, Wolf wolf, EntityDamageByEntityEvent event) { double initialDamage = event.getDamage(); double finalDamage = initialDamage; - McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(master); - TamingManager tamingManager = mcMMOPlayer.getTamingManager(); + if(master != null && !master.isOnline() && master.isValid()) { + McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(master); - if (tamingManager.canUseFastFoodService()) { - tamingManager.fastFoodService(wolf, event.getDamage()); + //Make sure the profiles been loaded + if(mcMMOPlayer == null) { + return; + } + + TamingManager tamingManager = mcMMOPlayer.getTamingManager(); + + if (tamingManager.canUseFastFoodService()) { + tamingManager.fastFoodService(wolf, event.getDamage()); + } + + tamingManager.pummel(target, wolf); + + if (tamingManager.canUseSharpenedClaws()) { + if(target instanceof Player) { + finalDamage+=tamingManager.sharpenedClaws(false); + } else { + finalDamage+=tamingManager.sharpenedClaws(true); + } + + } + + if (tamingManager.canUseGore()) { + finalDamage+=tamingManager.gore(target, initialDamage); + } + + applyScaledModifiers(initialDamage, finalDamage, event); + startGainXp(mcMMOPlayer, target, PrimarySkillType.TAMING); } - tamingManager.pummel(target, wolf); - - if (tamingManager.canUseSharpenedClaws()) { - finalDamage += tamingManager.getSharpenedClawsDamage(); - } - - if (tamingManager.canUseGore()) { - finalDamage += tamingManager.gore(target, initialDamage); - } - - applyScaledModifiers(initialDamage, finalDamage, event); - startGainXp(mcMMOPlayer, target, PrimarySkillType.TAMING); } private void processArcheryCombat(LivingEntity target, Player player, EntityDamageByEntityEvent event, Arrow arrow) { @@ -223,8 +239,9 @@ public final class CombatTools { archeryManager.processArrowRetrievalActivation(target, arrow); } - if (canUseLimitBreak(player, SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK)) { - finalDamage += getLimitBreakDamage(player, SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK); + if(canUseLimitBreak(player, target, SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK)) + { + finalDamage+=getLimitBreakDamage(player, target, SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK); } double distanceMultiplier = archeryManager.distanceXpBonusMultiplier(target, arrow); @@ -374,19 +391,81 @@ public final class CombatTools { } } - public int getLimitBreakDamage(Player player, SubSkillType subSkillType) { - return pluginRef.getRankTools().getRank(player, subSkillType); + public int getLimitBreakDamage(Player player, LivingEntity defender, SubSkillType subSkillType) { + if(defender instanceof Player) { + Player playerDefender = (Player) defender; + return getLimitBreakDamageAgainstQuality(player, subSkillType, getArmorQualityLevel(playerDefender)); + } else { + return getLimitBreakDamageAgainstQuality(player, subSkillType, 1000); + } + } + + public int getLimitBreakDamageAgainstQuality(Player player, SubSkillType subSkillType, int armorQualityLevel) { + int rawDamageBoost = pluginRef.getRankTools().getRank(player, subSkillType); + + if(armorQualityLevel <= 4) { + rawDamageBoost *= .25; //75% Nerf + } else if(armorQualityLevel <= 8) { + rawDamageBoost *= .50; //50% Nerf + } else if(armorQualityLevel <= 12) { + rawDamageBoost *= .75; //25% Nerf + } + + return rawDamageBoost; + } + + public int getArmorQualityLevel(Player defender) { + int armorQualityLevel = 0; + + for(ItemStack itemStack : defender.getInventory().getArmorContents()) { + if(itemStack != null) { + armorQualityLevel += getArmorQuality(itemStack); + } + } + + return armorQualityLevel; + } + + private int getArmorQuality(ItemStack itemStack) { + switch(itemStack.getType()) { + case LEATHER_HELMET: + case LEATHER_BOOTS: + case LEATHER_CHESTPLATE: + case LEATHER_LEGGINGS: + return 1; + case IRON_HELMET: + case IRON_BOOTS: + case IRON_CHESTPLATE: + case IRON_LEGGINGS: + return 2; + case GOLDEN_HELMET: + case GOLDEN_BOOTS: + case GOLDEN_CHESTPLATE: + case GOLDEN_LEGGINGS: + return 3; + case DIAMOND_HELMET: + case DIAMOND_BOOTS: + case DIAMOND_CHESTPLATE: + case DIAMOND_LEGGINGS: + return 6; + default: + return 1; + } } /** * Checks if player has access to their weapons limit break * - * @param player target player + * @param player target entity * @return true if the player has access to the limit break */ - public boolean canUseLimitBreak(Player player, SubSkillType subSkillType) { - return pluginRef.getRankTools().hasUnlockedSubskill(player, subSkillType) - && Permissions.isSubSkillEnabled(player, subSkillType); + public boolean canUseLimitBreak(Player player, LivingEntity target, SubSkillType subSkillType) { + if(target instanceof Player || AdvancedConfig.getInstance().canApplyLimitBreakPVE()) { + return pluginRef.getRankTools().hasUnlockedSubskill(player, subSkillType) + && pluginRef.getPermissionTools().isSubSkillEnabled(player, subSkillType); + } else { + return false; + } } /** @@ -610,7 +689,7 @@ public final class CombatTools { return false; } - if ((pluginRef.getPartyManager().inSameParty(player, defender) || pluginRef.getPartyManager().areAllies(player, defender)) && !(Permissions.friendlyFire(player) && Permissions.friendlyFire(defender))) { + if ((pluginRef.getPartyManager().inSameParty(player, defender) || pluginRef.getPartyManager().areAllies(player, defender)) && !(pluginRef.getPermissionTools().friendlyFire(player) && pluginRef.getPermissionTools().friendlyFire(defender))) { return false; } @@ -633,7 +712,7 @@ public final class CombatTools { // isFriendlyPet ensures that the Tameable is: Tamed, owned by a player, and the owner is in the same party // So we can make some assumptions here, about our casting and our check Player owner = (Player) ((Tameable) entity).getOwner(); - if (!(Permissions.friendlyFire(player) && Permissions.friendlyFire(owner))) { + if (!(pluginRef.getPermissionTools().friendlyFire(player) && pluginRef.getPermissionTools().friendlyFire(owner))) { return false; } } diff --git a/src/main/java/com/gmail/nossr50/util/skills/PerksUtils.java b/src/main/java/com/gmail/nossr50/util/skills/PerksUtils.java index 8dd6c10bf..dab2a8c42 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/PerksUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/PerksUtils.java @@ -1,7 +1,6 @@ package com.gmail.nossr50.util.skills; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.util.Permissions; import org.bukkit.entity.Player; public final class PerksUtils { @@ -12,11 +11,11 @@ public final class PerksUtils { } public static int handleCooldownPerks(Player player, int cooldown) { - if (Permissions.halvedCooldowns(player)) { + if (pluginRef.getPermissionTools().halvedCooldowns(player)) { cooldown *= 0.5; - } else if (Permissions.thirdedCooldowns(player)) { + } else if (pluginRef.getPermissionTools().thirdedCooldowns(player)) { cooldown *= (2.0 / 3.0); - } else if (Permissions.quarteredCooldowns(player)) { + } else if (pluginRef.getPermissionTools().quarteredCooldowns(player)) { cooldown *= 0.75; } @@ -31,7 +30,7 @@ public final class PerksUtils { * @return the activation chance with "lucky perk" accounted for */ public static int handleLuckyPerks(Player player, PrimarySkillType skill) { - if (Permissions.lucky(player, skill)) { + if (pluginRef.getPermissionTools().lucky(player, skill)) { return LUCKY_SKILL_ACTIVATION_CHANCE; } diff --git a/src/main/java/com/gmail/nossr50/util/skills/RankTools.java b/src/main/java/com/gmail/nossr50/util/skills/RankTools.java index fe64b1555..fd21df7e7 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/RankTools.java +++ b/src/main/java/com/gmail/nossr50/util/skills/RankTools.java @@ -10,7 +10,6 @@ import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.listeners.InteractionManager; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.skills.SkillUnlockNotificationTask; -import com.gmail.nossr50.util.Permissions; import com.google.common.reflect.TypeToken; import ninja.leaping.configurate.commented.CommentedConfigurationNode; import ninja.leaping.configurate.objectmapping.ObjectMappingException; @@ -45,7 +44,7 @@ public class RankTools { continue; //Don't send notifications if the player lacks the permission node - if(!Permissions.isSubSkillEnabled(mcMMOPlayer.getPlayer(), subSkillType)) + if(!pluginRef.getPermissionTools().isSubSkillEnabled(mcMMOPlayer.getPlayer(), subSkillType)) continue; //The players level is the exact level requirement for this skill diff --git a/src/main/java/com/gmail/nossr50/util/skills/SkillTools.java b/src/main/java/com/gmail/nossr50/util/skills/SkillTools.java index 47b2d770d..363549892 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/SkillTools.java +++ b/src/main/java/com/gmail/nossr50/util/skills/SkillTools.java @@ -11,7 +11,6 @@ import com.gmail.nossr50.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.datatypes.skills.ToolType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.StringUtils; import com.google.common.collect.ImmutableList; import org.bukkit.Bukkit; @@ -263,11 +262,11 @@ public class SkillTools { } public int getEnduranceLength(Player player) { - if (Permissions.twelveSecondActivationBoost(player)) { + if (pluginRef.getPermissionTools().twelveSecondActivationBoost(player)) { return 12; - } else if (Permissions.eightSecondActivationBoost(player)) { + } else if (pluginRef.getPermissionTools().eightSecondActivationBoost(player)) { return 8; - } else if (Permissions.fourSecondActivationBoost(player)) { + } else if (pluginRef.getPermissionTools().fourSecondActivationBoost(player)) { return 4; } else { return 0; @@ -728,7 +727,7 @@ public class SkillTools { } public boolean doesPlayerHaveSkillPermission(PrimarySkillType primarySkillType, Player player) { - return Permissions.skillEnabled(player, primarySkillType); + return pluginRef.getPermissionTools().skillEnabled(player, primarySkillType); } public boolean canCombatSkillsTrigger(PrimarySkillType primarySkillType, Entity target) { diff --git a/src/main/resources/advanced.yml b/src/main/resources/advanced.yml index 180875e86..6648a3dc7 100644 --- a/src/main/resources/advanced.yml +++ b/src/main/resources/advanced.yml @@ -1,5 +1,6 @@ # # Advanced configuration +# Last updated on ${project.version}-b${BUILD_NUMBER} # # For advanced users only! There is no need to change anything here. # @@ -13,6 +14,8 @@ # Settings for the Skills ### # Enables anonymous statistics +Metrics: + bstats: true Feedback: PlayerTips: true SkillCommand: @@ -74,6 +77,8 @@ Feedback: SendCopyOfMessageToChat: true Skills: General: + LimitBreak: + AllowPVE: false StartingLevel: 0 Ability: Length: @@ -173,6 +178,7 @@ Skills: # Damage modifier of critical hits for PVP / PVE, when causing a critical hit the damage gets multiplied by the modifier PVP_Modifier: 1.5 PVE_Modifier: 2.0 + GreaterImpact: # Chance: Chance of hitting with GreaterImpact, mobs are knocked backwards when successful # KnockbackModifier: Velocity modifier of GreaterImpact hits, this determines how great the knockback is @@ -180,6 +186,7 @@ Skills: Chance: 25.0 KnockbackModifier: 1.5 BonusDamage: 2.0 + ArmorImpact: # Multiplied against the skill rank to determine how much damage to do DamagePerRank: 6.5 @@ -194,6 +201,7 @@ Skills: # Settings for Fishing ### Fishing: + ShakeChance: Rank_1: 15.0 Rank_2: 15.0 @@ -203,6 +211,7 @@ Skills: Rank_6: 55.0 Rank_7: 65.0 Rank_8: 75.0 + # VanillaXPMultiplier: Vanilla XP gained from fishing is multiplied by these values. VanillaXPMultiplier: Rank_1: 1 @@ -213,9 +222,11 @@ Skills: Rank_6: 4 Rank_7: 5 Rank_8: 5 + FishermansDiet: # This determines when Fisherman's Diet adds extra hunger recovery to food RankChange: 20 + MasterAngler: # BoatMultiplier: Catch rate is multiplied by this modifier # BiomeModifier: Catch rate is multiplied by this modifier @@ -225,6 +236,7 @@ Skills: # Settings for Herbalism ### Herbalism: + GreenThumb: # ChanceMax: Maximum chance of GreenThumb when on or higher # MaxBonusLevel: On this level, GreenThumb chance will be @@ -232,6 +244,7 @@ Skills: MaxBonusLevel: Standard: 100 RetroMode: 1000 + DoubleDrops: # ChanceMax: Maximum chance of receiving double drops when on or higher # MaxBonusLevel: Level when of receiving double drops is reached @@ -239,6 +252,7 @@ Skills: MaxBonusLevel: Standard: 100 RetroMode: 1000 + HylianLuck: # ChanceMax: Maximum chance of Hylian Luck when on or higher # MaxBonusLevel: On this level, Hylian Luck chance will be @@ -246,6 +260,7 @@ Skills: MaxBonusLevel: Standard: 100 RetroMode: 1000 + ShroomThumb: # ChanceMax: Maximum chance of ShroomThumb when on or higher # MaxBonusLevel: On this level, ShroomThumb chance will be @@ -265,6 +280,7 @@ Skills: MaxBonusLevel: Standard: 100 RetroMode: 1000 + BlastMining: # BlastDamageDecrease Ranks: % of damage reduced from TNT explosions BlastDamageDecrease: @@ -276,6 +292,7 @@ Skills: Rank_6: 50.0 Rank_7: 50.0 Rank_8: 100.0 + # OreBonus Ranks: % of extra ores received when Blast Mining OreBonus: Rank_1: 35.0 @@ -286,6 +303,7 @@ Skills: Rank_6: 60.0 Rank_7: 65.0 Rank_8: 70.0 + # DebrisReduction_Rank: % of fewer non-ores received when Blast Mining DebrisReduction: Rank_1: 10.0 @@ -296,6 +314,7 @@ Skills: Rank_6: 30.0 Rank_7: 30.0 Rank_8: 30.0 + # DropMultiplier Ranks: # of times each ore will drop DropMultiplier: Rank_1: 1 @@ -306,6 +325,7 @@ Skills: Rank_6: 2 Rank_7: 3 Rank_8: 3 + # BlastRadiusModifier Ranks: Increases the blast radius by this amount BlastRadiusModifier: Rank_1: 1.0 @@ -327,6 +347,7 @@ Skills: MaxBonusLevel: Standard: 100 RetroMode: 1000 + SuperRepair: # ChanceMax: Maximum chance of Super Repair when on or higher # MaxBonusLevel: On this level, Super Repair chance will be @@ -334,6 +355,7 @@ Skills: MaxBonusLevel: Standard: 100 RetroMode: 1000 + ArcaneForging: May_Lose_Enchants: true Keep_Enchants_Chance: @@ -397,6 +419,14 @@ Skills: MaxBonusLevel: Standard: 100 RetroMode: 1000 + + FluxMining: + # Chance: Chance for Flux Mining to activate + Chance: 33.0 + MaxBonusLevel: + Standard: 100 + RetroMode: 1000 + # VanillaXPMultiplier: Vanilla XP gained from smelting ores is multiplied by these values. VanillaXPMultiplier: Rank_1: 1 @@ -407,6 +437,7 @@ Skills: Rank_6: 4 Rank_7: 5 Rank_8: 5 + # # Settings for Swords ### @@ -418,6 +449,7 @@ Skills: MaxBonusLevel: Standard: 100 RetroMode: 1000 + # DamagePlayer: Bleeding damage dealt to players # DamageMobs: Bleeding damage dealt to mobs DamagePlayer: 2.0 @@ -426,7 +458,9 @@ Skills: # These settings determine how long the Bleeding effect lasts MaxTicks: 8 BaseTicks: 2 + CounterAttack: + # ChanceMax: Maximum chance of triggering a counter attack # MaxBonusLevel: On this level, the chance to Counter will be ChanceMax: 30.0 @@ -489,13 +523,15 @@ Skills: Standard: 100 RetroMode: 1000 AntiTheft: false - ArrowDeflect:32 + + ArrowDeflect: # ChanceMax: Maximum chance of deflecting arrows # MaxBonusLevel: Level when the maximum chance to deflect is reached ChanceMax: 50.0 MaxBonusLevel: Standard: 100 RetroMode: 1000 + IronGrip: # ChanceMax: Maximum chance of preventing being disarmed # MaxBonusLevel: Level when the maximum chance to prevent being disarmed is reached @@ -503,6 +539,7 @@ Skills: MaxBonusLevel: Standard: 100 RetroMode: 1000 + IronArmStyle: # BonusMin: Minimum bonus damage for unarmed # BonusMax: Maximum bonus damage for unarmed @@ -541,4 +578,4 @@ Skills: ChanceMax: 100.0 MaxBonusLevel: Standard: 100 - RetroMode: 1000 + RetroMode: 1000 \ No newline at end of file diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index c3186a186..d6c6a2366 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -387,23 +387,19 @@ Skills: Item_Amount: 10 Summon_Amount: 1 Summon_Length: 240 - Summon_Max_Amount: 10 + Per_Player_Limit: 2 Ocelot: Item_Material: COD Item_Amount: 10 Summon_Amount: 1 Summon_Length: 240 - Summon_Max_Amount: 10 + Per_Player_Limit: 1 Horse: Item_Material: APPLE Item_Amount: 10 Summon_Amount: 1 Summon_Length: 240 - Summon_Max_Amount: 10 - - # Range to check for nearby pets when using Call Of The Wild, 0 will disable the check - Range: 40.0 - + Per_Player_Limit: 1 Unarmed: Enabled_For_PVP: true Enabled_For_PVE: true @@ -424,6 +420,8 @@ Skills: ### Bonus_Drops: Herbalism: + Chorus_Fruit: true + Chorus_Plant: true Beetroots: true Beetroot: true Brown_Mushroom: true diff --git a/src/main/resources/experience.yml b/src/main/resources/experience.yml index 9cf2ff53e..4dd602207 100644 --- a/src/main/resources/experience.yml +++ b/src/main/resources/experience.yml @@ -24,6 +24,7 @@ EarlyGameBoost: Enabled: true ExploitFix: + COTWBreeding: true UnsafeEnchantments: false # Prevent many exploits related to fishing Fishing: true @@ -31,6 +32,7 @@ ExploitFix: Acrobatics: true LavaStoneAndCobbleFarming: true TreeFellerReducedXP: true + PistonCheating: true Experience_Bars: # Turn this to false if you wanna disable XP bars Enable: true @@ -309,25 +311,25 @@ Experience_Values: Dead_Horn_Coral_Wall_Fan: 10 Allium: 300 Azure_Bluet: 150 - Beetroots_Ripe: 50 Blue_Orchid: 150 Brown_Mushroom: 150 Cactus: 30 - Carrots_Ripe: 50 - Chorus_Flower_Ripe: 25 + Chorus_Flower: 25 Chorus_Plant: 1 - Cocoa_Ripe: 30 - Wheat_Ripe: 50 + Carrots: 50 + Cocoa: 30 + Potatoes: 50 + Wheat: 50 + Beetroots: 50 + Nether_Wart: 50 Dead_Bush: 30 Lilac: 50 Melon: 20 - Nether_Wart_Ripe: 50 Orange_Tulip: 150 Oxeye_Daisy: 150 Peony: 50 Pink_Tulip: 150 Poppy: 100 - Potatoes_Ripe: 50 Pumpkin: 20 Red_Mushroom: 150 Red_Tulip: 150 @@ -344,8 +346,8 @@ Experience_Values: Dandelion: 100 Bamboo: 10 Cornflower: 150 - Lily_of_the_valley: 150 - Wither_rose: 500 + Lily_Of_The_Valley: 150 + Wither_Rose: 500 Mining: Magma_Block: 30 Tube_Coral_Block: 75 @@ -357,7 +359,7 @@ Experience_Values: Diamond_Ore: 2400 Emerald_Ore: 1000 End_Bricks: 50 - Nether_Brick: 50 + Nether_Bricks: 50 End_Stone: 15 Glowstone: 15 Gold_Ore: 1300 diff --git a/src/main/resources/locale/locale_de.properties b/src/main/resources/locale/locale_de.properties index 12d6c267b..9a1ee38ce 100644 --- a/src/main/resources/locale/locale_de.properties +++ b/src/main/resources/locale/locale_de.properties @@ -270,7 +270,7 @@ Commands.XPGain.Excavation = Graben und Sch\u00E4tze finden Commands.XPGain.Fishing = Angeln (Ach was :o) Commands.XPGain.Herbalism = Ernten Commands.XPGain.Mining = Erze und Steine abbauen -Commands.XPGain.Overhaul = &6Erfahrungs Erhalt: &3{0} +Commands.XPGain.Overhaul = &6Erfahrungserhalt: &3{0} Commands.XPGain.Repair = Reparieren Commands.XPGain.Swords = Monster angreifen Commands.XPGain.Taming = Monster z\u00E4hmen, mit dem Wolf k\u00E4mpfen diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index 900e84500..c89dcbb0e 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -55,6 +55,11 @@ Anvil.SingleItemStack=[[RED]]You cannot salvage or repair item stacks that have #DO NOT USE COLOR CODES IN THE JSON KEYS #COLORS ARE DEFINED IN advanced.yml IF YOU WISH TO CHANGE THEM +<<<<<<< HEAD +======= + +mcMMO.Template.Prefix=[[GOLD]]([[GREEN]]mcMMO[[GOLD]]) [[GRAY]]{0} +>>>>>>> 308e3a4b1f46e9e3de28d6d540dd055a540ed4d5 # BEGIN STYLING Ability.Generic.Refresh=[[GREEN]]**ABILITIES REFRESHED!** Ability.Generic.Template.Lock=[[GRAY]]{0} @@ -163,8 +168,8 @@ Archery.SubSkill.ArrowRetrieval.Name=Arrow Retrieval Archery.SubSkill.ArrowRetrieval.Description=Chance to retrieve arrows from corpses Archery.SubSkill.ArrowRetrieval.Stat=Arrow Recovery Chance Archery.SubSkill.ArcheryLimitBreak.Name=Archery Limit Break -Archery.SubSkill.ArcheryLimitBreak.Description=Breaking your limits. -Archery.SubSkill.ArcheryLimitBreak.Stat=Limit Break Bonus DMG +Archery.SubSkill.ArcheryLimitBreak.Description=Breaking your limits. Increased damage against tough opponents. Intended for PVP, up to server settings for whether or not it will boost damage in PVE. +Archery.SubSkill.ArcheryLimitBreak.Stat=Limit Break Max DMG Archery.Listener=Archery: Archery.SkillName=ARCHERY #AXES @@ -190,8 +195,8 @@ Axes.SubSkill.CriticalStrikes.Stat=Critical Strike Chance Axes.SubSkill.AxeMastery.Name=Axe Mastery Axes.SubSkill.AxeMastery.Description=Adds bonus DMG Axes.SubSkill.AxesLimitBreak.Name=Axes Limit Break -Axes.SubSkill.AxesLimitBreak.Description=Breaking your limits. -Axes.SubSkill.AxesLimitBreak.Stat=Limit Break Bonus DMG +Axes.SubSkill.AxesLimitBreak.Description=Breaking your limits. Increased damage against tough opponents. Intended for PVP, up to server settings for whether or not it will boost damage in PVE. +Axes.SubSkill.AxesLimitBreak.Stat=Limit Break Max DMG Axes.SubSkill.ArmorImpact.Name=Armor Impact Axes.SubSkill.ArmorImpact.Description=Strike with enough force to shatter armor Axes.SubSkill.GreaterImpact.Name=Greater Impact @@ -211,8 +216,8 @@ Excavation.SubSkill.GigaDrillBreaker.Description=3x Drop Rate, 3x EXP, +Speed Excavation.SubSkill.GigaDrillBreaker.Stat=Giga Drill Breaker Duration Excavation.SubSkill.Archaeology.Name=Archaeology Excavation.SubSkill.Archaeology.Description=Unearth the secrets of the land! High skill levels increase your odds of finding experience orbs when you find treasure! -Excavation.SubSkill.Archaeology.Stat=Archaelogy Experience Orb Chance -Excavation.SubSkill.Archaeology.Stat.Extra=Archaeoloy Experience Orb Amount +Excavation.SubSkill.Archaeology.Stat=Archaeology Experience Orb Chance +Excavation.SubSkill.Archaeology.Stat.Extra=Archaeology Experience Orb Amount Excavation.Listener=Excavation: Excavation.SkillName=EXCAVATION Excavation.Skills.GigaDrillBreaker.Off=**Giga Drill Breaker has worn off** @@ -419,8 +424,8 @@ Swords.SubSkill.Stab.Name=Stab Swords.SubSkill.Stab.Description=Adds bonus damage to your attacks. Swords.SubSkill.Stab.Stat=Stab Damage Swords.SubSkill.SwordsLimitBreak.Name=Swords Limit Break -Swords.SubSkill.SwordsLimitBreak.Description=Breaking your limits. -Swords.SubSkill.SwordsLimitBreak.Stat=Limit Break Bonus DMG +Swords.SubSkill.SwordsLimitBreak.Description=Breaking your limits. Increased damage against tough opponents. Intended for PVP, up to server settings for whether or not it will boost damage in PVE. +Swords.SubSkill.SwordsLimitBreak.Stat=Limit Break Max DMG Swords.SubSkill.Rupture.Stat=Rupture Chance Swords.SubSkill.Rupture.Stat.Extra=Rupture: [[GREEN]]{0} ticks [{1} DMG vs Player] [{2} DMG vs Mobs] Swords.Effect.4=Serrated Strikes Rupture+ @@ -483,7 +488,13 @@ Taming.Summon.Fail.Ocelot=[[RED]]You have too many ocelots nearby to summon any Taming.Summon.Fail.Wolf=[[RED]]You have too many wolves nearby to summon any more. Taming.Summon.Fail.Horse=[[RED]]You have too many horses nearby to summon any more. Taming.Summon.Fail.TooMany=[[RED]]You have reached the maximum limit of pets to summon. [[YELLOW]]({0}) -Taming.Summon.Name.Format={0}'s {1} +Taming.Summon.COTW.Success.WithoutLifespan=[[GREEN]](Call Of The Wild) [[GRAY]]You have summoned a [[GOLD]]{0}[[GRAY]] +Taming.Summon.COTW.Success.WithLifespan=[[GREEN]](Call Of The Wild) [[GRAY]]You have summoned a [[GOLD]]{0}[[GRAY]] and it has a duration of [[GOLD]]{1}[[GRAY]] seconds. +Taming.Summon.COTW.Limit=[[GREEN]](Call Of The Wild) [[GRAY]]You can only have [[RED]]{0} [[GRAY]]summoned [[GRAY]]{1} pets at the same time. +Taming.Summon.COTW.TimeExpired=[[GREEN]](Call Of The Wild) [[GRAY]]Time is up, your [[GOLD]]{0}[[GRAY]] departs. +Taming.Summon.COTW.BreedingDisallowed=[[GREEN]](Call Of The Wild) [[RED]]You cannot breed a summoned animal. +Taming.Summon.COTW.NeedMoreItems=[[GREEN]](Call Of The Wild) [[GRAY]]You need [[YELLOW]]{0}[[GRAY]] more [[DARK_AQUA]]{1}[[GRAY]](s) +Taming.Summon.Name.Format=[[GOLD]](COTW) [[WHITE]]{0}'s {1} #UNARMED Unarmed.Ability.Bonus.0=Iron Arm Style Unarmed.Ability.Bonus.1=+{0} DMG Upgrade @@ -498,8 +509,8 @@ Unarmed.SubSkill.Disarm.Name=Disarm Unarmed.SubSkill.Disarm.Description=Drops the foes item held in hand Unarmed.SubSkill.Disarm.Stat=Disarm Chance Unarmed.SubSkill.UnarmedLimitBreak.Name=Unarmed Limit Break -Unarmed.SubSkill.UnarmedLimitBreak.Description=Breaking your limits. -Unarmed.SubSkill.UnarmedLimitBreak.Stat=Limit Break Bonus DMG +Unarmed.SubSkill.UnarmedLimitBreak.Description=Breaking your limits. Increased damage against tough opponents. Intended for PVP, up to server settings for whether or not it will boost damage in PVE. +Unarmed.SubSkill.UnarmedLimitBreak.Stat=Limit Break Max DMG Unarmed.SubSkill.IronArmStyle.Name=Iron Arm Style Unarmed.SubSkill.IronArmStyle.Description=Hardens your arm over time Unarmed.SubSkill.ArrowDeflect.Name=Arrow Deflect @@ -556,7 +567,8 @@ Combat.TargetDazed=Target was [[DARK_RED]]Dazed Combat.TouchedFuzzy=[[DARK_RED]]Touched Fuzzy. Felt Dizzy. #COMMANDS ##generic -mcMMO.Description=[[DARK_AQUA]]About the [[YELLOW]]mcMMO[[DARK_AQUA]] Project:,[[GOLD]]mcMMO is an [[RED]]open source[[GOLD]] RPG mod created in February 2011,[[GOLD]]by [[BLUE]]nossr50[[GOLD]]. The goal is to provide a quality RPG experience.,[[DARK_AQUA]]Tips:,[[GOLD]] - [[GREEN]]Use [[RED]]/mcmmo help[[GREEN]] to see commands,[[GOLD]] - [[GREEN]]Type [[RED]]/SKILLNAME[[GREEN]] to see detailed skill info,[[DARK_AQUA]]Developers:,[[GOLD]] - [[GREEN]]nossr50 [[BLUE]](Founder & Project Lead),[[GOLD]] - [[GREEN]]GJ [[BLUE]](Former Project Lead),[[GOLD]] - [[GREEN]]NuclearW [[BLUE]](Developer),[[GOLD]] - [[GREEN]]bm01 [[BLUE]](Developer),[[GOLD]] - [[GREEN]]TfT_02 [[BLUE]](Developer),[[GOLD]] - [[GREEN]]Glitchfinder [[BLUE]](Developer),[[GOLD]] - [[GREEN]]t00thpick1 [[BLUE]](Developer),[[DARK_AQUA]]Useful Links:,[[GOLD]] - [[GREEN]]https://github.com/mcMMO-Dev/mcMMO/issues[[GOLD]] Bug Reporting,[[GOLD]] - [[GREEN]]https://discord.gg/EJGVanb [[GOLD]] Official Discord +mcMMO.Description=[[DARK_AQUA]]About the [[YELLOW]]mcMMO[[DARK_AQUA]] Project:,[[GOLD]]mcMMO is an [[RED]]open source[[GOLD]] RPG mod created in February 2011,[[GOLD]]by [[BLUE]]nossr50[[GOLD]]. The goal is to provide a quality RPG experience.,[[DARK_AQUA]]Tips:,[[GOLD]] - [[GREEN]]Use [[RED]]/mcmmo help[[GREEN]] to see commands,[[GOLD]] - [[GREEN]]Type [[RED]]/SKILLNAME[[GREEN]] to see detailed skill info,[[DARK_AQUA]]Developers:,[[GOLD]] - [[GREEN]]nossr50 [[BLUE]](Creator & Project Lead),[[GOLD]] - [[GREEN]]electronicboy [[BLUE]](Dev),[[GOLD]] - [[GREEN]]kashike [[BLUE]](Dev),[[GOLD]] - [[GREEN]]t00thpick1 [[BLUE]](Classic Maintainer) +mcMMO.Description.FormerDevs=[[DARK_AQUA]]Former Devs: [[GREEN]]GJ, NuclearW, bm01, TfT_02, Glitchfinder Commands.addlevels.AwardAll.1=[[GREEN]]You were awarded {0} levels in all skills! Commands.addlevels.AwardAll.2=All skills have been modified for {0}. Commands.addlevels.AwardSkill.1=[[GREEN]]You were awarded {0} levels in {1}! @@ -721,6 +733,7 @@ Commands.MmoInfo.DetailsHeader=[[DARK_AQUA]]-=[]=====[][[GREEN]] Details [[DARK_ Commands.MmoInfo.OldSkill=[[GRAY]]mcMMO skills are being converted into an improved modular skill system, unfortunately this skill has not been converted yet and lacks detailed stats. The new system will allow for faster release times for new mcMMO skills and greater flexibility with existing skills. Commands.MmoInfo.Mechanics=[[DARK_AQUA]]-=[]=====[][[GOLD]] Mechanics [[DARK_AQUA]][]=====[]=- Commands.MmoInfo.Stats=STATS: {0} +Commands.Mmodebug.Toggle=mcMMO Debug Mode is now [[GOLD]]{0}[[GRAY]], use this command again to toggle. With debug mode true, you can punch blocks to print useful information used for support. mcMMO.NoInvites=[[RED]]You have no invites at this time mcMMO.NoPermission=[[DARK_RED]]Insufficient permissions. mcMMO.NoSkillNote=[[DARK_GRAY]]If you don't have access to a skill it will not be shown here. @@ -925,7 +938,7 @@ Guides.Swords.Section.2=[[DARK_AQUA]]How does Counter Attack work?\n[[YELLOW]]Co Guides.Swords.Section.3=[[DARK_AQUA]]How does Rupture work?\n[[YELLOW]]Rupture causes enemies to take damage every two seconds. The \n[[YELLOW]]target will bleed until the effect wears off, or death, \n[[YELLOW]]whichever comes first.\n[[YELLOW]]The duration of the bleed is increased by your sword skill. ##Taming Guides.Taming.Section.0=[[DARK_AQUA]]About Taming:\n[[YELLOW]]Taming will give players various combat bonuses when using\n[[YELLOW]]tamed wolves.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill, you need to tame wolves/ocelots or\n[[YELLOW]]get into combat with your wolves. -Guides.Taming.Section.1=[[DARK_AQUA]]How does Call of the Wild work?\n[[YELLOW]]Call of the Wild is an active ability that will allow you to summon\n[[YELLOW]]a wolf or an ocelot by your side. You can do this by\n[[YELLOW]]left-clicking while holding bones or fish. +Guides.Taming.Section.1=[[DARK_AQUA]]How does Call of the Wild work?\n[[YELLOW]]Call of the Wild is an active ability that will allow you to summon\n[[YELLOW]]a wolf or an ocelot by your side. You can do this by\n[[YELLOW]]sneaking + left-clicking while holding bones or fish. Guides.Taming.Section.2=[[DARK_AQUA]]How does Beast Lore work?\n[[YELLOW]]Beast Lore allows players to inspect pets and to check the\n[[YELLOW]]stats of wolves and ocelots. Left-click a wolf or ocelot to use\n[[YELLOW]]Beast Lore. Guides.Taming.Section.3=[[DARK_AQUA]]How does Gore work?\n[[YELLOW]]Gore is a passive ability that has a chance of inflicting a\n[[YELLOW]]bleeding effect on your wolves' targets. Guides.Taming.Section.4=[[DARK_AQUA]]How does Sharpened Claws work?\n[[YELLOW]]Sharpened Claws provides a damage bonus to damage dealt\n[[YELLOW]]by wolves. The damage bonus depends on your Taming level. @@ -1056,6 +1069,7 @@ Commands.Description.mcstats=Show your mcMMO levels and XP Commands.Description.mcmmoreload=Reload all mcMMO config files Commands.Description.mctop=Show mcMMO leader boards Commands.Description.mmoedit=Edit mcMMO levels for a user +Commands.Description.mmodebug=Toggle a debug mode which prints useful information when you hit blocks Commands.Description.mmoupdate=Migrate mcMMO database from an old database into the current one Commands.Description.mcconvert=Converts database types or experience formula types Commands.Description.mmoshowdb=Show the name of the current database type (for later use with /mmoupdate) diff --git a/src/main/resources/locale/locale_hu_HU.properties b/src/main/resources/locale/locale_hu_HU.properties index b5ac2601f..18d584824 100644 --- a/src/main/resources/locale/locale_hu_HU.properties +++ b/src/main/resources/locale/locale_hu_HU.properties @@ -32,7 +32,7 @@ JSON.Unarmed=Pusztakezek JSON.Woodcutting=Fav\u00E1g\u00E1s JSON.URL.Website=A hivatalos mcMMO weboldal! JSON.URL.Discord=A hivatalos mcMMO Discord szerver! -JSON.URL.Patreon=T\u00E1mogat\u00E1s nossr50-nak a munk\u00E1j\u00E1r\u00E1\u00E9rt \u00E9s az mcMMO-nak a Patreonon! +JSON.URL.Patreon=T\u00E1mogat\u00E1s nossr50-nak a munk\u00E1j\u00E1\u00E9rt \u00E9s az mcMMO-nak a Patreon-on! JSON.URL.Spigot=A hivatalos mcMMO Spigot Forr\u00E1s Oldal! JSON.URL.Translation=Ford\u00EDtsd le az mcMMO-t m\u00E1s nyelvekre! JSON.URL.Wiki=A hivatalos mcMMO wiki! @@ -216,8 +216,10 @@ Excavation.Ability.Ready=[[GOLD]]El\u0151k\u00E9sz\u00EDted[[DARK_AQUA]] az \u00 Excavation.SubSkill.GigaDrillBreaker.Name=Giga F\u00FAr\u00F3-T\u00F6r\u0151 Excavation.SubSkill.GigaDrillBreaker.Description=3x T\u00E1rgy Es\u00E9si Es\u00E9ly, 3x XP, +Sebess\u00E9g Excavation.SubSkill.GigaDrillBreaker.Stat=Giga F\u00FAr\u00F3-T\u00F6r\u0151 Id\u0151tartam -Excavation.SubSkill.TreasureHunter.Name=R\u00E9g\u00E9szet -Excavation.SubSkill.TreasureHunter.Description=Fedezd fel a f\u00F6ld titkait! +Excavation.SubSkill.Archaeology.Name=R\u00E9g\u00E9szet +Excavation.SubSkill.Archaeology.Description=Fedezd fel a f\u00F6ld titkait! A magas k\u00E9pess\u00E9g szint n\u00F6veli az es\u00E9ly\u00E9t, hogy tapasztalatpontot tal\u00E1lj, amikor kincset tal\u00E1lsz! +Excavation.SubSkill.Archaeology.Stat=R\u00E9g\u00E9szet Tapasztalatpont Es\u00E9ly +Excavation.SubSkill.Archaeology.Stat.Extra=R\u00E9g\u00E9szet Tapasztalatpont Mennyis\u00E9g Excavation.Listener=\u00C1s\u00E1s: Excavation.SkillName=\u00C1S\u00C1S Excavation.Skills.GigaDrillBreaker.Off=*Giga F\u00FAr\u00F3-T\u00F6r\u0151 v\u00E9get \u00E9rt** @@ -249,7 +251,7 @@ Fishing.SubSkill.FishermansDiet.Description=N\u00F6veli a kihal\u00E1szott \u00E Fishing.SubSkill.FishermansDiet.Stat=Horg\u00E1szok Di\u00E9t\u00E1ja:[[GREEN]] Szint {0} Fishing.SubSkill.MasterAngler.Name=Mester Horg\u00E1sz Fishing.SubSkill.MasterAngler.Description=N\u00F6veli a Kap\u00E1s es\u00E9ly\u00E9t horg\u00E1szat k\u00F6zben -Fishing.SubSkill.MasterAngler.Stat=Hozz\u00E1adott Nagyobb Harap\u00E1si es\u00E9ly a jelenlegi helyen: [[GREEN]]+[[YELLOW]]{0} +Fishing.SubSkill.MasterAngler.Stat=Hozz\u00E1adott Nagyobb Harap\u00E1si es\u00E9ly a jelenlegi helyen: [[GREEN]]+{0} Fishing.SubSkill.IceFishing.Name=J\u00E9g Horg\u00E1szat Fishing.SubSkill.IceFishing.Description=Lehet\u0151v\u00E9 teszi sz\u00E1modra, hogy fagyos t\u00E1jakon is horg\u00E1szhass Fishing.SubSkill.IceFishing.Stat=J\u00E9g Horg\u00E1szat @@ -393,8 +395,8 @@ Salvage.Skills.ArcaneSuccess=[[GREEN]]Sikeresen kinyert\u00E9l minden tud\u00E1s Salvage.Listener.Anvil=[[DARK_RED]]Lehelyezt\u00E9l egy \u00C9rt\u00E9kment\u0151 \u00DCll\u0151t. Haszn\u00E1ld ezt eszk\u00F6z\u00F6k, \u00E9s p\u00E1nc\u00E9lzatok \u00FAjrahasznos\u00EDt\u00E1shoz. Salvage.Listener=\u00DAjrahasznos\u00EDt\u00E1s: Salvage.SkillName=\u00DAJRAHASZNOS\u00CDT\u00C1S -Salvage.Skills.Lottery.Normal=[[GOLD]]\u00DAjrahasznos\u00EDthatsz [[GREEN]]{0}[[GOLD]] anyagot ebb\u0151l [[DARK_AQUA]]{1}[[GOLD]]. -Salvage.Skills.Lottery.Perfect=[[GREEN]][[BOLD]]T\u00F6k\u00E9letes![[RESET]][[GOLD]] K\u00F6nnyed\u00E9n \u00FAjrahasznos\u00EDtott\u00E1l egy [[GREEN]]{1}[[GOLD]]-t visszanyerve [[DARK_AQUA]]{0}[[GOLD]] anyagot. +Salvage.Skills.Lottery.Normal=[[GOLD]]\u00DAjrahasznos\u00EDthatsz [[DARK_AQUA]]{0}[[GOLD]] anyagot ebb\u0151l [[YELLOW]]{1}[[GOLD]]. +Salvage.Skills.Lottery.Perfect=[[GREEN]][[BOLD]]T\u00F6k\u00E9letes![[RESET]][[GOLD]] K\u00F6nnyed\u00E9n \u00FAjrahasznos\u00EDtott\u00E1l egy [[DARK_AQUA]]{1}[[GOLD]]-t visszanyerve [[DARK_AQUA]]{0}[[GOLD]] anyagot. Salvage.Skills.Lottery.Untrained=[[GRAY]]M\u00E9g nem vagy el\u00E9g k\u00E9pezett az \u00FAjrahasznos\u00EDt\u00E1sban. Csak [[RED]]{0}[[GRAY]] anyagot tudt\u00E1l helyre\u00E1ll\u00EDtani ebb\u0151l [[GREEN]]{1}[[GRAY]]. #Anvil (Shared between SALVAGE and REPAIR) Anvil.Unbreakable=Ez a t\u00E1rgy t\u00F6rhetetlen! @@ -478,13 +480,13 @@ Taming.SubSkill.Pummel.TargetMessage=H\u00E1tra lett\u00E9l l\u00F6kve egy farka Taming.Listener.Wolf=[[DARK_GRAY]]A Farkasod hozz\u00E1d oson... Taming.Listener=Szel\u00EDd\u00EDt\u00E9s: Taming.SkillName=SZELID\u00CDT\u00C9S -Taming.Summon.Complete=[[GREEN]]Sikeres Megid\u00E9z\u00E9s -Taming.Summon.Lifespan= (\u00C9lettartam: {0}mp) -Taming.Summon.Fail.Ocelot=[[RED]]T\u00FAl sok ocelot van a k\u00F6zeledben, hogy t\u00F6bbet id\u00E9zhess. -Taming.Summon.Fail.Wolf=[[RED]]T\u00FAl sok farkas van a k\u00F6zeledben, hogy t\u00F6bbet id\u00E9zhess. -Taming.Summon.Fail.Horse=[[RED]]T\u00FAl sok l\u00F3 van a k\u00F6zeledben, hogy t\u00F6bbet id\u00E9zhess. -Taming.Summon.Fail.TooMany=[[RED]]El\u00E9rted a maxim\u00E1lis \u00E1llat-id\u00E9z\u00E9si limited. [[YELLOW]]({0}) -Taming.Summon.Name.Format={0} \u00E1llata: {1} +Taming.Summon.COTW.Success.WithoutLifespan=[[GREEN]](A Vadon Szava) [[GRAY]]Megid\u00E9zt\u00E9l egy [[GOLD]]{0}[[GRAY]] +Taming.Summon.COTW.Success.WithLifespan=[[GREEN]](A Vadon Szava) [[GRAY]]Megid\u00E9zt\u00E9l egy [[GOLD]]{0}[[GRAY]] \u00E9s az id\u0151tartama [[GOLD]]{1}[[GRAY]] m\u00E1sodperc. +Taming.Summon.COTW.Limit=[[GREEN]](A Vadon Szava) [[GRAY]]Egyszerre csak [[RED]]{0} [[GRAY]]megid\u00E9zett [[GRAY]]{1} h\u00E1zi\u00E1llat lehet egyid\u0151ben. +Taming.Summon.COTW.TimeExpired=[[GREEN]](A Vadon Szava) [[GRAY]]Az id\u0151 v\u00E9get \u00E9r, [[GOLD]]{0}[[GRAY]] elt\u00E1vozik. +Taming.Summon.COTW.BreedingDisallowed=[[GREEN]](A Vadon Szava) [[RED]]Nem szapor\u00EDthatsz megid\u00E9zett \u00E1llatot. +Taming.Summon.COTW.NeedMoreItems=[[GREEN]](A Vadon Szava) [[GRAY]]Sz\u00FCks\u00E9g van [[YELLOW]]{0}[[GRAY]] t\u00F6bb [[DARK_AQUA]]{1}[[GRAY]](m) +Taming.Summon.Name.Format=[[GOLD]](COTW) [[WHITE]]{0} \u00E1llata {1} #UNARMED Unarmed.Ability.Bonus.0=Vas-\u00D6k\u00F6l St\u00EDlus Unarmed.Ability.Bonus.1=+{0} Sebz\u00E9s Fejleszt\u00E9s @@ -635,7 +637,7 @@ Commands.Party.MembersNear=[[DARK_GRAY]]A K\u00D6ZELEDBEN [[DARK_AQUA]]{0}[[DARK Commands.Party.Accept=[[GREEN]]- Party felk\u00E9r\u00E9s elfogad\u00E1sa Commands.Party.Chat.Off=Csak party Chat [[RED]]kikapcsolva Commands.Party.Chat.On=Csak party Chat [[GREEN]]bekapcsolva -Commands.Party.Commands=---[][[GREEN]]PARTY PARANCSOK[[RED]][]--- +Commands.Party.Commands=[[RED]]---[][[GREEN]]PARTY PARANCSOK[[RED]][]--- Commands.Party.Invite.0=[[RED]]FIGYELEM: [[GREEN]]Party felk\u00E9r\u00E9st kapt\u00E1l a(z) {0}-ba/be {1}-t\u00F3l/t\u0151l. Commands.Party.Invite.1=[[YELLOW]]\u00CDrd be, hogy [[GREEN]]/party accept[[YELLOW]] a megh\u00EDv\u00E1s elfogad\u00E1s\u00E1hoz. Commands.Party.Invite=[[GREEN]]- Party megh\u00EDv\u00E1s k\u00FCld\u00E9se. @@ -927,7 +929,7 @@ Guides.Swords.Section.2=[[DARK_AQUA]]Hogyan m\u0171k\u00F6dik az Ellent\u00E1mad Guides.Swords.Section.3=[[DARK_AQUA]]Hogyan m\u0171k\u00F6dik a T\u00F6r\u00E9s?\n[[YELLOW]]A T\u00F6r\u00E9s k\u00E9t m\u00E1sodpercenk\u00E9nt sebzi az ellens\u00E9geidet. A c\u00E9lpont \n[[YELLOW]]mindaddig v\u00E9rezni fog, m\u00EDg a V\u00E9rz\u00E9s id\u0151tartam le nem j\u00E1r, vagy az \u00E1ldozat meg nem hal. \n[[YELLOW]]A V\u00E9rz\u00E9s id\u0151tartam a Kardok szintedt\u0151l f\u00FCgg. ##Taming Guides.Taming.Section.0=[[DARK_AQUA]]A szelid\u00EDt\u00E9sr\u0151l:\n[[YELLOW]]A Szel\u00EDd\u00EDt\u00E9s k\u00FCl\u00F6nb\u00F6z\u0151 harci b\u00F3nuszokkal l\u00E1tja el a j\u00E1t\u00E9kost, ha \n[[YELLOW]]szel\u00EDd\u00EDtett farkasokkal van.\n\n[[DARK_AQUA]]TAPASZTALAT SZERZ\u00C9S:\n[[YELLOW]]Szel\u00EDd\u00EDts farkasokat/ocelotokat, vagy harcolj \n[[YELLOW]]a farkasaid oldal\u00E1n. -Guides.Taming.Section.1=[[DARK_AQUA]]Hogyan m\u0171k\u00F6dik a Vadon H\u00EDv\u00E1sa?\n[[YELLOW]]A Vadon H\u00EDv\u00E1sa egy aktiv\u00E1lhat\u00F3 k\u00E9pess\u00E9g, amellyel magad mell\u00E9 id\u00E9zhetsz \n[[YELLOW]]egy farkast vagy egy ocelotot. Ezt \n[[YELLOW]]csonttal vagy hallal val\u00F3 balkattint\u00E1ssal teheted meg. +Guides.Taming.Section.1=[[DARK_AQUA]]Hogyan m\u0171k\u00F6dik a Vadon H\u00EDv\u00E1sa?\n[[YELLOW]]A Vadon H\u00EDv\u00E1sa egy aktiv\u00E1lhat\u00F3 k\u00E9pess\u00E9g, amellyel magad mell\u00E9 id\u00E9zhetsz \n[[YELLOW]]egy farkast vagy egy ocelotot. Ezt \n[[YELLOW]]csonttal vagy hallal val\u00F3 guggol\u00E1s k\u00F6zben balkattint\u00E1ssal teheted meg. Guides.Taming.Section.2=[[DARK_AQUA]]Hogyan m\u0171k\u00F6dik a Vad\u00E1llat-tan?\n[[YELLOW]]A Vad\u00E1llat-tan lehet\u0151v\u00E9 teszi a \n[[YELLOW]]farkasok \u00E9s ocelotok statisztik\u00E1inak megvizsg\u00E1l\u00E1s\u00E1t. Haszn\u00E1lat\u00E1hoz bal klikkelj egy farkasra\n[[YELLOW]]vagy ocelotra. Guides.Taming.Section.3=[[DARK_AQUA]]Hogyan m\u0171k\u00F6dik a Led\u00F6f\u00E9s?\n[[YELLOW]]A led\u00F6f\u00E9s egy passz\u00EDv k\u00E9pess\u00E9g, amely lehet\u0151v\u00E9 teszi, \n[[YELLOW]]hogy a farkasok c\u00E9lpontja V\u00E9rz\u00E9st kapjon. Guides.Taming.Section.4=[[DARK_AQUA]]Hogyan m\u0171k\u00F6dnek az \u00C9les Karmok?\n[[YELLOW]]Az \u00C9les Karmok b\u00F3nusz sebz\u00E9st ad a farkasok t\u00E1mad\u00E1sainak. \n[[YELLOW]]Ez a b\u00F3nusz a Szel\u00EDd\u00EDt\u00E9s szintedt\u0151l f\u00FCgg. @@ -1087,12 +1089,15 @@ Scoreboard.Misc.Ability=K\u00E9pess\u00E9g #DATABASE RECOVERY Profile.PendingLoad=[[RED]]Az mcMMO j\u00E1t\u00E9kos adatod m\u00E9g nincs bet\u00F6ltve. Profile.Loading.Success=[[GREEN]]mcMMO profil sikeresen bet\u00F6ltve. -Profile.Loading.FailurePlayer=[[RED]]Az mcMMO-nak probl\u00E9m\u00E1i vannak az adataid bet\u00F6lt\u00E9sekor, megpr\u00F3b\u00E1ltuk bet\u00F6lteni [[GREEN]]{0}[[RED]]x.[[LIGHT_GRAY]] Ezzel kapcsolatban \u00E9rdemes kapcsolatba l\u00E9pni a szerver adminisztr\u00E1torokkal. Az mcMMO megpr\u00F3b\u00E1lja bet\u00F6lteni az adatait mindaddig, am\u00EDg nem kapcsol\u00F3dsz le. Nem kapsz XP-t, \u00E9s nem tudod haszn\u00E1lni a k\u00E9pess\u00E9geket, am\u00EDg az adataid nem t\u00F6lt\u0151dnek be. +Profile.Loading.FailurePlayer=[[RED]]Az mcMMO-nak probl\u00E9m\u00E1i vannak az adataid bet\u00F6lt\u00E9sekor, megpr\u00F3b\u00E1ltuk bet\u00F6lteni [[GREEN]]{0}[[RED]]x.[[RED]] Ezzel kapcsolatban \u00E9rdemes kapcsolatba l\u00E9pni a szerver adminisztr\u00E1torokkal. Az mcMMO megpr\u00F3b\u00E1lja bet\u00F6lteni az adatait mindaddig, am\u00EDg nem kapcsol\u00F3dsz le. Nem kapsz XP-t, \u00E9s nem tudod haszn\u00E1lni a k\u00E9pess\u00E9geket, am\u00EDg az adataid nem t\u00F6lt\u0151dnek be. Profile.Loading.FailureNotice=[[DARK_RED]][A][[RED]] az mcMMO nem tudta bet\u00F6lteni ennek a j\u00E1t\u00E9kosnak az adatait [[YELLOW]]{0}[[RED]]. [[LIGHT_PURPLE]]K\u00E9rj\u00FCk, ellen\u0151rizd az adatb\u00E1zis be\u00E1ll\u00EDt\u00E1sait. Eddig tett k\u00EDs\u00E9rletek {1}. #Holiday Holiday.AprilFools.Levelup=[[GOLD]]{0} jelenlegi szint [[GREEN]]{1}[[GOLD]]! Holiday.Anniversary=[[BLUE]]Boldog {0}. \u00C9vfordul\u00F3t!\n[[BLUE]]nossr50, \u00E9s az \u00F6sszes fejleszt\u0151 tisztelet\u00E9re itt egy t\u0171zij\u00E1t\u00E9k show! #Reminder Messages Reminder.Squelched=[[GRAY]]Eml\u00E9keztet\u0151: jelenleg nem kapsz \u00E9rtes\u00EDt\u00E9seket az mcMMO-t\u00F3l. Ahhoz, hogy enged\u00E9lyezd az \u00E9rtes\u00EDt\u00E9seket, futtasd \u00FAjra a /mcnotify parancsot. Ez egy automatikus, \u00F3r\u00E1nk\u00E9nti eml\u00E9keztet\u0151. -#LocaleManager -Locale.Reloaded=[[GREEN]]Ford\u00EDt\u00E1s \u00FAjrat\u00F6ltve! \ No newline at end of file +#Locale +Locale.Reloaded=[[GREEN]]Ford\u00EDt\u00E1s \u00FAjrat\u00F6ltve! +#Player Leveling Stuff +LevelCap.PowerLevel=[[GOLD]]([[GREEN]]mcMMO[[GOLD]]) [[YELLOW]]El\u00E9rted ezt a teljes\u00EDtm\u00E9nyszintet [[RED]]{0}[[YELLOW]]. Ezen a ponton megsz\u0171nik a k\u00E9pess\u00E9gek szintje. +LevelCap.Skill=[[GOLD]]([[GREEN]]mcMMO[[GOLD]]) [[YELLOW]]El\u00E9rted ezt a szintet [[RED]]{0}[[YELLOW]] ebben [[GOLD]]{1}[[YELLOW]]. Ezen a ponton megsz\u0171nik a k\u00E9pess\u00E9g szintje. diff --git a/src/main/resources/locale/locale_ja_JP.properties b/src/main/resources/locale/locale_ja_JP.properties index b4ff3d35e..2bbc34d18 100644 --- a/src/main/resources/locale/locale_ja_JP.properties +++ b/src/main/resources/locale/locale_ja_JP.properties @@ -139,7 +139,7 @@ Alchemy.SubSkill.Concoctions.Description=\u3082\u3063\u3068\u6750\u6599\u3092\u5 Alchemy.SubSkill.Concoctions.Stat=\u8abf\u5408 \u30e9\u30f3\u30af: [[GREEN]]{0}[[DARK_AQUA]]/[[GREEN]]{1} Alchemy.SubSkill.Concoctions.Stat.Extra=\u6750\u6599 [[[GREEN]]{0}[[DARK_AQUA]]]: [[GREEN]]{1} Alchemy.Listener=\u932c\u91d1\u8853: -Alchemy.Ability.Locked.0=LOCKED UNTIL {0}+ SKILL (\u89e6\u5a92\u4f5c\u7528) +Alchemy.Ability.Locked.0=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ \u30b9\u30ad\u30eb (\u89e6\u5a92\u4f5c\u7528) Alchemy.SkillName=\u932c\u91d1\u8853 #ARCHERY @@ -203,6 +203,11 @@ Excavation.SubSkill.GigaDrillBreaker.Description=3x \u30c9\u30ed\u30c3\u30d7\u73 Excavation.SubSkill.GigaDrillBreaker.Stat=\u30ae\u30ac\u30c9\u30ea\u30eb\u30d6\u30ec\u30fc\u30ab\u30fc \u671f\u9593 Excavation.SubSkill.Archaeology.Name=\u8003\u53e4\u5b66 Excavation.SubSkill.Archaeology.Description=\u571f\u5730\u306b\u96a0\u308c\u305f\u7269\u3092\u6398\u308a\u51fa\u3059\uff01 +Excavation.SubSkill.Archaeology.Name=\u8003\u53e4\u5b66 +Excavation.SubSkill.Archaeology.Description=\u5b9d\u3092\u767a\u6398\u3057\u3088\u3046\uff01\u30b9\u30ad\u30eb\u30ec\u30d9\u30eb\u304c\u9ad8\u3044\u3068\u3001\u5b9d\u3092\u898b\u3064\u3051\u305f\u3068\u304d\u306b\u7d4c\u9a13\u5024\u30aa\u30fc\u30d6\u3092\u898b\u3064\u3051\u308b\u53ef\u80fd\u6027\u304c\u9ad8\u304f\u306a\u308a\u307e\u3059\u3002 +Excavation.SubSkill.Archaeology.Stat=\u8003\u53e4\u5b66 \u7d4c\u9a13\u5024\u30aa\u30fc\u30d6\u767a\u898b\u78ba\u7387 +Excavation.SubSkill.Archaeology.Stat.Extra=\u8003\u53e4\u5b66 \u7d4c\u9a13\u5024\u30aa\u30fc\u30d6\u91cf + Excavation.Listener=\u6398\u524a: Excavation.SkillName=\u6398\u524a Excavation.Skills.GigaDrillBreaker.Off=**\u30ae\u30ac\u30c9\u30ea\u30eb\u30d6\u30ec\u30fc\u30ab\u30fc \u3092\u6469\u640d\u3057\u305f** @@ -217,9 +222,9 @@ Fishing.Scared=[[GRAY]]&o\u6df7\u6c8c\u3068\u3057\u305f\u52d5\u304d\u306f\u9b5a\ Fishing.Exhausting=[[RED]]&o\u91e3\u308a\u7aff\u3092\u4e0d\u9069\u5207\u306b\u4f7f\u7528\u3059\u308b\u3068\u3001\u75b2\u52b4\u3092\u5f15\u304d\u8d77\u3053\u3057\u305f\u308a\u3001\u8010\u4e45\u5024\u3092\u6d88\u8cbb\u3057\u305f\u308a\u3057\u307e\u3059\u3002 Fishing.LowResourcesTip=[[GRAY]]\u3053\u306e\u5730\u57df\u306b\u3044\u308b\u9b5a\u304c\u305d\u308c\u307b\u3069\u591a\u304f\u306a\u3044\u3053\u3068\u3092\u611f\u3058\u307e\u3057\u305f\u3002\u5c11\u306a\u304f\u3068\u3082{0}\u30d6\u30ed\u30c3\u30af\u96e2\u308c\u305f\u3068\u3053\u308d\u3067\u91e3\u308a\u3092\u3057\u3066\u307f\u3066\u4e0b\u3055\u3044\u3002 Fishing.Ability.Info=\u30de\u30b8\u30c3\u30af\u30cf\u30f3\u30bf\u30fc: [[GRAY]] **\u30c8\u30ec\u30b8\u30e3\u30fc\u30cf\u30f3\u30bf\u30fc \u30e9\u30f3\u30af\u3067\u6539\u5584\u3059\u308b** -Fishing.Ability.Locked.0=LOCKED UNTIL {0}+ SKILL (\u30b7\u30a7\u30a4\u30af) -Fishing.Ability.Locked.1=LOCKED UNTIL {0}+ SKILL (\u7a74\u91e3\u308a) -Fishing.Ability.Locked.2=LOCKED UNTIL {0}+ SKILL (\u30de\u30b9\u30bf\u30fc\u30a2\u30f3\u30b0\u30e9\u30fc) +Fishing.Ability.Locked.0=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ \u30b9\u30ad\u30eb (\u30b7\u30a7\u30a4\u30af) +Fishing.Ability.Locked.1=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ \u30b9\u30ad\u30eb (\u7a74\u91e3\u308a) +Fishing.Ability.Locked.2=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ \u30b9\u30ad\u30eb (\u30de\u30b9\u30bf\u30fc\u30a2\u30f3\u30b0\u30e9\u30fc) Fishing.SubSkill.TreasureHunter.Name=\u30c8\u30ec\u30b8\u30e3\u30fc\u30cf\u30f3\u30bf\u30fc Fishing.SubSkill.TreasureHunter.Description=\u9b5a\u3084\u7269\u3092\u91e3\u308a\u4e0a\u3052\u308b\u3002 Fishing.SubSkill.TreasureHunter.Stat=\u30c8\u30ec\u30b8\u30e3\u30fc\u30cf\u30f3\u30bf\u30fc \u30e9\u30f3\u30af: [[GREEN]]{0}[[DARK_AQUA]]/[[GREEN]]{1} @@ -284,9 +289,9 @@ Herbalism.Skills.GTe.Other.Off=[[YELLOW]]{0}\u304c [[WHITE]]\u304c\u3059\u308a\u Herbalism.Skills.GTe.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\u304c [[RED]]\u30b0\u30ea\u30fc\u30f3\u30c6\u30e9 [[DARK_GREEN]]\u3092\u4f7f\u3063\u305f\uff01 #MINING -Mining.Ability.Locked.0=LOCKED UNTIL {0}+ SKILL (\u30d6\u30e9\u30b9\u30c8\u30de\u30a4\u30cb\u30f3\u30b0) -Mining.Ability.Locked.1=LOCKED UNTIL {0}+ SKILL (\u5927\u304d\u306a\u7206\u5f3e) -Mining.Ability.Locked.2=LOCKED UNTIL {0}+ SKILL (\u89e3\u4f53\u5c02\u9580\u77e5\u8b58) +Mining.Ability.Locked.0=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ \u30b9\u30ad\u30eb (\u30d6\u30e9\u30b9\u30c8\u30de\u30a4\u30cb\u30f3\u30b0) +Mining.Ability.Locked.1=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ \u30b9\u30ad\u30eb (\u5927\u304d\u306a\u7206\u5f3e) +Mining.Ability.Locked.2=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ \u30b9\u30ad\u30eb (\u89e3\u4f53\u5c02\u9580\u77e5\u8b58) Mining.Ability.Lower=[[GRAY]]\u30d4\u30c3\u30b1\u30eb\u3092\u4e0b\u3052\u305f\u3002 Mining.Ability.Ready=[[DARK_AQUA]]\u30d4\u30c3\u30b1\u30eb\u3092[[GOLD]]\u6e96\u5099[[DARK_AQUA]]\u3057\u305f\u3002 Mining.SubSkill.SuperBreaker.Name=\u30b9\u30fc\u30d1\u30fc\u30d6\u30ec\u30fc\u30ab\u30fc @@ -441,12 +446,12 @@ Taming.Ability.Bonus.8=\u30d5\u30a1\u30fc\u30b9\u30c8\u30d5\u30fc\u30c9\u30b5\u3 Taming.Ability.Bonus.9={0} \u306e\u78ba\u7387\u3067\u653b\u6483\u6642\u56de\u5fa9 Taming.Ability.Bonus.10=\u30db\u30fc\u30ea\u30fc\u30cf\u30a6\u30f3\u30c9 Taming.Ability.Bonus.11=\u9b54\u6cd5\u3084\u6bd2\u3067\u30c0\u30e1\u30fc\u30b8\u3092\u53d7\u3051\u305f\u6642\u72b6\u614b\u7570\u5e38\u3092\u53d6\u308a\u6d88\u3059\u3002 -Taming.Ability.Locked.0=LOCKED UNTIL {0}+ SKILL (\u74b0\u5883\u914d\u616e) -Taming.Ability.Locked.1=LOCKED UNTIL {0}+ SKILL (\u539a\u3044\u6bdb\u76ae) -Taming.Ability.Locked.2=LOCKED UNTIL {0}+ SKILL (\u885d\u6483\u8010\u6027) -Taming.Ability.Locked.3=LOCKED UNTIL {0}+ SKILL (\u92ed\u3044\u722a) -Taming.Ability.Locked.4=LOCKED UNTIL {0}+ SKILL (\u30d5\u30a1\u30fc\u30b9\u30c8\u30d5\u30fc\u30c9\u30b5\u30fc\u30d3\u30b9) -Taming.Ability.Locked.5=LOCKED UNTIL {0}+ SKILL (\u30db\u30fc\u30ea\u30fc\u30cf\u30a6\u30f3\u30c9) +Taming.Ability.Locked.0=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ \u30b9\u30ad\u30eb (\u74b0\u5883\u914d\u616e) +Taming.Ability.Locked.1=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ \u30b9\u30ad\u30eb (\u539a\u3044\u6bdb\u76ae) +Taming.Ability.Locked.2=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ \u30b9\u30ad\u30eb (\u885d\u6483\u8010\u6027) +Taming.Ability.Locked.3=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ \u30b9\u30ad\u30eb (\u92ed\u3044\u722a) +Taming.Ability.Locked.4=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ \u30b9\u30ad\u30eb (\u30d5\u30a1\u30fc\u30b9\u30c8\u30d5\u30fc\u30c9\u30b5\u30fc\u30d3\u30b9) +Taming.Ability.Locked.5=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ \u30b9\u30ad\u30eb (\u30db\u30fc\u30ea\u30fc\u30cf\u30a6\u30f3\u30c9) Taming.Combat.Chance.Gore=\u30b4\u30a2 \u78ba\u7387 Taming.SubSkill.BeastLore.Name=\u30d3\u30fc\u30b9\u30c8\u30ed\u30a2 Taming.SubSkill.BeastLore.Description=\u72fc\u3068\u732b\u3092\u9aa8\u3067\u691c\u67fb\u3059\u308b\u3002 @@ -473,13 +478,13 @@ Taming.SubSkill.Pummel.TargetMessage=\u72fc\u306b\u30ce\u30c3\u30af\u30d0\u30c3\ Taming.Listener.Wolf=[[DARK_GRAY]]\u72fc\u306f\u3042\u306a\u305f\u306e\u3082\u3068\u306b\u6025\u3044\u3067\u623b\u308a\u307e\u3059... Taming.Listener=\u8abf\u6559: Taming.SkillName=\u8abf\u6559 -Taming.Summon.Complete=[[GREEN]]\u53ec\u559a\u5b8c\u4e86 -Taming.Summon.Lifespan= (\u5bff\u547d: {0}\u79d2) -Taming.Summon.Fail.Ocelot=[[RED]]\u8fd1\u304f\u306b\u732b\u304c\u305f\u304f\u3055\u3093\u3044\u308b\u305f\u3081\u3053\u308c\u4ee5\u4e0a\u53ec\u559a\u3067\u304d\u307e\u305b\u3093\u3002 -Taming.Summon.Fail.Wolf=[[RED]]\u8fd1\u304f\u306b\u72fc\u304c\u305f\u304f\u3055\u3093\u3044\u308b\u305f\u3081\u3053\u308c\u4ee5\u4e0a\u53ec\u559a\u3067\u304d\u307e\u305b\u3093\u3002 -Taming.Summon.Fail.Horse=[[RED]]\u8fd1\u304f\u306b\u99ac\u304c\u305f\u304f\u3055\u3093\u3044\u308b\u305f\u3081\u3053\u308c\u4ee5\u4e0a\u53ec\u559a\u3067\u304d\u307e\u305b\u3093\u3002 -Taming.Summon.Fail.TooMany=[[RED]]\u53ec\u559a\u3067\u304d\u308b\u30da\u30c3\u30c8\u306e\u4e0a\u9650\u6570\u306b\u9054\u3057\u307e\u3057\u305f\u3002 [[YELLOW]]({0}) -Taming.Summon.Name.Format={0}\u306e{1} +Taming.Summon.COTW.Success.WithoutLifespan=[[GREEN]]\uff08\u91ce\u751f\u306e\u547c\u3073\u304b\u3051\uff09 [[GRAY]]\u3042\u306a\u305f\u306f[[GOLD]]{0}[[GRAY]]\u3092\u53ec\u559a\u3057\u307e\u3057\u305f[[GRAY]] +Taming.Summon.COTW.Success.WithLifespan=[[GREEN]]\uff08\u91ce\u751f\u306e\u547c\u3073\u304b\u3051\uff09 [[GOLD]]{0}[[GRAY]]\u3092\u53ec\u559a\u3057\u307e\u3057\u305f\u304c\u3001\u6301\u7d9a\u6642\u9593\u306f[[GOLD]]{1}[[GRAY]]\u79d2\u3067\u3059\u3002 +Taming.Summon.COTW.Limit=[[GREEN]]\uff08\u91ce\u751f\u306e\u547c\u3073\u304b\u3051\uff09 [[GOLD]]{0}[[GRAY]]\u306f\u540c\u6642\u306b[[GOLD]]{1}[[GRAY]]\u5339\u3057\u304b\u53ec\u559a\u3067\u304d\u307e\u305b\u3093\u3002 +Taming.Summon.COTW.TimeExpired=[[GREEN]]\uff08\u91ce\u751f\u306e\u547c\u3073\u304b\u3051\uff09 [[GRAY]]\u6642\u9593\u5207\u308c\u3067[[GOLD]]{0}[[GRAY]]\u304c\u7acb\u3061\u53bb\u308a\u307e\u3057\u305f\u3002 +Taming.Summon.COTW.BreedingDisallowed=[[GREEN]]\uff08\u91ce\u751f\u306e\u547c\u3073\u304b\u3051\uff09 [[RED]]\u53ec\u559a\u3055\u308c\u305f\u52d5\u7269\u3092\u7e41\u6b96\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002 +Taming.Summon.COTW.NeedMoreItems=[[GREEN]]\uff08\u91ce\u751f\u306e\u547c\u3073\u304b\u3051\uff09 [[YELLOW]]{0}[[GRAY]]\u304c[[DARK_AQUA]]{1}[[GRAY]]\u500b\u5fc5\u8981\u3067\u3059\u3002 +Taming.Summon.Name.Format=[[GOLD]](COTW) [[WHITE]]{0} {1} #UNARMED Unarmed.Ability.Bonus.0=\u9244\u8155\u30b9\u30bf\u30a4\u30eb @@ -518,7 +523,7 @@ Unarmed.Skills.Berserk.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\u304c [[RED]]\u30d0\u #WOODCUTTING Woodcutting.Ability.0=\u30ea\u30fc\u30d5\u30d6\u30ed\u30ef\u30fc Woodcutting.Ability.1=\u8449\u3092\u5439\u304d\u98db\u3070\u3059 -Woodcutting.Ability.Locked.0=LOCKED UNTIL {0}+ SKILL (\u30ea\u30fc\u30d5\u30d6\u30ed\u30ef\u30fc) +Woodcutting.Ability.Locked.0=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ \u30b9\u30ad\u30eb (\u30ea\u30fc\u30d5\u30d6\u30ed\u30ef\u30fc) Woodcutting.SubSkill.TreeFeller.Name=\u30c4\u30ea\u30fc\u30d5\u30a7\u30e9\u30fc Woodcutting.SubSkill.TreeFeller.Description=\u6728\u3092\u7206\u767a\u3055\u305b\u308b\u3002 Woodcutting.SubSkill.TreeFeller.Stat=\u30c4\u30ea\u30fc\u30d5\u30a7\u30e9\u30fc \u9577\u3055 @@ -609,11 +614,11 @@ Party.Feature.Teleport=\u30d1\u30fc\u30c6\u30a3\u30fc\u30c6\u30ec\u30dd\u30fc\u3 Party.Feature.Alliance=\u540c\u76df Party.Feature.ItemShare=\u30a2\u30a4\u30c6\u30e0\u5171\u6709 Party.Feature.XpShare=XP\u5171\u6709 -Party.Feature.Locked.Chat=LOCKED UNTIL {0}+ (\u30d1\u30fc\u30c6\u30a3\u30fc\u30c1\u30e3\u30c3\u30c8) -Party.Feature.Locked.Teleport=LOCKED UNTIL {0}+ (\u30d1\u30fc\u30c6\u30a3\u30fc\u30c6\u30ec\u30dd\u30fc\u30c8) -Party.Feature.Locked.Alliance=LOCKED UNTIL {0}+ (\u540c\u76df) -Party.Feature.Locked.ItemShare=LOCKED UNTIL {0}+ (\u30a2\u30a4\u30c6\u30e0\u5171\u6709) -Party.Feature.Locked.XpShare=LOCKED UNTIL {0}+ (XP\u5171\u6709) +Party.Feature.Locked.Chat=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ (\u30d1\u30fc\u30c6\u30a3\u30fc\u30c1\u30e3\u30c3\u30c8) +Party.Feature.Locked.Teleport=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ (\u30d1\u30fc\u30c6\u30a3\u30fc\u30c6\u30ec\u30dd\u30fc\u30c8) +Party.Feature.Locked.Alliance=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ (\u540c\u76df) +Party.Feature.Locked.ItemShare=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ (\u30a2\u30a4\u30c6\u30e0\u5171\u6709) +Party.Feature.Locked.XpShare=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ (XP\u5171\u6709) Party.Feature.Disabled.1=[[RED]]\u30d1\u30fc\u30c6\u30a3\u30fc\u30c1\u30e3\u30c3\u30c8\u306f\u307e\u3060\u958b\u653e\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002 Party.Feature.Disabled.2=[[RED]]\u30d1\u30fc\u30c6\u30a3\u30fc\u30c6\u30ec\u30dd\u30fc\u30c8\u306f\u307e\u3060\u958b\u653e\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002 Party.Feature.Disabled.3=[[RED]]P\u540c\u76df\u306f\u307e\u3060\u958b\u653e\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002 @@ -692,26 +697,26 @@ Guides.Alchemy.Section.4=[[DARK_AQUA]]Concoctions tier 2 ingredients:\n[[YELLOW] Guides.Alchemy.Section.5=[[DARK_AQUA]]Concoctions tier 4 ingredients:\n[[YELLOW]]Apple (Potion of Health Boost)\n[[YELLOW]]Rotten Flesh (Potion of Hunger)\n\n[[DARK_AQUA]]Concoctions tier 5 ingredients:\n[[YELLOW]]Brown Mushroom (Potion of Nausea)\n[[YELLOW]]Ink Sack (Potion of Blindness) Guides.Alchemy.Section.6=[[DARK_AQUA]]Concoctions tier 6 ingredients:\n[[YELLOW]]Fern (Potion of Saturation)\n\n[[DARK_AQUA]]Concoctions tier 7 ingredients:\n[[YELLOW]]Poisonous Potato (Potion of Decay)\n\n[[DARK_AQUA]]Concoctions tier 8 ingredients:\n[[YELLOW]]Regular Golden Apple (Potion of Resistance) ##Archery -Guides.Archery.Section.0=[[DARK_AQUA]]About Archery:\n[[YELLOW]]Archery is about shooting with your bow and arrow.\n[[YELLOW]]It provides various combat bonuses, such as a damage boost\n[[YELLOW]]that scales with your level and the ability to daze your\n[[YELLOW]]opponents in PvP. In addition to this, you can retrieve\n[[YELLOW]]some of your spent arrows from the corpses of your foes.\n\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you need to shoot mobs or\n[[YELLOW]]other players. +Guides.Archery.Section.0=[[DARK_AQUA]]\u5f13\u306b\u3064\u3044\u3066\uff1a\n[[YELLOW]]Archery is about shooting with your bow and arrow.\n[[YELLOW]]It provides various combat bonuses, such as a damage boost\n[[YELLOW]]that scales with your level and the ability to daze your\n[[YELLOW]]opponents in PvP. In addition to this, you can retrieve\n[[YELLOW]]some of your spent arrows from the corpses of your foes.\n\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you need to shoot mobs or\n[[YELLOW]]other players. Guides.Archery.Section.1=[[DARK_AQUA]]How does Skill Shot work?\n[[YELLOW]]Skill Shot provides additional damage to your shots.\n[[YELLOW]]The bonus damage from Skill Shot increases as you\n[[YELLOW]]level in Archery.\n[[YELLOW]]With the default settings, your archery damage increases 10%\n[[YELLOW]]every 50 levels, to a maximum of 200% bonus damage. Guides.Archery.Section.2=[[DARK_AQUA]]How does Daze work?\n[[YELLOW]]You have a passive chance to daze other players when\n[[YELLOW]]you shoot them. When Daze triggers it forces your opponents\n[[YELLOW]]to look straight up for a short duration.\n[[YELLOW]]A Daze shot also deals an additional 4 damage (2 hearts). Guides.Archery.Section.3=[[DARK_AQUA]]How does Arrow Retrieval work?\n[[YELLOW]]You have a passive chance to retrieve some of your arrows\n[[YELLOW]]when you kill a mob with your bow.\n[[YELLOW]]This chance increases as you level in Archery.\n[[YELLOW]]By default, this ability increases by 0.1% per level, up to 100%\n[[YELLOW]]at level 1000. ##Axes -Guides.Axes.Section.0=[[DARK_AQUA]]About Axes:\n[[YELLOW]]With the Axes skill you can use your axe for much more then\n[[YELLOW]]just deforesting! You can hack and chop away at mobs\n[[YELLOW]]and players to gain XP, hitting mobs with the effect of\n[[YELLOW]]knockback and inflicting DEADLY criticals on mobs and players.\n[[YELLOW]]Your axe also becomes a hand-held woodchipper,\n[[YELLOW]]breaking down the enemy's armor with ease as your level\n[[YELLOW]]increases.\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you need hit other mobs or players\n[[YELLOW]]with an Axe. +Guides.Axes.Section.0=[[DARK_AQUA]]\u65a7\u306b\u3064\u3044\u3066\uff1a\n[[YELLOW]]With the Axes skill you can use your axe for much more then\n[[YELLOW]]just deforesting! You can hack and chop away at mobs\n[[YELLOW]]and players to gain XP, hitting mobs with the effect of\n[[YELLOW]]knockback and inflicting DEADLY criticals on mobs and players.\n[[YELLOW]]Your axe also becomes a hand-held woodchipper,\n[[YELLOW]]breaking down the enemy's armor with ease as your level\n[[YELLOW]]increases.\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you need hit other mobs or players\n[[YELLOW]]with an Axe. Guides.Axes.Section.1=[[DARK_AQUA]]How does Skull Splitter work?\n[[YELLOW]]This ability allows you to deal an AoE (Area of Effect) hit.\n[[YELLOW]]This AoE hit will deal half as much damage as you did to the\n[[YELLOW]]main target, so it's great for clearing out large piles of mobs. Guides.Axes.Section.2=[[DARK_AQUA]]How does Critical Strikes work?\n[[YELLOW]]Critical Strikes is a passive ability which gives players a\n[[YELLOW]]chance to deal additional damage.\n[[YELLOW]]With the default settings, every 2 skill levels in Axes awards a\n[[YELLOW]]0.1% chance to deal a Critical Strike, causing 2.0 times damage\n[[YELLOW]]to mobs or 1.5 times damage against other players. Guides.Axes.Section.3=[[DARK_AQUA]]How does Axe Mastery work?\n[[YELLOW]]Axe Mastery is a passive ability that will add additional damage\n[[YELLOW]]to your hits when using Axes.\n[[YELLOW]]By default, the bonus damage increases by 1 every 50 levels,\n[[YELLOW]]up to a cap of 4 extra damage at level 200. Guides.Axes.Section.4=[[DARK_AQUA]]How does Armor Impact work?\n[[YELLOW]]Strike with enough force to shatter armor!\n[[YELLOW]]Armor Impact has a passive chance to damage your\n[[YELLOW]]opponent's armor. This damage increases as you level in Axes. Guides.Axes.Section.5=[[DARK_AQUA]]How does Greater Impact work?\n[[YELLOW]]You have a passive chance to achieve a greater impact when\n[[YELLOW]]hitting mobs or players with your axe.\n[[YELLOW]]By default this chance is 25%. This passive ability has an\n[[YELLOW]]extreme knockback effect, similar to the Knockback II\n[[YELLOW]]enchantment. In addition, it deals bonus damage to the target. ##Excavation -Guides.Excavation.Section.0=[[DARK_AQUA]]About Excavation:\n[[YELLOW]]Excavation is the act of digging up dirt to find treasures.\n[[YELLOW]]By excavating the land you will find treasures.\n[[YELLOW]]The more you do this the more treasures you can find.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you must dig with a shovel in hand.\n[[YELLOW]]Only certain materials can be dug up for treasures and XP. +Guides.Excavation.Section.0=[[DARK_AQUA]]\u6398\u524a\u306b\u3064\u3044\u3066\uff1a\n[[YELLOW]]Excavation is the act of digging up dirt to find treasures.\n[[YELLOW]]By excavating the land you will find treasures.\n[[YELLOW]]The more you do this the more treasures you can find.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you must dig with a shovel in hand.\n[[YELLOW]]Only certain materials can be dug up for treasures and XP. Guides.Excavation.Section.1=[[DARK_AQUA]]Compatible Materials:\n[[YELLOW]]Grass, Dirt, Sand, Clay, Gravel, Mycelium, Soul Sand, Snow Guides.Excavation.Section.2=[[DARK_AQUA]]How to use Giga Drill Breaker:\n[[YELLOW]]With a shovel in hand right click to ready your tool.\n[[YELLOW]]Once in this state you have about 4 seconds to make\n[[YELLOW]]contact with Excavation compatible materials this will\n[[YELLOW]]activate Giga Drill Breaker. Guides.Excavation.Section.3=[[DARK_AQUA]]What is Giga Drill Breaker?\n[[YELLOW]]Giga Drill Breaker is an ability with a cooldown\n[[YELLOW]]tied to Excavation skill. It triples your chance\n[[YELLOW]]of finding treasures and enables instant break\n[[YELLOW]]on Excavation materials. Guides.Excavation.Section.4=[[DARK_AQUA]]How does Archaeology work?\n[[YELLOW]]Every possible treasure for Excavation has its own\n[[YELLOW]]skill level requirement for it to drop, as a result it's\n[[YELLOW]]difficult to say how much it is helping you.\n[[YELLOW]]Just keep in mind that the higher your Excavation skill\n[[YELLOW]]is, the more treasures that can be found.\n[[YELLOW]]And also keep in mind that each type of Excavation\n[[YELLOW]]compatible material has its own unique list of treasures.\n[[YELLOW]]In other words you will find different treasures in Dirt\n[[YELLOW]]than you would in Gravel. Guides.Excavation.Section.5=[[DARK_AQUA]]Notes about Excavation:\n[[YELLOW]]Excavation drops are completely customizeable\n[[YELLOW]]So results vary server to server. ##Fishing -Guides.Fishing.Section.0=[[DARK_AQUA]]About Fishing:\n[[YELLOW]]With the Fishing skill, Fishing is exciting again!\n[[YELLOW]]Find hidden treasures, and shake items off mobs.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]Catch fish. +Guides.Fishing.Section.0=[[DARK_AQUA]]\u91e3\u308a\u306b\u3064\u3044\u3066\uff1a\n[[YELLOW]]With the Fishing skill, Fishing is exciting again!\n[[YELLOW]]Find hidden treasures, and shake items off mobs.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]Catch fish. Guides.Fishing.Section.1=[[DARK_AQUA]]How does Treasure Hunter work?\n[[YELLOW]]This ability allows you to find treasure from fishing \n[[YELLOW]]with a small chance of the items being enchanted.\n[[YELLOW]]Every possible treasure for Fishing has a chance\n[[YELLOW]]to drop on any level. It depends however\n[[YELLOW]]what the rarity of the item is how often it will drop.\n[[YELLOW]]The higher your Fishing skill is, the better\n[[YELLOW]]your chances are to find better treasures. Guides.Fishing.Section.2=[[DARK_AQUA]]How does Ice Fishing work?\n[[YELLOW]]This passive skill allows you to fish in ice lakes!\n[[YELLOW]]Cast your fishing rod in an ice lake and the ability will\n[[YELLOW]]create a small hole in the ice to fish in. Guides.Fishing.Section.3=[[DARK_AQUA]]How does Master Angler work?\n[[YELLOW]]This passive skill increases the bite chance while fishing.\n[[YELLOW]]When you've unlocked this ability, fishing while in\n[[YELLOW]]a boat or when an ocean biome doubles the bite chance. @@ -719,7 +724,7 @@ Guides.Fishing.Section.4=[[DARK_AQUA]]How does Shake work?\n[[YELLOW]]This activ Guides.Fishing.Section.5=[[DARK_AQUA]]How does Fisherman's Diet work?\n[[YELLOW]]This passive skill increases the amount of hunger restored \n[[YELLOW]]from eating fish. Guides.Fishing.Section.6=[[DARK_AQUA]]Notes about Fishing:\n[[YELLOW]]Fishing drops are completely customizable,\n[[YELLOW]]so results vary server to server. ##Herbalism -Guides.Herbalism.Section.0=[[DARK_AQUA]]About Herbalism:\n[[YELLOW]]Herbalism is about collecting herbs and plants.\n\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]Collect plants and herbs. +Guides.Herbalism.Section.0=[[DARK_AQUA]]\u8fb2\u696d\u306b\u3064\u3044\u3066\uff1a\n[[YELLOW]]Herbalism is about collecting herbs and plants.\n\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]Collect plants and herbs. Guides.Herbalism.Section.1=[[DARK_AQUA]]Compatible Blocks\n[[YELLOW]]Wheat, Potatoes, Carrots, Melons, \n[[YELLOW]]Pumpkins, Sugar Canes, Cocoa Beans, Flowers, Cacti, Mushrooms,\n[[YELLOW]]Nether Wart, Lily Pads, and Vines. Guides.Herbalism.Section.2=[[DARK_AQUA]]How does Green Terra work?\n[[YELLOW]]Green Terra is an active ability, you can right-click\n[[YELLOW]]while holding a hoe to activate Green Terra.\n[[YELLOW]]Green Terra grants players a chance to get 3x drops from\n[[YELLOW]]harvesting plants. It also gives players the ability to\n[[YELLOW]]spread life into blocks and transform them using seeds\n[[YELLOW]]from your inventory. Guides.Herbalism.Section.3=[[DARK_AQUA]]How does Green Thumb (Crops) work?\n[[YELLOW]]This passive ability will automatically replant crops when\n[[YELLOW]]harvesting.\n[[YELLOW]]Your chance of success depends on your Herbalism skill. @@ -728,20 +733,20 @@ Guides.Herbalism.Section.5=[[DARK_AQUA]]How does Farmer's Diet work?\n[[YELLOW]] Guides.Herbalism.Section.6=[[DARK_AQUA]]How does Hylian Luck work?\n[[YELLOW]]This passive ability gives you a chance to find rare items\n[[YELLOW]]when certain blocks are broken with a sword. Guides.Herbalism.Section.7=[[DARK_AQUA]]How do Double Drops work?\n[[YELLOW]]This passive ability gives players more yield from their\n[[YELLOW]]harvests. ##Mining -Guides.Mining.Section.0=[[DARK_AQUA]]About Mining:\n[[YELLOW]]Mining consists of mining stone and ores. It provides bonuses\n[[YELLOW]]to the amount of materials dropped while mining.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill, you must mine with a pickaxe in hand.\n[[YELLOW]]Only certain blocks award XP. +Guides.Mining.Section.0=[[DARK_AQUA]]\u63a1\u6398\u306b\u3064\u3044\u3066\uff1a\n[[YELLOW]]Mining consists of mining stone and ores. It provides bonuses\n[[YELLOW]]to the amount of materials dropped while mining.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill, you must mine with a pickaxe in hand.\n[[YELLOW]]Only certain blocks award XP. Guides.Mining.Section.1=[[DARK_AQUA]]Compatible Materials:\n[[YELLOW]]Stone, Coal Ore, Iron Ore, Gold Ore, Diamond Ore, Redstone Ore,\n[[YELLOW]]Lapis Ore, Obsidian, Mossy Cobblestone, Ender Stone,\n[[YELLOW]]Glowstone, and Netherrack. Guides.Mining.Section.2=[[DARK_AQUA]]How to use Super Breaker:\n[[YELLOW]]With a pickaxe in your hand, right click to ready your tool.\n[[YELLOW]]Once in this state, you have about 4 seconds to make contact\n[[YELLOW]]with Mining compatible materials, which will activate Super\n[[YELLOW]]Breaker. Guides.Mining.Section.3=[[DARK_AQUA]]What is Super Breaker?\n[[YELLOW]]Super Breaker is an ability with a cooldown tied to the Mining\n[[YELLOW]]skill. It triples your chance of extra items dropping and\n[[YELLOW]]enables instant break on Mining materials. Guides.Mining.Section.4=[[DARK_AQUA]]How to use Blast Mining:\n[[YELLOW]]With a pickaxe in hand,\n[[YELLOW]]crouch and right-click on TNT from a distance. This will cause the TNT\n[[YELLOW]]to instantly explode. Guides.Mining.Section.5=[[DARK_AQUA]]How does Blast Mining work?\n[[YELLOW]]Blast Mining is an ability with a cooldown tied to the Mining\n[[YELLOW]]skill. It gives bonuses when mining with TNT and allows you\n[[YELLOW]]to remote detonate TNT. There are three parts to Blast Mining.\n[[YELLOW]]The first part is Bigger Bombs, which increases blast radius.\n[[YELLOW]]The second is Demolitions Expert, which decreases damage\n[[YELLOW]]from TNT explosions. The third part simply increases the\n[[YELLOW]]amount of ores dropped from TNT and decreases the\n[[YELLOW]]debris dropped. ##Repair -Guides.Repair.Section.0=[[DARK_AQUA]]About Repair:\n[[YELLOW]]Repair allows you to use an iron block to repair armor and\n[[YELLOW]]tools.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]Repair tools or armor using the mcMMO Anvil. This is an\n[[YELLOW]]iron block by default and should not be confused with\n[[YELLOW]]the Vanilla Minecraft Anvil. +Guides.Repair.Section.0=[[DARK_AQUA]]\u4fee\u7406\u306b\u3064\u3044\u3066\uff1a\n[[YELLOW]]Repair allows you to use an iron block to repair armor and\n[[YELLOW]]tools.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]Repair tools or armor using the mcMMO Anvil. This is an\n[[YELLOW]]iron block by default and should not be confused with\n[[YELLOW]]the Vanilla Minecraft Anvil. Guides.Repair.Section.1=[[DARK_AQUA]]How can I use Repair?\n[[YELLOW]]Place down a mcMMO Anvil and right-click to repair the item \n[[YELLOW]]you're currently holding. This consumes 1 item on every use. Guides.Repair.Section.2=[[DARK_AQUA]]How does Repair Mastery work?\n[[YELLOW]]Repair Mastery increases the repair amount. The extra amount\n[[YELLOW]]repaired is influenced by your Repair skill level. Guides.Repair.Section.3=[[DARK_AQUA]]How does Super Repair work?\n[[YELLOW]]Super Repair is a passive ability. When repairing an item,\n[[YELLOW]]it grants players a chance to repair an item with\n[[YELLOW]]double effectiveness. Guides.Repair.Section.4=[[DARK_AQUA]]How does Arcane Forging work?\n[[YELLOW]]This passive ability allows you to repair items with a certain\n[[YELLOW]]chance of maintaining its enchantments. The enchants may be\n[[YELLOW]]kept at their existing levels, downgraded to a lower level,\n[[YELLOW]]or lost entirely. ##Salvage -Guides.Salvage.Section.0=[[DARK_AQUA]]About Salvage:\n[[YELLOW]]Salvage allows you to use an gold block to salvage armor and\n[[YELLOW]]tools.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]Salvage is a child skill of Repair and Fishing, your Salvage\n[[YELLOW]]skill level is based on your Fishing and Repair skill levels. +Guides.Salvage.Section.0=[[DARK_AQUA]]\u30b5\u30eb\u30d9\u30fc\u30b8\u306b\u3064\u3044\u3066\uff1a\n[[YELLOW]]Salvage allows you to use an gold block to salvage armor and\n[[YELLOW]]tools.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]Salvage is a child skill of Repair and Fishing, your Salvage\n[[YELLOW]]skill level is based on your Fishing and Repair skill levels. Guides.Salvage.Section.1=[[DARK_AQUA]]How can I use Salvage?\n[[YELLOW]]Place down a mcMMO Salvage Anvil and right-click to salvage\n[[YELLOW]]the item you're currently holding. This will break apart the item,\n[[YELLOW]]and give back materials used to craft the item.\n\n[[YELLOW]]For example, salvaging an iron pickaxe will give you iron bars. Guides.Salvage.Section.2=[[DARK_AQUA]]How does Advanced Salvage work?\n[[YELLOW]]When unlocked, this ability allows you to salvage damaged items.\n[[YELLOW]]The yield percentage increases as you level up. A higher yield\n[[YELLOW]]means that you can get more materials back.\n[[YELLOW]]With advanced salvage you will always get 1 material back,\n[[YELLOW]]unless the item is too damaged. So you don't have to worry\n[[YELLOW]]about destroying items without getting anything in return. Guides.Salvage.Section.3=[[DARK_AQUA]]To illustrate how this works, here's an example:\n[[YELLOW]]Let's say we salvage a gold pickaxe which is damaged for 20%,\n[[YELLOW]]this means that the maximum amount you could get is only 2\n[[YELLOW]](because the pick is crafted with 3 ingots - each worth\n[[YELLOW]]33,33% durability) which is equal to 66%. If your yield\n[[YELLOW]]percentage is below 66% you are not able to get 2 ingots.\n[[YELLOW]]If it is above this value you are able to gain the "full amount",\n[[YELLOW]]which means that you will get 2 ingots. @@ -749,13 +754,13 @@ Guides.Salvage.Section.4=[[DARK_AQUA]]How does Arcane Salvage work?\n[[YELLOW]]T ##Smelting Guides.Smelting.Section.0=Coming soon... ##Swords -Guides.Swords.Section.0=[[DARK_AQUA]]About Swords:\n[[YELLOW]]This skill awards combat bonuses to anyone fighting with a\n[[YELLOW]]sword.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]XP is gained based on the amount of damage dealt to mobs or \n[[YELLOW]]other players when wielding a sword. +Guides.Swords.Section.0=[[DARK_AQUA]]\u5263\u306b\u3064\u3044\u3066\uff1a\n[[YELLOW]]This skill awards combat bonuses to anyone fighting with a\n[[YELLOW]]sword.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]XP is gained based on the amount of damage dealt to mobs or \n[[YELLOW]]other players when wielding a sword. Guides.Swords.Section.1=[[DARK_AQUA]]How does Serrated Strikes work?\n[[YELLOW]]Serrated Strikes is an active ability, you can activate it by\n[[YELLOW]]right-clicking with a sword. This ability allows you to deal \n[[YELLOW]]an AoE (Area of Effect) hit. This AoE will do a bonus 25%\n[[YELLOW]]damage and will inflict a bleed effect that lasts for 5 ticks. Guides.Swords.Section.2=[[DARK_AQUA]]How does Counter Attack work?\n[[YELLOW]]Counter Attack is an active ability. When blocking and taking\n[[YELLOW]]hits from mobs, you will have a chance to reflect 50% of \n[[YELLOW]]the damage that was taken. Guides.Swords.Section.3=[[DARK_AQUA]]How does Rupture work?\n[[YELLOW]]Rupture causes enemies to take damage every two seconds. The \n[[YELLOW]]target will bleed until the effect wears off, or death, \n[[YELLOW]]whichever comes first.\n[[YELLOW]]The duration of the bleed is increased by your sword skill. ##Taming -Guides.Taming.Section.0=[[DARK_AQUA]]About Taming:\n[[YELLOW]]Taming will give players various combat bonuses when using\n[[YELLOW]]tamed wolves.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill, you need to tame wolves/ocelots or\n[[YELLOW]]get into combat with your wolves. -Guides.Taming.Section.1=[[DARK_AQUA]]How does Call of the Wild work?\n[[YELLOW]]Call of the Wild is an active ability that will allow you to summon\n[[YELLOW]]a wolf or an ocelot by your side. You can do this by\n[[YELLOW]]left-clicking while holding bones or fish. +Guides.Taming.Section.0=[[DARK_AQUA]]\u8abf\u6559\u306b\u3064\u3044\u3066\uff1a\n[[YELLOW]]Taming will give players various combat bonuses when using\n[[YELLOW]]tamed wolves.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill, you need to tame wolves/ocelots or\n[[YELLOW]]get into combat with your wolves. +Guides.Taming.Section.1=[DARK_AQUA]]How does Call of the Wild work?\n[[YELLOW]]Call of the Wild is an active ability that will allow you to summon\n[[YELLOW]]a wolf or an ocelot by your side. You can do this by\n[[YELLOW]]sneaking + left-clicking while holding bones or fish. Guides.Taming.Section.2=[[DARK_AQUA]]How does Beast Lore work?\n[[YELLOW]]Beast Lore allows players to inspect pets and to check the\n[[YELLOW]]stats of wolves and ocelots. Left-click a wolf or ocelot to use\n[[YELLOW]]Beast Lore. Guides.Taming.Section.3=[[DARK_AQUA]]How does Gore work?\n[[YELLOW]]Gore is a passive ability that has a chance of inflicting a\n[[YELLOW]]bleeding effect on your wolves' targets. Guides.Taming.Section.4=[[DARK_AQUA]]How does Sharpened Claws work?\n[[YELLOW]]Sharpened Claws provides a damage bonus to damage dealt\n[[YELLOW]]by wolves. The damage bonus depends on your Taming level. @@ -764,14 +769,14 @@ Guides.Taming.Section.6=[[DARK_AQUA]]How does Thick Fur work?\n[[YELLOW]]This pa Guides.Taming.Section.7=[[DARK_AQUA]]How does Shock Proof work?\n[[YELLOW]]This passive ability reduces damage done to wolves\n[[YELLOW]]from explosions. Guides.Taming.Section.8=[[DARK_AQUA]]How does Fast Food Service work?\n[[YELLOW]]This passive ability gives wolves a chance to heal whenever\n[[YELLOW]]they perform an attack. ##Unarmed -Guides.Unarmed.Section.0=[[DARK_AQUA]]About Unarmed:\n[[YELLOW]]Unarmed will give players various combat bonuses when using\n[[YELLOW]]your fists as a weapon. \n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]XP is gained based on the amount of damage dealt to mobs \n[[YELLOW]]or other players when unarmed. +Guides.Unarmed.Section.0=[[DARK_AQUA]]\u7d20\u624b\u306b\u3064\u3044\u3066\uff1a\n[[YELLOW]]Unarmed will give players various combat bonuses when using\n[[YELLOW]]your fists as a weapon. \n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]XP is gained based on the amount of damage dealt to mobs \n[[YELLOW]]or other players when unarmed. Guides.Unarmed.Section.1=[[DARK_AQUA]]How does Berserk work?\n[[YELLOW]]Beserk is an active ability that is activated by\n[[YELLOW]]right-clicking. While in Beserk mode, you deal 50% more\n[[YELLOW]]damage and you can break weak materials instantly, such as\n[[YELLOW]]Dirt and Grass. Guides.Unarmed.Section.2=[[DARK_AQUA]]How does Iron Arm work?\n[[YELLOW]]Iron Arm increases the damage dealt when hitting mobs or\n[[YELLOW]]players with your fists. Guides.Unarmed.Section.3=[[DARK_AQUA]]How does Arrow Deflect work?\n[[YELLOW]]Arrow Deflect is a passive ability that gives you a chance\n[[YELLOW]]to deflect arrows shot by Skeletons or other players.\n[[YELLOW]]The arrow will fall harmlessly to the ground. Guides.Unarmed.Section.4=[[DARK_AQUA]]How does Iron Grip work?\n[[YELLOW]]Iron Grip is a passive ability that counters disarm. As your\n[[YELLOW]]unarmed level increases, the chance of preventing a disarm increases. Guides.Unarmed.Section.5=[[DARK_AQUA]]How does Disarm work?\n[[YELLOW]]This passive ability allows players to disarm other players,\n[[YELLOW]]causing the target's equipped item to fall to the ground. ##Woodcutting -Guides.Woodcutting.Section.0=[[DARK_AQUA]]About Woodcutting:\n[[YELLOW]]Woodcutting is all about chopping down trees.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]XP is gained whenever you break log blocks. +Guides.Woodcutting.Section.0=[[DARK_AQUA]]\u6728\u3053\u308a\u306b\u3064\u3044\u3066\uff1a\n[[YELLOW]]Woodcutting is all about chopping down trees.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]XP is gained whenever you break log blocks. Guides.Woodcutting.Section.1=[[DARK_AQUA]]How does Tree Feller work?\n[[YELLOW]]Tree Feller is an active ability, you can right-click\n[[YELLOW]]while holding an ax to activate Tree Feller. This will\n[[YELLOW]]cause the entire tree to break instantly, dropping all\n[[YELLOW]]of its logs at once. Guides.Woodcutting.Section.2=[[DARK_AQUA]]How does Leaf Blower work?\n[[YELLOW]]Leaf Blower is a passive ability that will cause leaf\n[[YELLOW]]blocks to break instantly when hit with an axe. By default,\n[[YELLOW]]this ability unlocks at level 100. Guides.Woodcutting.Section.3=[[DARK_AQUA]]How do Double Drops work?\n[[YELLOW]]This passive ability gives you a chance to obtain an extra\n[[YELLOW]]block for every log you chop. @@ -832,8 +837,8 @@ MOTD.Website=[[GOLD]][mcMMO] [[GREEN]]{0}[[YELLOW]] - mcMMO \u30a6\u30a7\u30d6\u Smelting.SubSkill.UnderstandingTheArt.Name=\u82b8\u8853\u3092\u7406\u89e3\u3059\u308b Smelting.SubSkill.UnderstandingTheArt.Description=\u6d1e\u7a9f\u306e\u4e2d\u3067\u88fd\u932c\u306b\u6642\u9593\u3092\u304b\u3051\u904e\u304e\u3066\u3044\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\n\u88fd\u932c\u306e\u3055\u307e\u3056\u307e\u306a\u7279\u6027\u3092\u5f37\u5316\u3057\u307e\u3059\u3002 Smelting.SubSkill.UnderstandingTheArt.Stat=\u30d0\u30cb\u30e9XP Multiplier: [[YELLOW]]{0}x -Smelting.Ability.Locked.0=LOCKED UNTIL {0}+ SKILL (\u30d0\u30cb\u30e9XP\u30d6\u30fc\u30b9\u30c8) -Smelting.Ability.Locked.1=LOCKED UNTIL {0}+ SKILL (\u30d5\u30e9\u30c3\u30af\u30b9\u30de\u30a4\u30cb\u30f3\u30b0) +Smelting.Ability.Locked.0=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ \u30b9\u30ad\u30eb (\u30d0\u30cb\u30e9XP\u30d6\u30fc\u30b9\u30c8) +Smelting.Ability.Locked.1=\u30ed\u30c3\u30af\u3055\u308c\u308b\u307e\u3067 {0}+ \u30b9\u30ad\u30eb (\u30d5\u30e9\u30c3\u30af\u30b9\u30de\u30a4\u30cb\u30f3\u30b0) Smelting.SubSkill.FuelEfficiency.Name=\u71c3\u6599\u52b9\u7387 Smelting.SubSkill.FuelEfficiency.Description=\u88fd\u932c\u6642\u306b\u7ac8\u3067\u4f7f\u7528\u3059\u308b\u71c3\u6599\u306e\u71c3\u713c\u6642\u9593\u3092\u9577\u304f\u3059\u308b\u3002 Smelting.SubSkill.FuelEfficiency.Stat=\u71c3\u6599\u52b9\u7387 \u4e57\u6570: [[YELLOW]]{0}x diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 0cd380f2c..c2f6cdf14 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -11,7 +11,7 @@ description: > in order to evaluate and balance the mechanics of mcMMO in every update. author: nossr50 -authors: [GJ, NuclearW, bm01, Glitchfinder, TfT_02, t00thpick1, Riking] +authors: [GJ, NuclearW, bm01, Glitchfinder, TfT_02, t00thpick1, Riking, electronicboy, kashike] website: https://www.mcmmo.org main: com.gmail.nossr50.mcMMO softdepend: [WorldGuard, CombatTag, HealthBar] @@ -19,6 +19,9 @@ load: STARTUP api-version: 1.13 commands: + mmodebug: + aliases: [mcmmodebugmode] + description: Toggles a debug mode which will print useful information to chat mmoinfo: aliases: [mcinfo] description: Info pages for mcMMO @@ -541,14 +544,11 @@ permissions: children: mcmmo.ability.taming.callofthewild.horse: true mcmmo.ability.taming.callofthewild.ocelot: true - mcmmo.ability.taming.callofthewild.renamepets: true mcmmo.ability.taming.callofthewild.wolf: true mcmmo.ability.taming.callofthewild.horse: description: Allows players to summon Horses with Call of the Wild mcmmo.ability.taming.callofthewild.ocelot: description: Allows players to summon Ocelots with Call of the Wild - mcmmo.ability.taming.callofthewild.renamepets: - description: Allows players to rename pets with Call of the Wild mcmmo.ability.taming.callofthewild.wolf: description: Allows players to summon Wolves with Call of the Wild mcmmo.ability.taming.environmentallyaware: