diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/MHDCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/MHDCommand.java index 4138e2582..5dfc12ac2 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/MHDCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/MHDCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.data.database.FlatfileDatabaseManager; import com.gmail.nossr50.core.data.database.SQLDatabaseManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McImportCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McImportCommand.java index e370d91ec..086757f27 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McImportCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McImportCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.core.skills.ModConfigType; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.mcMMO; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -71,17 +71,14 @@ public class McImportCommand implements CommandExecutor { materialNames.get(type).add(materialName); continue; } - } - catch (FileNotFoundException e) { + } catch (FileNotFoundException e) { mcMMO.p.getLogger().warning("Could not find " + importFile.getAbsolutePath() + " ! (No such file or directory)"); mcMMO.p.getLogger().warning("Copy and paste latest.log to " + importFile.getParentFile().getAbsolutePath() + " and rename it to import.log"); return false; - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); return false; - } - finally { + } finally { tryClose(in); } @@ -116,8 +113,7 @@ public class McImportCommand implements CommandExecutor { } try { c.close(); - } - catch (IOException e) { + } catch (IOException e) { e.printStackTrace(); } } @@ -169,16 +165,13 @@ public class McImportCommand implements CommandExecutor { out = new FileWriter(outputFile); out.write(writer.toString()); - } - catch (IOException e) { + } catch (IOException e) { e.printStackTrace(); return; - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); return; - } - finally { + } finally { tryClose(out); fileAmount++; } @@ -208,14 +201,11 @@ public class McImportCommand implements CommandExecutor { String skillName = "UNIDENTIFIED"; if (materialName.contains("ORE")) { skillName = "Mining"; - } - else if (materialName.contains("LOG") || materialName.contains("LEAVES")) { + } else if (materialName.contains("LOG") || materialName.contains("LEAVES")) { skillName = "Woodcutting"; - } - else if (materialName.contains("GRASS") || materialName.contains("FLOWER") || materialName.contains("CROP")) { + } else if (materialName.contains("GRASS") || materialName.contains("FLOWER") || materialName.contains("CROP")) { skillName = "Herbalism"; - } - else if (materialName.contains("DIRT") || materialName.contains("SAND")) { + } else if (materialName.contains("DIRT") || materialName.contains("SAND")) { skillName = "Excavation"; } @@ -230,8 +220,7 @@ public class McImportCommand implements CommandExecutor { if (skillName.equals("Mining")) { skillContents.add(" " + " " + "Smelting_XP_Gain: 9"); - } - else if (skillName.equals("Woodcutting")) { + } else if (skillName.equals("Woodcutting")) { skillContents.add(" " + " " + "Is_Log: " + materialName.contains("LOG")); } } @@ -247,20 +236,15 @@ public class McImportCommand implements CommandExecutor { String toolType = "UNIDENTIFIED"; if (materialName.contains("PICKAXE")) { toolType = "Pickaxes"; - } - else if (materialName.contains("AXE")) { + } else if (materialName.contains("AXE")) { toolType = "Axes"; - } - else if (materialName.contains("BOW")) { + } else if (materialName.contains("BOW")) { toolType = "Bows"; - } - else if (materialName.contains("HOE")) { + } else if (materialName.contains("HOE")) { toolType = "Hoes"; - } - else if (materialName.contains("SHOVEL") || materialName.contains("SPADE")) { + } else if (materialName.contains("SHOVEL") || materialName.contains("SPADE")) { toolType = "Shovels"; - } - else if (materialName.contains("SWORD")) { + } else if (materialName.contains("SWORD")) { toolType = "Swords"; } @@ -287,14 +271,11 @@ public class McImportCommand implements CommandExecutor { String toolType = "UNIDENTIFIED"; if (materialName.contains("BOOT") || materialName.contains("SHOE")) { toolType = "Boots"; - } - else if (materialName.contains("CHESTPLATE") || materialName.contains("CHEST")) { + } else if (materialName.contains("CHESTPLATE") || materialName.contains("CHEST")) { toolType = "Chestplates"; - } - else if (materialName.contains("HELM") || materialName.contains("HAT")) { + } else if (materialName.contains("HELM") || materialName.contains("HAT")) { toolType = "Helmets"; - } - else if (materialName.contains("LEGGINGS") || materialName.contains("LEGS") || materialName.contains("PANTS")) { + } else if (materialName.contains("LEGGINGS") || materialName.contains("LEGS") || materialName.contains("PANTS")) { toolType = "Leggings"; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McconvertCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McconvertCommand.java index f9a518873..5b29c3c10 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McconvertCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McconvertCommand.java @@ -22,9 +22,6 @@ public class McconvertCommand implements TabExecutor { private static final List DATABASE_TYPES; private static final List SUBCOMMANDS = ImmutableList.of("database", "experience"); - private CommandExecutor databaseConvertCommand = new ConvertDatabaseCommand(); - private CommandExecutor experienceConvertCommand = new ConvertExperienceCommand(); - static { ArrayList formulaTypes = new ArrayList(); ArrayList databaseTypes = new ArrayList(); @@ -52,14 +49,16 @@ public class McconvertCommand implements TabExecutor { } + private CommandExecutor databaseConvertCommand = new ConvertDatabaseCommand(); + private CommandExecutor experienceConvertCommand = new ConvertExperienceCommand(); + @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { switch (args.length) { case 2: if (args[0].equalsIgnoreCase("database") || args[0].equalsIgnoreCase("db")) { return databaseConvertCommand.onCommand(sender, command, label, args); - } - else if (args[0].equalsIgnoreCase("experience") || args[0].equalsIgnoreCase("xp") || args[1].equalsIgnoreCase("exp")) { + } else if (args[0].equalsIgnoreCase("experience") || args[0].equalsIgnoreCase("xp") || args[1].equalsIgnoreCase("exp")) { return experienceConvertCommand.onCommand(sender, command, label, args); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java index 3a20b6b4b..104fb5e01 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McmmoCommand.java @@ -3,8 +3,8 @@ package com.gmail.nossr50.commands; import com.gmail.nossr50.commands.party.PartySubcommandType; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.mcMMO; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -71,7 +71,7 @@ public class McmmoCommand implements CommandExecutor { 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 (!Permissions.skillreset(sender) && !Permissions.mmoedit(sender) && !Permissions.adminChat(sender) && !Permissions.mcgod(sender)) return; sender.sendMessage(LocaleLoader.getString("Commands.Other")); diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/McnotifyCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/McnotifyCommand.java index afbe211b7..3c3818406 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/McnotifyCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/McnotifyCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/ToggleCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/ToggleCommand.java index 5956d6df9..2b10cea70 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/ToggleCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/ToggleCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -71,7 +71,10 @@ public abstract class ToggleCommand implements TabExecutor { } protected abstract boolean hasOtherPermission(CommandSender sender); + protected abstract boolean hasSelfPermission(CommandSender sender); + protected abstract void applyCommandAction(McMMOPlayer mcMMOPlayer); + protected abstract void sendSuccessMessage(CommandSender sender, String playerName); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/XprateCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/XprateCommand.java index 6d6765822..d655df001 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/XprateCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/XprateCommand.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.commands; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.StringUtils; import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.util.player.NotificationManager; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.ChatColor; import org.bukkit.command.Command; @@ -25,7 +25,7 @@ public class XprateCommand implements TabExecutor { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { switch (args.length) { case 1: - if (!args[0].equalsIgnoreCase("reset") && !args[0].equalsIgnoreCase("clear")) { + if (!args[0].equalsIgnoreCase("reset") && !args[0].equalsIgnoreCase("clear")) { return false; } @@ -36,12 +36,11 @@ public class XprateCommand implements TabExecutor { if (mcMMO.p.isXPEventEnabled()) { - if(AdvancedConfig.getInstance().useTitlesForXPEvent()) - { + if (AdvancedConfig.getInstance().useTitlesForXPEvent()) { NotificationManager.broadcastTitle(mcMMO.p.getServer(), LocaleLoader.getString("Commands.Event.Stop"), LocaleLoader.getString("Commands.Event.Stop.Subtitle"), - 10, 10*20, 20); + 10, 10 * 20, 20); } mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.Stop")); @@ -65,36 +64,31 @@ public class XprateCommand implements TabExecutor { if (CommandUtils.shouldDisableToggle(args[1])) { mcMMO.p.setXPEventEnabled(false); - } - else if (CommandUtils.shouldEnableToggle(args[1])) { + } else if (CommandUtils.shouldEnableToggle(args[1])) { mcMMO.p.setXPEventEnabled(true); - } - else { + } else { return false; } int newXpRate = Integer.parseInt(args[0]); - if(newXpRate < 0) - { - sender.sendMessage(ChatColor.RED+LocaleLoader.getString("Commands.NegativeNumberWarn")); + if (newXpRate < 0) { + sender.sendMessage(ChatColor.RED + LocaleLoader.getString("Commands.NegativeNumberWarn")); return true; } ExperienceConfig.getInstance().setExperienceGainsGlobalMultiplier(newXpRate); if (mcMMO.p.isXPEventEnabled()) { - if(AdvancedConfig.getInstance().useTitlesForXPEvent()) - { + if (AdvancedConfig.getInstance().useTitlesForXPEvent()) { NotificationManager.broadcastTitle(mcMMO.p.getServer(), LocaleLoader.getString("Commands.Event.Start"), LocaleLoader.getString("Commands.Event.XP", newXpRate), - 10, 10*20, 20); + 10, 10 * 20, 20); } mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.Start")); mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Commands.Event.XP", newXpRate)); - } - else { + } else { sender.sendMessage(LocaleLoader.getString("Commands.xprate.modified", newXpRate)); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java index 6bc73b9c2..4c1c883e8 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/ChatCommand.java @@ -3,13 +3,13 @@ package com.gmail.nossr50.commands.chat; import com.gmail.nossr50.core.chat.ChatManager; import com.gmail.nossr50.core.chat.ChatManagerFactory; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.party.PartyFeature; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -21,8 +21,8 @@ import java.util.ArrayList; import java.util.List; public abstract class ChatCommand implements TabExecutor { - private ChatMode chatMode; protected ChatManager chatManager; + private ChatMode chatMode; public ChatCommand(ChatMode chatMode) { this.chatMode = chatMode; @@ -47,8 +47,7 @@ public abstract class ChatCommand implements TabExecutor { if (mcMMOPlayer.isChatEnabled(chatMode)) { disableChatMode(mcMMOPlayer, sender); - } - else { + } else { enableChatMode(mcMMOPlayer, sender); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java index 219ffa072..4cd76d299 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/chat/PartyChatCommand.java @@ -2,12 +2,12 @@ package com.gmail.nossr50.commands.chat; import com.gmail.nossr50.core.chat.PartyChatManager; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -35,8 +35,7 @@ public class PartyChatCommand extends ChatCommand { } message = buildChatMessage(args, 0); - } - else { + } else { if (args.length < 2) { sender.sendMessage(LocaleLoader.getString("Party.Specify")); return; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/database/ConvertDatabaseCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/database/ConvertDatabaseCommand.java index 69620c5a7..840a6823c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/database/ConvertDatabaseCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/database/ConvertDatabaseCommand.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.commands.database; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.data.database.DatabaseManager; import com.gmail.nossr50.core.data.database.DatabaseManagerFactory; import com.gmail.nossr50.core.datatypes.database.DatabaseType; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.runnables.database.DatabaseConversionTask; import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.mcMMO; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -41,8 +41,7 @@ public class ConvertDatabaseCommand implements CommandExecutor { } oldDatabase = DatabaseManagerFactory.createCustomDatabaseManager((Class) clazz); - } - catch (Throwable e) { + } catch (Throwable e) { e.printStackTrace(); sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Database.InvalidType", args[1])); return true; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/database/McremoveCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/database/McremoveCommand.java index c4b83e977..66f19cd15 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/database/McremoveCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/database/McremoveCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.database; -import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.util.commands.CommandUtils; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -26,8 +26,7 @@ public class McremoveCommand implements TabExecutor { if (mcMMO.getDatabaseManager().removeUser(playerName)) { sender.sendMessage(LocaleLoader.getString("Commands.mcremove.Success", playerName)); - } - else { + } else { sender.sendMessage(playerName + " could not be removed from the database."); // Pretty sure this should NEVER happen. } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddlevelsCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddlevelsCommand.java index 4ea0ecf2e..be5d98f63 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddlevelsCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddlevelsCommand.java @@ -2,8 +2,8 @@ package com.gmail.nossr50.commands.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.EventUtils; import com.gmail.nossr50.core.util.Permissions; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddxpCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddxpCommand.java index 2b1fbd647..112f087ef 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddxpCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/AddxpCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.experience; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Permissions; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -25,8 +25,7 @@ public class AddxpCommand extends ExperienceCommand { protected void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill, int value) { if (player != null) { UserManager.getPlayer(player).applyXpGain(skill, value, XPGainReason.COMMAND, XPGainSource.COMMAND); - } - else { + } else { profile.addXp(skill, value); profile.scheduleAsyncSave(); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java index 7c1b1b8ab..d75ee9182 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ConvertExperienceCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.experience; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.runnables.database.FormulaConversionTask; import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.mcMMO; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java index a8a24db35..37839cb3c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/ExperienceCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.experience; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.OfflinePlayer; import org.bukkit.command.Command; @@ -20,6 +20,14 @@ import java.util.List; import java.util.UUID; public abstract class ExperienceCommand implements TabExecutor { + protected static void handleSenderMessage(CommandSender sender, String playerName, PrimarySkillType skill) { + if (skill == null) { + sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", playerName)); + } else { + sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", skill.getName(), playerName)); + } + } + @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { PrimarySkillType skill; @@ -45,8 +53,7 @@ public abstract class ExperienceCommand implements TabExecutor { skill = null; } - if (skill != null && skill.isChildSkill()) - { + if (skill != null && skill.isChildSkill()) { sender.sendMessage(LocaleLoader.getString("Commands.Skill.ChildSkill")); return true; } @@ -70,8 +77,7 @@ public abstract class ExperienceCommand implements TabExecutor { skill = null; } - if (skill != null && skill.isChildSkill()) - { + if (skill != null && skill.isChildSkill()) { sender.sendMessage(LocaleLoader.getString("Commands.Skill.ChildSkill")); return true; } @@ -95,8 +101,7 @@ public abstract class ExperienceCommand implements TabExecutor { } editValues(null, profile, skill, value); - } - else { + } else { editValues(mcMMOPlayer.getPlayer(), mcMMOPlayer.getProfile(), skill, value); } @@ -122,24 +127,19 @@ public abstract class ExperienceCommand implements TabExecutor { } protected abstract boolean permissionsCheckSelf(CommandSender sender); + protected abstract boolean permissionsCheckOthers(CommandSender sender); + protected abstract void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill, int value); + protected abstract void handlePlayerMessageAll(Player player, int value); + protected abstract void handlePlayerMessageSkill(Player player, int value, PrimarySkillType skill); private boolean validateArguments(CommandSender sender, String skillName, String value) { return !(CommandUtils.isInvalidInteger(sender, value) || (!skillName.equalsIgnoreCase("all") && CommandUtils.isInvalidSkill(sender, skillName))); } - protected static void handleSenderMessage(CommandSender sender, String playerName, PrimarySkillType skill) { - if (skill == null) { - sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", playerName)); - } - else { - sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", skill.getName(), playerName)); - } - } - protected void editValues(Player player, PlayerProfile profile, PrimarySkillType skill, int value) { if (skill == null) { for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) { @@ -149,8 +149,7 @@ public abstract class ExperienceCommand implements TabExecutor { if (player != null) { handlePlayerMessageAll(player, value); } - } - else { + } else { handleCommand(player, profile, skill, value); if (player != null) { diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/MmoeditCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/MmoeditCommand.java index d7e9150f7..fa616cee1 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/MmoeditCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/MmoeditCommand.java @@ -2,8 +2,8 @@ package com.gmail.nossr50.commands.experience; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.EventUtils; import com.gmail.nossr50.core.util.Permissions; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/SkillresetCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/SkillresetCommand.java index d9a98242d..66d9ee038 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/experience/SkillresetCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/experience/SkillresetCommand.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.commands.experience; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.EventUtils; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.OfflinePlayer; import org.bukkit.command.Command; @@ -27,6 +27,14 @@ import java.util.UUID; * value/quantity argument is removed. */ public class SkillresetCommand implements TabExecutor { + protected static void handleSenderMessage(CommandSender sender, String playerName, PrimarySkillType skill) { + if (skill == null) { + sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", playerName)); + } else { + sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", skill.getName(), playerName)); + } + } + @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { PrimarySkillType skill; @@ -47,8 +55,7 @@ public class SkillresetCommand implements TabExecutor { if (args[0].equalsIgnoreCase("all")) { skill = null; - } - else { + } else { skill = PrimarySkillType.getSkill(args[1]); } @@ -67,8 +74,7 @@ public class SkillresetCommand implements TabExecutor { if (args[1].equalsIgnoreCase("all")) { skill = null; - } - else { + } else { skill = PrimarySkillType.getSkill(args[1]); } @@ -89,8 +95,7 @@ public class SkillresetCommand implements TabExecutor { } editValues(null, profile, skill); - } - else { + } else { editValues(mcMMOPlayer.getPlayer(), mcMMOPlayer.getProfile(), skill); } @@ -149,15 +154,6 @@ public class SkillresetCommand implements TabExecutor { return skillName.equalsIgnoreCase("all") || !CommandUtils.isInvalidSkill(sender, skillName); } - protected static void handleSenderMessage(CommandSender sender, String playerName, PrimarySkillType skill) { - if (skill == null) { - sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", playerName)); - } - else { - sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", skill.getName(), playerName)); - } - } - protected void editValues(Player player, PlayerProfile profile, PrimarySkillType skill) { if (skill == null) { for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) { @@ -167,8 +163,7 @@ public class SkillresetCommand implements TabExecutor { if (player != null) { handlePlayerMessageAll(player); } - } - else { + } else { handleCommand(player, profile, skill); if (player != null) { diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java index 2e2bcd582..9d816402f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.hardcore; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.mcMMO; import org.bukkit.command.CommandSender; public class HardcoreCommand extends HardcoreModeCommand { @@ -54,8 +54,7 @@ public class HardcoreCommand extends HardcoreModeCommand { for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) { primarySkillType.setHardcoreStatLossEnabled(enable); } - } - else { + } else { skill.setHardcoreStatLossEnabled(enable); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreModeCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreModeCommand.java index 190e92925..5decf71e5 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreModeCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreModeCommand.java @@ -28,8 +28,7 @@ public abstract class HardcoreModeCommand implements TabExecutor { if (checkEnabled(null)) { disable(null); - } - else { + } else { enable(null); } @@ -122,9 +121,14 @@ public abstract class HardcoreModeCommand implements TabExecutor { } protected abstract boolean checkTogglePermissions(CommandSender sender); + protected abstract boolean checkModifyPermissions(CommandSender sender); + protected abstract boolean checkEnabled(PrimarySkillType skill); + protected abstract void enable(PrimarySkillType skill); + protected abstract void disable(PrimarySkillType skill); + protected abstract void modify(CommandSender sender, double newPercentage); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java index 97758e956..b3a19a48c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.hardcore; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Permissions; +import com.gmail.nossr50.mcMMO; import org.bukkit.command.CommandSender; public class VampirismCommand extends HardcoreModeCommand { @@ -54,8 +54,7 @@ public class VampirismCommand extends HardcoreModeCommand { for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) { primarySkillType.setHardcoreVampirismEnabled(enable); } - } - else { + } else { skill.setHardcoreVampirismEnabled(enable); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyAcceptCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyAcceptCommand.java index d9e8535bd..acf63df8f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyAcceptCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyAcceptCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.party; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangeOwnerCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangeOwnerCommand.java index 6fc137f72..5eb2154f6 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangeOwnerCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangeOwnerCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.party; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.mcMMO; import org.bukkit.OfflinePlayer; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangePasswordCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangePasswordCommand.java index 28503767e..e8f49776d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangePasswordCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyChangePasswordCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.party; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java index d71b11818..a0d58322f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCommand.java @@ -3,12 +3,12 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.commands.chat.PartyChatCommand; import com.gmail.nossr50.commands.party.alliance.PartyAllianceCommand; import com.gmail.nossr50.commands.party.teleport.PtpCommand; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -38,24 +38,24 @@ public class PartyCommand implements TabExecutor { PARTY_SUBCOMMANDS = ImmutableList.copyOf(subcommands); } - private CommandExecutor partyJoinCommand = new PartyJoinCommand(); - private CommandExecutor partyAcceptCommand = new PartyAcceptCommand(); - private CommandExecutor partyCreateCommand = new PartyCreateCommand(); - private CommandExecutor partyQuitCommand = new PartyQuitCommand(); - private CommandExecutor partyXpShareCommand = new PartyXpShareCommand(); - private CommandExecutor partyItemShareCommand = new PartyItemShareCommand(); - private CommandExecutor partyInviteCommand = new PartyInviteCommand(); - private CommandExecutor partyKickCommand = new PartyKickCommand(); - private CommandExecutor partyDisbandCommand = new PartyDisbandCommand(); - private CommandExecutor partyChangeOwnerCommand = new PartyChangeOwnerCommand(); - private CommandExecutor partyLockCommand = new PartyLockCommand(); + private CommandExecutor partyJoinCommand = new PartyJoinCommand(); + private CommandExecutor partyAcceptCommand = new PartyAcceptCommand(); + private CommandExecutor partyCreateCommand = new PartyCreateCommand(); + private CommandExecutor partyQuitCommand = new PartyQuitCommand(); + private CommandExecutor partyXpShareCommand = new PartyXpShareCommand(); + private CommandExecutor partyItemShareCommand = new PartyItemShareCommand(); + private CommandExecutor partyInviteCommand = new PartyInviteCommand(); + private CommandExecutor partyKickCommand = new PartyKickCommand(); + private CommandExecutor partyDisbandCommand = new PartyDisbandCommand(); + private CommandExecutor partyChangeOwnerCommand = new PartyChangeOwnerCommand(); + private CommandExecutor partyLockCommand = new PartyLockCommand(); private CommandExecutor partyChangePasswordCommand = new PartyChangePasswordCommand(); - private CommandExecutor partyRenameCommand = new PartyRenameCommand(); - private CommandExecutor partyInfoCommand = new PartyInfoCommand(); - private CommandExecutor partyHelpCommand = new PartyHelpCommand(); - private CommandExecutor partyTeleportCommand = new PtpCommand(); - private CommandExecutor partyChatCommand = new PartyChatCommand(); - private CommandExecutor partyAllianceCommand = new PartyAllianceCommand(); + private CommandExecutor partyRenameCommand = new PartyRenameCommand(); + private CommandExecutor partyInfoCommand = new PartyInfoCommand(); + private CommandExecutor partyHelpCommand = new PartyHelpCommand(); + private CommandExecutor partyTeleportCommand = new PtpCommand(); + private CommandExecutor partyChatCommand = new PartyChatCommand(); + private CommandExecutor partyAllianceCommand = new PartyAllianceCommand(); @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCreateCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCreateCommand.java index 90f0fe974..ff547962d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCreateCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyCreateCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.party; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyDisbandCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyDisbandCommand.java index 6d8c692c5..6001a512e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyDisbandCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyDisbandCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.party; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; -import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java index d8c0ed899..944bae118 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInfoCommand.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; import com.gmail.nossr50.core.datatypes.party.ShareMode; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -65,8 +65,7 @@ public class PartyInfoCommand implements CommandExecutor { if (isUnlockedFeature(party, partyFeature)) { unlockedPartyFeatures.add(partyFeature.getLocaleString()); - } - else { + } else { lockedPartyFeatures.add(partyFeature.getFeatureLockedLocaleString()); } } @@ -123,7 +122,7 @@ public class PartyInfoCommand implements CommandExecutor { int membersOnline = party.getVisibleMembers(player).size(); player.sendMessage(LocaleLoader.getString("Commands.Party.Members.Header")); - player.sendMessage(LocaleLoader.getString("Commands.Party.MembersNear", nearMembers.size()+1, membersOnline)); + player.sendMessage(LocaleLoader.getString("Commands.Party.MembersNear", nearMembers.size() + 1, membersOnline)); player.sendMessage(party.createMembersList(player)); } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java index 77240b094..facdd9fad 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyInviteCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -46,8 +46,7 @@ public class PartyInviteCommand implements CommandExecutor { Party playerParty = mcMMOPlayer.getParty(); - if(PartyManager.isPartyFull(target, playerParty)) - { + if (PartyManager.isPartyFull(target, playerParty)) { player.sendMessage(LocaleLoader.getString("Commands.Party.PartyFull.Invite", target.getName(), playerParty.toString(), Config.getInstance().getPartyMaxSize())); return true; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java index 0beb71618..473d4f637 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyItemShareCommand.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.ItemShareType; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; @@ -8,7 +9,6 @@ import com.gmail.nossr50.core.datatypes.party.ShareMode; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.StringUtils; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -41,19 +41,16 @@ public class PartyItemShareCommand implements CommandExecutor { if (CommandUtils.shouldEnableToggle(args[2])) { toggle = true; - } - else if (CommandUtils.shouldDisableToggle(args[2])) { + } else if (CommandUtils.shouldDisableToggle(args[2])) { toggle = false; - } - else { + } else { sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "itemshare", " ")); return true; } try { handleToggleItemShareCategory(party, ItemShareType.valueOf(args[1].toUpperCase()), toggle); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "itemshare", " ")); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyJoinCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyJoinCommand.java index e60ca6348..7d01ece25 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyJoinCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyJoinCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.party; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -54,8 +54,7 @@ public class PartyJoinCommand implements CommandExecutor { return true; } - if(PartyManager.isPartyFull(player, targetParty)) - { + if (PartyManager.isPartyFull(player, targetParty)) { player.sendMessage(LocaleLoader.getString("Commands.Party.PartyFull", targetParty.toString())); return true; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java index 4eec0fa64..7b969845d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyKickCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.party; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; -import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; +import com.gmail.nossr50.mcMMO; import org.bukkit.OfflinePlayer; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyLockCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyLockCommand.java index 4e70cd29f..d312d4d94 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyLockCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyLockCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.party; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -17,8 +17,7 @@ public class PartyLockCommand implements CommandExecutor { case 1: if (args[0].equalsIgnoreCase("lock")) { togglePartyLock(sender, true); - } - else if (args[0].equalsIgnoreCase("unlock")) { + } else if (args[0].equalsIgnoreCase("unlock")) { togglePartyLock(sender, false); } @@ -32,11 +31,9 @@ public class PartyLockCommand implements CommandExecutor { if (CommandUtils.shouldEnableToggle(args[1])) { togglePartyLock(sender, true); - } - else if (CommandUtils.shouldDisableToggle(args[1])) { + } else if (CommandUtils.shouldDisableToggle(args[1])) { togglePartyLock(sender, false); - } - else { + } else { sendUsageStrings(sender); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyQuitCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyQuitCommand.java index 6c1f62e9f..2097451c4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyQuitCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyQuitCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.party; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java index b84a19c7e..802f1797e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyRenameCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.party; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartySubcommandType.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartySubcommandType.java index f4ebdb510..c9c45453d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartySubcommandType.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartySubcommandType.java @@ -30,20 +30,15 @@ public enum PartySubcommandType { if (commandName.equalsIgnoreCase("?")) { return HELP; - } - else if (commandName.equalsIgnoreCase("q") || commandName.equalsIgnoreCase("leave")) { + } else if (commandName.equalsIgnoreCase("q") || commandName.equalsIgnoreCase("leave")) { return QUIT; - } - else if (commandName.equalsIgnoreCase("leader")) { + } else if (commandName.equalsIgnoreCase("leader")) { return OWNER; - } - else if (commandName.equalsIgnoreCase("xpshare") || commandName.equalsIgnoreCase("shareexp") || commandName.equalsIgnoreCase("sharexp")) { + } else if (commandName.equalsIgnoreCase("xpshare") || commandName.equalsIgnoreCase("shareexp") || commandName.equalsIgnoreCase("sharexp")) { return XPSHARE; - } - else if (commandName.equalsIgnoreCase("shareitem") || commandName.equalsIgnoreCase("shareitems")) { + } else if (commandName.equalsIgnoreCase("shareitem") || commandName.equalsIgnoreCase("shareitems")) { return ITEMSHARE; - } - else if (commandName.equalsIgnoreCase("ally")) { + } else if (commandName.equalsIgnoreCase("ally")) { return ALLIANCE; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java index 1069244a3..2290132cf 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/PartyXpShareCommand.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.commands.party; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; import com.gmail.nossr50.core.datatypes.party.ShareMode; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.StringUtils; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -27,11 +27,9 @@ public class PartyXpShareCommand implements CommandExecutor { case 2: if (args[1].equalsIgnoreCase("none") || CommandUtils.shouldDisableToggle(args[1])) { handleChangingShareMode(party, ShareMode.NONE); - } - else if (args[1].equalsIgnoreCase("equal") || args[1].equalsIgnoreCase("even") || CommandUtils.shouldEnableToggle(args[1])) { + } else if (args[1].equalsIgnoreCase("equal") || args[1].equalsIgnoreCase("even") || CommandUtils.shouldEnableToggle(args[1])) { handleChangingShareMode(party, ShareMode.EQUAL); - } - else { + } else { sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "xpshare", "")); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceAcceptCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceAcceptCommand.java index 6169132c7..ed263aaa3 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceAcceptCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceAcceptCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.party.alliance; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java index 754d61a61..d7f7e07ee 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceCommand.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.commands.party.alliance; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import org.bukkit.ChatColor; import org.bukkit.command.Command; @@ -21,12 +21,10 @@ import java.util.ArrayList; import java.util.List; public class PartyAllianceCommand implements TabExecutor { + public static final List ALLIANCE_SUBCOMMANDS = ImmutableList.of("invite", "accept", "disband"); private Player player; private Party playerParty; private Party targetParty; - - public static final List ALLIANCE_SUBCOMMANDS = ImmutableList.of("invite", "accept", "disband"); - private CommandExecutor partyAllianceInviteCommand = new PartyAllianceInviteCommand(); private CommandExecutor partyAllianceAcceptCommand = new PartyAllianceAcceptCommand(); private CommandExecutor partyAllianceDisbandCommand = new PartyAllianceDisbandCommand(); diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceDisbandCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceDisbandCommand.java index 418f4f478..34bf835c3 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceDisbandCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceDisbandCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.party.alliance; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceInviteCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceInviteCommand.java index 704e3e0c8..c396ab8f2 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceInviteCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/alliance/PartyAllianceInviteCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.party.alliance; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptAnyCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptAnyCommand.java index b525e779d..fa4d0d675 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptAnyCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptAnyCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.party.teleport; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -20,8 +20,7 @@ public class PtpAcceptAnyCommand implements CommandExecutor { if (ptpRecord.isConfirmRequired()) { sender.sendMessage(LocaleLoader.getString("Commands.ptp.AcceptAny.Disabled")); - } - else { + } else { sender.sendMessage(LocaleLoader.getString("Commands.ptp.AcceptAny.Enabled")); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java index de5330587..824d5e7c9 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpAcceptCommand.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.commands.party.teleport; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.SkillUtils; import org.bukkit.World; import org.bukkit.command.Command; @@ -49,8 +49,7 @@ public class PtpAcceptCommand implements CommandExecutor { if (!Permissions.partyTeleportWorld(target, targetWorld)) { target.sendMessage(LocaleLoader.getString("Commands.ptp.NoWorldPermissions", targetWorld.getName())); return true; - } - else if (targetWorld != playerWorld && !Permissions.partyTeleportWorld(target, playerWorld)) { + } else if (targetWorld != playerWorld && !Permissions.partyTeleportWorld(target, playerWorld)) { target.sendMessage(LocaleLoader.getString("Commands.ptp.NoWorldPermissions", playerWorld.getName())); return true; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java index a76b3af7e..625cc8257 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java @@ -2,22 +2,22 @@ package com.gmail.nossr50.commands.party.teleport; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.config.skills.WorldBlacklist; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyFeature; import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.runnables.items.TeleportationWarmup; import com.gmail.nossr50.core.util.EventUtils; import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.SkillUtils; import com.gmail.nossr50.core.worldguard.WorldGuardManager; import com.gmail.nossr50.core.worldguard.WorldGuardUtils; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -36,6 +36,54 @@ public class PtpCommand implements TabExecutor { private CommandExecutor ptpAcceptAnyCommand = new PtpAcceptAnyCommand(); private CommandExecutor ptpAcceptCommand = new PtpAcceptCommand(); + protected static boolean canTeleport(CommandSender sender, Player player, String targetName) { + McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetName); + + if (!CommandUtils.checkPlayerExistence(sender, targetName, mcMMOTarget)) { + return false; + } + + Player target = mcMMOTarget.getPlayer(); + + if (player.equals(target)) { + player.sendMessage(LocaleLoader.getString("Party.Teleport.Self")); + return false; + } + + if (!PartyManager.inSameParty(player, target)) { + player.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName)); + return false; + } + + if (!mcMMOTarget.getPartyTeleportRecord().isEnabled()) { + player.sendMessage(LocaleLoader.getString("Party.Teleport.Disabled", targetName)); + return false; + } + + if (!target.isValid()) { + player.sendMessage(LocaleLoader.getString("Party.Teleport.Dead")); + return false; + } + + return true; + } + + protected static void handleTeleportWarmup(Player teleportingPlayer, Player targetPlayer) { + McMMOPlayer mcMMOPlayer = UserManager.getPlayer(teleportingPlayer); + McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetPlayer); + + long warmup = Config.getInstance().getPTPCommandWarmup(); + + mcMMOPlayer.actualizeTeleportCommenceLocation(teleportingPlayer); + + if (warmup > 0) { + teleportingPlayer.sendMessage(LocaleLoader.getString("Teleport.Commencing", warmup)); + new TeleportationWarmup(mcMMOPlayer, mcMMOTarget).runTaskLater(mcMMO.p, 20 * warmup); + } else { + EventUtils.handlePartyTeleportEvent(teleportingPlayer, targetPlayer); + } + } + @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (CommandUtils.noConsoleUsage(sender)) { @@ -45,14 +93,13 @@ public class PtpCommand implements TabExecutor { Player player = (Player) sender; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return true; } /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(player.getWorld())) + if (WorldBlacklist.isWorldBlacklisted(player.getWorld())) return true; if (!UserManager.hasPlayerDataKey(player)) { @@ -171,53 +218,4 @@ public class PtpCommand implements TabExecutor { target.sendMessage(LocaleLoader.getString("Commands.ptp.Request1", player.getName())); target.sendMessage(LocaleLoader.getString("Commands.ptp.Request2", Config.getInstance().getPTPCommandTimeout())); } - - protected static boolean canTeleport(CommandSender sender, Player player, String targetName) { - McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetName); - - if (!CommandUtils.checkPlayerExistence(sender, targetName, mcMMOTarget)) { - return false; - } - - Player target = mcMMOTarget.getPlayer(); - - if (player.equals(target)) { - player.sendMessage(LocaleLoader.getString("Party.Teleport.Self")); - return false; - } - - if (!PartyManager.inSameParty(player, target)) { - player.sendMessage(LocaleLoader.getString("Party.NotInYourParty", targetName)); - return false; - } - - if (!mcMMOTarget.getPartyTeleportRecord().isEnabled()) { - player.sendMessage(LocaleLoader.getString("Party.Teleport.Disabled", targetName)); - return false; - } - - if (!target.isValid()) { - player.sendMessage(LocaleLoader.getString("Party.Teleport.Dead")); - return false; - } - - return true; - } - - protected static void handleTeleportWarmup(Player teleportingPlayer, Player targetPlayer) { - McMMOPlayer mcMMOPlayer = UserManager.getPlayer(teleportingPlayer); - McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetPlayer); - - long warmup = Config.getInstance().getPTPCommandWarmup(); - - mcMMOPlayer.actualizeTeleportCommenceLocation(teleportingPlayer); - - if (warmup > 0) { - teleportingPlayer.sendMessage(LocaleLoader.getString("Teleport.Commencing", warmup)); - new TeleportationWarmup(mcMMOPlayer, mcMMOTarget).runTaskLater(mcMMO.p, 20 * warmup); - } - else { - EventUtils.handlePartyTeleportEvent(teleportingPlayer, targetPlayer); - } - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpToggleCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpToggleCommand.java index 1449b7c24..e1e4a7097 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpToggleCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/party/teleport/PtpToggleCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.party.teleport; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -20,8 +20,7 @@ public class PtpToggleCommand implements CommandExecutor { if (ptpRecord.isEnabled()) { sender.sendMessage(LocaleLoader.getString("Commands.ptp.Disabled")); - } - else { + } else { sender.sendMessage(LocaleLoader.getString("Commands.ptp.Enabled")); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java index 7214e389c..5bb5384bd 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.commands.player; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -65,8 +65,7 @@ public class InspectCommand implements TabExecutor { sender.sendMessage(CommandUtils.displaySkill(profile, skill)); } - } - else { + } else { Player target = mcMMOPlayer.getPlayer(); if (CommandUtils.hidden(sender, target, Permissions.inspectHidden(sender))) { @@ -74,8 +73,7 @@ public class InspectCommand implements TabExecutor { sender.sendMessage(LocaleLoader.getString("Inspect.Offline")); return true; } - } - else if (CommandUtils.tooFar(sender, target, Permissions.inspectFar(sender))) { + } else if (CommandUtils.tooFar(sender, target, Permissions.inspectFar(sender))) { return true; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java index 29734c1be..6a3c06715 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MccooldownCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.player; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.SuperAbilityType; +import com.gmail.nossr50.core.util.commands.CommandUtils; import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; @@ -52,8 +52,7 @@ public class MccooldownCommand implements TabExecutor { if (seconds <= 0) { player.sendMessage(LocaleLoader.getString("Commands.Cooldowns.Row.Y", ability.getName())); - } - else { + } else { player.sendMessage(LocaleLoader.getString("Commands.Cooldowns.Row.N", ability.getName(), seconds)); } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java index abcea5284..419606632 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.commands.player; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.runnables.commands.McrankCommandAsyncTask; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -61,8 +61,7 @@ public class McrankCommand implements TabExecutor { if (CommandUtils.tooFar(sender, player, Permissions.mcrankFar(sender))) { return true; } - } - else if (CommandUtils.inspectOffline(sender, mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false), Permissions.mcrankOffline(sender))) { + } else if (CommandUtils.inspectOffline(sender, mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false), Permissions.mcrankOffline(sender))) { return true; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java index 3a7bc321e..64b2fc11d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/McstatsCommand.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.commands.player; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; @@ -47,8 +47,7 @@ public class McstatsCommand implements TabExecutor { if (powerLevelCap != Integer.MAX_VALUE) { player.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Capped", UserManager.getPlayer(player).getPowerLevel(), powerLevelCap)); - } - else { + } else { player.sendMessage(LocaleLoader.getString("Commands.PowerLevel", UserManager.getPlayer(player).getPowerLevel())); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java index fd53d54bf..bbefd239a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.commands.player; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.runnables.commands.MctopCommandAsyncTask; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.StringUtils; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java index c6cf8b0f4..86d9c068c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; -import com.gmail.nossr50.listeners.InteractionManager; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.util.random.RandomChanceSkill; import com.gmail.nossr50.core.util.random.RandomChanceUtil; import com.gmail.nossr50.core.util.skills.SkillActivationType; +import com.gmail.nossr50.listeners.InteractionManager; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; @@ -50,31 +50,30 @@ public class AcrobaticsCommand extends SkillCommand { messages.add(getStatMessage(SubSkillType.ACROBATICS_DODGE, dodgeChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", dodgeChanceLucky) : "")); } - + if (canRoll) { AbstractSubSkill abstractSubSkill = InteractionManager.getAbstractByName("Roll"); - if(abstractSubSkill != null) - { + if (abstractSubSkill != null) { double rollChance, graceChance; //Chance to roll at half - RandomChanceSkill roll_rcs = new RandomChanceSkill(player, SubSkillType.ACROBATICS_ROLL); + RandomChanceSkill roll_rcs = new RandomChanceSkill(player, SubSkillType.ACROBATICS_ROLL); //Chance to graceful roll RandomChanceSkill grace_rcs = new RandomChanceSkill(player, SubSkillType.ACROBATICS_ROLL); grace_rcs.setSkillLevel(grace_rcs.getSkillLevel() * 2); //Double Odds //Chance Stat Calculations - rollChance = RandomChanceUtil.getRandomChanceExecutionChance(roll_rcs); - graceChance = RandomChanceUtil.getRandomChanceExecutionChance(grace_rcs); + rollChance = RandomChanceUtil.getRandomChanceExecutionChance(roll_rcs); + graceChance = RandomChanceUtil.getRandomChanceExecutionChance(grace_rcs); //damageThreshold = AdvancedConfig.getInstance().getRollDamageThreshold(); String rollStrings[] = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.ACROBATICS_ROLL); //Format - double rollChanceLucky = rollChance * 1.333D; + double rollChanceLucky = rollChance * 1.333D; double graceChanceLucky = graceChance * 1.333D; messages.add(getStatMessage(SubSkillType.ACROBATICS_ROLL, rollStrings[0]) diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AlchemyCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AlchemyCommand.java index c5d0da343..86ffdc2d3 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AlchemyCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AlchemyCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyManager; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.RankUtils; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; @@ -18,8 +18,8 @@ public class AlchemyCommand extends SkillCommand { private String brewSpeed; private String brewSpeedLucky; - private int tier; - private int ingredientCount; + private int tier; + private int ingredientCount; private String ingredientList; private boolean canCatalysis; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AprilCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AprilCommand.java index 54863cd3c..52edb0b78 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AprilCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AprilCommand.java @@ -16,10 +16,9 @@ import java.util.ArrayList; import java.util.List; public class AprilCommand implements TabExecutor { - private String skillName; - protected DecimalFormat percent = new DecimalFormat("##0.00%"); protected DecimalFormat decimal = new DecimalFormat("##0.00"); + private String skillName; @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java index 94ceca20f..9da128ba9 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.primary.archery.Archery; import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.util.skills.SkillActivationType; @@ -35,14 +35,14 @@ public class ArcheryCommand extends SkillCommand { retrieveChance = retrieveStrings[0]; retrieveChanceLucky = retrieveStrings[1]; } - + // ARCHERY_DAZE if (canDaze) { String[] dazeStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.ARCHERY_DAZE); dazeChance = dazeStrings[0]; dazeChanceLucky = dazeStrings[1]; } - + // SKILL SHOT if (canSkillShot) { skillShotBonus = percent.format(Archery.getDamageBonusPercent(player)); @@ -64,12 +64,12 @@ public class ArcheryCommand extends SkillCommand { messages.add(getStatMessage(SubSkillType.ARCHERY_ARROW_RETRIEVAL, retrieveChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", retrieveChanceLucky) : "")); } - + if (canDaze) { messages.add(getStatMessage(SubSkillType.ARCHERY_DAZE, dazeChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", dazeChanceLucky) : "")); } - + if (canSkillShot) { messages.add(getStatMessage(SubSkillType.ARCHERY_SKILL_SHOT, skillShotBonus)); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java index 160d52d64..a95eb273c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.primary.axes.Axes; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.RankUtils; import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; @@ -44,14 +44,14 @@ public class AxesCommand extends SkillCommand { if (canAxeMastery) { axeMasteryDamage = Axes.getAxeMasteryBonusDamage(player); } - + // CRITICAL HIT if (canCritical) { String[] criticalHitStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.AXES_CRITICAL_STRIKES); critChance = criticalHitStrings[0]; critChanceLucky = criticalHitStrings[1]; } - + // SKULL SPLITTER if (canSkullSplitter) { String[] skullSplitterStrings = calculateLengthDisplayValues(player, skillValue); @@ -76,7 +76,7 @@ public class AxesCommand extends SkillCommand { if (canImpact) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Axes.Ability.Bonus.2"), LocaleLoader.getString("Axes.Ability.Bonus.3", impactDamage))); } - + if (canAxeMastery) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Axes.Ability.Bonus.0"), LocaleLoader.getString("Axes.Ability.Bonus.1", axeMasteryDamage))); } @@ -85,7 +85,7 @@ public class AxesCommand extends SkillCommand { messages.add(getStatMessage(SubSkillType.AXES_CRITICAL_STRIKES, critChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", critChanceLucky) : "")); } - + if (canGreaterImpact) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Axes.Ability.Bonus.4"), LocaleLoader.getString("Axes.Ability.Bonus.5", Axes.greaterImpactBonusDamage))); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java index c502553e7..c8debcff0 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.util.skills.RankUtils; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java index ba150f6f0..4e60a73b7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java @@ -2,15 +2,15 @@ package com.gmail.nossr50.commands.skills; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.treasure.TreasureConfig; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.skills.treasure.Rarity; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.primary.fishing.Fishing; import com.gmail.nossr50.core.skills.primary.fishing.FishingManager; +import com.gmail.nossr50.core.skills.treasure.Rarity; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.random.RandomChanceUtil; import com.gmail.nossr50.core.util.skills.RankUtils; import net.md_5.bungee.api.chat.TextComponent; @@ -74,7 +74,7 @@ public class FishingCommand extends SkillCommand { } } - if(totalEnchantChance >= 1) + if (totalEnchantChance >= 1) magicChance = percent.format(totalEnchantChance / 100.0); else magicChance = percent.format(0); @@ -129,15 +129,15 @@ public class FishingCommand extends SkillCommand { @Override protected List statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) { List messages = new ArrayList(); - + if (canFishermansDiet) { messages.add(getStatMessage(false, true, SubSkillType.FISHING_FISHERMANS_DIET, String.valueOf(fishermansDietRank))); } - + if (canIceFish) { messages.add(getStatMessage(SubSkillType.FISHING_ICE_FISHING, SubSkillType.FISHING_ICE_FISHING.getLocaleStatDescription())); } - + if (canMagicHunt) { messages.add(getStatMessage(SubSkillType.FISHING_MAGIC_HUNTER, magicChance)); } @@ -146,12 +146,12 @@ public class FishingCommand extends SkillCommand { //TODO: Update this with more details messages.add(getStatMessage(false, true, SubSkillType.FISHING_MASTER_ANGLER, biteChance)); } - + if (canShake) { messages.add(getStatMessage(SubSkillType.FISHING_SHAKE, shakeChance) - + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", shakeChanceLucky) : "")); + + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", shakeChanceLucky) : "")); } - + if (canTreasureHunt) { messages.add(getStatMessage(false, true, SubSkillType.FISHING_TREASURE_HUNTER, String.valueOf(lootTier), String.valueOf(RankUtils.getHighestRank(SubSkillType.FISHING_TREASURE_HUNTER)))); messages.add(getStatMessage(true, true, SubSkillType.FISHING_TREASURE_HUNTER, diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java index 54d49dcce..a5e86c6dd 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.util.skills.RankUtils; @@ -42,19 +42,20 @@ public class HerbalismCommand extends SkillCommand { @Override protected void dataCalculations(Player player, float skillValue) { - + // DOUBLE DROPS if (canDoubleDrop) { - String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.HERBALISM_DOUBLE_DROPS);; + String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.HERBALISM_DOUBLE_DROPS); + ; doubleDropChance = doubleDropStrings[0]; doubleDropChanceLucky = doubleDropStrings[1]; } - + // FARMERS DIET if (canFarmersDiet) { farmersDietRank = RankUtils.getRank(player, SubSkillType.HERBALISM_FARMERS_DIET); } - + // GREEN TERRA if (canGreenTerra) { String[] greenTerraStrings = calculateLengthDisplayValues(player, skillValue); @@ -105,11 +106,11 @@ public class HerbalismCommand extends SkillCommand { messages.add(getStatMessage(SubSkillType.HERBALISM_DOUBLE_DROPS, doubleDropChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : "")); } - + if (canFarmersDiet) { messages.add(getStatMessage(false, true, SubSkillType.HERBALISM_FARMERS_DIET, String.valueOf(farmersDietRank))); } - + if (canGreenTerra) { messages.add(getStatMessage(SubSkillType.HERBALISM_GREEN_TERRA, greenTerraLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", greenTerraLengthEndurance) : "")); @@ -124,7 +125,7 @@ public class HerbalismCommand extends SkillCommand { } if (canGreenThumbPlants) { - messages.add(getStatMessage(true, true,SubSkillType.HERBALISM_GREEN_THUMB, String.valueOf(greenThumbStage))); + messages.add(getStatMessage(true, true, SubSkillType.HERBALISM_GREEN_THUMB, String.valueOf(greenThumbStage))); } if (hasHylianLuck) { diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java index 2ae4fe8dd..9e0cc63ee 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.primary.mining.MiningManager; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.RankUtils; import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; @@ -51,14 +51,14 @@ public class MiningCommand extends SkillCommand { blastDamageDecrease = percent.format(miningManager.getBlastDamageModifier() / 100.0D); blastRadiusIncrease = miningManager.getBlastRadiusModifier(); } - + // DOUBLE DROPS if (canDoubleDrop) { String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.MINING_DOUBLE_DROPS); doubleDropChance = doubleDropStrings[0]; doubleDropChanceLucky = doubleDropStrings[1]; } - + // SUPER BREAKER if (canSuperBreaker) { String[] superBreakerStrings = calculateLengthDisplayValues(player, skillValue); @@ -84,17 +84,17 @@ public class MiningCommand extends SkillCommand { messages.add(getStatMessage(true, true, SubSkillType.MINING_BLAST_MINING, String.valueOf(blastRadiusIncrease))); //messages.add(LocaleLoader.getString("Mining.Blast.Radius.Increase", blastRadiusIncrease)); } - + if (canBlast) { messages.add(getStatMessage(false, true, SubSkillType.MINING_BLAST_MINING, String.valueOf(blastMiningRank), String.valueOf(RankUtils.getHighestRank(SubSkillType.MINING_BLAST_MINING)), LocaleLoader.getString("Mining.Blast.Effect", oreBonus, debrisReduction, bonusTNTDrops))); //messages.add(LocaleLoader.getString("Mining.Blast.Rank", blastMiningRank, RankUtils.getHighestRank(SubSkillType.MINING_BLAST_MINING), LocaleLoader.getString("Mining.Blast.Effect", oreBonus, debrisReduction, bonusTNTDrops))); } - - if (canDemoExpert) { + + if (canDemoExpert) { messages.add(getStatMessage(SubSkillType.MINING_DEMOLITIONS_EXPERTISE, blastDamageDecrease)); //messages.add(LocaleLoader.getString("Mining.Effect.Decrease", blastDamageDecrease)); } - + if (canDoubleDrop) { messages.add(getStatMessage(SubSkillType.HERBALISM_DOUBLE_DROPS, doubleDropChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : "")); diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java index 3883f797e..6c1f2ead5 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; -import com.gmail.nossr50.listeners.InteractionManager; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; +import com.gmail.nossr50.listeners.InteractionManager; import com.google.common.collect.ImmutableList; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -27,26 +27,22 @@ public class MmoInfoCommand implements TabExecutor { /* * Only allow players to use this command */ - if(commandSender instanceof Player) - { - if(args.length < 1) + if (commandSender instanceof Player) { + if (args.length < 1) return false; Player player = (Player) commandSender; - if(Permissions.mmoinfo(player)) - { - if(args == null || args[0] == null) + if (Permissions.mmoinfo(player)) { + if (args == null || args[0] == null) return false; - if(args[0].equalsIgnoreCase( "???")) - { + if (args[0].equalsIgnoreCase("???")) { player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Header")); player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.SubSkillHeader", "???")); player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.DetailsHeader")); player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Mystery")); return true; - } else if(InteractionManager.getAbstractByName(args[0]) != null || PrimarySkillType.SUBSKILL_NAMES.contains(args[0])) - { + } else if (InteractionManager.getAbstractByName(args[0]) != null || PrimarySkillType.SUBSKILL_NAMES.contains(args[0])) { displayInfo(player, args[0]); return true; } @@ -70,12 +66,10 @@ public class MmoInfoCommand implements TabExecutor { } } - private void displayInfo(Player player, String subSkillName) - { + private void displayInfo(Player player, String subSkillName) { //Check to see if the skill exists in the new system AbstractSubSkill abstractSubSkill = InteractionManager.getAbstractByName(subSkillName); - if(abstractSubSkill != null) - { + if (abstractSubSkill != null) { /* New System Skills are programmable */ abstractSubSkill.printInfo(player); //TextComponentFactory.sendPlayerUrlHeader(player); @@ -89,9 +83,8 @@ public class MmoInfoCommand implements TabExecutor { player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.OldSkill")); } - for(SubSkillType subSkillType : SubSkillType.values()) - { - if(subSkillType.getNiceNameNoSpaces(subSkillType).equalsIgnoreCase(subSkillName)) + for (SubSkillType subSkillType : SubSkillType.values()) { + if (subSkillType.getNiceNameNoSpaces(subSkillType).equalsIgnoreCase(subSkillName)) subSkillName = subSkillType.getWikiName(subSkillType.toString()); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java index 049823e35..4833a9619 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java @@ -1,19 +1,19 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.MaterialType; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.skills.primary.repair.ArcaneForging; import com.gmail.nossr50.core.skills.primary.repair.Repair; import com.gmail.nossr50.core.skills.primary.repair.RepairManager; import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.RankUtils; import com.gmail.nossr50.core.util.skills.SkillActivationType; +import com.gmail.nossr50.mcMMO; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -107,7 +107,7 @@ public class RepairCommand extends SkillCommand { String.valueOf(arcaneBypass ? 0 : repairManager.getDowngradeEnchantChance()))); //Jesus those parentheses } } - + if (canMasterRepair) { messages.add(getStatMessage(false, true, SubSkillType.REPAIR_REPAIR_MASTERY, repairMasteryBonus)); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SalvageCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SalvageCommand.java index 1c5b03f6a..43dcc9870 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SalvageCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SalvageCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.child.salvage.Salvage; import com.gmail.nossr50.core.skills.child.salvage.SalvageManager; import com.gmail.nossr50.core.util.TextComponentFactory; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.RankUtils; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java index d12a2f1cf..95c21b0ac 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillCommand.java @@ -2,16 +2,16 @@ package com.gmail.nossr50.commands.skills; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.child.FamilyTree; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.StringUtils; import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.util.commands.CommandUtils; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.random.RandomChanceUtil; import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.core.util.skills.PerksUtils; @@ -33,11 +33,9 @@ import java.util.Set; public abstract class SkillCommand implements TabExecutor { protected PrimarySkillType skill; - private String skillName; - protected DecimalFormat percent = new DecimalFormat("##0.00%"); protected DecimalFormat decimal = new DecimalFormat("##0.00"); - + private String skillName; private CommandExecutor skillGuideCommand; public SkillCommand(PrimarySkillType skill) { @@ -46,6 +44,15 @@ public abstract class SkillCommand implements TabExecutor { skillGuideCommand = new SkillGuideCommand(skill); } + public static String[] addItemToFirstPositionOfArray(String itemToAdd, String... existingArray) { + String[] newArray = new String[existingArray.length + 1]; + newArray[0] = itemToAdd; + + System.arraycopy(existingArray, 0, newArray, 1, existingArray.length); + + return newArray; + } + @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (CommandUtils.noConsoleUsage(sender)) { @@ -66,9 +73,8 @@ public abstract class SkillCommand implements TabExecutor { float skillValue = mcMMOPlayer.getSkillLevel(skill); //Send the players a few blank lines to make finding the top of the skill command easier - if(AdvancedConfig.getInstance().doesSkillCommandSendBlankLines()) - for(int i = 0; i < 2; i++) - { + if (AdvancedConfig.getInstance().doesSkillCommandSendBlankLines()) + for (int i = 0; i < 2; i++) { player.sendMessage(""); } @@ -99,8 +105,7 @@ public abstract class SkillCommand implements TabExecutor { //Link Header - if(Config.getInstance().getUrlLinksEnabled()) - { + if (Config.getInstance().getUrlLinksEnabled()) { player.sendMessage(LocaleLoader.getString("Overhaul.mcMMO.Header")); TextComponentFactory.sendPlayerUrlHeader(player); } @@ -138,8 +143,7 @@ public abstract class SkillCommand implements TabExecutor { player.sendMessage(LocaleLoader.getString("Skills.Overhaul.Header", skillName)); - if(!skill.isChildSkill()) - { + if (!skill.isChildSkill()) { /* * NON-CHILD SKILLS */ @@ -162,17 +166,16 @@ public abstract class SkillCommand implements TabExecutor { //TODO: Add JSON here for (PrimarySkillType parent : parents) { parentList.add(parent); - /*player.sendMessage(parent.getName() + " - " + LocaleLoader.getString("Effects.Level.Overhaul", mcMMOPlayer.getSkillLevel(parent), mcMMOPlayer.getSkillXpLevel(parent), mcMMOPlayer.getXpToLevel(parent)))*/; + /*player.sendMessage(parent.getName() + " - " + LocaleLoader.getString("Effects.Level.Overhaul", mcMMOPlayer.getSkillLevel(parent), mcMMOPlayer.getSkillXpLevel(parent), mcMMOPlayer.getXpToLevel(parent)))*/ + ; } String parentMessage = ""; - for(int i = 0; i < parentList.size(); i++) - { - if(i+1 < parentList.size()) - { + for (int i = 0; i < parentList.size(); i++) { + if (i + 1 < parentList.size()) { parentMessage += LocaleLoader.getString("Effects.Child.ParentList", parentList.get(i).getName(), mcMMOPlayer.getSkillLevel(parentList.get(i))); - parentMessage += ChatColor.GRAY+", "; + parentMessage += ChatColor.GRAY + ", "; } else { parentMessage += LocaleLoader.getString("Effects.Child.ParentList", parentList.get(i).getName(), mcMMOPlayer.getSkillLevel(parentList.get(i))); } @@ -231,11 +234,9 @@ public abstract class SkillCommand implements TabExecutor { int length; - if(abilityLengthCap <= 0) - { + if (abilityLengthCap <= 0) { length = 2 + (int) (skillValue / abilityLengthVar); - } - else { + } else { length = 2 + (int) (Math.min(abilityLengthCap, skillValue) / abilityLengthVar); } @@ -245,40 +246,27 @@ public abstract class SkillCommand implements TabExecutor { length = Math.min(length, maxLength); } - return new String[] { String.valueOf(length), String.valueOf(enduranceLength) }; + return new String[]{String.valueOf(length), String.valueOf(enduranceLength)}; } - protected String getStatMessage(SubSkillType subSkillType, String... vars) - { + protected String getStatMessage(SubSkillType subSkillType, String... vars) { return getStatMessage(false, false, subSkillType, vars); } - protected String getStatMessage(boolean isExtra, boolean isCustom, SubSkillType subSkillType, String... vars) - { + protected String getStatMessage(boolean isExtra, boolean isCustom, SubSkillType subSkillType, String... vars) { String templateKey = isCustom ? "Ability.Generic.Template.Custom" : "Ability.Generic.Template"; String statDescriptionKey = !isExtra ? subSkillType.getLocaleKeyStatDescription() : subSkillType.getLocaleKeyStatExtraDescription(); - if(isCustom) + if (isCustom) //Cast to Object[] to suppress warnings return LocaleLoader.getString(templateKey, LocaleLoader.getString(statDescriptionKey, (Object[]) vars)); - else - { + else { String[] mergedList = addItemToFirstPositionOfArray(LocaleLoader.getString(statDescriptionKey), vars); //Cast to Object[] to suppress warnings return LocaleLoader.getString(templateKey, (Object[]) mergedList); } } - - public static String[] addItemToFirstPositionOfArray(String itemToAdd, String... existingArray) { - String[] newArray = new String[existingArray.length + 1]; - newArray[0] = itemToAdd; - - System.arraycopy(existingArray, 0, newArray, 1, existingArray.length); - - return newArray; - } - protected abstract void dataCalculations(Player player, float skillValue); protected abstract void permissionsCheck(Player player); @@ -291,12 +279,12 @@ public abstract class SkillCommand implements TabExecutor { /** * Checks if a player can use a skill - * @param player target player + * + * @param player target player * @param subSkillType target subskill * @return true if the player has permission and has the skill unlocked */ - protected boolean canUseSubskill(Player player, SubSkillType subSkillType) - { + protected boolean canUseSubskill(Player player, SubSkillType subSkillType) { return Permissions.isSubSkillEnabled(player, subSkillType) && RankUtils.hasUnlockedSubskill(player, subSkillType); } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillGuideCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillGuideCommand.java index 7b1280c4a..9a0694860 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillGuideCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SkillGuideCommand.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.commands.skills; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.StringUtils; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -75,8 +75,7 @@ public class SkillGuideCommand implements CommandExecutor { while (allStrings.size() < 9) { if (pageIndexStart + allStrings.size() > guide.size()) { allStrings.add(""); - } - else { + } else { allStrings.add(guide.get(pageIndexStart + (allStrings.size() - 1))); } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java index d01ae1ebc..59c71571f 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.child.smelting.Smelting; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.RankUtils; import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; @@ -44,7 +44,7 @@ public class SmeltingCommand extends SkillCommand { str_fluxMiningChance = fluxMiningStrings[0]; str_fluxMiningChanceLucky = fluxMiningStrings[1]; }*/ - + // SECOND SMELT if (canSecondSmelt) { String[] secondSmeltStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.SMELTING_SECOND_SMELT); @@ -70,7 +70,7 @@ public class SmeltingCommand extends SkillCommand { + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", str_fluxMiningChanceLucky) : "")); //messages.add(LocaleLoader.getString("Smelting.Ability.FluxMining", str_fluxMiningChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", str_fluxMiningChanceLucky) : "")); }*/ - + if (canFuelEfficiency) { messages.add(getStatMessage(false, true, SubSkillType.SMELTING_FUEL_EFFICIENCY, burnTimeModifier)); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java index 7133d440a..a202d2f3b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.commands.skills; import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.RankUtils; import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; @@ -49,7 +49,7 @@ public class SwordsCommand extends SkillCommand { bleedChance = bleedStrings[0]; bleedChanceLucky = bleedStrings[1]; } - + // SERRATED STRIKES if (canSerratedStrike) { String[] serratedStrikesStrings = calculateLengthDisplayValues(player, skillValue); @@ -70,8 +70,8 @@ public class SwordsCommand extends SkillCommand { List messages = new ArrayList(); int ruptureTicks = UserManager.getPlayer(player).getSwordsManager().getRuptureBleedTicks(); - double ruptureDamagePlayers = RankUtils.getRank(player, SubSkillType.SWORDS_RUPTURE) >= 3 ? AdvancedConfig.getInstance().getRuptureDamagePlayer() * 1.5D : AdvancedConfig.getInstance().getRuptureDamagePlayer(); - double ruptureDamageMobs = RankUtils.getRank(player, SubSkillType.SWORDS_RUPTURE) >= 3 ? AdvancedConfig.getInstance().getRuptureDamageMobs() * 1.5D : AdvancedConfig.getInstance().getRuptureDamageMobs(); + double ruptureDamagePlayers = RankUtils.getRank(player, SubSkillType.SWORDS_RUPTURE) >= 3 ? AdvancedConfig.getInstance().getRuptureDamagePlayer() * 1.5D : AdvancedConfig.getInstance().getRuptureDamagePlayer(); + double ruptureDamageMobs = RankUtils.getRank(player, SubSkillType.SWORDS_RUPTURE) >= 3 ? AdvancedConfig.getInstance().getRuptureDamageMobs() * 1.5D : AdvancedConfig.getInstance().getRuptureDamageMobs(); if (canCounter) { messages.add(getStatMessage(SubSkillType.SWORDS_COUNTER_ATTACK, counterChance) diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java index 23fe7406f..5d0833f0d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.primary.taming.Taming; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; @@ -61,17 +61,17 @@ public class TamingCommand extends SkillCommand { if (canEnvironmentallyAware) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.0"), LocaleLoader.getString("Taming.Ability.Bonus.1"))); } - + if (canFastFood) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.8"), LocaleLoader.getString("Taming.Ability.Bonus.9", percent.format(Taming.fastFoodServiceActivationChance / 100D)))); } - + if (canGore) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Combat.Chance.Gore"), goreChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", goreChanceLucky) : "")); } - + if (canHolyHound) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.10"), LocaleLoader.getString("Taming.Ability.Bonus.11"))); } @@ -79,11 +79,11 @@ public class TamingCommand extends SkillCommand { if (canSharpenedClaws) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.6"), LocaleLoader.getString("Taming.Ability.Bonus.7", Taming.sharpenedClawsBonusDamage))); } - + if (canShockProof) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.4"), LocaleLoader.getString("Taming.Ability.Bonus.5", Taming.shockProofModifier))); } - + if (canThickFur) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.2"), LocaleLoader.getString("Taming.Ability.Bonus.3", Taming.thickFurModifier))); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java index 30f3ebb0a..e0f84b728 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.RankUtils; import com.gmail.nossr50.core.util.skills.SkillActivationType; import net.md_5.bungee.api.chat.TextComponent; @@ -39,11 +39,12 @@ public class UnarmedCommand extends SkillCommand { protected void dataCalculations(Player player, float skillValue) { // UNARMED_ARROW_DEFLECT if (canDeflect) { - String[] deflectStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.UNARMED_ARROW_DEFLECT);; + String[] deflectStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.UNARMED_ARROW_DEFLECT); + ; deflectChance = deflectStrings[0]; deflectChanceLucky = deflectStrings[1]; } - + // BERSERK if (canBerserk) { String[] berserkStrings = calculateLengthDisplayValues(player, skillValue); @@ -53,7 +54,8 @@ public class UnarmedCommand extends SkillCommand { // UNARMED_DISARM if (canDisarm) { - String[] disarmStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.UNARMED_DISARM);; + String[] disarmStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.UNARMED_DISARM); + ; disarmChance = disarmStrings[0]; disarmChanceLucky = disarmStrings[1]; } @@ -90,19 +92,19 @@ public class UnarmedCommand extends SkillCommand { + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", deflectChanceLucky) : "")); //messages.add(LocaleLoader.getString("Unarmed.Ability.Chance.ArrowDeflect", deflectChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", deflectChanceLucky) : "")); } - + if (canBerserk) { messages.add(getStatMessage(SubSkillType.UNARMED_BERSERK, berserkLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", berserkLengthEndurance) : "")); //messages.add(LocaleLoader.getString("Unarmed.Ability.Berserk.Length", berserkLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", berserkLengthEndurance) : "")); } - + if (canDisarm) { messages.add(getStatMessage(SubSkillType.UNARMED_DISARM, disarmChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", disarmChanceLucky) : "")); //messages.add(LocaleLoader.getString("Unarmed.Ability.Chance.Disarm", disarmChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", disarmChanceLucky) : "")); } - + if (canIronArm) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Unarmed.Ability.Bonus.0"), LocaleLoader.getString("Unarmed.Ability.Bonus.1", ironArmBonus))); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java index 0d55831f7..c5c31d93a 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java +++ b/bukkit/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.util.skills.RankUtils; @@ -36,7 +36,7 @@ public class WoodcuttingCommand extends SkillCommand { if (canDoubleDrop) { setDoubleDropClassicChanceStrings(player); } - + // TREE FELLER if (canTreeFell) { String[] treeFellerStrings = calculateLengthDisplayValues(player, skillValue); @@ -46,7 +46,8 @@ public class WoodcuttingCommand extends SkillCommand { } private void setDoubleDropClassicChanceStrings(Player player) { - String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.WOODCUTTING_HARVEST_LUMBER);; + String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.WOODCUTTING_HARVEST_LUMBER); + ; doubleDropChance = doubleDropStrings[0]; doubleDropChanceLucky = doubleDropStrings[1]; } @@ -69,7 +70,7 @@ public class WoodcuttingCommand extends SkillCommand { messages.add(getStatMessage(SubSkillType.WOODCUTTING_HARVEST_LUMBER, doubleDropChance) + (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : "")); } - + if (canLeafBlow) { messages.add(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Woodcutting.Ability.0"), LocaleLoader.getString("Woodcutting.Ability.1"))); } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/chat/McMMOChatEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/chat/McMMOChatEvent.java index 9c4f3ae68..ce13caf12 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/chat/McMMOChatEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/chat/McMMOChatEvent.java @@ -6,6 +6,10 @@ import org.bukkit.event.HandlerList; import org.bukkit.plugin.Plugin; public abstract class McMMOChatEvent extends Event implements Cancellable { + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); private boolean cancelled; private Plugin plugin; private String sender; @@ -27,6 +31,10 @@ public abstract class McMMOChatEvent extends Event implements Cancellable { this.message = message; } + public static HandlerList getHandlerList() { + return handlers; + } + /** * @return The plugin responsible for this event, note this can be null */ @@ -48,13 +56,6 @@ public abstract class McMMOChatEvent extends Event implements Cancellable { return displayName; } - /** - * @return String message that will be sent - */ - public String getMessage() { - return message; - } - /** * @param displayName String display name of the player who sent the chat */ @@ -62,6 +63,13 @@ public abstract class McMMOChatEvent extends Event implements Cancellable { this.displayName = displayName; } + /** + * @return String message that will be sent + */ + public String getMessage() { + return message; + } + /** * @param message String message to be sent in chat */ @@ -69,7 +77,9 @@ public abstract class McMMOChatEvent extends Event implements Cancellable { this.message = message; } - /** Following are required for Cancellable **/ + /** + * Following are required for Cancellable + **/ @Override public boolean isCancelled() { return cancelled; @@ -80,15 +90,8 @@ public abstract class McMMOChatEvent extends Event implements Cancellable { this.cancelled = cancelled; } - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java index 855d4eadc..a19cc810d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.events.experience; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; @@ -12,10 +12,11 @@ import org.bukkit.event.player.PlayerEvent; * Generic event for mcMMO experience events. */ public abstract class McMMOPlayerExperienceEvent extends PlayerEvent implements Cancellable { - private boolean cancelled; + private static final HandlerList handlers = new HandlerList(); protected PrimarySkillType skill; protected int skillLevel; protected XPGainReason xpGainReason; + private boolean cancelled; @Deprecated protected McMMOPlayerExperienceEvent(Player player, PrimarySkillType skill) { @@ -32,6 +33,10 @@ public abstract class McMMOPlayerExperienceEvent extends PlayerEvent implements this.xpGainReason = xpGainReason; } + public static HandlerList getHandlerList() { + return handlers; + } + /** * @return The skill involved in this event */ @@ -53,7 +58,9 @@ public abstract class McMMOPlayerExperienceEvent extends PlayerEvent implements return xpGainReason; } - /** Following are required for Cancellable **/ + /** + * Following are required for Cancellable + **/ @Override public boolean isCancelled() { return cancelled; @@ -63,15 +70,9 @@ public abstract class McMMOPlayerExperienceEvent extends PlayerEvent implements public void setCancelled(boolean cancelled) { this.cancelled = cancelled; } - - private static final HandlerList handlers = new HandlerList(); @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelDownEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelDownEvent.java index 515d53314..183cced08 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelDownEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelDownEvent.java @@ -9,6 +9,7 @@ import org.bukkit.event.HandlerList; * Called when a user loses levels in a skill */ public class McMMOPlayerLevelDownEvent extends McMMOPlayerLevelChangeEvent { + private static final HandlerList handlers = new HandlerList(); private int levelsLost; @Deprecated @@ -33,11 +34,8 @@ public class McMMOPlayerLevelDownEvent extends McMMOPlayerLevelChangeEvent { this.levelsLost = levelsLost; } - /** - * @param levelsLost Set the number of levels lost in this event - */ - public void setLevelsLost(int levelsLost) { - this.levelsLost = levelsLost; + public static HandlerList getHandlerList() { + return handlers; } /** @@ -47,14 +45,15 @@ public class McMMOPlayerLevelDownEvent extends McMMOPlayerLevelChangeEvent { return levelsLost; } - private static final HandlerList handlers = new HandlerList(); + /** + * @param levelsLost Set the number of levels lost in this event + */ + public void setLevelsLost(int levelsLost) { + this.levelsLost = levelsLost; + } @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java index dc3cf393a..1dd843d7e 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java @@ -9,6 +9,7 @@ import org.bukkit.event.HandlerList; * Called when a user levels up in a skill */ public class McMMOPlayerLevelUpEvent extends McMMOPlayerLevelChangeEvent { + private static final HandlerList handlers = new HandlerList(); private int levelsGained; @Deprecated @@ -33,11 +34,8 @@ public class McMMOPlayerLevelUpEvent extends McMMOPlayerLevelChangeEvent { this.levelsGained = levelsGained; } - /** - * @param levelsGained Set the number of levels gained in this event - */ - public void setLevelsGained(int levelsGained) { - this.levelsGained = levelsGained; + public static HandlerList getHandlerList() { + return handlers; } /** @@ -47,14 +45,15 @@ public class McMMOPlayerLevelUpEvent extends McMMOPlayerLevelChangeEvent { return levelsGained; } - private static final HandlerList handlers = new HandlerList(); + /** + * @param levelsGained Set the number of levels gained in this event + */ + public void setLevelsGained(int levelsGained) { + this.levelsGained = levelsGained; + } @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerXpGainEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerXpGainEvent.java index 2116c7948..c3290569d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerXpGainEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerXpGainEvent.java @@ -9,6 +9,7 @@ import org.bukkit.event.HandlerList; * Called when a player gains XP in a skill */ public class McMMOPlayerXpGainEvent extends McMMOPlayerExperienceEvent { + private static final HandlerList handlers = new HandlerList(); private float xpGained; @Deprecated @@ -22,6 +23,10 @@ public class McMMOPlayerXpGainEvent extends McMMOPlayerExperienceEvent { this.xpGained = xpGained; } + public static HandlerList getHandlerList() { + return handlers; + } + /** * @return The amount of experience gained in this event */ @@ -29,6 +34,13 @@ public class McMMOPlayerXpGainEvent extends McMMOPlayerExperienceEvent { return xpGained; } + /** + * @param xpGained int amount of experience gained in this event + */ + public void setRawXpGained(float xpGained) { + this.xpGained = xpGained; + } + /** * @return int amount of experience gained in this event */ @@ -37,13 +49,6 @@ public class McMMOPlayerXpGainEvent extends McMMOPlayerExperienceEvent { return (int) xpGained; } - /** - * @param xpGained int amount of experience gained in this event - */ - public void setRawXpGained(float xpGained) { - this.xpGained = xpGained; - } - /** * @param xpGained int amount of experience gained in this event */ @@ -52,14 +57,8 @@ public class McMMOPlayerXpGainEvent extends McMMOPlayerExperienceEvent { this.xpGained = xpGained; } - private static final HandlerList handlers = new HandlerList(); - @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerDeathPenaltyEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerDeathPenaltyEvent.java index bf723375a..a6035351c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerDeathPenaltyEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerDeathPenaltyEvent.java @@ -8,9 +8,12 @@ import org.bukkit.event.player.PlayerEvent; import java.util.HashMap; public class McMMOPlayerDeathPenaltyEvent extends PlayerEvent implements Cancellable { + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); private HashMap levelChanged; private HashMap experienceChanged; - private boolean cancelled; public McMMOPlayerDeathPenaltyEvent(Player player, HashMap levelChanged, HashMap experienceChanged) { @@ -26,6 +29,10 @@ public class McMMOPlayerDeathPenaltyEvent extends PlayerEvent implements Cancell this.cancelled = false; } + public static HandlerList getHandlerList() { + return handlers; + } + public HashMap getLevelChanged() { return levelChanged; } @@ -42,7 +49,9 @@ public class McMMOPlayerDeathPenaltyEvent extends PlayerEvent implements Cancell this.experienceChanged = experienceChanged; } - /** Following are required for Cancellable **/ + /** + * Following are required for Cancellable + **/ @Override public boolean isCancelled() { return cancelled; @@ -53,15 +62,8 @@ public class McMMOPlayerDeathPenaltyEvent extends PlayerEvent implements Cancell this.cancelled = cancelled; } - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerPreDeathPenaltyEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerPreDeathPenaltyEvent.java index b831f0426..7e8b8fb22 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerPreDeathPenaltyEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/hardcore/McMMOPlayerPreDeathPenaltyEvent.java @@ -6,6 +6,10 @@ import org.bukkit.event.HandlerList; import org.bukkit.event.player.PlayerEvent; public class McMMOPlayerPreDeathPenaltyEvent extends PlayerEvent implements Cancellable { + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); private boolean cancelled; public McMMOPlayerPreDeathPenaltyEvent(Player player) { @@ -13,7 +17,13 @@ public class McMMOPlayerPreDeathPenaltyEvent extends PlayerEvent implements Canc this.cancelled = false; } - /** Following are required for Cancellable **/ + public static HandlerList getHandlerList() { + return handlers; + } + + /** + * Following are required for Cancellable + **/ @Override public boolean isCancelled() { return cancelled; @@ -24,15 +34,8 @@ public class McMMOPlayerPreDeathPenaltyEvent extends PlayerEvent implements Canc this.cancelled = cancelled; } - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/items/McMMOItemSpawnEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/items/McMMOItemSpawnEvent.java index b6d7dcb94..5756fe5fe 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/items/McMMOItemSpawnEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/items/McMMOItemSpawnEvent.java @@ -10,6 +10,10 @@ import org.bukkit.inventory.ItemStack; * Called when mcMMO is preparing to drop an item. */ public class McMMOItemSpawnEvent extends Event implements Cancellable { + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); private Location location; private ItemStack itemStack; private boolean cancelled; @@ -20,6 +24,10 @@ public class McMMOItemSpawnEvent extends Event implements Cancellable { this.cancelled = false; } + public static HandlerList getHandlerList() { + return handlers; + } + /** * @return Location where the item will be dropped */ @@ -48,7 +56,9 @@ public class McMMOItemSpawnEvent extends Event implements Cancellable { this.itemStack = itemStack; } - /** Following are required for Cancellable **/ + /** + * Following are required for Cancellable + **/ @Override public boolean isCancelled() { return cancelled; @@ -59,15 +69,8 @@ public class McMMOItemSpawnEvent extends Event implements Cancellable { this.cancelled = cancelled; } - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyAllianceChangeEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyAllianceChangeEvent.java index 1e126e501..4a57ca955 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyAllianceChangeEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyAllianceChangeEvent.java @@ -6,6 +6,10 @@ import org.bukkit.event.HandlerList; import org.bukkit.event.player.PlayerEvent; public class McMMOPartyAllianceChangeEvent extends PlayerEvent implements Cancellable { + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); private String oldAlly; private String newAlly; private EventReason reason; @@ -24,6 +28,10 @@ public class McMMOPartyAllianceChangeEvent extends PlayerEvent implements Cancel this.cancelled = false; } + public static HandlerList getHandlerList() { + return handlers; + } + /** * @return The party being left, or null if the player was not in a party */ @@ -45,6 +53,24 @@ public class McMMOPartyAllianceChangeEvent extends PlayerEvent implements Cancel return reason; } + /** + * Following are required for Cancellable + **/ + @Override + public boolean isCancelled() { + return cancelled; + } + + @Override + public void setCancelled(boolean cancelled) { + this.cancelled = cancelled; + } + + @Override + public HandlerList getHandlers() { + return handlers; + } + /** * A list of reasons why the event may have been fired */ @@ -64,27 +90,4 @@ public class McMMOPartyAllianceChangeEvent extends PlayerEvent implements Cancel */ CUSTOM; } - - /** Following are required for Cancellable **/ - @Override - public boolean isCancelled() { - return cancelled; - } - - @Override - public void setCancelled(boolean cancelled) { - this.cancelled = cancelled; - } - - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - - @Override - public HandlerList getHandlers() { - return handlers; - } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyChangeEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyChangeEvent.java index f2d3f537e..00fea8f2c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyChangeEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyChangeEvent.java @@ -9,6 +9,10 @@ import org.bukkit.event.player.PlayerEvent; * Called when a player attempts to join, leave, or change parties. */ public class McMMOPartyChangeEvent extends PlayerEvent implements Cancellable { + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); private String oldParty; private String newParty; private EventReason reason; @@ -27,6 +31,10 @@ public class McMMOPartyChangeEvent extends PlayerEvent implements Cancellable { this.cancelled = false; } + public static HandlerList getHandlerList() { + return handlers; + } + /** * @return The party being left, or null if the player was not in a party */ @@ -48,6 +56,24 @@ public class McMMOPartyChangeEvent extends PlayerEvent implements Cancellable { return reason; } + /** + * Following are required for Cancellable + **/ + @Override + public boolean isCancelled() { + return cancelled; + } + + @Override + public void setCancelled(boolean cancelled) { + this.cancelled = cancelled; + } + + @Override + public HandlerList getHandlers() { + return handlers; + } + /** * A list of reasons why the event may have been fired */ @@ -77,27 +103,4 @@ public class McMMOPartyChangeEvent extends PlayerEvent implements Cancellable { */ CUSTOM; } - - /** Following are required for Cancellable **/ - @Override - public boolean isCancelled() { - return cancelled; - } - - @Override - public void setCancelled(boolean cancelled) { - this.cancelled = cancelled; - } - - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - - @Override - public HandlerList getHandlers() { - return handlers; - } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyLevelUpEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyLevelUpEvent.java index 521a10d5e..78ade045c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyLevelUpEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyLevelUpEvent.java @@ -6,6 +6,10 @@ import org.bukkit.event.Event; import org.bukkit.event.HandlerList; public class McMMOPartyLevelUpEvent extends Event implements Cancellable { + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); private Party party; private int levelsChanged; private boolean cancelled; @@ -16,6 +20,10 @@ public class McMMOPartyLevelUpEvent extends Event implements Cancellable { this.cancelled = false; } + public static HandlerList getHandlerList() { + return handlers; + } + public Party getParty() { return party; } @@ -28,7 +36,9 @@ public class McMMOPartyLevelUpEvent extends Event implements Cancellable { this.levelsChanged = levelsChanged; } - /** Following are required for Cancellable **/ + /** + * Following are required for Cancellable + **/ @Override public boolean isCancelled() { return cancelled; @@ -39,15 +49,8 @@ public class McMMOPartyLevelUpEvent extends Event implements Cancellable { this.cancelled = cancelled; } - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyTeleportEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyTeleportEvent.java index 9bc1fe1ee..7139e3264 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyTeleportEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyTeleportEvent.java @@ -8,6 +8,10 @@ import org.bukkit.event.player.PlayerTeleportEvent; * Called just before a player teleports using the /ptp command. */ public class McMMOPartyTeleportEvent extends PlayerTeleportEvent { + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); private String party; private Player target; @@ -17,6 +21,10 @@ public class McMMOPartyTeleportEvent extends PlayerTeleportEvent { this.target = target; } + public static HandlerList getHandlerList() { + return handlers; + } + /** * @return The party the teleporting player is in */ @@ -31,15 +39,8 @@ public class McMMOPartyTeleportEvent extends PlayerTeleportEvent { return target; } - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyXpGainEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyXpGainEvent.java index 91f76c6c0..2854ac512 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyXpGainEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/party/McMMOPartyXpGainEvent.java @@ -6,6 +6,10 @@ import org.bukkit.event.Event; import org.bukkit.event.HandlerList; public class McMMOPartyXpGainEvent extends Event implements Cancellable { + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); private Party party; private float xpGained; private boolean cancelled; @@ -16,6 +20,10 @@ public class McMMOPartyXpGainEvent extends Event implements Cancellable { this.cancelled = false; } + public static HandlerList getHandlerList() { + return handlers; + } + public Party getParty() { return party; } @@ -27,6 +35,13 @@ public class McMMOPartyXpGainEvent extends Event implements Cancellable { return xpGained; } + /** + * @param xpGained set amount of experience gained in this event + */ + public void setRawXpGained(float xpGained) { + this.xpGained = xpGained; + } + /** * @return int amount of experience gained in this event */ @@ -35,13 +50,6 @@ public class McMMOPartyXpGainEvent extends Event implements Cancellable { return (int) xpGained; } - /** - * @param xpGained set amount of experience gained in this event - */ - public void setRawXpGained(float xpGained) { - this.xpGained = xpGained; - } - /** * @param xpGained set int amount of experience gained in this event */ @@ -50,7 +58,9 @@ public class McMMOPartyXpGainEvent extends Event implements Cancellable { this.xpGained = xpGained; } - /** Following are required for Cancellable **/ + /** + * Following are required for Cancellable + **/ @Override public boolean isCancelled() { return cancelled; @@ -61,15 +71,8 @@ public class McMMOPartyXpGainEvent extends Event implements Cancellable { this.cancelled = cancelled; } - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardEvent.java index 44a22538b..b7b608716 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardEvent.java @@ -11,24 +11,31 @@ import org.bukkit.scoreboard.Scoreboard; */ abstract public class McMMOScoreboardEvent extends Event { - protected Scoreboard targetBoard; //Scoreboard involved in this event + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); final Scoreboard currentBoard; //Can be null + private final ScoreboardEventReason scoreboardEventReason; + protected Scoreboard targetBoard; //Scoreboard involved in this event protected Player targetPlayer; - private final ScoreboardEventReason scoreboardEventReason; + /** GETTER & SETTER BOILERPLATE **/ - public McMMOScoreboardEvent(Scoreboard targetBoard, Scoreboard currentBoard, Player targetPlayer, ScoreboardEventReason scoreboardEventReason) - { + public McMMOScoreboardEvent(Scoreboard targetBoard, Scoreboard currentBoard, Player targetPlayer, ScoreboardEventReason scoreboardEventReason) { this.scoreboardEventReason = scoreboardEventReason; this.targetBoard = targetBoard; this.currentBoard = currentBoard; this.targetPlayer = targetPlayer; } - /** GETTER & SETTER BOILERPLATE **/ + public static HandlerList getHandlerList() { + return handlers; + } /** * This is the scoreboard the player will be assigned to after this event + * * @return the target board to assign the player after this event fires */ public Scoreboard getTargetBoard() { @@ -37,6 +44,7 @@ abstract public class McMMOScoreboardEvent extends Event { /** * Change the scoreboard that the player will be assigned to after this event fires + * * @param targetBoard the new board to assign the player to */ public void setTargetBoard(Scoreboard targetBoard) { @@ -45,15 +53,26 @@ abstract public class McMMOScoreboardEvent extends Event { /** * The player involved in this event (this can be changed) + * * @return the player involved in this event */ public Player getTargetPlayer() { return targetPlayer; } + /** + * Change the target player for this event + * + * @param targetPlayer the new target for this event + */ + public void setTargetPlayer(Player targetPlayer) { + this.targetPlayer = targetPlayer; + } + /** * This is the scoreboard the player is currently assigned to at the time the event was fired * Grabbed via player.getScoreboard() + * * @return players current scoreboard */ public Scoreboard getCurrentBoard() { @@ -62,29 +81,15 @@ abstract public class McMMOScoreboardEvent extends Event { /** * The ENUM defining the reason for this event + * * @return the reason for this event */ public ScoreboardEventReason getScoreboardEventReason() { return scoreboardEventReason; } - /** - * Change the target player for this event - * @param targetPlayer the new target for this event - */ - public void setTargetPlayer(Player targetPlayer) { - this.targetPlayer = targetPlayer; - } - - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardObjectiveEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardObjectiveEvent.java index 2f883f19e..41ffb01a2 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardObjectiveEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/scoreboard/McMMOScoreboardObjectiveEvent.java @@ -6,10 +6,9 @@ import org.bukkit.scoreboard.Objective; import org.bukkit.scoreboard.Scoreboard; public class McMMOScoreboardObjectiveEvent extends McMMOScoreboardEvent implements Cancellable { - protected boolean cancelled; - - protected Objective targetObjective; protected final ScoreboardObjectiveEventReason objectiveEventReason; + protected boolean cancelled; + protected Objective targetObjective; public McMMOScoreboardObjectiveEvent(Objective targetObjective, ScoreboardObjectiveEventReason objectiveEventReason, Scoreboard scoreboard, Scoreboard oldboard, Player targetPlayer, ScoreboardEventReason scoreboardEventReason) { super(scoreboard, oldboard, targetPlayer, scoreboardEventReason); @@ -20,6 +19,7 @@ public class McMMOScoreboardObjectiveEvent extends McMMOScoreboardEvent implemen /** * The objective that will be modified by this event + * * @return */ public Objective getTargetObjective() { @@ -28,6 +28,7 @@ public class McMMOScoreboardObjectiveEvent extends McMMOScoreboardEvent implemen /** * Change the target objective for this event + * * @param newObjective new target objective */ public void setTargetObjective(Objective newObjective) { diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerNotificationEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerNotificationEvent.java index cc71c4f54..046eb65d8 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerNotificationEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerNotificationEvent.java @@ -12,6 +12,10 @@ import org.bukkit.event.player.PlayerEvent; * This event is sent for when mcMMO informs a player about various important information */ public class McMMOPlayerNotificationEvent extends PlayerEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + protected final NotificationType notificationType; + protected ChatMessageType chatMessageType; + protected TextComponent notificationTextComponent; private boolean isCancelled; /* * Messages can be sent to both places, as configured in advanced.yml @@ -20,12 +24,6 @@ public class McMMOPlayerNotificationEvent extends PlayerEvent implements Cancell */ private boolean isMessageAlsoBeingSentToChat; - private static final HandlerList handlers = new HandlerList(); - protected ChatMessageType chatMessageType; - - protected TextComponent notificationTextComponent; - protected final NotificationType notificationType; - public McMMOPlayerNotificationEvent(Player who, NotificationType notificationType, TextComponent notificationTextComponent, ChatMessageType chatMessageType, boolean isMessageAlsoBeingSentToChat) { super(who); this.notificationType = notificationType; @@ -39,6 +37,10 @@ public class McMMOPlayerNotificationEvent extends PlayerEvent implements Cancell * Getters & Setters */ + public static HandlerList getHandlerList() { + return handlers; + } + public boolean isMessageAlsoBeingSentToChat() { return isMessageAlsoBeingSentToChat; } @@ -63,27 +65,24 @@ public class McMMOPlayerNotificationEvent extends PlayerEvent implements Cancell this.chatMessageType = chatMessageType; } + /* + * Custom Event Boilerplate + */ + /** * The notification type for this event + * * @return this event's notification type */ public NotificationType getEventNotificationType() { return notificationType; } - /* - * Custom Event Boilerplate - */ - @Override public HandlerList getHandlers() { return handlers; } - public static HandlerList getHandlerList() { - return handlers; - } - /* * Cancellable Interface Boilerplate */ diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java index 96f1ceb4e..0bcafac90 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/McMMOPlayerSkillEvent.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.events.skills; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.skills.PrimarySkillType; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; import org.bukkit.event.player.PlayerEvent; @@ -10,6 +10,10 @@ import org.bukkit.event.player.PlayerEvent; * Generic event for mcMMO skill handling. */ public abstract class McMMOPlayerSkillEvent extends PlayerEvent { + /** + * Rest of file is required boilerplate for custom events + **/ + private static final HandlerList handlers = new HandlerList(); protected PrimarySkillType skill; protected int skillLevel; @@ -19,6 +23,10 @@ public abstract class McMMOPlayerSkillEvent extends PlayerEvent { this.skillLevel = UserManager.getPlayer(player).getSkillLevel(skill); } + public static HandlerList getHandlerList() { + return handlers; + } + /** * @return The skill involved in this event */ @@ -33,15 +41,8 @@ public abstract class McMMOPlayerSkillEvent extends PlayerEvent { return skillLevel; } - /** Rest of file is required boilerplate for custom events **/ - private static final HandlerList handlers = new HandlerList(); - @Override public HandlerList getHandlers() { return handlers; } - - public static HandlerList getHandlerList() { - return handlers; - } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/repair/McMMOPlayerRepairCheckEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/repair/McMMOPlayerRepairCheckEvent.java index 9cd0733a7..1ce52a60c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/repair/McMMOPlayerRepairCheckEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/repair/McMMOPlayerRepairCheckEvent.java @@ -44,7 +44,9 @@ public class McMMOPlayerRepairCheckEvent extends McMMOPlayerSkillEvent implement return repairedObject; } - /** Following are required for Cancellable **/ + /** + * Following are required for Cancellable + **/ @Override public boolean isCancelled() { return cancelled; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java index a1a6567e9..7a379de9d 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/salvage/McMMOPlayerSalvageCheckEvent.java @@ -44,7 +44,9 @@ public class McMMOPlayerSalvageCheckEvent extends McMMOPlayerSkillEvent implemen return enchantedBook; } - /** Following are required for Cancellable **/ + /** + * Following are required for Cancellable + **/ @Override public boolean isCancelled() { return cancelled; diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillEvent.java index 3454c9826..3cbb74d4b 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillEvent.java @@ -13,7 +13,8 @@ public class SubSkillEvent extends McMMOPlayerSkillEvent implements Cancellable /** * Only skills using the old system will fire this event - * @param player target player + * + * @param player target player * @param subSkillType target subskill * @Deprecated Skills will be using a new system stemming from the AbstractSubSkill class so make sure you check for both events, this event will be removed eventually. */ @@ -23,13 +24,13 @@ public class SubSkillEvent extends McMMOPlayerSkillEvent implements Cancellable this.subSkillType = subSkillType; } - public SubSkillEvent(Player player, AbstractSubSkill abstractSubSkill) - { + public SubSkillEvent(Player player, AbstractSubSkill abstractSubSkill) { super(player, abstractSubSkill.getPrimarySkill()); } /** * Gets the SubSkillType involved in the event + * * @return the SubSkillType */ public SubSkillType getSubSkillType() { diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java index 00073617f..2815cbfa4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/secondaryabilities/SubSkillRandomCheckEvent.java @@ -12,8 +12,7 @@ public class SubSkillRandomCheckEvent extends SubSkillEvent { this.chance = chance; } - public SubSkillRandomCheckEvent(Player player, AbstractSubSkill abstractSubSkill, double chance) - { + public SubSkillRandomCheckEvent(Player player, AbstractSubSkill abstractSubSkill, double chance) { super(player, abstractSubSkill); this.chance = chance; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/events/skills/unarmed/McMMOPlayerDisarmEvent.java b/bukkit/src/main/java/com/gmail/nossr50/events/skills/unarmed/McMMOPlayerDisarmEvent.java index c363f2c78..e401c1382 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/events/skills/unarmed/McMMOPlayerDisarmEvent.java +++ b/bukkit/src/main/java/com/gmail/nossr50/events/skills/unarmed/McMMOPlayerDisarmEvent.java @@ -18,7 +18,9 @@ public class McMMOPlayerDisarmEvent extends McMMOPlayerSkillEvent implements Can return defender; } - /** Following are required for Cancellable **/ + /** + * Following are required for Cancellable + **/ @Override public boolean isCancelled() { return cancelled; diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index 7ff911060..e5205b7d7 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -1,34 +1,34 @@ package com.gmail.nossr50.listeners; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.config.skills.HiddenConfig; import com.gmail.nossr50.core.config.skills.WorldBlacklist; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.core.skills.ToolType; -import com.gmail.nossr50.events.fake.FakeBlockBreakEvent; -import com.gmail.nossr50.events.fake.FakeBlockDamageEvent; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.core.skills.child.salvage.Salvage; import com.gmail.nossr50.core.skills.primary.alchemy.Alchemy; import com.gmail.nossr50.core.skills.primary.excavation.ExcavationManager; import com.gmail.nossr50.core.skills.primary.herbalism.Herbalism; import com.gmail.nossr50.core.skills.primary.herbalism.HerbalismManager; import com.gmail.nossr50.core.skills.primary.mining.MiningManager; import com.gmail.nossr50.core.skills.primary.repair.Repair; -import com.gmail.nossr50.core.skills.child.salvage.Salvage; import com.gmail.nossr50.core.skills.primary.woodcutting.WoodcuttingManager; import com.gmail.nossr50.core.util.BlockUtils; import com.gmail.nossr50.core.util.EventUtils; import com.gmail.nossr50.core.util.ItemUtils; import com.gmail.nossr50.core.util.Permissions; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.SkillUtils; import com.gmail.nossr50.core.util.sounds.SoundManager; import com.gmail.nossr50.core.util.sounds.SoundType; import com.gmail.nossr50.core.worldguard.WorldGuardManager; import com.gmail.nossr50.core.worldguard.WorldGuardUtils; +import com.gmail.nossr50.events.fake.FakeBlockBreakEvent; +import com.gmail.nossr50.events.fake.FakeBlockDamageEvent; +import com.gmail.nossr50.mcMMO; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; @@ -62,7 +62,7 @@ public class BlockListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onBlockPistonExtend(BlockPistonExtendEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; BlockFace direction = event.getDirection(); @@ -85,7 +85,7 @@ public class BlockListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onBlockPistonRetract(BlockPistonRetractEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; // Get opposite direction so we get correct block @@ -105,14 +105,12 @@ public class BlockListener implements Listener { * @param event The event to watch */ @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) - public void onEntityBlockFormEvent(EntityBlockFormEvent event) - { + public void onEntityBlockFormEvent(EntityBlockFormEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; - if(BlockUtils.shouldBeWatched(event.getBlock().getState())) - { + if (BlockUtils.shouldBeWatched(event.getBlock().getState())) { mcMMO.getPlaceStore().setTrue(event.getBlock()); } } @@ -125,14 +123,14 @@ public class BlockListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onFallingBlock(EntityChangeBlockEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; if (BlockUtils.shouldBeWatched(event.getBlock().getState()) && event.getEntityType().equals(EntityType.FALLING_BLOCK)) { if (event.getTo().equals(Material.AIR) && mcMMO.getPlaceStore().isTrue(event.getBlock())) { - event.getEntity().setMetadata("mcMMOBlockFall", new FixedMetadataValue( plugin, event.getBlock().getLocation())); + event.getEntity().setMetadata("mcMMOBlockFall", new FixedMetadataValue(plugin, event.getBlock().getLocation())); } else { - List values = event.getEntity().getMetadata( "mcMMOBlockFall" ); + List values = event.getEntity().getMetadata("mcMMOBlockFall"); if (!values.isEmpty()) { @@ -140,8 +138,8 @@ public class BlockListener implements Listener { Block spawn = ((org.bukkit.Location) values.get(0).value()).getBlock(); - mcMMO.getPlaceStore().setTrue( event.getBlock() ); - mcMMO.getPlaceStore().setFalse( spawn ); + mcMMO.getPlaceStore().setTrue(event.getBlock()); + mcMMO.getPlaceStore().setFalse(spawn); } } @@ -156,7 +154,7 @@ public class BlockListener implements Listener { @EventHandler(priority = EventPriority.MONITOR) public void onBlockPlace(BlockPlaceEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; Player player = event.getPlayer(); @@ -178,8 +176,7 @@ public class BlockListener implements Listener { if (blockState.getType() == Repair.anvilMaterial && PrimarySkillType.REPAIR.getPermissions(player)) { mcMMOPlayer.getRepairManager().placedAnvilCheck(); - } - else if (blockState.getType() == Salvage.anvilMaterial && PrimarySkillType.SALVAGE.getPermissions(player)) { + } else if (blockState.getType() == Salvage.anvilMaterial && PrimarySkillType.SALVAGE.getPermissions(player)) { mcMMOPlayer.getSalvageManager().placedAnvilCheck(); } } @@ -192,7 +189,7 @@ public class BlockListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onBlockMultiPlace(BlockMultiPlaceEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; Player player = event.getPlayer(); @@ -201,8 +198,7 @@ public class BlockListener implements Listener { return; } - for (BlockState replacedBlockState : event.getReplacedBlockStates()) - { + for (BlockState replacedBlockState : event.getReplacedBlockStates()) { BlockState blockState = replacedBlockState.getBlock().getState(); /* Check if the blocks placed should be monitored so they do not give out XP in the future */ @@ -213,10 +209,9 @@ public class BlockListener implements Listener { } @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) - public void onBlockGrow(BlockGrowEvent event) - { + public void onBlockGrow(BlockGrowEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; BlockState blockState = event.getBlock().getState(); @@ -236,13 +231,12 @@ public class BlockListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onBlockBreak(BlockBreakEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer())) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer())) return; } @@ -300,8 +294,7 @@ public class BlockListener implements Listener { WoodcuttingManager woodcuttingManager = mcMMOPlayer.getWoodcuttingManager(); if (woodcuttingManager.canUseTreeFeller(heldItem)) { woodcuttingManager.processTreeFeller(blockState); - } - else { + } else { woodcuttingManager.woodcuttingBlockCheck(blockState); } } @@ -328,13 +321,12 @@ public class BlockListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onBlockBreakHigher(BlockBreakEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer())) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer())) return; } @@ -363,8 +355,7 @@ public class BlockListener implements Listener { if (herbalismManager.processHylianLuck(blockState)) { blockState.update(true); event.setCancelled(true); - } - else if (blockState.getType() == Material.FLOWER_POT) { + } else if (blockState.getType() == Material.FLOWER_POT) { blockState.setType(Material.AIR); blockState.update(true); event.setCancelled(true); @@ -394,13 +385,12 @@ public class BlockListener implements Listener { BlockState blockState = event.getBlock().getState(); /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer())) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer())) return; } @@ -423,17 +413,13 @@ public class BlockListener implements Listener { if (mcMMOPlayer.getToolPreparationMode(ToolType.HOE) && ItemUtils.isHoe(heldItem) && (BlockUtils.affectedByGreenTerra(blockState) || BlockUtils.canMakeMossy(blockState)) && Permissions.greenTerra(player)) { mcMMOPlayer.checkAbilityActivation(PrimarySkillType.HERBALISM); - } - else if (mcMMOPlayer.getToolPreparationMode(ToolType.AXE) && ItemUtils.isAxe(heldItem) && BlockUtils.isLog(blockState) && Permissions.treeFeller(player)) { + } else if (mcMMOPlayer.getToolPreparationMode(ToolType.AXE) && ItemUtils.isAxe(heldItem) && BlockUtils.isLog(blockState) && Permissions.treeFeller(player)) { mcMMOPlayer.checkAbilityActivation(PrimarySkillType.WOODCUTTING); - } - else if (mcMMOPlayer.getToolPreparationMode(ToolType.PICKAXE) && ItemUtils.isPickaxe(heldItem) && BlockUtils.affectedBySuperBreaker(blockState) && Permissions.superBreaker(player)) { + } else if (mcMMOPlayer.getToolPreparationMode(ToolType.PICKAXE) && ItemUtils.isPickaxe(heldItem) && BlockUtils.affectedBySuperBreaker(blockState) && Permissions.superBreaker(player)) { mcMMOPlayer.checkAbilityActivation(PrimarySkillType.MINING); - } - else if (mcMMOPlayer.getToolPreparationMode(ToolType.SHOVEL) && ItemUtils.isShovel(heldItem) && BlockUtils.affectedByGigaDrillBreaker(blockState) && Permissions.gigaDrillBreaker(player)) { + } else if (mcMMOPlayer.getToolPreparationMode(ToolType.SHOVEL) && ItemUtils.isShovel(heldItem) && BlockUtils.affectedByGigaDrillBreaker(blockState) && Permissions.gigaDrillBreaker(player)) { mcMMOPlayer.checkAbilityActivation(PrimarySkillType.EXCAVATION); - } - else if (mcMMOPlayer.getToolPreparationMode(ToolType.FISTS) && heldItem.getType() == Material.AIR && (BlockUtils.affectedByGigaDrillBreaker(blockState) || blockState.getType() == Material.SNOW || BlockUtils.affectedByBlockCracker(blockState) && Permissions.berserk(player))) { + } else if (mcMMOPlayer.getToolPreparationMode(ToolType.FISTS) && heldItem.getType() == Material.AIR && (BlockUtils.affectedByGigaDrillBreaker(blockState) || blockState.getType() == Material.SNOW || BlockUtils.affectedByBlockCracker(blockState) && Permissions.berserk(player))) { mcMMOPlayer.checkAbilityActivation(PrimarySkillType.UNARMED); } } @@ -466,13 +452,12 @@ public class BlockListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onBlockDamageHigher(BlockDamageEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer())) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer())) return; } @@ -500,19 +485,16 @@ public class BlockListener implements Listener { if (mcMMOPlayer.getHerbalismManager().processGreenTerra(blockState)) { blockState.update(true); } - } - else if (mcMMOPlayer.getAbilityMode(SuperAbilityType.BERSERK) && heldItem.getType() == Material.AIR) { + } else if (mcMMOPlayer.getAbilityMode(SuperAbilityType.BERSERK) && heldItem.getType() == Material.AIR) { if (SuperAbilityType.BERSERK.blockCheck(block.getState()) && EventUtils.simulateBlockBreak(block, player, true)) { event.setInstaBreak(true); SoundManager.sendSound(player, block.getLocation(), SoundType.POP); - } - else if (mcMMOPlayer.getUnarmedManager().canUseBlockCracker() && BlockUtils.affectedByBlockCracker(blockState) && EventUtils.simulateBlockBreak(block, player, true)) { + } else if (mcMMOPlayer.getUnarmedManager().canUseBlockCracker() && BlockUtils.affectedByBlockCracker(blockState) && EventUtils.simulateBlockBreak(block, player, true)) { if (mcMMOPlayer.getUnarmedManager().blockCrackerCheck(blockState)) { blockState.update(); } } - } - else if (mcMMOPlayer.getWoodcuttingManager().canUseLeafBlower(heldItem) && BlockUtils.isLeaves(blockState) && EventUtils.simulateBlockBreak(block, player, true)) { + } else if (mcMMOPlayer.getWoodcuttingManager().canUseLeafBlower(heldItem) && BlockUtils.isLeaves(blockState) && EventUtils.simulateBlockBreak(block, player, true)) { event.setInstaBreak(true); SoundManager.sendSound(player, block.getLocation(), SoundType.POP); } @@ -532,46 +514,39 @@ public class BlockListener implements Listener { } public void debugStickDump(Player player, BlockState blockState) { - if(player.getInventory().getItemInMainHand().getType() == Material.DEBUG_STICK) - { - if(mcMMO.getPlaceStore().isTrue(blockState)) + if (player.getInventory().getItemInMainHand().getType() == Material.DEBUG_STICK) { + if (mcMMO.getPlaceStore().isTrue(blockState)) player.sendMessage("[mcMMO DEBUG] This block is not natural and does not reward treasures/XP"); - else - { + else { player.sendMessage("[mcMMO DEBUG] This block is considered natural by mcMMO"); UserManager.getPlayer(player).getExcavationManager().printExcavationDebug(player, blockState); } - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (WorldGuardManager.getInstance().hasMainFlag(player)) player.sendMessage("[mcMMO DEBUG] World Guard main flag is permitted for this player in this region"); else player.sendMessage("[mcMMO DEBUG] World Guard main flag is DENIED for this player in this region"); - if(WorldGuardManager.getInstance().hasXPFlag(player)) + if (WorldGuardManager.getInstance().hasXPFlag(player)) player.sendMessage("[mcMMO DEBUG] World Guard xp flag is permitted for this player in this region"); else player.sendMessage("[mcMMO DEBUG] World Guard xp flag is not permitted for this player in this region"); } - if(blockState instanceof Furnace) - { + if (blockState instanceof Furnace) { Furnace furnace = (Furnace) blockState; - if(furnace.hasMetadata(mcMMO.furnaceMetadataKey)) - { + if (furnace.hasMetadata(mcMMO.furnaceMetadataKey)) { player.sendMessage("[mcMMO DEBUG] This furnace has a registered owner"); Player furnacePlayer = getPlayerFromFurnace(furnace.getBlock()); - if(furnacePlayer != null) - { - player.sendMessage("[mcMMO DEBUG] This furnace is owned by player "+furnacePlayer.getName()); + if (furnacePlayer != null) { + player.sendMessage("[mcMMO DEBUG] This furnace is owned by player " + furnacePlayer.getName()); } - } - else + } else player.sendMessage("[mcMMO DEBUG] This furnace does not have a registered owner"); } - if(ExperienceConfig.getInstance().isExperienceBarsEnabled()) + if (ExperienceConfig.getInstance().isExperienceBarsEnabled()) player.sendMessage("[mcMMO DEBUG] XP bars are enabled, however you should check per-skill settings to make sure those are enabled."); } } diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 5ee64bf7c..59742142c 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -1,31 +1,31 @@ package com.gmail.nossr50.listeners; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.config.skills.WorldBlacklist; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.meta.OldName; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.skills.subskills.interfaces.InteractType; -import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent; -import com.gmail.nossr50.events.fake.FakeEntityDamageEvent; -import com.gmail.nossr50.events.fake.FakeEntityTameEvent; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.party.PartyManager; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.primary.archery.Archery; import com.gmail.nossr50.core.skills.primary.fishing.Fishing; import com.gmail.nossr50.core.skills.primary.mining.BlastMining; import com.gmail.nossr50.core.skills.primary.mining.MiningManager; import com.gmail.nossr50.core.skills.primary.taming.Taming; import com.gmail.nossr50.core.skills.primary.taming.TamingManager; +import com.gmail.nossr50.core.skills.subskills.interfaces.InteractType; import com.gmail.nossr50.core.util.BlockUtils; import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.core.util.Permissions; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.CombatUtils; import com.gmail.nossr50.core.worldguard.WorldGuardManager; import com.gmail.nossr50.core.worldguard.WorldGuardUtils; +import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent; +import com.gmail.nossr50.events.fake.FakeEntityDamageEvent; +import com.gmail.nossr50.events.fake.FakeEntityTameEvent; +import com.gmail.nossr50.mcMMO; import org.bukkit.Material; import org.bukkit.OfflinePlayer; import org.bukkit.block.Block; @@ -55,15 +55,13 @@ public class EntityListener implements Listener { } @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) - public void onEntityTargetEntity(EntityTargetLivingEntityEvent event) - { - if(!ExperienceConfig.getInstance().isEndermanEndermiteFarmingPrevented()) + public void onEntityTargetEntity(EntityTargetLivingEntityEvent event) { + if (!ExperienceConfig.getInstance().isEndermanEndermiteFarmingPrevented()) return; //Prevent entities from giving XP if they target endermite - if(event.getTarget() instanceof Endermite) - { - if(event.getEntity().getMetadata(mcMMO.entityMetadataKey) == null || event.getEntity().getMetadata(mcMMO.entityMetadataKey).size() <= 0) + if (event.getTarget() instanceof Endermite) { + if (event.getEntity().getMetadata(mcMMO.entityMetadataKey) == null || event.getEntity().getMetadata(mcMMO.entityMetadataKey).size() <= 0) event.getEntity().setMetadata(mcMMO.entityMetadataKey, mcMMO.metadataValue); } } @@ -71,17 +69,15 @@ public class EntityListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onEntityShootBow(EntityShootBowEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; - if(event.getEntity() instanceof Player) - { + if (event.getEntity() instanceof Player) { Player player = (Player) event.getEntity(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } } @@ -105,17 +101,15 @@ public class EntityListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onProjectileLaunch(ProjectileLaunchEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; - if(event.getEntity() instanceof Player) - { + if (event.getEntity() instanceof Player) { Player player = (Player) event.getEntity(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } } @@ -133,13 +127,12 @@ public class EntityListener implements Listener { /** * Monitor EntityChangeBlock events. * - * @param event - * The event to watch + * @param event The event to watch */ @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onEntityChangeBlock(EntityChangeBlockEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; Block block = event.getBlock(); @@ -159,14 +152,12 @@ public class EntityListener implements Listener { if (mcMMO.getPlaceStore().isTrue(block) && !isTracked) { mcMMO.getPlaceStore().setFalse(block); entity.setMetadata(mcMMO.entityMetadataKey, mcMMO.metadataValue); - } - else if (isTracked) { + } else if (isTracked) { mcMMO.getPlaceStore().setTrue(block); } } else if ((block.getType() == Material.REDSTONE_ORE)) { return; - } - else { + } else { if (mcMMO.getPlaceStore().isTrue(block)) { mcMMO.getPlaceStore().setFalse(block); } @@ -176,13 +167,12 @@ public class EntityListener implements Listener { /** * Handle EntityDamageByEntity events that involve modifying the event. * - * @param event - * The event to watch + * @param event The event to watch */ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onEntityDamageByEntity(EntityDamageByEntityEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; if (event instanceof FakeEntityDamageByEntityEvent) { @@ -192,9 +182,8 @@ public class EntityListener implements Listener { if (event.getEntity() instanceof ArmorStand) { return; } - - if (event.getDamager().hasMetadata(mcMMO.funfettiMetadataKey)) - { + + if (event.getDamager().hasMetadata(mcMMO.funfettiMetadataKey)) { event.setCancelled(true); return; } @@ -203,14 +192,12 @@ public class EntityListener implements Listener { Entity defender = event.getEntity(); Entity attacker = event.getDamager(); - if(attacker instanceof Player) - { + if (attacker instanceof Player) { Player player = (Player) attacker; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } } @@ -221,7 +208,7 @@ public class EntityListener implements Listener { Player attackingPlayer = (Player) attacker; if (event.getDamage(DamageModifier.ABSORPTION) > 0) { //If friendly fire is off don't allow players to hurt one another - if(!Config.getInstance().getPartyFriendlyFire()) + if (!Config.getInstance().getPartyFriendlyFire()) if ((PartyManager.inSameParty(defendingPlayer, attackingPlayer) || PartyManager.areAllies(defendingPlayer, attackingPlayer)) && !(Permissions.friendlyFire(attackingPlayer) && Permissions.friendlyFire(defendingPlayer))) { event.setCancelled(true); return; @@ -252,7 +239,6 @@ public class EntityListener implements Listener { } - if (Misc.isNPCEntity(attacker)) { return; } @@ -263,15 +249,13 @@ public class EntityListener implements Listener { if (projectileSource instanceof LivingEntity) { attacker = (LivingEntity) projectileSource; } - } - else if (attacker instanceof Tameable) { + } else if (attacker instanceof Tameable) { AnimalTamer animalTamer = ((Tameable) attacker).getOwner(); if (animalTamer != null && ((OfflinePlayer) animalTamer).isOnline()) { attacker = (Entity) animalTamer; } - } - else if (attacker instanceof TNTPrimed && defender instanceof Player) { + } else if (attacker instanceof TNTPrimed && defender instanceof Player) { if (BlastMining.processBlastMiningExplosion(event, (TNTPrimed) attacker, (Player) defender)) { return; } @@ -292,7 +276,7 @@ public class EntityListener implements Listener { } //Party Friendly Fire - if(!Config.getInstance().getPartyFriendlyFire()) + if (!Config.getInstance().getPartyFriendlyFire()) if ((PartyManager.inSameParty(defendingPlayer, attackingPlayer) || PartyManager.areAllies(defendingPlayer, attackingPlayer)) && !(Permissions.friendlyFire(attackingPlayer) && Permissions.friendlyFire(defendingPlayer))) { event.setCancelled(true); return; @@ -305,17 +289,14 @@ public class EntityListener implements Listener { /** * This sets entity names back to whatever they are supposed to be */ - if(!(attacker instanceof Player) && defender instanceof Player) - { - if(event.getFinalDamage() >= ((LivingEntity) defender).getHealth()) - { + if (!(attacker instanceof Player) && defender instanceof Player) { + if (event.getFinalDamage() >= ((LivingEntity) defender).getHealth()) { List metadataValue = attacker.getMetadata("mcMMO_oldName"); - if(metadataValue.size() <= 0) + if (metadataValue.size() <= 0) return; - if(metadataValue != null) - { + if (metadataValue != null) { OldName oldName = (OldName) metadataValue.get(0); attacker.setCustomName(oldName.asString()); attacker.setCustomNameVisible(false); @@ -327,22 +308,19 @@ public class EntityListener implements Listener { /** * Handle EntityDamage events that involve modifying the event. * - * @param event - * The event to modify + * @param event The event to modify */ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onEntityDamage(EntityDamageEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; - if(event.getEntity() instanceof Player) - { + if (event.getEntity() instanceof Player) { Player player = (Player) event.getEntity(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } } @@ -408,19 +386,15 @@ public class EntityListener implements Listener { mcMMOPlayer.actualizeRecentlyHurt(); } - } - - else if (livingEntity instanceof Tameable) { + } else if (livingEntity instanceof Tameable) { Tameable pet = (Tameable) livingEntity; AnimalTamer owner = pet.getOwner(); - if(owner instanceof Player) - { + if (owner instanceof Player) { Player player = (Player) owner; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } } @@ -493,13 +467,12 @@ public class EntityListener implements Listener { /** * Monitor EntityDeath events. * - * @param event - * The event to watch + * @param event The event to watch */ @EventHandler(priority = EventPriority.LOWEST) public void onEntityDeathLowest(EntityDeathEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; LivingEntity entity = event.getEntity(); @@ -526,13 +499,12 @@ public class EntityListener implements Listener { /** * Monitor EntityDeath events. * - * @param event - * The event to watch + * @param event The event to watch */ @EventHandler(priority = EventPriority.MONITOR) public void onEntityDeath(EntityDeathEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; LivingEntity entity = event.getEntity(); @@ -547,13 +519,12 @@ public class EntityListener implements Listener { /** * Monitor CreatureSpawn events. * - * @param event - * The event to watch + * @param event The event to watch */ @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onCreatureSpawn(CreatureSpawnEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; LivingEntity entity = event.getEntity(); @@ -583,13 +554,12 @@ public class EntityListener implements Listener { /** * Handle ExplosionPrime events that involve modifying the event. * - * @param event - * The event to modify + * @param event The event to modify */ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onExplosionPrime(ExplosionPrimeEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; Entity entity = event.getEntity(); @@ -607,9 +577,8 @@ public class EntityListener implements Listener { } /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -623,13 +592,12 @@ public class EntityListener implements Listener { /** * Handle EntityExplode events that involve modifying the event. * - * @param event - * The event to modify + * @param event The event to modify */ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onEnitityExplode(EntityExplodeEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; Entity entity = event.getEntity(); @@ -647,9 +615,8 @@ public class EntityListener implements Listener { } /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -664,13 +631,12 @@ public class EntityListener implements Listener { /** * Handle EntityExplode events that involve modifying the event. * - * @param event - * The event to modify + * @param event The event to modify */ @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onEntityExplodeMonitor(EntityExplodeEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; Entity entity = event.getEntity(); @@ -685,13 +651,12 @@ public class EntityListener implements Listener { /** * Handle FoodLevelChange events that involve modifying the event. * - * @param event - * The event to modify + * @param event The event to modify */ @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onFoodLevelChange(FoodLevelChangeEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; Entity entity = event.getEntity(); @@ -703,9 +668,8 @@ public class EntityListener implements Listener { Player player = (Player) entity; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -728,27 +692,27 @@ public class EntityListener implements Listener { */ switch (player.getInventory().getItemInMainHand().getType()) { case BAKED_POTATO: /* - * RESTORES 3 HUNGER - RESTORES 5 1/2 HUNGER @ - * 1000 - */ + * RESTORES 3 HUNGER - RESTORES 5 1/2 HUNGER @ + * 1000 + */ case BEETROOT: case BREAD: /* RESTORES 2 1/2 HUNGER - RESTORES 5 HUNGER @ 1000 */ case CARROT: /* - * RESTORES 2 HUNGER - RESTORES 4 1/2 HUNGER @ - * 1000 - */ + * RESTORES 2 HUNGER - RESTORES 4 1/2 HUNGER @ + * 1000 + */ case GOLDEN_CARROT: /* - * RESTORES 3 HUNGER - RESTORES 5 1/2 HUNGER @ - * 1000 - */ + * RESTORES 3 HUNGER - RESTORES 5 1/2 HUNGER @ + * 1000 + */ case MUSHROOM_STEW: /* - * RESTORES 4 HUNGER - RESTORES 6 1/2 HUNGER @ - * 1000 - */ + * RESTORES 4 HUNGER - RESTORES 6 1/2 HUNGER @ + * 1000 + */ case PUMPKIN_PIE: /* - * RESTORES 4 HUNGER - RESTORES 6 1/2 HUNGER @ - * 1000 - */ + * RESTORES 4 HUNGER - RESTORES 6 1/2 HUNGER @ + * 1000 + */ if (Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_FARMERS_DIET)) { event.setFoodLevel(UserManager.getPlayer(player).getHerbalismManager().farmersDiet(newFoodLevel)); } @@ -757,9 +721,9 @@ public class EntityListener implements Listener { case COOKIE: /* RESTORES 1/2 HUNGER - RESTORES 2 HUNGER @ 1000 */ case MELON_SLICE: /* RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER @ 1000 */ case POISONOUS_POTATO: /* - * RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER - * @ 1000 - */ + * RESTORES 1 HUNGER - RESTORES 2 1/2 HUNGER + * @ 1000 + */ case POTATO: /* RESTORES 1/2 HUNGER - RESTORES 2 HUNGER @ 1000 */ if (Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_FARMERS_DIET)) { event.setFoodLevel(UserManager.getPlayer(player).getHerbalismManager().farmersDiet(newFoodLevel)); @@ -767,9 +731,9 @@ public class EntityListener implements Listener { return; case COOKED_SALMON: /* - * RESTORES 2 1/2 HUNGER - RESTORES 5 HUNGER @ - * 1000 - */ + * RESTORES 2 1/2 HUNGER - RESTORES 5 HUNGER @ + * 1000 + */ if (Permissions.isSubSkillEnabled(player, SubSkillType.FISHING_FISHERMANS_DIET)) { event.setFoodLevel(UserManager.getPlayer(player).getFishingManager().handleFishermanDiet(Fishing.fishermansDietRankLevel1, newFoodLevel)); } @@ -789,13 +753,12 @@ public class EntityListener implements Listener { /** * Monitor EntityTame events. * - * @param event - * The event to watch + * @param event The event to watch */ @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onEntityTame(EntityTameEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; if (event instanceof FakeEntityTameEvent) { @@ -805,9 +768,8 @@ public class EntityListener implements Listener { Player player = (Player) event.getOwner(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -824,13 +786,12 @@ public class EntityListener implements Listener { /** * Handle EntityTarget events. * - * @param event - * The event to process + * @param event The event to process */ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onEntityTarget(EntityTargetEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; Entity entity = event.getEntity(); @@ -843,9 +804,8 @@ public class EntityListener implements Listener { Player player = (Player) target; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -867,13 +827,12 @@ public class EntityListener implements Listener { * Handle PotionSplash events in order to fix broken Splash Potion of * Saturation. * - * @param event - * The event to process + * @param event The event to process */ @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPotionSplash(PotionSplashEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; for (PotionEffect effect : ((PotionMeta) event.getPotion().getItem().getItemMeta()).getCustomEffects()) { @@ -887,11 +846,11 @@ public class EntityListener implements Listener { } } } - + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPigZapEvent(PigZapEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; if (event.getEntity().hasMetadata(mcMMO.entityMetadataKey)) { diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/InteractionManager.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/InteractionManager.java index 71d8d6486..ca29ca3a9 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/InteractionManager.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/InteractionManager.java @@ -17,26 +17,26 @@ public class InteractionManager { /** * Registers subskills with the Interaction registration + * * @param abstractSubSkill the target subskill to register */ - public static void registerSubSkill(AbstractSubSkill abstractSubSkill) - { + public static void registerSubSkill(AbstractSubSkill abstractSubSkill) { /* INIT MAPS */ - if(interactRegister == null) + if (interactRegister == null) interactRegister = new HashMap<>(); - if(subSkillList == null) + if (subSkillList == null) subSkillList = new ArrayList<>(); - if(subSkillNameMap == null) + if (subSkillNameMap == null) subSkillNameMap = new HashMap<>(); //Store a unique copy of each subskill - if(!subSkillList.contains(abstractSubSkill)) + if (!subSkillList.contains(abstractSubSkill)) subSkillList.add(abstractSubSkill); //Init ArrayList - if(interactRegister.get(abstractSubSkill.getInteractType()) == null) + if (interactRegister.get(abstractSubSkill.getInteractType()) == null) interactRegister.put(abstractSubSkill.getInteractType(), new ArrayList<>()); //Registration array reference @@ -48,33 +48,32 @@ public class InteractionManager { String lowerCaseName = abstractSubSkill.getConfigKeyName().toLowerCase(); //Register in name map - if(subSkillNameMap.get(lowerCaseName) == null) + if (subSkillNameMap.get(lowerCaseName) == null) subSkillNameMap.put(lowerCaseName, abstractSubSkill); - System.out.println("[mcMMO] registered subskill: "+ abstractSubSkill.getConfigKeyName()); + System.out.println("[mcMMO] registered subskill: " + abstractSubSkill.getConfigKeyName()); } /** * Grabs the registered abstract skill by its name * Is not case sensitive + * * @param name name of subskill, not case sensitive * @return null if the subskill is not registered */ - public static AbstractSubSkill getAbstractByName(String name) - { + public static AbstractSubSkill getAbstractByName(String name) { return subSkillNameMap.get(name.toLowerCase()); } /** * Processes the associated Interactions for this event - * @param event target event - * @param plugin instance of mcMMO plugin + * + * @param event target event + * @param plugin instance of mcMMO plugin * @param curInteractType the associated interaction type */ - public static void processEvent(Event event, mcMMO plugin, InteractType curInteractType) - { - for(Interaction interaction : interactRegister.get(curInteractType)) - { + public static void processEvent(Event event, mcMMO plugin, InteractType curInteractType) { + for (Interaction interaction : interactRegister.get(curInteractType)) { interaction.doInteraction(event, plugin); } } @@ -82,25 +81,24 @@ public class InteractionManager { /** * Returns the list that contains all unique instances of registered Interaction classes * Interactions are extensions of abstract classes that represent modifying behaviours in Minecraft through events + * * @return the unique collection of all registered Interaction classes */ - public static ArrayList getSubSkillList() - { + public static ArrayList getSubSkillList() { return subSkillList; } - public static boolean hasSubSkill(String name) - { + public static boolean hasSubSkill(String name) { return getAbstractByName(name) != null; } - public static boolean hasSubSkill(SubSkillType subSkillType) - { + public static boolean hasSubSkill(SubSkillType subSkillType) { return hasSubSkill(subSkillType.getNiceNameNoSpaces(subSkillType)); } /** * Returns the associative map which contains all registered interactions + * * @return the interact register */ public static HashMap> getInteractRegister() { diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java index 3f856fb75..c4e071c16 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java @@ -2,19 +2,19 @@ package com.gmail.nossr50.listeners; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.config.skills.WorldBlacklist; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.runnables.player.PlayerUpdateInventoryTask; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.events.fake.FakeBrewEvent; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.runnables.player.PlayerUpdateInventoryTask; import com.gmail.nossr50.core.skills.primary.alchemy.Alchemy; import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyPotionBrewer; import com.gmail.nossr50.core.util.ItemUtils; import com.gmail.nossr50.core.util.Permissions; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.SkillUtils; import com.gmail.nossr50.core.worldguard.WorldGuardManager; import com.gmail.nossr50.core.worldguard.WorldGuardUtils; +import com.gmail.nossr50.events.fake.FakeBrewEvent; +import com.gmail.nossr50.mcMMO; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; @@ -42,7 +42,7 @@ public class InventoryListener implements Listener { @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onInventoryOpen(InventoryOpenEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) return; Block furnaceBlock = processInventoryOpenOrCloseEvent(event.getInventory()); @@ -57,14 +57,14 @@ public class InventoryListener implements Listener { return; } - if(!furnaceBlock.hasMetadata(mcMMO.furnaceMetadataKey) && furnaceBlock.getMetadata(mcMMO.furnaceMetadataKey).size() == 0) + if (!furnaceBlock.hasMetadata(mcMMO.furnaceMetadataKey) && furnaceBlock.getMetadata(mcMMO.furnaceMetadataKey).size() == 0) furnaceBlock.setMetadata(mcMMO.furnaceMetadataKey, UserManager.getPlayer((Player) player).getPlayerMetadata()); } @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onInventoryClose(InventoryCloseEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) return; Block furnaceBlock = processInventoryOpenOrCloseEvent(event.getInventory()); @@ -85,7 +85,7 @@ public class InventoryListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onFurnaceBurnEvent(FurnaceBurnEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; Block furnaceBlock = event.getBlock(); @@ -99,9 +99,8 @@ public class InventoryListener implements Listener { Player player = getPlayerFromFurnace(furnaceBlock); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -115,7 +114,7 @@ public class InventoryListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onFurnaceSmeltEvent(FurnaceSmeltEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; Block furnaceBlock = event.getBlock(); @@ -128,9 +127,8 @@ public class InventoryListener implements Listener { Player player = getPlayerFromFurnace(furnaceBlock); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -144,7 +142,7 @@ public class InventoryListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onFurnaceExtractEvent(FurnaceExtractEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) return; Block furnaceBlock = event.getBlock(); @@ -156,9 +154,8 @@ public class InventoryListener implements Listener { Player player = getPlayerFromFurnace(furnaceBlock); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -173,18 +170,16 @@ public class InventoryListener implements Listener { @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) public void onInventoryClickEventNormal(InventoryClickEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getWhoClicked().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getWhoClicked().getWorld())) return; Inventory inventory = event.getInventory(); - if(event.getWhoClicked() instanceof Player) - { + if (event.getWhoClicked() instanceof Player) { Player player = ((Player) event.getWhoClicked()).getPlayer(); Block furnaceBlock = processInventoryOpenOrCloseEvent(event.getInventory()); - if (furnaceBlock != null) - { + if (furnaceBlock != null) { if (furnaceBlock.getMetadata(mcMMO.furnaceMetadataKey).size() > 0) furnaceBlock.removeMetadata(mcMMO.furnaceMetadataKey, mcMMO.p); @@ -211,9 +206,8 @@ public class InventoryListener implements Listener { Player player = (Player) whoClicked; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -251,8 +245,7 @@ public class InventoryListener implements Listener { default: return; } - } - else if (slot == InventoryType.SlotType.FUEL) { + } else if (slot == InventoryType.SlotType.FUEL) { boolean emptyClicked = AlchemyPotionBrewer.isEmpty(clicked); if (AlchemyPotionBrewer.isEmpty(cursor)) { @@ -262,8 +255,7 @@ public class InventoryListener implements Listener { } AlchemyPotionBrewer.scheduleCheck(player, stand); - } - else if (emptyClicked) { + } else if (emptyClicked) { if (AlchemyPotionBrewer.isValidIngredient(player, cursor)) { int amount = cursor.getAmount(); @@ -274,8 +266,7 @@ public class InventoryListener implements Listener { AlchemyPotionBrewer.scheduleUpdate(inventory); AlchemyPotionBrewer.scheduleCheck(player, stand); - } - else if (click == ClickType.RIGHT) { + } else if (click == ClickType.RIGHT) { event.setCancelled(true); ItemStack one = cursor.clone(); @@ -298,7 +289,7 @@ public class InventoryListener implements Listener { @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) public void onInventoryDragEvent(InventoryDragEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getWhoClicked().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getWhoClicked().getWorld())) return; Inventory inventory = event.getInventory(); @@ -330,9 +321,8 @@ public class InventoryListener implements Listener { Player player = (Player) whoClicked; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -349,10 +339,9 @@ public class InventoryListener implements Listener { // Apparently sometimes vanilla brewing beats our task listener to the actual brew. We handle this by cancelling the vanilla event and finishing our brew ourselves. @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) - public void onBrew(BrewEvent event) - { + public void onBrew(BrewEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) return; if (event instanceof FakeBrewEvent) @@ -367,7 +356,7 @@ public class InventoryListener implements Listener { @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) public void onInventoryMoveItemEvent(InventoryMoveItemEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getSource().getLocation().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getSource().getLocation().getWorld())) return; Inventory inventory = event.getDestination(); @@ -415,7 +404,7 @@ public class InventoryListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onCraftItem(CraftItemEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getWhoClicked().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getWhoClicked().getWorld())) return; final HumanEntity whoClicked = event.getWhoClicked(); @@ -433,9 +422,8 @@ public class InventoryListener implements Listener { Player player = (Player) whoClicked; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 9a15cf63d..7fc4135d4 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -1,35 +1,35 @@ package com.gmail.nossr50.listeners; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.chat.ChatManager; import com.gmail.nossr50.core.chat.ChatManagerFactory; import com.gmail.nossr50.core.chat.PartyChatManager; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.config.skills.WorldBlacklist; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.core.util.*; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.party.ShareHandler; import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.child.salvage.Salvage; +import com.gmail.nossr50.core.skills.child.salvage.SalvageManager; import com.gmail.nossr50.core.skills.primary.fishing.FishingManager; import com.gmail.nossr50.core.skills.primary.herbalism.HerbalismManager; import com.gmail.nossr50.core.skills.primary.mining.MiningManager; import com.gmail.nossr50.core.skills.primary.repair.Repair; import com.gmail.nossr50.core.skills.primary.repair.RepairManager; -import com.gmail.nossr50.core.skills.child.salvage.Salvage; -import com.gmail.nossr50.core.skills.child.salvage.SalvageManager; import com.gmail.nossr50.core.skills.primary.taming.TamingManager; -import com.gmail.nossr50.util.*; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.util.*; import com.gmail.nossr50.core.util.skills.SkillUtils; import com.gmail.nossr50.core.util.sounds.SoundManager; import com.gmail.nossr50.core.util.sounds.SoundType; import com.gmail.nossr50.core.worldguard.WorldGuardManager; import com.gmail.nossr50.core.worldguard.WorldGuardUtils; +import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.util.*; import org.bukkit.GameMode; import org.bukkit.Material; import org.bukkit.block.Block; @@ -63,15 +63,14 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlayerTeleport(PlayerTeleportEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) return; Player player = event.getPlayer(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -94,15 +93,14 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onPlayerDeathLowest(PlayerDeathEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; String deathMessage = event.getDeathMessage(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(event.getEntity())) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(event.getEntity())) return; } @@ -127,7 +125,7 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlayerDeathMonitor(PlayerDeathEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; boolean statLossEnabled = HardcoreManager.isStatLossEnabled(); @@ -146,9 +144,8 @@ public class PlayerListener implements Listener { Player killer = killedPlayer.getKiller(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(killedPlayer)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(killedPlayer)) return; } @@ -202,13 +199,12 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlayerDropItem(PlayerDropItemEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) return; /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer())) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(event.getPlayer())) return; } @@ -233,15 +229,14 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onPlayerFishHighest(PlayerFishEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) return; Player player = event.getPlayer(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -266,7 +261,7 @@ public class PlayerListener implements Listener { if (Permissions.vanillaXpBoost(player, PrimarySkillType.FISHING)) { //Don't modify XP below vanilla values - if(fishingManager.handleVanillaXpBoost(event.getExpToDrop()) > 1) + if (fishingManager.handleVanillaXpBoost(event.getExpToDrop()) > 1) event.setExpToDrop(fishingManager.handleVanillaXpBoost(event.getExpToDrop())); } return; @@ -304,15 +299,14 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlayerFishMonitor(PlayerFishEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) return; Player player = event.getPlayer(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -334,7 +328,7 @@ public class PlayerListener implements Listener { return; case CAUGHT_FISH: - if(fishingManager.exploitPrevention(event.getHook().getBoundingBox())) + if (fishingManager.exploitPrevention(event.getHook().getBoundingBox())) return; fishingManager.handleFishing((Item) caught); fishingManager.setFishingTarget(); @@ -363,17 +357,15 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onPlayerPickupItem(EntityPickupItemEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; - if(event.getEntity() instanceof Player) - { + if (event.getEntity() instanceof Player) { Player player = (Player) event.getEntity(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -493,15 +485,14 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onPlayerInteractLowest(PlayerInteractEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) return; Player player = event.getPlayer(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -547,8 +538,7 @@ public class PlayerListener implements Listener { else if (miningManager.canDetonate()) { if (type == Material.TNT) { event.setCancelled(true); // Don't detonate the TNT if they're too close - } - else { + } else { miningManager.remoteDetonation(); } } @@ -596,15 +586,14 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.MONITOR) public void onPlayerInteractMonitor(PlayerInteractEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) return; Player player = event.getPlayer(); /* WORLD GUARD MAIN FLAG CHECK */ - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasMainFlag(player)) + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasMainFlag(player)) return; } @@ -617,10 +606,10 @@ public class PlayerListener implements Listener { switch (event.getAction()) { case RIGHT_CLICK_BLOCK: - if(player.getInventory().getItemInOffHand().getType() != Material.AIR && !player.isInsideVehicle() && !player.isSneaking()) { + if (player.getInventory().getItemInOffHand().getType() != Material.AIR && !player.isInsideVehicle() && !player.isSneaking()) { break; } - + Block block = event.getClickedBlock(); BlockState blockState = block.getState(); @@ -675,10 +664,10 @@ public class PlayerListener implements Listener { break; case RIGHT_CLICK_AIR: - if(player.getInventory().getItemInOffHand().getType() != Material.AIR && !player.isInsideVehicle() && !player.isSneaking()) { + if (player.getInventory().getItemInOffHand().getType() != Material.AIR && !player.isInsideVehicle() && !player.isSneaking()) { break; } - + /* ACTIVATION CHECKS */ if (Config.getInstance().getAbilitiesEnabled()) { mcMMOPlayer.processAbilityActivation(PrimarySkillType.AXES); @@ -714,11 +703,9 @@ public class PlayerListener implements Listener { if (type == Config.getInstance().getTamingCOTWMaterial(EntityType.WOLF)) { tamingManager.summonWolf(); - } - else if (type == Config.getInstance().getTamingCOTWMaterial(EntityType.OCELOT)) { + } else if (type == Config.getInstance().getTamingCOTWMaterial(EntityType.OCELOT)) { tamingManager.summonOcelot(); - } - else if (type == Config.getInstance().getTamingCOTWMaterial(EntityType.HORSE)) { + } else if (type == Config.getInstance().getTamingCOTWMaterial(EntityType.HORSE)) { tamingManager.summonHorse(); } @@ -763,8 +750,7 @@ public class PlayerListener implements Listener { chatManager = ChatManagerFactory.getChatManager(plugin, ChatMode.PARTY); ((PartyChatManager) chatManager).setParty(party); - } - else if (mcMMOPlayer.isChatEnabled(ChatMode.ADMIN)) { + } else if (mcMMOPlayer.isChatEnabled(ChatMode.ADMIN)) { chatManager = ChatManagerFactory.getChatManager(plugin, ChatMode.ADMIN); } @@ -806,7 +792,7 @@ public class PlayerListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlayerStatisticIncrementEvent(PlayerStatisticIncrementEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getPlayer().getWorld())) return; if (!mcMMO.getHolidayManager().isAprilFirst()) { diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java index 9b098a83f..f936898a3 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/SelfListener.java @@ -1,18 +1,18 @@ package com.gmail.nossr50.listeners; -import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; +import com.gmail.nossr50.core.worldguard.WorldGuardManager; +import com.gmail.nossr50.core.worldguard.WorldGuardUtils; 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.core.data.UserManager; -import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; -import com.gmail.nossr50.core.worldguard.WorldGuardManager; -import com.gmail.nossr50.core.worldguard.WorldGuardUtils; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -22,8 +22,7 @@ public class SelfListener implements Listener { //Used in task scheduling and other things private final mcMMO plugin; - public SelfListener(mcMMO plugin) - { + public SelfListener(mcMMO plugin) { this.plugin = plugin; } @@ -33,14 +32,13 @@ public class SelfListener implements Listener { PrimarySkillType skill = event.getSkill(); //Players can gain multiple levels especially during xprate events - for(int i = 0; i < event.getLevelsGained(); i++) - { + for (int i = 0; i < event.getLevelsGained(); i++) { int previousLevelGained = event.getSkillLevel() - i; //Send player skill unlock notifications UserManager.getPlayer(player).processUnlockNotifications(plugin, event.getSkill(), previousLevelGained); } - if(Config.getInstance().getScoreboardsEnabled()) + if (Config.getInstance().getScoreboardsEnabled()) ScoreboardManager.handleLevelUp(player, skill); if (!Config.getInstance().getLevelUpEffectsEnabled()) { @@ -54,13 +52,13 @@ public class SelfListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlayerXp(McMMOPlayerXpGainEvent event) { - if(Config.getInstance().getScoreboardsEnabled()) + if (Config.getInstance().getScoreboardsEnabled()) ScoreboardManager.handleXp(event.getPlayer(), event.getSkill()); } @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onAbility(McMMOPlayerAbilityActivateEvent event) { - if(Config.getInstance().getScoreboardsEnabled()) + if (Config.getInstance().getScoreboardsEnabled()) ScoreboardManager.cooldownUpdate(event.getPlayer(), event.getSkill()); } @@ -71,23 +69,19 @@ public class SelfListener implements Listener { PrimarySkillType primarySkillType = event.getSkill(); //WorldGuard XP Check - if(event.getXpGainReason() == XPGainReason.PVE || + if (event.getXpGainReason() == XPGainReason.PVE || event.getXpGainReason() == XPGainReason.PVP || event.getXpGainReason() == XPGainReason.SHARED_PVE || - event.getXpGainReason() == XPGainReason.SHARED_PVP) - { - if(WorldGuardUtils.isWorldGuardLoaded()) - { - if(!WorldGuardManager.getInstance().hasXPFlag(player)) - { + event.getXpGainReason() == XPGainReason.SHARED_PVP) { + if (WorldGuardUtils.isWorldGuardLoaded()) { + if (!WorldGuardManager.getInstance().hasXPFlag(player)) { event.setRawXpGained(0); event.setCancelled(true); } } } - if (event.getXpGainReason() == XPGainReason.COMMAND) - { + if (event.getXpGainReason() == XPGainReason.COMMAND) { return; } @@ -124,12 +118,10 @@ public class SelfListener implements Listener { * Make sure players get a guaranteed minimum of XP */ //If there is no guaranteed minimum proceed, otherwise only proceed if newValue would be higher than our guaranteed minimum - if(guaranteedMinimum <= 0 || newValue > guaranteedMinimum) - { + if (guaranteedMinimum <= 0 || newValue > guaranteedMinimum) { if (newValue > 0) { event.setRawXpGained(newValue); - } - else { + } else { event.setCancelled(true); } } else { diff --git a/bukkit/src/main/java/com/gmail/nossr50/listeners/WorldListener.java b/bukkit/src/main/java/com/gmail/nossr50/listeners/WorldListener.java index c72d49d27..a533f0238 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/listeners/WorldListener.java +++ b/bukkit/src/main/java/com/gmail/nossr50/listeners/WorldListener.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.listeners; import com.gmail.nossr50.core.config.skills.WorldBlacklist; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.data.blockmeta.conversion.BlockStoreConversionMain; +import com.gmail.nossr50.mcMMO; import org.bukkit.Chunk; import org.bukkit.World; import org.bukkit.block.BlockState; @@ -31,7 +31,7 @@ public class WorldListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onStructureGrow(StructureGrowEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getWorld())) return; if (!mcMMO.getPlaceStore().isTrue(event.getLocation().getBlock())) { @@ -51,7 +51,7 @@ public class WorldListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onWorldInit(WorldInitEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getWorld())) return; World world = event.getWorld(); @@ -73,7 +73,7 @@ public class WorldListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onWorldUnload(WorldUnloadEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getWorld())) return; mcMMO.getPlaceStore().unloadWorld(event.getWorld()); @@ -87,7 +87,7 @@ public class WorldListener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onChunkUnload(ChunkUnloadEvent event) { /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getWorld())) + if (WorldBlacklist.isWorldBlacklisted(event.getWorld())) return; Chunk chunk = event.getChunk(); diff --git a/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java b/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java index e97d1b573..836198c74 100644 --- a/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/bukkit/src/main/java/com/gmail/nossr50/mcMMO.java @@ -8,14 +8,13 @@ import com.gmail.nossr50.config.mods.ToolConfigManager; import com.gmail.nossr50.config.skills.alchemy.PotionConfig; import com.gmail.nossr50.config.skills.repair.RepairConfigManager; import com.gmail.nossr50.config.skills.salvage.SalvageConfigManager; -import com.gmail.nossr50.core.config.treasure.TreasureConfig; import com.gmail.nossr50.core.config.skills.*; +import com.gmail.nossr50.core.config.treasure.TreasureConfig; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.data.blockmeta.chunkmeta.ChunkManager; +import com.gmail.nossr50.core.data.blockmeta.chunkmeta.ChunkManagerFactory; import com.gmail.nossr50.core.data.database.DatabaseManager; import com.gmail.nossr50.core.data.database.DatabaseManagerFactory; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.subskills.acrobatics.Roll; -import com.gmail.nossr50.core.util.*; -import com.gmail.nossr50.listeners.*; import com.gmail.nossr50.core.party.PartyManager; import com.gmail.nossr50.core.runnables.CheckDateTask; import com.gmail.nossr50.core.runnables.SaveTimerTask; @@ -26,24 +25,25 @@ import com.gmail.nossr50.core.runnables.player.ClearRegisteredXPGainTask; import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask; import com.gmail.nossr50.core.runnables.player.PowerLevelUpdatingTask; import com.gmail.nossr50.core.runnables.skills.BleedTimerTask; -import com.gmail.nossr50.core.skills.primary.alchemy.Alchemy; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.child.ChildConfig; -import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; -import com.gmail.nossr50.core.skills.primary.repair.repairables.RepairableManager; -import com.gmail.nossr50.core.skills.primary.repair.repairables.SimpleRepairableManager; import com.gmail.nossr50.core.skills.child.salvage.salvageables.Salvageable; import com.gmail.nossr50.core.skills.child.salvage.salvageables.SalvageableManager; import com.gmail.nossr50.core.skills.child.salvage.salvageables.SimpleSalvageableManager; -import com.gmail.nossr50.util.*; -import com.gmail.nossr50.core.data.blockmeta.chunkmeta.ChunkManager; -import com.gmail.nossr50.core.data.blockmeta.chunkmeta.ChunkManagerFactory; +import com.gmail.nossr50.core.skills.primary.alchemy.Alchemy; +import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; +import com.gmail.nossr50.core.skills.primary.repair.repairables.RepairableManager; +import com.gmail.nossr50.core.skills.primary.repair.repairables.SimpleRepairableManager; +import com.gmail.nossr50.core.skills.subskills.acrobatics.Roll; +import com.gmail.nossr50.core.util.*; import com.gmail.nossr50.core.util.commands.CommandRegistrationManager; import com.gmail.nossr50.core.util.experience.FormulaManager; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.core.util.skills.RankUtils; import com.gmail.nossr50.core.util.upgrade.UpgradeManager; import com.gmail.nossr50.core.worldguard.WorldGuardManager; +import com.gmail.nossr50.listeners.*; +import com.gmail.nossr50.util.*; import com.google.common.base.Charsets; import net.shatteredlands.shatt.backup.ZipLibrary; import org.bstats.bukkit.Metrics; @@ -61,6 +61,29 @@ import java.util.ArrayList; import java.util.List; public class mcMMO extends JavaPlugin { + /* Metadata Values */ + public final static String entityMetadataKey = "mcMMO: Spawned Entity"; + public final static String blockMetadataKey = "mcMMO: Piston Tracking"; + public final static String furnaceMetadataKey = "mcMMO: Tracked Furnace"; + public final static String tntMetadataKey = "mcMMO: Tracked TNT"; + public final static String funfettiMetadataKey = "mcMMO: Funfetti"; + public final static String tntsafeMetadataKey = "mcMMO: Safe TNT"; + public final static String customNameKey = "mcMMO: Custom Name"; + public final static String customVisibleKey = "mcMMO: Name Visibility"; + public final static String droppedItemKey = "mcMMO: Tracked Item"; + public final static String infiniteArrowKey = "mcMMO: Infinite Arrow"; + public final static String bowForceKey = "mcMMO: Bow Force"; + public final static String arrowDistanceKey = "mcMMO: Arrow Distance"; + //public final static String customDamageKey = "mcMMO: Custom Damage"; + public final static String disarmedItemKey = "mcMMO: Disarmed Item"; + public final static String playerDataKey = "mcMMO: Player Data"; + public final static String greenThumbDataKey = "mcMMO: Green Thumb"; + public final static String databaseCommandKey = "mcMMO: Processing Database Command"; + public final static String bredMetadataKey = "mcMMO: Bred Animal"; + public static mcMMO p; + // Jar Stuff + public static File mcmmo; + public static FixedMetadataValue metadataValue; /* Managers */ private static ChunkManager placeStore; private static RepairableManager repairableManager; @@ -70,53 +93,92 @@ public class mcMMO extends JavaPlugin { private static FormulaManager formulaManager; private static HolidayManager holidayManager; private static UpgradeManager upgradeManager; - /* Blacklist */ private static WorldBlacklist worldBlacklist; - /* File Paths */ private static String mainDirectory; private static String flatFileDirectory; private static String usersFile; private static String modDirectory; - - public static mcMMO p; - - // Jar Stuff - public static File mcmmo; - /* Plugin Checks */ private static boolean healthBarPluginEnabled; - + private static boolean isRetroModeEnabled; // Config Validation Check public boolean noErrorsInConfigFiles = true; - // XP Event Check private boolean xpEventEnabled; - private static boolean isRetroModeEnabled; + public static String getMainDirectory() { + return mainDirectory; + } - /* Metadata Values */ - public final static String entityMetadataKey = "mcMMO: Spawned Entity"; - public final static String blockMetadataKey = "mcMMO: Piston Tracking"; - public final static String furnaceMetadataKey = "mcMMO: Tracked Furnace"; - public final static String tntMetadataKey = "mcMMO: Tracked TNT"; - public final static String funfettiMetadataKey = "mcMMO: Funfetti"; - public final static String tntsafeMetadataKey = "mcMMO: Safe TNT"; - public final static String customNameKey = "mcMMO: Custom Name"; - public final static String customVisibleKey = "mcMMO: Name Visibility"; - public final static String droppedItemKey = "mcMMO: Tracked Item"; - public final static String infiniteArrowKey = "mcMMO: Infinite Arrow"; - public final static String bowForceKey = "mcMMO: Bow Force"; - public final static String arrowDistanceKey = "mcMMO: Arrow Distance"; - //public final static String customDamageKey = "mcMMO: Custom Damage"; - public final static String disarmedItemKey = "mcMMO: Disarmed Item"; - public final static String playerDataKey = "mcMMO: Player Data"; - public final static String greenThumbDataKey = "mcMMO: Green Thumb"; - public final static String databaseCommandKey = "mcMMO: Processing Database Command"; - public final static String bredMetadataKey = "mcMMO: Bred Animal"; + public static String getFlatFileDirectory() { + return flatFileDirectory; + } - public static FixedMetadataValue metadataValue; + public static String getUsersFilePath() { + return usersFile; + } + + public static String getModDirectory() { + return modDirectory; + } + + public static FormulaManager getFormulaManager() { + return formulaManager; + } + + public static HolidayManager getHolidayManager() { + return holidayManager; + } + + public static ChunkManager getPlaceStore() { + return placeStore; + } + + public static RepairableManager getRepairableManager() { + return repairableManager; + } + + public static SalvageableManager getSalvageableManager() { + return salvageableManager; + } + + public static DatabaseManager getDatabaseManager() { + return databaseManager; + } + + @Deprecated + public static void setDatabaseManager(DatabaseManager databaseManager) { + mcMMO.databaseManager = databaseManager; + } + + public static ModManager getModManager() { + return modManager; + } + + public static UpgradeManager getUpgradeManager() { + return upgradeManager; + } + + public static boolean isHealthBarPluginEnabled() { + return healthBarPluginEnabled; + } + + /** + * Checks if this plugin is using retro mode + * Retro mode is a 0-1000 skill system + * Standard mode is scaled for 1-100 + * + * @return true if retro mode is enabled + */ + public static boolean isRetroModeEnabled() { + return isRetroModeEnabled; + } + + public static WorldBlacklist getWorldBlacklist() { + return worldBlacklist; + } /** * Things to be run when the plugin is enabled. @@ -192,23 +254,21 @@ public class mcMMO extends JavaPlugin { Metrics metrics; - if(Config.getInstance().getIsMetricsEnabled()) { + if (Config.getInstance().getIsMetricsEnabled()) { metrics = new Metrics(this); metrics.addCustomChart(new Metrics.SimplePie("version", () -> getDescription().getVersion())); - if(Config.getInstance().getIsRetroMode()) + if (Config.getInstance().getIsRetroMode()) metrics.addCustomChart(new Metrics.SimplePie("scaling", () -> "Standard")); else metrics.addCustomChart(new Metrics.SimplePie("scaling", () -> "Retro")); } - } - catch (Throwable t) { + } catch (Throwable t) { getLogger().severe("There was an error while enabling mcMMO!"); if (!(t instanceof ExceptionInInitializerError)) { t.printStackTrace(); - } - else { + } else { getLogger().info("Please do not replace the mcMMO jar while the server is running."); } @@ -220,9 +280,8 @@ public class mcMMO extends JavaPlugin { } @Override - public void onLoad() - { - if(getServer().getPluginManager().getPlugin("WorldGuard") != null) + public void onLoad() { + if (getServer().getPluginManager().getPlugin("WorldGuard") != null) WorldGuardManager.getInstance().registerFlags(); } @@ -238,15 +297,16 @@ public class mcMMO extends JavaPlugin { PartyManager.saveParties(); // Save our parties //TODO: Needed? - if(Config.getInstance().getScoreboardsEnabled()) + if (Config.getInstance().getScoreboardsEnabled()) ScoreboardManager.teardownAll(); formulaManager.saveFormula(); holidayManager.saveAnniversaryFiles(); placeStore.saveAll(); // Save our metadata placeStore.cleanUp(); // Cleanup empty metadata stores + } catch (NullPointerException e) { + e.printStackTrace(); } - catch (NullPointerException e) { e.printStackTrace(); } debug("Canceling all tasks..."); getServer().getScheduler().cancelTasks(this); // This removes our tasks @@ -257,16 +317,13 @@ public class mcMMO extends JavaPlugin { // Remove other tasks BEFORE starting the Backup, or we just cancel it straight away. try { ZipLibrary.mcMMOBackup(); - } - catch (IOException e) { + } catch (IOException e) { getLogger().severe(e.toString()); - } - catch (Throwable e) { + } catch (Throwable e) { if (e instanceof NoClassDefFoundError) { getLogger().severe("Backup class not found!"); getLogger().info("Please do not replace the mcMMO jar while the server is running."); - } - else { + } else { getLogger().severe(e.toString()); } } @@ -276,22 +333,6 @@ public class mcMMO extends JavaPlugin { debug("Was disabled."); // How informative! } - public static String getMainDirectory() { - return mainDirectory; - } - - public static String getFlatFileDirectory() { - return flatFileDirectory; - } - - public static String getUsersFilePath() { - return usersFile; - } - - public static String getModDirectory() { - return modDirectory; - } - public boolean isXPEventEnabled() { return xpEventEnabled; } @@ -308,47 +349,6 @@ public class mcMMO extends JavaPlugin { getLogger().info("[Debug] " + message); } - public static FormulaManager getFormulaManager() { - return formulaManager; - } - - public static HolidayManager getHolidayManager() { - return holidayManager; - } - - public static ChunkManager getPlaceStore() { - return placeStore; - } - - public static RepairableManager getRepairableManager() { - return repairableManager; - } - - public static SalvageableManager getSalvageableManager() { - return salvageableManager; - } - - public static DatabaseManager getDatabaseManager() { - return databaseManager; - } - - public static ModManager getModManager() { - return modManager; - } - - public static UpgradeManager getUpgradeManager() { - return upgradeManager; - } - - @Deprecated - public static void setDatabaseManager(DatabaseManager databaseManager) { - mcMMO.databaseManager = databaseManager; - } - - public static boolean isHealthBarPluginEnabled() { - return healthBarPluginEnabled; - } - /** * Setup the various storage file paths */ @@ -377,10 +377,10 @@ public class mcMMO extends JavaPlugin { } } - File oldArmorFile = new File(modDirectory + "armor.yml"); - File oldBlocksFile = new File(modDirectory + "blocks.yml"); + File oldArmorFile = new File(modDirectory + "armor.yml"); + File oldBlocksFile = new File(modDirectory + "blocks.yml"); File oldEntitiesFile = new File(modDirectory + "entities.yml"); - File oldToolsFile = new File(modDirectory + "tools.yml"); + File oldToolsFile = new File(modDirectory + "tools.yml"); if (oldArmorFile.exists()) { if (!oldArmorFile.renameTo(new File(modDirectory + "armor.default.yml"))) { @@ -475,8 +475,7 @@ public class mcMMO extends JavaPlugin { * Acrobatics skills */ - if(CoreSkillsConfig.getInstance().isPrimarySkillEnabled(PrimarySkillType.ACROBATICS)) - { + if (CoreSkillsConfig.getInstance().isPrimarySkillEnabled(PrimarySkillType.ACROBATICS)) { System.out.println("[mcMMO]" + " enabling Acrobatics Skills"); //TODO: Should do this differently @@ -510,8 +509,7 @@ public class mcMMO extends JavaPlugin { if (purgeIntervalTicks == 0) { new UserPurgeTask().runTaskLaterAsynchronously(this, 2 * Misc.TICK_CONVERSION_FACTOR); // Start 2 seconds after startup. - } - else if (purgeIntervalTicks > 0) { + } else if (purgeIntervalTicks > 0) { new UserPurgeTask().runTaskTimerAsynchronously(this, purgeIntervalTicks, purgeIntervalTicks); } @@ -520,8 +518,7 @@ public class mcMMO extends JavaPlugin { if (kickIntervalTicks == 0) { new PartyAutoKickTask().runTaskLater(this, 2 * Misc.TICK_CONVERSION_FACTOR); // Start 2 seconds after startup. - } - else if (kickIntervalTicks > 0) { + } else if (kickIntervalTicks > 0) { new PartyAutoKickTask().runTaskTimer(this, kickIntervalTicks, kickIntervalTicks); } @@ -564,18 +561,4 @@ public class mcMMO extends JavaPlugin { InputStream in = getResource(fileName); return in == null ? null : new InputStreamReader(in, Charsets.UTF_8); } - - /** - * Checks if this plugin is using retro mode - * Retro mode is a 0-1000 skill system - * Standard mode is scaled for 1-100 - * @return true if retro mode is enabled - */ - public static boolean isRetroModeEnabled() { - return isRetroModeEnabled; - } - - public static WorldBlacklist getWorldBlacklist() { - return worldBlacklist; - } } diff --git a/bukkit/src/main/java/util/java/mcMMO/PotionConfigGenerator.java b/bukkit/src/main/java/util/java/mcMMO/PotionConfigGenerator.java index f50e6b4f2..f5fd26552 100644 --- a/bukkit/src/main/java/util/java/mcMMO/PotionConfigGenerator.java +++ b/bukkit/src/main/java/util/java/mcMMO/PotionConfigGenerator.java @@ -14,114 +14,6 @@ import java.util.Map.Entry; public class PotionConfigGenerator { - public static class Ingredient { - - public Material mat; - public int data; - public String name; - - public Ingredient(Material mat) { - this.mat = mat; - this.data = 0; - name = mat.name(); - } - - } - public static class WriteablePotion { - - public String name; - public Material mat; - public PotionData data; - public PotionEffect effect; - public String baseName; - - public WriteablePotion(PotionData data) { - this(Material.POTION, data); - } - - public WriteablePotion(Material type, PotionData data) { - this(type, data, null, getMCName(data.getType())); - } - - public WriteablePotion(Material mat, PotionType type, PotionEffect effect, String baseName) { - this(mat, new PotionData(type, false, false), effect, baseName); - } - - public WriteablePotion(Material type, PotionData data, PotionEffect effect, String baseName) { - this.data = data; - this.effect = effect; - this.mat = type; - this.baseName = baseName; - this.name = "POTION_OF_" + baseName; - if (mat == Material.SPLASH_POTION) { - this.name = "SPLASH_" + this.name; - } - if (mat == Material.LINGERING_POTION) { - this.name = "LINGERING_" + this.name; - } - if (data.isExtended()) { - this.name += "_EXTENDED"; - } - if (data.isUpgraded()) { - this.name += "_II"; - } - } - - public WriteablePotion(PotionType type) { - this(new PotionData(type, false, false)); - } - - public WriteablePotion(Material mat, PotionType type) { - this(mat, new PotionData(type, false, false)); - } - - private static String getMCName(PotionType type) { - switch (type) { - case INSTANT_DAMAGE : - return "HARMING"; - case INSTANT_HEAL : - return "HEALING"; - case JUMP : - return "LEAPING"; - case REGEN : - return "REGENERATION"; - case SPEED : - return "SWIFTNESS"; - case UNCRAFTABLE : - return "EMPTY"; - case LUCK : - case MUNDANE : - case NIGHT_VISION : - case POISON : - case INVISIBILITY : - case SLOWNESS : - case AWKWARD : - case STRENGTH : - case THICK : - case FIRE_RESISTANCE : - case WATER : - case WATER_BREATHING : - case WEAKNESS : - case TURTLE_MASTER: - case SLOW_FALLING: - return type.name(); - default : - return ""; - } - } - - public int hashCode() { - return name.hashCode(); - } - - public boolean equals(Object obj) { - if (!(obj instanceof WriteablePotion)) { - return false; - } - return name.equals(((WriteablePotion) obj).name); - } - } - public static void main(String[] args) { Map> vanillaPotions = new HashMap<>(); populateVanillaPotions(vanillaPotions); @@ -250,59 +142,59 @@ public class PotionConfigGenerator { private static String getName(PotionEffectType type) { switch (type.getId()) { - case 1 : + case 1: return "SPEED"; - case 2 : + case 2: return "SLOW"; - case 3 : + case 3: return "FAST_DIGGING"; - case 4 : + case 4: return "SLOW_DIGGING"; - case 5 : + case 5: return "INCREASE_DAMAGE"; - case 6 : + case 6: return "HEAL"; - case 7 : + case 7: return "HARM"; - case 8 : + case 8: return "JUMP"; - case 9 : + case 9: return "CONFUSION"; - case 10 : + case 10: return "REGENERATION"; - case 11 : + case 11: return "DAMAGE_RESISTANCE"; - case 12 : + case 12: return "FIRE_RESISTANCE"; - case 13 : + case 13: return "WATER_BREATHING"; - case 14 : + case 14: return "INVISIBILITY"; - case 15 : + case 15: return "BLINDNESS"; - case 16 : + case 16: return "NIGHT_VISION"; - case 17 : + case 17: return "HUNGER"; - case 18 : + case 18: return "WEAKNESS"; - case 19 : + case 19: return "POISON"; - case 20 : + case 20: return "WITHER"; - case 21 : + case 21: return "HEALTH_BOOST"; - case 22 : + case 22: return "ABSORPTION"; - case 23 : + case 23: return "SATURATION"; - case 24 : + case 24: return "GLOWING"; - case 25 : + case 25: return "LEVITATION"; - case 26 : + case 26: return "LUCK"; - case 27 : + case 27: return "UNLUCK"; case 28: return "SLOW_FALLING"; @@ -310,7 +202,7 @@ public class PotionConfigGenerator { return "CONDUIT_POWER"; case 30: return "DOLPHINS_GRACE"; - default : + default: return "UNKNOWN_EFFECT_TYPE_" + type.getId(); } } @@ -348,9 +240,9 @@ public class PotionConfigGenerator { private static void getChildren(WriteablePotion current, HashMap children) { switch (current.data.getType()) { - case WATER : - assert(!current.data.isExtended()); - assert(!current.data.isUpgraded()); + case WATER: + assert (!current.data.isExtended()); + assert (!current.data.isUpgraded()); children.put(new Ingredient(Material.NETHER_WART), new WriteablePotion(current.mat, PotionType.AWKWARD)); children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, PotionType.WEAKNESS)); children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, PotionType.MUNDANE)); @@ -363,9 +255,9 @@ public class PotionConfigGenerator { children.put(new Ingredient(Material.GLISTERING_MELON_SLICE), new WriteablePotion(current.mat, PotionType.MUNDANE)); children.put(new Ingredient(Material.GHAST_TEAR), new WriteablePotion(current.mat, PotionType.MUNDANE)); return; - case AWKWARD : - assert(!current.data.isExtended()); - assert(!current.data.isUpgraded()); + case AWKWARD: + assert (!current.data.isExtended()); + assert (!current.data.isUpgraded()); children.put(new Ingredient(Material.GOLDEN_CARROT), new WriteablePotion(current.mat, PotionType.NIGHT_VISION)); children.put(new Ingredient(Material.RABBIT_FOOT), new WriteablePotion(current.mat, PotionType.JUMP)); children.put(new Ingredient(Material.MAGMA_CREAM), new WriteablePotion(current.mat, PotionType.FIRE_RESISTANCE)); @@ -396,8 +288,8 @@ public class PotionConfigGenerator { children.put(new Ingredient(Material.FERN), new WriteablePotion(current.mat, PotionType.UNCRAFTABLE, new PotionEffect(PotionEffectType.SATURATION, (int) (8 * mod), 0), "SATURATION")); children.put(new Ingredient(Material.APPLE), new WriteablePotion(current.mat, PotionType.UNCRAFTABLE, new PotionEffect(PotionEffectType.HEALTH_BOOST, (int) (1800 * mod), 0), "HEALTH_BOOST")); return; - case FIRE_RESISTANCE : - assert(!current.data.isUpgraded()); + case FIRE_RESISTANCE: + assert (!current.data.isUpgraded()); if (current.data.isExtended()) { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, new PotionData(PotionType.SLOWNESS, true, false))); } else { @@ -405,14 +297,14 @@ public class PotionConfigGenerator { children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); } return; - case INSTANT_DAMAGE : - assert(!current.data.isExtended()); + case INSTANT_DAMAGE: + assert (!current.data.isExtended()); if (!current.data.isUpgraded()) { children.put(new Ingredient(Material.GLOWSTONE_DUST), new WriteablePotion(current.mat, new PotionData(current.data.getType(), false, true))); } return; - case INSTANT_HEAL : - assert(!current.data.isExtended()); + case INSTANT_HEAL: + assert (!current.data.isExtended()); if (!current.data.isUpgraded()) { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, PotionType.INSTANT_DAMAGE)); children.put(new Ingredient(Material.GLOWSTONE_DUST), new WriteablePotion(current.mat, new PotionData(current.data.getType(), false, true))); @@ -420,21 +312,21 @@ public class PotionConfigGenerator { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, new PotionData(PotionType.INSTANT_DAMAGE, false, true))); } return; - case INVISIBILITY : - assert(!current.data.isUpgraded()); + case INVISIBILITY: + assert (!current.data.isUpgraded()); if (!current.data.isExtended()) { children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); } return; - case JUMP : + case JUMP: if (!current.data.isUpgraded() && !current.data.isExtended()) { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, PotionType.SLOWNESS)); children.put(new Ingredient(Material.GLOWSTONE_DUST), new WriteablePotion(current.mat, new PotionData(current.data.getType(), false, true))); children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); } return; - case NIGHT_VISION : - assert(!current.data.isUpgraded()); + case NIGHT_VISION: + assert (!current.data.isUpgraded()); if (!current.data.isExtended()) { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, PotionType.INVISIBILITY)); children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); @@ -442,7 +334,7 @@ public class PotionConfigGenerator { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, new PotionData(PotionType.INVISIBILITY, true, false))); } return; - case POISON : + case POISON: if (!current.data.isUpgraded() && !current.data.isExtended()) { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, PotionType.INSTANT_DAMAGE)); children.put(new Ingredient(Material.GLOWSTONE_DUST), new WriteablePotion(current.mat, new PotionData(current.data.getType(), false, true))); @@ -451,25 +343,25 @@ public class PotionConfigGenerator { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, new PotionData(PotionType.INSTANT_DAMAGE, false, true))); } return; - case REGEN : + case REGEN: if (!current.data.isUpgraded() && !current.data.isExtended()) { children.put(new Ingredient(Material.GLOWSTONE_DUST), new WriteablePotion(current.mat, new PotionData(current.data.getType(), false, true))); children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); } return; - case SLOWNESS : - assert(!current.data.isUpgraded()); + case SLOWNESS: + assert (!current.data.isUpgraded()); if (!current.data.isExtended()) { children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); } return; - case SLOW_FALLING : - assert(!current.data.isUpgraded()); + case SLOW_FALLING: + assert (!current.data.isUpgraded()); if (!current.data.isExtended()) { children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); } return; - case SPEED : + case SPEED: if (!current.data.isUpgraded() && !current.data.isExtended()) { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, PotionType.SLOWNESS)); children.put(new Ingredient(Material.GLOWSTONE_DUST), new WriteablePotion(current.mat, new PotionData(current.data.getType(), false, true))); @@ -478,7 +370,7 @@ public class PotionConfigGenerator { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, new PotionData(PotionType.SLOWNESS, true, false))); } return; - case STRENGTH : + case STRENGTH: if (!current.data.isUpgraded() && !current.data.isExtended()) { children.put(new Ingredient(Material.GLOWSTONE_DUST), new WriteablePotion(current.mat, new PotionData(current.data.getType(), false, true))); children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); @@ -490,28 +382,28 @@ public class PotionConfigGenerator { children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); } return; - case WATER_BREATHING : - assert(!current.data.isUpgraded()); + case WATER_BREATHING: + assert (!current.data.isUpgraded()); if (!current.data.isExtended()) { children.put(new Ingredient(Material.FERMENTED_SPIDER_EYE), new WriteablePotion(current.mat, PotionType.INSTANT_DAMAGE)); children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); } return; - case WEAKNESS : - assert(!current.data.isUpgraded()); + case WEAKNESS: + assert (!current.data.isUpgraded()); if (!current.data.isExtended()) { children.put(new Ingredient(Material.REDSTONE), new WriteablePotion(current.mat, new PotionData(current.data.getType(), true, false))); } return; - case LUCK : - case MUNDANE : - case THICK : - case UNCRAFTABLE : - assert(!current.data.isExtended()); - assert(!current.data.isUpgraded()); + case LUCK: + case MUNDANE: + case THICK: + case UNCRAFTABLE: + assert (!current.data.isExtended()); + assert (!current.data.isUpgraded()); return; - default : - assert(false); + default: + assert (false); break; } } @@ -608,7 +500,7 @@ public class PotionConfigGenerator { } mcMMOPotions.put(data, children); } - + // Add all material state changes for (Entry> entry : mcMMOPotions.entrySet()) { if (entry.getKey().mat == Material.POTION) { @@ -620,4 +512,113 @@ public class PotionConfigGenerator { } } } + + public static class Ingredient { + + public Material mat; + public int data; + public String name; + + public Ingredient(Material mat) { + this.mat = mat; + this.data = 0; + name = mat.name(); + } + + } + + public static class WriteablePotion { + + public String name; + public Material mat; + public PotionData data; + public PotionEffect effect; + public String baseName; + + public WriteablePotion(PotionData data) { + this(Material.POTION, data); + } + + public WriteablePotion(Material type, PotionData data) { + this(type, data, null, getMCName(data.getType())); + } + + public WriteablePotion(Material mat, PotionType type, PotionEffect effect, String baseName) { + this(mat, new PotionData(type, false, false), effect, baseName); + } + + public WriteablePotion(Material type, PotionData data, PotionEffect effect, String baseName) { + this.data = data; + this.effect = effect; + this.mat = type; + this.baseName = baseName; + this.name = "POTION_OF_" + baseName; + if (mat == Material.SPLASH_POTION) { + this.name = "SPLASH_" + this.name; + } + if (mat == Material.LINGERING_POTION) { + this.name = "LINGERING_" + this.name; + } + if (data.isExtended()) { + this.name += "_EXTENDED"; + } + if (data.isUpgraded()) { + this.name += "_II"; + } + } + + public WriteablePotion(PotionType type) { + this(new PotionData(type, false, false)); + } + + public WriteablePotion(Material mat, PotionType type) { + this(mat, new PotionData(type, false, false)); + } + + private static String getMCName(PotionType type) { + switch (type) { + case INSTANT_DAMAGE: + return "HARMING"; + case INSTANT_HEAL: + return "HEALING"; + case JUMP: + return "LEAPING"; + case REGEN: + return "REGENERATION"; + case SPEED: + return "SWIFTNESS"; + case UNCRAFTABLE: + return "EMPTY"; + case LUCK: + case MUNDANE: + case NIGHT_VISION: + case POISON: + case INVISIBILITY: + case SLOWNESS: + case AWKWARD: + case STRENGTH: + case THICK: + case FIRE_RESISTANCE: + case WATER: + case WATER_BREATHING: + case WEAKNESS: + case TURTLE_MASTER: + case SLOW_FALLING: + return type.name(); + default: + return ""; + } + } + + public int hashCode() { + return name.hashCode(); + } + + public boolean equals(Object obj) { + if (!(obj instanceof WriteablePotion)) { + return false; + } + return name.equals(((WriteablePotion) obj).name); + } + } } diff --git a/bukkit/src/main/resources/child.yml b/bukkit/src/main/resources/child.yml index 685a6ce71..df215b424 100644 --- a/bukkit/src/main/resources/child.yml +++ b/bukkit/src/main/resources/child.yml @@ -9,8 +9,8 @@ # ##### Salvage: - - Fishing - - Repair +- Fishing +- Repair Smelting: - - Mining - - Repair \ No newline at end of file +- Mining +- Repair \ No newline at end of file diff --git a/bukkit/src/main/resources/config.yml b/bukkit/src/main/resources/config.yml index b528d3784..98c99daba 100644 --- a/bukkit/src/main/resources/config.yml +++ b/bukkit/src/main/resources/config.yml @@ -8,9 +8,9 @@ # Settings for mcMMO in general ### General: - # Turning this on will scale mcMMO around 1-1000 with default scaling factor - # Everything in your config related to skill level requirements, skill level bonuses, etc will be multiplied by 10 when this mode is on - # This change is purely cosmetic, it retains the old feel of mcMMO where you could level up thousands of times + # Turning this on will scale mcMMO around 1-1000 with default scaling factor + # Everything in your config related to skill level requirements, skill level bonuses, etc will be multiplied by 10 when this mode is on + # This change is purely cosmetic, it retains the old feel of mcMMO where you could level up thousands of times RetroMode: Enabled: false Locale: en_US diff --git a/bukkit/src/main/resources/coreskills.yml b/bukkit/src/main/resources/coreskills.yml index ba54e50f2..75e99afb8 100644 --- a/bukkit/src/main/resources/coreskills.yml +++ b/bukkit/src/main/resources/coreskills.yml @@ -3,7 +3,7 @@ #Acrobatics Acrobatics: - # turn this to false to disable all subskills for this skill - Enabled: true - Roll: - Enabled: true \ No newline at end of file + # turn this to false to disable all subskills for this skill + Enabled: true + Roll: + Enabled: true \ No newline at end of file diff --git a/bukkit/src/main/resources/itemweights.yml b/bukkit/src/main/resources/itemweights.yml index 7277c120a..55072c556 100644 --- a/bukkit/src/main/resources/itemweights.yml +++ b/bukkit/src/main/resources/itemweights.yml @@ -57,40 +57,40 @@ Item_Weights: # Case insensitive, though the name must be exactly the same as set in the Bukkit Material enum. Party_Shareables: Misc_Items: - - Diamond_Sword - - Diamond_Shovel - - Diamond_Pickaxe - - Diamond_Axe - - Golden_Sword - - Golden_Shovel - - Golden_Pickaxe - - Golden_Axe - - Iron_Sword - - Iron_Shovel - - Iron_Pickaxe - - Iron_Axe - - Stone_Sword - - Stone_Shovel - - Stone_Pickaxe - - Stone_Axe - - Wooden_Sword - - Wooden_Shovel - - Wooden_Pickaxe - - Wooden_Axe - - Bow - - Diamond_Helmet - - Diamond_Chestplate - - Diamond_Leggings - - Diamond_Boots - - Golden_Helmet - - Golden_Chestplate - - Golden_Leggings - - Golden_Boots - - Iron_Helmet - - Iron_Chestplate - - Iron_Leggings - - Iron_Boots - - Leather_Helmet - - Leather_Chestplate - - Leather_Leggings - - Leather_Boots + - Diamond_Sword + - Diamond_Shovel + - Diamond_Pickaxe + - Diamond_Axe + - Golden_Sword + - Golden_Shovel + - Golden_Pickaxe + - Golden_Axe + - Iron_Sword + - Iron_Shovel + - Iron_Pickaxe + - Iron_Axe + - Stone_Sword + - Stone_Shovel + - Stone_Pickaxe + - Stone_Axe + - Wooden_Sword + - Wooden_Shovel + - Wooden_Pickaxe + - Wooden_Axe + - Bow + - Diamond_Helmet + - Diamond_Chestplate + - Diamond_Leggings + - Diamond_Boots + - Golden_Helmet + - Golden_Chestplate + - Golden_Leggings + - Golden_Boots + - Iron_Helmet + - Iron_Chestplate + - Iron_Leggings + - Iron_Boots + - Leather_Helmet + - Leather_Chestplate + - Leather_Leggings + - Leather_Boots diff --git a/bukkit/src/main/resources/locale/locale_cs_CZ.properties b/bukkit/src/main/resources/locale/locale_cs_CZ.properties index 79daa5e53..2fefdf856 100644 --- a/bukkit/src/main/resources/locale/locale_cs_CZ.properties +++ b/bukkit/src/main/resources/locale/locale_cs_CZ.properties @@ -104,7 +104,7 @@ Herbalism.Ability.GTe.Length=D\u00e9lka trv\u00e1n\u00ed Zelen\u00e9 planety: [[ Herbalism.Ability.GTe.NeedMore=Bude\u0161 pot\u0159ebovat v\u00edc sem\u00ednek pro Green Tera. Herbalism.Ability.GTh.Chance=\u0160ance na dovednost Zahradn\u00edk: [[YELLOW]]{0} Herbalism.Ability.GTh.Fail=**ZAHRADN\u00cdK SELHAL** -Herbalism.Ability.GTh.Stage= Zahradn\u00edk Stage: [[\u017dlut\u00e9]] Plodiny rostou ve st\u00e1diu {0} +Herbalism.Ability.GTh.Stage=Zahradn\u00edk Stage: [[\u017dlut\u00e9]] Plodiny rostou ve st\u00e1diu {0} Herbalism.Ability.GTh=[[GREEN]]**ZAHRADNIK** Herbalism.Ability.HylianLuck=Hylian Luck zm\u011bn\u011bn: [[YELLOW]]{0} Herbalism.Ability.Lower=[[GRAY]]**SKLONIL JSI SVOJI MOTYKU** @@ -292,7 +292,7 @@ Unarmed.Ability.Bonus.1=+{0} Zv\u00fd\u0161en\u00ed zran\u011bn\u00ed Unarmed.Ability.Chance.ArrowDeflect=\u0160ance na vych\u00edlen\u00ed \u0161\u00edpu: [[YELLOW]]{0} Unarmed.Ability.Chance.Disarm=\u0160ance na odzbrojen\u00ed: [[YELLOW]]{0} Unarmed.Ability.Chance.IronGrip=\u0160ance na \u017delezn\u00fd stisk: [[YELLOW]]{0} -Unarmed.Ability.IronGrip.Attacker= Tv\u016fj soupe\u0159 m\u00e1 \u017eelezn\u00e9 sev\u0159en\u00ed! +Unarmed.Ability.IronGrip.Attacker=Tv\u016fj soupe\u0159 m\u00e1 \u017eelezn\u00e9 sev\u0159en\u00ed! Unarmed.Ability.IronGrip.Defender=[[GREEN]]Tv\u016fj \u017eelezny stisk zabr\u00e1nil tomu abys byl odzbrojen! Unarmed.Ability.Lower=[[GRAY]]**SKL\u00c1N\u00cd\u0160 SV\u00c9 P\u011aSTI** Unarmed.Ability.Ready=[[GREEN]]**PRIPRAVIL JSI SVOJE PESTI** @@ -548,7 +548,7 @@ Guides.Available=[[GRAY]]N\u00e1vod k {0} - napi\u0161te /{1} ? [page] Guides.Header=[[GOLD]]-=[[GREEN]]{0} N\u00e1vod[[GOLD]]=- Guides.Page.Invalid=Nespr\u00e1vn\u00e9 \u010d\u00edslo str\u00e1nky! Guides.Page.OutOfRange=Tato str\u00e1nka neexistuje, je tu pouze {0} str\u00e1nek. -Guides.Usage= Pou\u017eit\u00ed je /{0} ? [page] +Guides.Usage=Pou\u017eit\u00ed je /{0} ? [page] Guides.Smelting.Section.0=Ji\u017e brzy... Inspect.Offline=Nem\u00e1\u0161 pr\u00e1va kontrolovat hr\u00e1\u010de co nejsou online! Inspect.OfflineStats=mcMMO Statistiky pro offline hrace [[YELLOW]]{0} diff --git a/bukkit/src/main/resources/locale/locale_cy.properties b/bukkit/src/main/resources/locale/locale_cy.properties index dd6fc8bd6..0f535450c 100644 --- a/bukkit/src/main/resources/locale/locale_cy.properties +++ b/bukkit/src/main/resources/locale/locale_cy.properties @@ -12,7 +12,7 @@ Acrobatics.SubSkill.Roll.Chance=Roll Chance: [[YELLOW]]{0} Acrobatics.SubSkill.Roll.GraceChance=Graceful Roll Chance: [[YELLOW]]{0} Acrobatics.Roll.Text=**Rolled** Acrobatics.SkillName=ACROBATEG -Acrobatics.Skillup= Acrobateg sgil cynyddu {0}. Cyfanswm ({1}) +Acrobatics.Skillup=Acrobateg sgil cynyddu {0}. Cyfanswm ({1}) Archery.Combat.DazeChance=Chance to Daze: [[YELLOW]]{0} Archery.Combat.RetrieveChance=Chance to Retrieve Arrows: [[YELLOW]]{0} Archery.Combat.SkillshotBonus=Skill Shot Bonus Damage: [[YELLOW]]{0} @@ -23,7 +23,7 @@ Archery.SubSkill.ArrowRetrieval.Name=Arrow Retrieval Archery.SubSkill.ArrowRetrieval.Description=Chance to retrieve arrows from corpses Archery.Listener=Archery: Archery.SkillName=ARCHERY -Archery.Skillup= sgiliau Saethyddiaeth cynyddu {0}. Cyfanswm ({1}) +Archery.Skillup=sgiliau Saethyddiaeth cynyddu {0}. Cyfanswm ({1}) Axes.Ability.Bonus.0=Axe Mastery Axes.Ability.Bonus.1=Bonus {0} damage Axes.Ability.Bonus.2=Impact @@ -36,7 +36,7 @@ Axes.Combat.CritStruck=[[DARK_RED]]You were CRITICALLY hit! Axes.Combat.CritChance=Chance to critically strike: [[YELLOW]]{0} Axes.Combat.CriticalHit=CRITICAL HIT! Axes.Combat.GI.Proc=[[GREEN]]**STRUCK WITH GREAT FORCE** -Axes.Combat.GI.Struck= ** ** BRIFO GAN EFFAITH FWYAF +Axes.Combat.GI.Struck=** ** BRIFO GAN EFFAITH FWYAF Axes.Combat.SS.Length=Skull Splitter Length: [[YELLOW]]{0}s Axes.SubSkill.SkullSplitter.Name=Skull Splitter Axes.SubSkill.SkullSplitter.Description=Deal AoE Damage @@ -55,7 +55,7 @@ Axes.Skills.SS.On=actifadu Penglog Llorweddol Axes.Skills.SS.Refresh=[[GREEN]] Eich [[YELLOW]] Penglog Llorweddol [[GREEN]] gallu ei hadnewyddu! Axes.Skills.SS.Other.Off=Skull Splitter[[GREEN]] has worn off for [[YELLOW]]{0} Axes.Skills.SS.Other.On=[[GREEN]] {0} [[DARK_GREEN]] wedi defnyddio [[RED]] Llorweddol Benglog! -Axes.Skillup= sgiliau Echelau cynyddu {0}. Cyfanswm ({1}) +Axes.Skillup=sgiliau Echelau cynyddu {0}. Cyfanswm ({1}) Excavation.Ability.Lower=[[GRAY]]**YOU LOWER YOUR SHOVEL** Excavation.Ability.Ready=[[GREEN]]**YOU READY YOUR SHOVEL** Excavation.SubSkill.GigaDrillBreaker.Name=Giga Drill Breaker @@ -112,10 +112,10 @@ Herbalism.Listener=Meddygaeth lysieuol: Herbalism.SkillName=HERBALISM Herbalism.Skills.GTe.On=[[GREEN]]**GREEN TERRA ACTIVATED** Herbalism.Skills.GTe.Refresh=[[GREEN]] Eich [[YELLOW]] Green Terra [[GREEN]] gallu ei hadnewyddu! -Herbalism.Skills.GTe.Other.Off= Green terra [[GREEN]] wedi gwisgo i ffwrdd ar gyfer [[YELLOW]] {0} +Herbalism.Skills.GTe.Other.Off=Green terra [[GREEN]] wedi gwisgo i ffwrdd ar gyfer [[YELLOW]] {0} Herbalism.Skills.GTe.Other.On=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Green Terra! Herbalism.Skillup=Herbalism skill increased by {0}. Total ({1}) -Mining.Ability.Length= Hyd Torri\'r Super: [[YELLOW]] {0} s +Mining.Ability.Length=Hyd Torri\'r Super: [[YELLOW]] {0} s Mining.Ability.Locked.0=LOCKED UNTIL {0}+ SKILL (BLAST MINING) Mining.Ability.Locked.1=LOCKED UNTIL {0}+ SKILL (BIGGER BOMBS) Mining.Ability.Locked.2=LOCKED UNTIL {0}+ SKILL (DEMOLITIONS EXPERTISE) @@ -140,9 +140,9 @@ Mining.Skills.SuperBreaker.On=[[GREEN]]**SUPER BREAKER ACTIVATED** Mining.Skills.SuperBreaker.Other.Off=Super Breaker[[GREEN]] has worn off for [[YELLOW]]{0} Mining.Skills.SuperBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Super Breaker! Mining.Skills.SuperBreaker.Refresh=[[GREEN]] Eich [[YELLOW]] Super Torri\'r [[GREEN]] gallu ei hadnewyddu! -Mining.Skillup= sgiliau Mwyngloddio cynyddu {0}. Cyfanswm ({1}) +Mining.Skillup=sgiliau Mwyngloddio cynyddu {0}. Cyfanswm ({1}) Mining.Blast.Boom=[[GRAY]]**BOOM** -Mining.Blast.Radius.Increase= Chwyth Cynnydd Radiws [[YELLOW]] {0} +Mining.Blast.Radius.Increase=Chwyth Cynnydd Radiws [[YELLOW]] {0} Mining.Blast.Rank=Blast Mining: [[YELLOW]] Rank {0}/8 [[GRAY]]({1}) Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Blast Mining! Mining.Blast.Refresh=[[GREEN]] Eich [[YELLOW]] Mwyngloddio Chwyth [[GREEN]] gallu ei hadnewyddu! @@ -182,7 +182,7 @@ Repair.Skills.NotFullDurability=[[DARK_RED]]You can\'t salvage damaged items. Repair.Skills.Mastery=Repair Mastery: [[YELLOW]]Extra {0} durability restored Repair.Skills.StackedItems=[[DARK_RED]]You can\'t repair stacked items. Repair.Skills.Super.Chance=Super Repair Chance: [[YELLOW]]{0} -Repair.Skillup= sgiliau Atgyweirio cynyddu {0}. Cyfanswm ({1}) +Repair.Skillup=sgiliau Atgyweirio cynyddu {0}. Cyfanswm ({1}) Repair.Arcane.Chance.Downgrade=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}% Repair.Arcane.Chance.Success=[[GRAY]] Cyfradd Llwyddiant AF: [[YELLOW]] {0}% Repair.Arcane.Downgrade=Arcane power has decreased for this item. @@ -212,7 +212,7 @@ Swords.SkillName=SWORDS Swords.Skills.SS.Off=**Serrated Strikes has worn off** Swords.Skills.SS.On=[[GREEN]] ** Streiciau danheddog actifadu ** Swords.Skills.SS.Refresh=[[GREEN]]Your [[YELLOW]]Serrated Strikes [[GREEN]]ability is refreshed! -Swords.Skills.SS.Other.Off= Streiciau danheddog [[GREEN]] wedi gwisgo i ffwrdd ar gyfer [[YELLOW]] {0} +Swords.Skills.SS.Other.Off=Streiciau danheddog [[GREEN]] wedi gwisgo i ffwrdd ar gyfer [[YELLOW]] {0} Swords.Skills.SS.Other.On=[[GREEN]] {0} [[DARK_GREEN]] wedi defnyddio [[RED]] Streiciau danheddog! Swords.Skillup=Swords skill increased by {0}. Total ({1}) Swords.SS.Length=Serrated Strikes Length: [[YELLOW]]{0}s @@ -250,14 +250,14 @@ Taming.SubSkill.ThickFur.Description=DMG Reduction, Fire Resistance Taming.Listener.Wolf=[[DARK_GRAY]] Eich sgrialu i blaidd yn \u00f4l i chi ... Taming.Listener=Taming: Taming.SkillName=TAMING -Taming.Skillup= sgiliau Ddofi cynyddu {0}.\u00a0Cyfanswm ({1}) +Taming.Skillup=sgiliau Ddofi cynyddu {0}.\u00a0Cyfanswm ({1}) Taming.Summon.Complete=[[GREEN]]Summoning complete Taming.Summon.Fail.Ocelot=You have too many ocelots nearby to summon any more. Taming.Summon.Fail.Wolf=You have too many wolves nearby to summon any more. Unarmed.Ability.Berserk.Length=Berserk Length: [[YELLOW]]{0}s Unarmed.Ability.Bonus.0=Iron Arm Style Unarmed.Ability.Bonus.1=+{0} DMG Upgrade -Unarmed.Ability.Chance.ArrowDeflect= Saeth wyro cyfle: [[YELLOW]] {0} +Unarmed.Ability.Chance.ArrowDeflect=Saeth wyro cyfle: [[YELLOW]] {0} Unarmed.Ability.Chance.Disarm=Disarm Chance: [[YELLOW]]{0} Unarmed.Ability.IronGrip.Attacker=Your opponent has an iron grip! Unarmed.Ability.IronGrip.Defender=[[GREEN]]Your iron grip kept you from being disarmed! @@ -273,9 +273,9 @@ Unarmed.SubSkill.ArrowDeflect.Name=Arrow Deflect Unarmed.SubSkill.ArrowDeflect.Description=Deflect arrows Unarmed.Listener=Dim Arfau: Unarmed.SkillName=UNARMED -Unarmed.Skills.Berserk.Off= ** arno\\\'i hun wedi gwisgo i ffwrdd ** +Unarmed.Skills.Berserk.Off=** arno\\\'i hun wedi gwisgo i ffwrdd ** Unarmed.Skills.Berserk.On=[[GREEN]]**BERSERK ACTIVATED** -Unarmed.Skills.Berserk.Other.Off= arno\'i hun [[GREEN]] wedi gwisgo i ffwrdd ar gyfer [[YELLOW]] {0} +Unarmed.Skills.Berserk.Other.Off=arno\'i hun [[GREEN]] wedi gwisgo i ffwrdd ar gyfer [[YELLOW]] {0} Unarmed.Skills.Berserk.Other.On=[[GREEN]] {0} [[DARK_GREEN]] wedi defnyddio [[RED]] arno\'i hun! Unarmed.Skills.Berserk.Refresh=[[GREEN]]Your [[YELLOW]]Berserk [[GREEN]]ability is refreshed! Unarmed.Skillup=Unarmed skill increased by {0}. Total ({1}) @@ -295,9 +295,9 @@ Woodcutting.SkillName=Torri coed Woodcutting.Skills.TreeFeller.Off=**Tree Feller has worn off** Woodcutting.Skills.TreeFeller.On=[[GREEN]]**TREE FELLER ACTIVATED** Woodcutting.Skills.TreeFeller.Refresh=[[GREEN]] Eich [[YELLOW]] Feller Coed [[GREEN]] gallu ei hadnewyddu! -Woodcutting.Skills.TreeFeller.Other.Off= Feller Coed [[GREEN]] wedi gwisgo i ffwrdd ar gyfer [[YELLOW]] {0} +Woodcutting.Skills.TreeFeller.Other.Off=Feller Coed [[GREEN]] wedi gwisgo i ffwrdd ar gyfer [[YELLOW]] {0} Woodcutting.Skills.TreeFeller.Other.On=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Tree Feller! -Woodcutting.Skills.TreeFeller.Splinter= EICH AXE GWAHANU I DDWSINAU O DARNAU! +Woodcutting.Skills.TreeFeller.Splinter=EICH AXE GWAHANU I DDWSINAU O DARNAU! Woodcutting.Skills.TreeFeller.Threshold=That tree is too large! Woodcutting.Skillup=Woodcutting skill increased by {0}. Total ({1}) Ability.Generic.Refresh=[[GREEN]]**ABILITIES REFRESHED!** @@ -321,10 +321,10 @@ Commands.Ability.Off=Ability use toggled [[RED]]off Commands.Ability.On=Ability use toggled [[GREEN]]on Commands.AdminChat.Off=Admin Sgwrs unig [[RED]] Oddi ar Commands.AdminChat.On=Admin Chat only [[GREEN]]On -Commands.AdminToggle= - sgwrs gweinyddol Toggle +Commands.AdminToggle=- sgwrs gweinyddol Toggle Commands.Chat.Console=*Console* -Commands.Disabled= Mae\'r gorchymyn yn anabl. -Commands.DoesNotExist= nid Chwaraewr yn bodoli yn y gronfa ddata! +Commands.Disabled=Mae\'r gorchymyn yn anabl. +Commands.DoesNotExist=nid Chwaraewr yn bodoli yn y gronfa ddata! Commands.GodMode.Disabled=mcMMO Godmode Disabled Commands.GodMode.Enabled=mcMMO Godmode Enabled Commands.GodMode.Forbidden=[mcMMO] God Mode not permitted on this world (See Permissions) @@ -353,9 +353,9 @@ Commands.Party.Accept=- Accept party invite Commands.Party.Chat.Off=Party Chat only [[RED]]Off Commands.Party.Chat.On=Party Chat only [[GREEN]]On Commands.Party.Commands=[[GREEN]]--PARTY COMMANDS-- -Commands.Party.Invite.0= RHYBUDD: [[GREEN]] fod wedi derbyn gwahoddiad i barti {0} o {1} -Commands.Party.Kick= oeddech yn cicio o blaid {0}! -Commands.Party.Leave= Yr ydych wedi gadael y blaid honno +Commands.Party.Invite.0=RHYBUDD: [[GREEN]] fod wedi derbyn gwahoddiad i barti {0} o {1} +Commands.Party.Kick=oeddech yn cicio o blaid {0}! +Commands.Party.Leave=Yr ydych wedi gadael y blaid honno Commands.Party.None=You are not in a party. Commands.Party.Quit=- Leave your current party Commands.Party.Teleport= [[RED]]- Teleport to party member @@ -394,8 +394,8 @@ Party.Owner.NotLeader=[[DARK_RED]]You are no longer the party leader. Party.Owner.Player=[[GREEN]]You are now the party leader. Party.Password.Incorrect=Party password is incorrect. Party.Password.Set=[[GREEN]] Blaid cyfrinair wedi ei osod i {0} -Party.Player.Invalid= Nid yw hynny\'n chwaraewr ddilys. -Party.Teleport.Dead= Ni allwch teleport y chwaraewr yn farw. +Party.Player.Invalid=Nid yw hynny\'n chwaraewr ddilys. +Party.Teleport.Dead=Ni allwch teleport y chwaraewr yn farw. Party.Teleport.Player=[[GREEN]]You have teleported to {0}. Party.Teleport.Self=You can\'t teleport to yourself! Party.Teleport.Target=[[GREEN]] {0} wedi teleported i chi. @@ -429,7 +429,7 @@ Effects.Template=[[DARK_AQUA]]{0}: [[GREEN]]{1} Guides.Available=[[GRAY]]Guide for {0} available - type /{1} ? [page] Guides.Header=[[GOLD]]-=[[GREEN]]{0} Guide[[GOLD]]=- Guides.Page.Invalid=Not a valid page number! -Guides.Usage= Usage is /{0} ? [page] +Guides.Usage=Usage is /{0} ? [page] Inspect.Offline=You do not have permission to inspect offline players! Inspect.OfflineStats=mcMMO Stats for Offline Player [[YELLOW]]{0} Inspect.Stats=[[GREEN]]mcMMO Stats for [[YELLOW]]{0} @@ -441,7 +441,7 @@ Skills.Disarmed=[[DARK_RED]] Rydych wedi cael eich diarfogi! Skills.Header=-----[][[GREEN]]{0}[[RED]][]----- Skills.NeedMore=[[DARK_RED]] y bydd angen mwy o [[GRAY]]{0} Skills.Stats={0}[[GREEN]]{1}[[DARK_AQUA]] XP([[GRAY]]{2}[[DARK_AQUA]]/[[GRAY]]{3}[[DARK_AQUA]]) -Skills.TooTired= Yr ydych yn rhy flinedig i ddefnyddio\'r gallu eto. [[YELLOW]]({0}s) +Skills.TooTired=Yr ydych yn rhy flinedig i ddefnyddio\'r gallu eto. [[YELLOW]]({0}s) Stats.Header.Combat=[GOLD]] - = GWRTHSEFYLL SGILIAU = - Stats.Header.Gathering=[[GOLD]] -= CASGLU SGILIAU = = - Stats.Header.Misc=[[GOLD]]-=MISC SKILLS=- diff --git a/bukkit/src/main/resources/locale/locale_da.properties b/bukkit/src/main/resources/locale/locale_da.properties index 087f11d89..2a5177942 100644 --- a/bukkit/src/main/resources/locale/locale_da.properties +++ b/bukkit/src/main/resources/locale/locale_da.properties @@ -380,7 +380,7 @@ Commands.Usage.Page=side Commands.Usage.Player=spiller Commands.Usage.Skill=Evne Commands.Usage.XP=xp -mcMMO.NoInvites= Du har ingen invitationer p\u00e5 nuv\u00e6rende tidspunkt +mcMMO.NoInvites=Du har ingen invitationer p\u00e5 nuv\u00e6rende tidspunkt mcMMO.NoPermission=[[DARK_RED]]Ikke nok Tilladelser. mcMMO.NoSkillNote=[[DARK_GRAY]]Hvis du ikke har adgang til en evne, vil den evne ikke blive vist her. Party.Forbidden=[mcMMO] grupper er ikke tilladt i denne verden (Se Tilladelser) @@ -430,8 +430,8 @@ Effects.Template=[[DARK_AQUA]]{0}: [[GREEN]]{1} Guides.Available=[[GRAY]]Guide for {0} tilg\u00e6ngelige - skriv /{1} ? [page] Guides.Header=[[GOLD]]-=[[GREEN]]{0} Guide[[GOLD]]=- Guides.Page.Invalid=Ikke et gyldigt side nummer! -Guides.Usage= Korrekt brug er /{0} ? [page] -Inspect.Offline= Du har ikke tilladelse til at inspicere offline spillere! +Guides.Usage=Korrekt brug er /{0} ? [page] +Inspect.Offline=Du har ikke tilladelse til at inspicere offline spillere! Inspect.OfflineStats=mcMMO Stats for Offline Spillere [[YELLOW]]{0} Inspect.Stats=[[GREEN]]mcMMO F\u00e6rdigheder for [[YELLOW]]{0} Inspect.TooFar=Du er for langt v\u00e6k til at inspicere denne spiller! diff --git a/bukkit/src/main/resources/locale/locale_de.properties b/bukkit/src/main/resources/locale/locale_de.properties index 722c69880..10b051723 100644 --- a/bukkit/src/main/resources/locale/locale_de.properties +++ b/bukkit/src/main/resources/locale/locale_de.properties @@ -30,7 +30,6 @@ #Giga Bohrhammer in Giga Bohrer umbenannt. #Added Guides.Smelting.Section.1 # --Lumis31 - #ACROBATICS Acrobatics.Ability.Proc=[[GREEN]]**Grazi\u00f6s Abgerollt** Acrobatics.Combat.Proc=[[GREEN]]**Ausgewichen** @@ -47,7 +46,6 @@ Acrobatics.SubSkill.Roll.GraceChance=Grazi\u00f6se Rolle-Chance: [[YELLOW]]{0} Acrobatics.Roll.Text=**Abgerollt** Acrobatics.SkillName=AKROBATIK Acrobatics.Skillup=Akrobatik Skill um {0} gestiegen. Gesamt ({1}) - #ALCHEMY Alchemy.SubSkill.Catalysis.Name=Katalyse Alchemy.SubSkill.Catalysis.Description=Erh\u00F6ht die Braugeschwindigkeit @@ -60,7 +58,6 @@ Alchemy.Concoctions.Rank=Braukunst Rang: [[YELLOW]]{0}/{1} Alchemy.Concoctions.Ingredients=Zutaten [[[YELLOW]]{0}[[RED]]]: [[YELLOW]]{1} Alchemy.SkillName=ALCHEMIE Alchemy.Skillup=Alchemie Skill um {0} gestiegen. Gesamt ({1}) - #ARCHERY Archery.Combat.DazeChance=Chance auf Bet\u00e4ubung: [[YELLOW]]{0} Archery.Combat.RetrieveChance=Chance auf Pfeil-R\u00fcckgewinnung: [[YELLOW]]{0} @@ -74,7 +71,6 @@ Archery.SubSkill.ArrowRetrieval.Description=Chance auf Pfeil-R\u00fcckgewinnung Archery.Listener=Bogen: Archery.SkillName=BOGEN Archery.Skillup=Bogenschie\u00DFen Fertigkeit ist um {0} gestiegen. Gesamt ({1}) - #AXES Axes.Ability.Bonus.0=Axt-Beherrschung Axes.Ability.Bonus.1={0} Zusatz-Schaden @@ -109,7 +105,6 @@ Axes.Skills.SS.Refresh=[[GREEN]]Dein [[YELLOW]]Sch\u00e4del-Spalter [[GREEN]]ist Axes.Skills.SS.Other.Off={0}s [[RED]]Sch\u00e4del-Spalter[[GREEN]] ist [[GREEN]]abgenutzt Axes.Skills.SS.Other.On=[[GREEN]]{0}[[DARK_GREEN]] benutzte [[RED]]Sch\u00e4del-Spalter! Axes.Skillup=Axt Skill um {0} gestiegen. Gesamt ({1}) - #EXCAVATION Excavation.Ability.Lower=[[GRAY]]**Du senkst deine SCHAUFEL** Excavation.Ability.Ready=[[GREEN]]**Deine SCHAUFEL ist bereit** @@ -126,7 +121,6 @@ Excavation.Skills.GigaDrillBreaker.Refresh=[[GREEN]]Dein [[YELLOW]]Giga Bohrer [ Excavation.Skills.GigaDrillBreaker.Other.Off={0}s [[RED]]Giga Bohrer[[GREEN]] ist [[GREEN]]ausgelaufen Excavation.Skills.GigaDrillBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]] benutzte [[RED]]Giga Bohrer! Excavation.Skillup=Graben Skill um {0} gestiegen. Gesamt ({1}) - #FISHING Fishing.Ability.Chance=Anbei\u00DFwahrscheinlichkeit: [[YELLOW]]{0} Fishing.Ability.Info=Zauber-J\u00e4ger: [[GRAY]] **Verbessert sich mit Schatz-J\u00e4ger Rang** @@ -134,7 +128,7 @@ Fishing.Ability.Locked.0=GESPERRT bis Skill {0}+ (Rei\u00DFen) Fishing.Ability.Locked.1=GESPERRT bis Skill {0}+ (Eisangeln) Fishing.Ability.Locked.2=GESPERRT bis Skill {0}+ (Profiangel) Fishing.Ability.Rank=Schatz-J\u00e4ger Rang: [[YELLOW]]{0}/{1} -Fishing.Ability.TH.DropRate= Drop Rate: [[DARK_RED]]Falle: [[YELLOW]]{0} [[GRAY]]Oft: [[YELLOW]]{1} [[GREEN]]Gelegentlich: [[YELLOW]]{2}\n[[BLUE]]Au\u00DFergew\u00F6hnlich: [[YELLOW]]{3} [[LIGHT_PURPLE]]Selten: [[YELLOW]]{4} [[GOLD]]Schatz: [[YELLOW]]{5} [[AQUA]]Schallplatte: [[YELLOW]]{6} +Fishing.Ability.TH.DropRate=Drop Rate: [[DARK_RED]]Falle: [[YELLOW]]{0} [[GRAY]]Oft: [[YELLOW]]{1} [[GREEN]]Gelegentlich: [[YELLOW]]{2}\n[[BLUE]]Au\u00DFergew\u00F6hnlich: [[YELLOW]]{3} [[LIGHT_PURPLE]]Selten: [[YELLOW]]{4} [[GOLD]]Schatz: [[YELLOW]]{5} [[AQUA]]Schallplatte: [[YELLOW]]{6} Fishing.Ability.TH.MagicRate=Zauber-J\u00e4ger Chance: [[YELLOW]]{0} Fishing.Ability.Shake=Rei\u00DFen-Chance: [[YELLOW]]{0} Fishing.Ability.IceFishing=Eisangeln: Angeln im Eis @@ -158,7 +152,6 @@ Fishing.Ability.TH.Boom=[[GRAY]]KARPADOR SETZT PLATSCHER EIN!!! Fishing.Ability.TH.Poison=[[GRAY]]Hier stinkt etwas... Fishing.SkillName=ANGELN Fishing.Skillup=Angel Skill um {0} gestiegen. Gesamt ({1}) - #HERBALISM Herbalism.Ability.DoubleDropChance=Chance auf Doppel-Drops: [[YELLOW]]{0} Herbalism.Ability.FD=Bauernfr\u00fchst\u00fcck: [[YELLOW]]Stufe {0} @@ -195,7 +188,6 @@ Herbalism.Skills.GTe.Refresh=[[GREEN]]Deine [[YELLOW]]Gr\u00fcnes Land [[GREEN]] Herbalism.Skills.GTe.Other.Off={0}s [[RED]]Gr\u00fcnes Land[[GREEN]] ist [[GREEN]]ausgelaufen. Herbalism.Skills.GTe.Other.On=[[GREEN]]{0}[[DARK_GREEN]] benutzte [[RED]]Gr\u00fcnes Land! Herbalism.Skillup=Pflanzenkunde Skill um {0} gestiegen. Gesamt ({1}) - #MINING Mining.Ability.Length=Super-Brecher Dauer: [[YELLOW]]{0}s Mining.Ability.Locked.0=GESPERRT bis Skill {0}+ (Z\u00fcndstoff) @@ -223,7 +215,6 @@ Mining.Skills.SuperBreaker.Other.Off={0}s [[RED]]Super-Brecher[[GREEN]] ist [[GR Mining.Skills.SuperBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]] benutzte [[RED]]Super-Brecher! Mining.Skills.SuperBreaker.Refresh=[[GREEN]]Dein [[YELLOW]]Super-Brecher [[GREEN]]ist wieder bereit! Mining.Skillup=Bergbau Fertigkeit ist um {0} gestiegen. Gesamt ({1}) - #Blast Mining Mining.Blast.Boom=[[GRAY]]**BOOM** Mining.Blast.Effect=+{0} Erze -{1} Schutt, {2}x Drops @@ -231,7 +222,6 @@ Mining.Blast.Radius.Increase=Z\u00fcndstoff Radius Erh\u00f6hung: [[YELLOW]]+{0} Mining.Blast.Rank=Z\u00fcndstoff Rang:[[YELLOW]] {0}/8 [[GRAY]]({1}) Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] benutzte [[RED]]Z\u00fcndstoff! Mining.Blast.Refresh=[[GREEN]]Dein [[YELLOW]]Z\u00fcndstoff [[GREEN]]ist wieder bereit! - #REPAIR Repair.SubSkill.Repair.Name=Reparatur Repair.SubSkill.Repair.Description=Repariere Werkzeuge & R\u00fcstung @@ -265,7 +255,6 @@ Repair.Skills.StackedItems=[[DARK_RED]]Du kannst keine gestapelten Gegenst\u00e4 Repair.Skills.Super.Chance=Super-Reparatur Chance: [[YELLOW]]{0} Repair.Skillup=Reparatur Skill um {0} gestiegen. Gesamt ({1}) Repair.Pretty.Name=Reparatur - #Arcane Forging Repair.Arcane.Chance.Downgrade=[[GRAY]]AS Verminderungs Chance: [[YELLOW]]{0}% Repair.Arcane.Chance.Success=[[GRAY]]AS Erfolgs-Rate: [[YELLOW]]{0}% @@ -274,7 +263,6 @@ Repair.Arcane.Fail=Der Gegenstands wurde entzaubert. Repair.Arcane.Lost=Du hast nicht gen\u00fcgend Skill um Verzauberungen zu erhalten. Repair.Arcane.Perfect=[[GREEN]]Du hast den Zauber-Wert des Gegenstands erhalten. Repair.Arcane.Rank=Arkanes Schmieden Rang: [[YELLOW]]{0}/{1} - #SALVAGE Salvage.Pretty.Name=Verwerten Salvage.SubSkill.AdvancedSalvage.Name=Fortgeschrittenes Verwerten @@ -297,7 +285,6 @@ Salvage.Skills.ArcaneSuccess=[[GREEN]]Du konntest alles Wissen aus diesem Item e Salvage.Listener.Anvil=[[DARK_RED]]Du hast einen Verwertungs-Amboss platziert, benutze ihn um Werkzeuge und R\u00FCstung zu verwerten. Salvage.Listener=Verwerten: Salvage.SkillName=VERWERTEN - #SWORDS Swords.Ability.Lower=[[GRAY]]**Du senkst dein SCHWERT** Swords.Ability.Ready=[[GREEN]]**Dein SCHWERT ist bereit** @@ -328,7 +315,6 @@ Swords.Skills.SS.Other.Off={0}s [[RED]]S\u00e4gezahnschlag[[GREEN]] ist [[GREEN] Swords.Skills.SS.Other.On=[[GREEN]]{0}[[DARK_GREEN]] benutzte [[RED]]S\u00e4gezahnschlag! Swords.Skillup=Schwert Skill um {0} gestiegen. Gesamt ({1}) Swords.SS.Length=S\u00e4gezahnschlag Dauer: [[YELLOW]]{0}s - #TAMING Taming.Ability.Bonus.0=Umweltbewusst Taming.Ability.Bonus.1=W\u00f6lfe weichen Gefahren aus @@ -373,13 +359,12 @@ Taming.Listener=Z\u00e4hmen: Taming.SkillName=Z\u00c4HMEN Taming.Skillup=Z\u00e4hhmen Skill um {0} gestiegen. Gesamt ({1}) Taming.Summon.Complete=[[GREEN]]Beschw\u00f6rung abgeschlossen -Taming.Summon.Lifespan= (Lebenszeit: {0}s) +Taming.Summon.Lifespan=(Lebenszeit: {0}s) Taming.Summon.Fail.Ocelot=Du hast zu viele Ozelots um dich, um weitere zu beschw\u00f6ren. Taming.Summon.Fail.Wolf=Du hast zu viele W\u00f6lfe um dich, um weitere zu beschw\u00f6ren. Taming.Summon.Fail.Horse=Du hast zu viele Pferde um dich, um weitere zu beschw\u00f6ren. Taming.Summon.Fail.TooMany=Du hast das Maximum an beschworenen Tieren erreicht [[YELLOW]]({0}) Taming.Summon.Name.Format={0}''s {1} - #UNARMED Unarmed.Ability.Berserk.Length=Berserker Dauer: [[YELLOW]]{0}s Unarmed.Ability.Bonus.0=Eiserner Arm @@ -409,7 +394,6 @@ Unarmed.Skills.Berserk.Other.Off={0}s [[RED]]Berserker[[GREEN]] ist [[GREEN]]aus Unarmed.Skills.Berserk.Other.On=[[GREEN]]{0}[[DARK_GREEN]] benutzte [[RED]]Berserker! Unarmed.Skills.Berserk.Refresh=[[GREEN]]Dein [[YELLOW]]Berserker [[GREEN]]ist wieder bereit! Unarmed.Skillup=Unbewaffnet Skill um {0} gestiegen. Gesamt ({1}) - #WOODCUTTING Woodcutting.Ability.0=Bl\u00e4ttersturm Woodcutting.Ability.1=Bl\u00e4st Bl\u00e4tter davon @@ -432,13 +416,11 @@ Woodcutting.Skills.TreeFeller.Other.On=[[GREEN]]{0}[[DARK_GREEN]] benutzte [[RED Woodcutting.Skills.TreeFeller.Splinter=Deine Axt zersplittert in tausend kleine Teile! Woodcutting.Skills.TreeFeller.Threshold=Dieser Baum ist zu gro\u00DF! Woodcutting.Skillup=Holzf\u00e4ller Skill um {0} gestiegen. Gesamt ({1}) - #ABILITIY ##generic Ability.Generic.Refresh=[[GREEN]]**F\u00e4higkeit wieder BEREIT!** Ability.Generic.Template.Lock=[[GRAY]]{0} Ability.Generic.Template=[[GOLD]]{0}: [[DARK_AQUA]]{1} - #COMBAT Combat.ArrowDeflect=[[WHITE]]**Pfeil ABGELENKT** Combat.BeastLore=[[GREEN]]**BESTIENKUNDE** @@ -448,7 +430,6 @@ Combat.Gore=[[GREEN]]**AUFGESCHLITZT** Combat.StruckByGore=**du wurdest AUFGESCHLITZT** Combat.TargetDazed=Ziel wurde [[DARK_RED]]BET\u00c4UBT Combat.TouchedFuzzy=[[DARK_RED]]Ungl\u00fccklich ber\u00fchrt. Schwindelgef\u00fchl. - #COMMANDS ##generic mcMMO.Description=[[DARK_AQUA]]\u00DCber das [[YELLOW]]mcMMO[[DARK_AQUA]] Projekt: [[GOLD]]mcMMO ist ein [[RED]]open source[[GOLD]] RPG mod der im Februar 2011,[[GOLD]]von [[BLUE]]com.gmail.nossr50[[GOLD]] erstellt wurde. Ziel ist es eine gute RPG Erfahrung zu vermitteln.,[[DARK_AQUA]]Tipps:,[[GOLD]] - [[GREEN]]Benutz [[RED]]/mcmmo help[[GREEN]] um Befehle zu sehen,[[GOLD]] - [[GREEN]]Tippe [[RED]]/SKILLNAME[[GREEN]] um detaillierte Skillinformationen zu sehen,[[DARK_AQUA]]Entwickler:,[[GOLD]] - [[GREEN]]com.gmail.nossr50 [[BLUE]](Gr\u00FCnder),[[GOLD]] - [[GREEN]]GJ [[BLUE]](Projektleitung),[[GOLD]] - [[GREEN]]NuclearW [[BLUE]](Entwickler),[[GOLD]] - [[GREEN]]bm01 [[BLUE]](Entwickler),[[GOLD]] - [[GREEN]]TfT_02 [[BLUE]](Entwickler),[[GOLD]] - [[GREEN]]Glitchfinder [[BLUE]](Entwickler),[[GOLD]] - [[GREEN]]t00thpick1 [[BLUE]](Entwickler),[[GOLD]] - [[GREEN]]lumis31 [[BLUE]](Deutsche \u00DCbersetzung), [[DARK_AQUA]]N\u00FCtzliche Links:,[[GOLD]] - [[GREEN]]https://github.com/mcMMO-Dev/mcMMO/issues[[GOLD]] Bug Reporting,[[GOLD]] - [[GREEN]]#mcmmo @ irc.esper.net[[GOLD]] IRC Chat, @@ -471,7 +452,7 @@ Commands.Cooldowns.Row.Y=\ [[AQUA]]{0}[[WHITE]] - [[DARK_GREEN]]Bereit! Commands.Database.Cooldown=Du musst 1 Sekunde warten bevor du diesen Befehl erneut verwenden darfst. Commands.Database.Processing=Dein vorheriger Befehl wird noch verarbeitet. Bitte warten. Commands.Disabled=Dieser Befehl ist deaktiviert. -Commands.DoesNotExist= [[RED]]Spieler in Datenbank nicht vorhanden! +Commands.DoesNotExist=[[RED]]Spieler in Datenbank nicht vorhanden! Commands.GodMode.Disabled=mcMMO Godmode deaktiviert Commands.GodMode.Enabled=mcMMO Godmode aktiviert Commands.GodMode.Forbidden=[mcMMO] Der Godmode ist in dieser Welt nicht erlaubt(Siehe Permissions) @@ -557,7 +538,7 @@ Commands.Party.Alliance.Invite.Accepted=[[GREEN]]B\u00FCndnis Anfrage angenommen Commands.Party.Alliance.None=Deine Party hat keine Verb\u00FCndeten. Commands.Party.Alliance.AlreadyAllies=Deine Party ist bereits in einem B\u00FCndnis. Trenne mit[[DARK_AQUA]]/party alliance disband Commands.Party.Alliance.Help.0=Diese Party ist in keinem B\u00FCndnis. Lade einen Party Anf\u00FChrer an. -Commands.Party.Alliance.Help.1= um zu verb\u00FCnden [[DARK_AQUA]]/party alliance invite [[RED]]. +Commands.Party.Alliance.Help.1=um zu verb\u00FCnden [[DARK_AQUA]]/party alliance invite [[RED]]. Commands.ptp.Enabled=Party Teleport [[GREEN]]aktiviert Commands.ptp.Disabled=Party Teleport [[RED]]deaktiviert Commands.ptp.NoRequests=Du hast aktuell keine teleportanfragen. @@ -606,7 +587,6 @@ Commands.Usage.XP=xp mcMMO.NoInvites=Du hast zurzeit keine Einladungen mcMMO.NoPermission=[[DARK_RED]]Unzureichende Berechtigungen. mcMMO.NoSkillNote=[[DARK_GRAY]]Wenn du keinen Zugriff auf einen Skill hast wird er hier nicht angezeigt. - ##party Party.Forbidden=[mcMMO] Parties not permitted on this world (See Permissions) Party.Help.0=Proper usage is [[DARK_AQUA]]{0} [password]. @@ -633,7 +613,7 @@ Party.NotOwner=[[DARK_RED]]You are not the party leader. Party.Target.NotOwner=[[DARK_RED]]{0} is not the party leader. Party.Owner.New=[[GREEN]]{0} is the new party leader. Party.Owner.NotLeader=[[DARK_RED]]You are no longer the party leader. -Party.Owner.Player =[[GREEN]]You are now the party leader. +Party.Owner.Player=[[GREEN]]You are now the party leader. Party.Password.None=This party is password protected. Please provide a password to join. Party.Password.Incorrect=Party password is incorrect. Party.Password.Set=[[GREEN]]Party password set to {0} @@ -683,7 +663,6 @@ Party.ItemShare.Category.Mining=Mining Party.ItemShare.Category.Herbalism=Herbalism Party.ItemShare.Category.Woodcutting=Woodcutting Party.ItemShare.Category.Misc=Misc - ##xp Commands.XPGain.Acrobatics=Fallen Commands.XPGain.Alchemy=Tr\u00E4nke brauen @@ -710,27 +689,23 @@ Commands.xprate.proper.2=Bitte spezifiziere mit true/false ob dies ein XP-Event Commands.xprate.started.0=[[GOLD]]Das XP EVENT f\u00fcr mcMMO hat BEGONNEN! Commands.xprate.started.1=[[GOLD]]Die mcMMO XP RATE liegt nun bei {0}x! XPRate.Event=[[GOLD]]mcMMO hat gerade ein XP-RATE Event. Derzeitige XP Rate: {0}x! - #EFFECTS ##generic Effects.Effects=EFFEKTE Effects.Child=[[DARK_GRAY]]LVL: [[GREEN]]{0} Effects.Level=[[DARK_GRAY]]LVL: [[GREEN]]{0} [[DARK_AQUA]]XP[[YELLOW]]([[GOLD]]{1}[[YELLOW]]/[[GOLD]]{2}[[YELLOW]]) -Effects.Parent= [[GOLD]]{0} - +Effects.Parent=[[GOLD]]{0} - Effects.Template=[[DARK_AQUA]]{0}: [[GREEN]]{1} - #GUIDES Guides.Available=[[GRAY]]Anleitung f\u00FCr {0} vorhanden - tippe /{1} ? [Seite] Guides.Header=[[GOLD]]-=[[GREEN]]{0} Anleitung[[GOLD]]=- Guides.Page.Invalid=Keine g\u00FCltige Seitenzahl! Guides.Page.OutOfRange=Es gibt nur insgesamt {0} Seiten. -Guides.Usage= Der Befehl ist /{0} ? [Seite] - +Guides.Usage=Der Befehl ist /{0} ? [Seite] ##Acrobatics Guides.Acrobatics.Section.0=[[DARK_AQUA]]\u00DCber Akrobatik:\n[[YELLOW]]Akrobatik ist die Kunst sich grazi\u00F6s fortzubewegen.\n[[YELLOW]]Fall- und Kampfschaden werden reduziert\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]XP sammelst du indem du in K\u00E4mpfen\n[[YELLOW]]ausweichst, oder St\u00FCrze aus gro\u00DFen H\u00F6hen \u00FCberlebst. Guides.Acrobatics.Section.1=[[DARK_AQUA]]Wie funktioniert Rollen?\n[[YELLOW]]Ab und zu rollst du beim Fallen ab und der Fallschaden wird\n[[YELLOW]]reduziert. Wenn du den Schleichen Knopf w\u00E4hrend dem Fallen\n[[YELLOW]]h\u00E4ltst, verdoppelt sich die Wahrscheinlichkeit abzurollen.\n[[YELLOW]]In dem Fall rollst du grazi\u00F6s ab.\n[[YELLOW]]Grazi\u00F6se Rollen sind gleich wie normale Rollen, nur dass\n[[YELLOW]]sie \u00F6fter passieren und damit mehr Schutz vor St\u00FCrzen\n[[YELLOW]]liefern. Guides.Acrobatics.Section.2=[[DARK_AQUA]]Wie funktioniert Ausweichen?\n[[YELLOW]]Ausweichen ist eine passive F\u00E4higkeit\n[[YELLOW]]die ab und zu den Schaden in K\u00E4mpfen halbiert.\n[[YELLOW]]Die Wahrscheinlichkeit auszuweichen ist abh\u00E4ngig vom \n[[YELLOW]]Akrobatiklevel. - ##Alchemy Guides.Alchemy.Section.0=[[DARK_AQUA]]\u00DCber Alchemie:\n[[YELLOW]]In Alchemie musst du Tr\u00E4nke brauen.\n[[YELLOW]]Mit h\u00F6herem Level werden die Tr\u00E4nke schneller\n[[YELLOW]]gebraut und neue Zutaten f\u00FCr zun\u00E4chst unerh\u00E4ltliche Tr\u00E4nke \n[[YELLOW]]freigeschaltet.\n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]Tr\u00E4nke brauen. Guides.Alchemy.Section.1=[[DARK_AQUA]]Wie funktioniert Katalyse?\n[[YELLOW]]Katalyse beschleunigt das Brauen von Tr\u00E4nken bis\n[[YELLOW]]zu 4-facher Geschwindigkeit bei Level 1000.\n[[YELLOW]] @@ -739,14 +714,12 @@ Guides.Alchemy.Section.3=[[DARK_AQUA]]Braukunst Tier 1 Zutaten:\n[[YELLOW]]Lohne Guides.Alchemy.Section.4=[[DARK_AQUA]]Braukunst Tier 2 Zutaten:\n[[YELLOW]]Karotte (Eile)\n[[YELLOW]]Schleimball (Langsamkeit)\n\n[[DARK_AQUA]]Braukunst Tier 3 Zutaten:\n[[YELLOW]]Quarz (Absoption)\n[[YELLOW]]Roter Pilz (Springen) Guides.Alchemy.Section.5=[[DARK_AQUA]]Braukunst Tier 4 Zutaten:\n[[YELLOW]]Apfel (Gesundheitsboost)\n[[YELLOW]]Verrottetes Fleisch (Hunger)\n\n[[DARK_AQUA]]Braukunst Tier 5 Zutaten:\n[[YELLOW]]Brauner Pilz(\u00DCbelkeit)\n[[YELLOW]]Tintensack (Blindheit) Guides.Alchemy.Section.6=[[DARK_AQUA]]Braukunst Tier 6 Zutaten:\n[[YELLOW]]Gras (S\u00E4ttigung)\n\n[[DARK_AQUA]]Braukunst Tier 7 Zutaten:\n[[YELLOW]]Giftige Kartoffel(Verwesung)\n\n[[DARK_AQUA]]Braukunst Tier 8 Zutaten:\n[[YELLOW]]Normaler Goldener Apfel (Resistenz) - ##Archery Guides.Archery.Section.0=[[DARK_AQUA]]\u00DCber Bogenschie\u00DFen:\n[[YELLOW]]In Bogenschie\u00DFen geht es um die Verwendung von Pfeil und\n[[YELLOW]]Bogen.\n\n[[YELLOW]]Es gibt unterschiedliche Kampfboni, wie Zusatzschaden,\n[[YELLOW]]der mit dem Level steigt und der F\u00E4higkeit Feinde im PVP\n[[YELLOW]]zu bet\u00E4uben. Zus\u00E4tzlich kannst du einige verschossene\n[[YELLOW]]Pfeile aus den Leichen deiner Feinde wiedergewinnen. Guides.Archery.Section.1=[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]XP erh\u00E4ltst du durch das Abschie\u00DFen von Monstern und\n[[YELLOW]]anderen Spielern. Guides.Archery.Section.2=[[DARK_AQUA]]Wie funktioniert der Kunstschuss?\n[[YELLOW]]Kunstschuss erh\u00F6ht den Schaden deines Schusses.\n[[YELLOW]]Der Zusatzschaden steigt mit deinem Bogen Level.\n[[YELLOW]]In den Standardeinstellungen steigt der Schaden um 10%\n[[YELLOW]]alle 50 Level, mit einem Maximum von 200% extra. Guides.Archery.Section.3=[[DARK_AQUA]]Wie Funktioniert Bet\u00E4ubung?\n[[YELLOW]]Du hast eine passive Wahrscheinlichkeit andere Spieler\n[[YELLOW]]zu bet\u00E4uben wenn du sie anschie\u00DFt. Der Spieler wird\n[[YELLOW]]gezwungen f\u00FCr eine kurze Weile senkrecht nach oben zu\n[[YELLOW]]schauen.\n[[YELLOW]]Ein Bet\u00E4ubungsschuss f\u00FCgt au\u00DFerdem 4 Schadenspunkte \n[[YELLOW]](2 Herzen) extra zu. Guides.Archery.Section.4=[[DARK_AQUA]]Wie funktioniert die Pfeilr\u00FCckgewinnung?\n[[YELLOW]]Du hast eine passive Wahrscheinlichkeit einige Pfeile\n[[YELLOW]]zur\u00FCckzubekommen wenn du Monster mit dem Bogen t\u00F6test.\n[[YELLOW]]Die Wahrscheinlichkeit steigt mit dem Bogen Level.\n[[YELLOW]]Standardm\u00E4\u00DFig steigt diese F\u00E4higkeit um 0.1% pro Level, bis\n[[YELLOW]]100% bei Level 1000. - ##Axes Guides.Axes.Section.0=[[DARK_AQUA]]\u00DCber Axt:\n[[YELLOW]]Mit dem Axt Skill kannst du die Axt f\u00FCr viel mehr als\n[[YELLOW]]nur abholzen verwenden! Du kannst Monster und Spieler\n[[YELLOW]]sprichw\u00F6rtlich weghacken und ihnen t\u00F6dliche\n[[YELLOW]]Schl\u00E4ge verpassen oder sie zur\u00FCckweichen lassen\n[[YELLOW]]Deine Axt zerst\u00F6rt au\u00DFerdem sehr gut R\u00FCstungen,\n[[YELLOW]]was mit h\u00F6herem Level noch mehr ansteigt. Guides.Axes.Section.1=[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]Um XP zu bekommen musst du Spieler oder Monster \n[[YELLOW]]mit einer Axt schlagen. @@ -755,7 +728,6 @@ Guides.Axes.Section.3=[[DARK_AQUA]]Wie funktionieren kritische Treffer?\n[[YELLO Guides.Axes.Section.4=[[DARK_AQUA]]Wie funktioniert die Axt-Beherrschung?\n[[YELLOW]]Axt Beherrschung ist eine passive F\u00E4higkeit die deinen\n[[YELLOW]]Axt-Schl\u00E4gen Zusatzschaden hinzuf\u00FCgt.\n[[YELLOW]]Standardm\u00E4\u00DFig steigt der Schaden um 1 alle 50 Level,\n[[YELLOW]]maximal auf 4 Extraschaden bei Level 200. Guides.Axes.Section.5=[[DARK_AQUA]]Wie funktioniert Wucht?\n[[YELLOW]]Schlage m\u00E4chtig zu und zerst\u00F6re R\u00FCstungen!\n[[YELLOW]]Wucht hat eine passive Wahrscheinlichkeit gegnerische\n[[YELLOW]]R\u00FCstung zu besch\u00E4digen. Dieser Schaden steigt mit deinem Axt\n[[YELLOW]]Level. Guides.Axes.Section.6=[[DARK_AQUA]]Wie funktioniert der Wucht-Schlag?\n[[YELLOW]]Du hast eine passive Chance Monster und\n[[YELLOW]]Spieler beim Schlag zur\u00FCckweichen zu lassen\n[[YELLOW]]Standardm\u00E4\u00DFig ist die Wahrscheinlichkeit 25%\n[[YELLOW]]Zus\u00E4tzlich f\u00FCgst du Zusatzschaden zu. - ##Excavation Guides.Excavation.Section.0=[[DARK_AQUA]]\u00DCber Graben:\n[[YELLOW]]Graben ist die F\u00E4higkeit Sch\u00E4tze im Dreck zu finden.\n[[YELLOW]]Durch Aufgraben des Landes wirst du Sch\u00E4tze finden\n[[YELLOW]]Je l\u00E4nger du das tust, desto mehr Sch\u00E4tze findest du.\n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]XP erh\u00E4ltst du durch Schaufeln.\n[[YELLOW]]Nur bestimmte Materialen geben XP und Sch\u00E4tze. Guides.Excavation.Section.1=[[DARK_AQUA]]Kompatible Materialien:\n[[YELLOW]]Gras, Erde, Sand, Lehm, Kies, Myzel, Seelensand, Schnee @@ -764,7 +736,6 @@ Guides.Excavation.Section.3=[[DARK_AQUA]]Was ist der Giga Bohrer?\n[[YELLOW]]Gig Guides.Excavation.Section.4=[[DARK_AQUA]]Wie funktioniert der Schatz J\u00E4ger?\n[[YELLOW]]Jeder m\u00F6gliche Schatz hat seine eigene Level Voraussetzung\n[[YELLOW]]um zu erscheinen, folglich ist es schwer[[YELLOW]]zu sagen inwiefern es \n[[YELLOW]]dir hilft ein höheres Level zu haben.\n[[YELLOW]]Je h\u00F6her das Level, desto mehr Sch\u00E4tze k\u00F6nnen gefunden\n[[YELLOW]]werden. Guides.Excavation.Section.5=Beachte au\u00DFerdem, dass jedes kompatible Material seine\n[[YELLOW]]eigenen einzigartigen Sch\u00E4tze hat.\n[[YELLOW]]Anders ausgedr\u00FCckt: Sch\u00E4tze die du in Kies findest\n[[YELLOW]]gibt es nicht zwingend in Erde. Guides.Excavation.Section.6=[[DARK_AQUA]]Bemerkung zu Graben:\n[[YELLOW]]Graben Drops sind vollkommen anpassbar\n[[YELLOW]]Ergebnisse unterscheiden sich deshalb von Server zu Server. - ##Fishing Guides.Fishing.Section.0=[[DARK_AQUA]]\u00DCber Angeln:\n[[YELLOW]]Mit dem Angeln Skill ist Angeln wieder aufregend!\n[[YELLOW]]Finde versteckte Sch\u00E4tze oder Rei\u00DFe Items von Monstern.\n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]Fang Fische. Guides.Fishing.Section.1=[[DARK_AQUA]]Wie funktioniert der Schatz J\u00E4ger?\n[[YELLOW]]Mit dieser F\u00E4higkeit kannst du beim Angeln Sch\u00E4tze finden.\n[[YELLOW]]Diese k\u00F6nnen sogar verzaubert sein!\n[[YELLOW]]Jeder m\u00F6gliche Schatz kann mit jedem Level gefunden\n[[YELLOW]]werden. Die H\u00E4ufigkeit h\u00E4ngt von dem Wert des Items ab.\n[[YELLOW]]Je h\u00F6her der Angeln Skill ist, desto einfacher wird es\n[[YELLOW]]wertvolle Sch\u00E4tze zu finden. @@ -773,7 +744,6 @@ Guides.Fishing.Section.3=[[DARK_AQUA]]Wie funktioniert die Profiangel?\n[[YELLOW Guides.Fishing.Section.4=[[DARK_AQUA]]Wie funktioniert Rei\u00DFen?\n[[YELLOW]]Diese F\u00E4higkeit erm\u00F6glich es Monstern Items zu entrei\u00DFen,\n[[YELLOW]]indem du sie an deine Angel h\u00E4ngst. \n[[YELLOW]]Die Monster lassen das Item, das sie normalerweise beim Tod\n[[YELLOW]]fallen lassen fallen.\n[[YELLOW]]Au\u00DFerdem gibt es eine kleine Wahrscheinlichkeit Monstersch\u00E4del\n[[YELLOW]]zu bekommen. Guides.Fishing.Section.5=[[DARK_AQUA]]Wie funktioniert die Fischer-Mahlzeit?\n[[YELLOW]]Du wirst beim Essen von Fisch besser satt. Guides.Fishing.Section.6=[[DARK_AQUA]]Bemerkung zum Angeln:\n[[YELLOW]]Angeln Drops sind vollkommen anpassbar.\n[[YELLOW]]Ergebnisse unterscheiden sich deshalb von Server zu Server. - ##Herbalism Guides.Herbalism.Section.0=[[DARK_AQUA]]\u00DCber Pflanzenkunde\n[[YELLOW]]In Pflanzenkunde geht es um das Ernten.\n\n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]Ernte Pflanzen. Guides.Herbalism.Section.1=[[DARK_AQUA]]Kompatible Blocks\n[[YELLOW]]Weizen, Kartoffeln, Karotten, Melonen, K\u00FCrbisse,\n[[YELLOW]]Zuckerrohr, Kakaobohnen, Blumen, Kakteen,\n[[YELLOW]]Pilze, Netherwarzen, Seerosen und Ranken. @@ -783,7 +753,6 @@ Guides.Herbalism.Section.4=[[DARK_AQUA]]Wie funktioniert der Gr\u00FCne Daumen(B Guides.Herbalism.Section.5=[[DARK_AQUA]]Wie funktioniert das Bauernfr\u00FChst\u00FCck?\n[[YELLOW]]Du wirst beim Essen von Brot, Keksen, Melonen, Pilzsuppe,\n[[YELLOW]]Karotten und Kartoffeln satter. Guides.Herbalism.Section.6=[[DARK_AQUA]]Wie funktioniert Hylians Gl\u00FCck?\n[[YELLOW]]Diese passive F\u00E4higkeit gibt dir eine Chance Items zu finden\n[[YELLOW]]wenn du bestimmte Bl\u00F6cke mit dem Schwert abbaust. Guides.Herbalism.Section.7=[[DARK_AQUA]]Wie funktionieren Doppeldrops?\n[[YELLOW]]Du erh\u00E4ltst beim Ernten mehr Ertrag. - ##Mining Guides.Mining.Section.0=[[DARK_AQUA]]\u00DCber Bergbau:\n[[YELLOW]]Im Bergbau musst du Steine und Erze sammeln. Du erh\u00E4ltst\n[[YELLOW]]ab und zu zus\u00E4tzliche Drops.\n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]Um Erfahrung zu sammeln musst du mit der Spitzhacke abbauen.\n[[YELLOW]]Nur bestimmte Blocks geben XP. Guides.Mining.Section.1=[[DARK_AQUA]]Kompatible Materialien:\n[[YELLOW]]Stein, Kohleerz, Eisenerz, Golderz, Diamanterz, Redstoneerz,\n[[YELLOW]]Lapiserz, Obsidian, Bemooster Bruchstein, Endstein,\n[[YELLOW]]Glowstone, und Netherrack. @@ -791,31 +760,26 @@ Guides.Mining.Section.2=[[DARK_AQUA]]Wie funktioniert Super-Brecher?:\n[[YELLOW] Guides.Mining.Section.3=[[DARK_AQUA]]Was ist Super-Brecher?\n[[YELLOW]]Super-Brecher ist eine F\u00E4higkeit deren Dauer\n[[YELLOW]]vom Bergbau Skill abh\u00E4ngt. Es verdreifacht die \n[[YELLOW]]Wahrscheinlichkeit Sch\u00E4tze zu finden und erm\u00F6glicht\n[[YELLOW]]sofortiges Abbauen kompatibler Materialien. Guides.Mining.Section.4=[[DARK_AQUA]]Wie benutzt man Z\u00FCndstoff?:\n[[YELLOW]]Halte ein Feuerzeug in der Hand, b\u00FCck dich und klicke aus\n[[YELLOW]]sicherer Entfernung mit der rechten Maustaste auf das TNT.\n[[YELLOW]]Das TNT wird sofort explodieren. Guides.Mining.Section.5=[[DARK_AQUA]]Wie funktioniert Z\u00FCndstoff?\n[[YELLOW]]Z\u00FCndstoff ist eine F\u00E4higkeit mit einer Abklingzeit, deren St\u00E4rke\n[[YELLOW]]vom Level abh\u00E4ngt. Sie erlaubt dir beim Abbauen mit TNT dieses\n[[YELLOW]]aus der Ferne zu z\u00FCnden. Z\u00FCndstoff besteht aus 3 Teilen.\n[[YELLOW]]Erstens dem Sprengmeister mit gr\u00F6\u00DFeren Explosionen\n[[YELLOW]]Zweitens dem Explosions-Experten, der Schaden von TNT\n[[YELLOW]]reduziert.\n[[YELLOW]]Die dritte F\u00E4higkeit erh\u00F6ht einfach den Erzertrag und\n[[YELLOW]]und reduziert den Schutt. - ##Repair Guides.Repair.Section.0=[[DARK_AQUA]]\u00DCber Reparatur:\n[[YELLOW]]Reparatur erlaub dir an einem Eisenblock Werkzeuge und\n[[YELLOW]]Waffen zu reparieren.\n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]Repariere Werkzeuge am Eisenblockamboss\n[[RED]]Achtung: [[YELLOW]]Das ist nicht der normale Minecraft Amboss! Guides.Repair.Section.1=[[DARK_AQUA]]Wie kann ich Reparatur verwenden?\n[[YELLOW]]Platziere einen mcMMO Amboss, halte das zu reparierende Item\n[[YELLOW]]in der Hand und klicke mit der rechten Maustaste auf ihn. Zum\n[[YELLOW]]Reparieren benötigst du die Ausgangsmaterialien im Inventar,\n[[YELLOW]]diese werden dir im Zuge der Reparatur abgezogen. Guides.Repair.Section.2=[[DARK_AQUA]]Wie funktioniert der Reparatur Meister?\n[[YELLOW]]Mit dem Reparatur Meister wird dein Werkzeug ein bisschen\n[[YELLOW]]besser als normalerweise repariert.\n[[YELLOW]]Der Bonus ist abh\u00E4ngig vom Reparatur Level. Guides.Repair.Section.3=[[DARK_AQUA]]Wie funktioniert Super Reparatur?\n[[YELLOW]]Mit Super Reparatur werden ab und zu deine Items\n[[YELLOW]]doppelt so gut repariert. Guides.Repair.Section.4=[[DARK_AQUA]]Wie funktioniert Arkanes Schmieden?\n[[YELLOW]]Diese F\u00E4higkeit erm\u00F6glicht dir mit einer gewissen\n[[YELLOW]]Wahrscheinlichkeit Verzauberungen auf Items zu erhalten.\n[[YELLOW]]Verzauberungen k\u00F6nnen erhalten, vermindert werden oder\n[[YELLOW]]ganz verloren gehen. - ##Salvage Guides.Salvage.Section.0=[[DARK_AQUA]]\u00DCber Verwerten:\n[[YELLOW]]Mit einem Goldamboss kannst du R\u00FCstungen und\n[[YELLOW]]Werkzeuge verwerten.\n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]Verwerten ist ein vom Angeln und Reparieren abh\u00E4ngiger Skill\n[[YELLOW]]Sein Level ist die H\u00E4lfte von deren Summe. Guides.Salvage.Section.1=[[DARK_AQUA]]Wie funktioniert Verwerten?\n[[YELLOW]]Platziere einen Goldamboss und rechtsklicke mit dem Item in\n[[YELLOW]]der Hand. Das item wird zerst\u00F6rt und in seine\n[[YELLOW]]Bestandteile zerlegt.\n\n[[YELLOW]]Beispielsweise gibt eine Eisenaxt Eisenbarren. Guides.Salvage.Section.2=[[DARK_AQUA]]Wie funktioniert Fortgeschrittenes Verwerten?\n[[YELLOW]]Sobald freigeschaltet, kannst du besch\u00E4digte Items verwerten.\n[[YELLOW]]Der Ertrag steigt mit dem Level.\n[[YELLOW]]Der Mindestertrag ist immer 1 Item, ansonsten kannst du nicht\n[[YELLOW]]verwerten. Guides.Salvage.Section.3=[[DARK_AQUA]]Zur Verbildlichung ein Beispiel:\n[[YELLOW]]Sagen wir verwerten eine Goldene Spitzhacke mit 80%\n[[YELLOW]]Haltbarkeit, bedeutet das, dass wir nur 2 Gold bekommen\n[[YELLOW]]k\u00F6nnen (Spitzhacke=3 Goldbarren, also jeder 33,33%\n[[YELLOW]]Haltbarkeit) was 66% entspricht. Wenn dein\n[[YELLOW]]Ertragsprozentsatz unter 66% liegt wirst du keine 2 Barren\n[[YELLOW]]bekommen k\u00F6nnen. Wenn sie dar\u00FCber ist, kannst du den\n[[YELLOW]]"gesamten Betrag" bekommen, der aus 2 Eisenbarren besteht. Guides.Salvage.Section.4=[[DARK_AQUA]]Wie funktioniert Arkanes Verwerten?\n[[YELLOW]]Diese F\u00E4higkeit erm\u00F6glicht es verzauberte B\u00FCcher beim\n[[YELLOW]]Verwerten von verzauberten Items zu bekommen.\n[[YELLOW]]Verzauberungen k\u00F6nnen vollkommen oder teilweise extrahiert\n[[YELLOW]]werden.\n[[YELLOW]]Bei einer teilweisen Extraktion wird das Verzauberungslevel\n[[YELLOW]]reduziert. - ##Smelting Guides.Smelting.Section.0=Kommt irgendwann mal... Guides.Smelting.Section.1=Immer noch hier? - ##Swords Guides.Swords.Section.0=[[DARK_AQUA]]\u00DCber Schwerter:\n[[YELLOW]]Diese F\u00E4higkeit gibt Kampfboni bei Benutzung\n[[YELLOW]]des Schwertes.\n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]Verletze Monster und Spieler mit dem Schwert. Guides.Swords.Section.1=[[DARK_AQUA]]Wie funktioniert der S\u00E4gezahnschlag??\n[[YELLOW]]S\u00E4gezahnschlag ist eine aktive F\u00E4higkeit die du mit Rechtsklick \n[[YELLOW]]aktivierst.\n[[YELLOW]]Mit dieser F\u00E4higkeit kannst du Fl\u00E4chenschaden verteilen. \n[[YELLOW]]Au\u00DFerdem blutet das Ziel f\u00FCr kurze Zeit. Guides.Swords.Section.2=[[DARK_AQUA]]Wie funktioniert der Gegenangriff?\n[[YELLOW]]Gegenangriff ist eine aktive F\u00E4higkeit,\n[[YELLOW]]bei der Angriffe von Monstern beim Blocken um bis zu 50%\n[[YELLOW]]des erhaltenen Schadens reflektiert werden k\u00F6nnen. Guides.Swords.Section.3=[[DARK_AQUA]]Wie funktioniert Blutung?\n[[YELLOW]]Blutung f\u00FCgt den Gegnern alle 2 Sekunden Schaden zu. Das\n[[YELLOW]]Bluten geht solange bis die F\u00E4higkeit ausl\u00E4uft oder der\n[[YELLOW]]Gegner stirbt.\n[[YELLOW]]Die Dauer der Blutung erh\u00F6ht sich mit dem Schwert Skill. - ##Taming Guides.Taming.Section.0=[[DARK_AQUA]]\u00DCber Z\u00E4hmen:\n[[YELLOW]]Z\u00E4hmen gibt dem Spieler diverse Kampfboni beim Kampf mit\n[[YELLOW]]gez\u00E4hmten W\u00F6lfen.\n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]Um XP zu bekommen musst du Tiere z\u00E4hmen oder mit\n[[YELLOW]]deinen W\u00F6lfen k\u00E4mpfen. Guides.Taming.Section.1=[[DARK_AQUA]]Wie funktioniert Ruf der Wildnis?\n[[YELLOW]]Ruf der Wildnis ist eine aktive F\u00E4higkeit die dir erlaubt\n[[YELLOW]]einen Wolf, einen Ozelot oder ein Pferd an deine Seite zu\n[[YELLOW]]rufen. \n[[YELLOW]]Das tust du, indem du Linksklickst w\u00E4hrend du Knochen, Fisch\n[[YELLOW]]oder \u00C4pfel in der Hand h\u00E4ltst. @@ -826,7 +790,6 @@ Guides.Taming.Section.5=[[DARK_AQUA]]Wie funktioniert Umweltbewusst?\n[[YELLOW]] Guides.Taming.Section.6=[[DARK_AQUA]]Wie funktioniert Dicker Pelz?\n[[YELLOW]]Diese passive F\u00E4higkeit reduziert Schaden und \n[[YELLOW]]macht W\u00F6lfe feuerresistent. Guides.Taming.Section.7=[[DARK_AQUA]]Wie funktioniert Schocksicher?\n[[YELLOW]]Diese passive F\u00E4higkeit reduziert den Schaden\n[[YELLOW]]durch Explosionen. Guides.Taming.Section.8=[[DARK_AQUA]]Wie funktioniert Schnell-Imbiss?\n[[YELLOW]]Diese passive F\u00E4higkeit gibt dem Wolf eine Chance sich zu \n[[YELLOW]]erholen wann immer er einen Gegner verletzt. - ##Unarmed Guides.Unarmed.Section.0=[[DARK_AQUA]]\u00DCber Unbewaffnet:\n[[YELLOW]]Mit Unbewaffnet kann der echte Mann endlich mit seinen\n[[YELLOW]]F\u00E4usten angemessen zuschlagen. \n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]K\u00E4mpfe unbewaffnet gegen Monster und andere Spieler Guides.Unarmed.Section.1=[[DARK_AQUA]]Wie funktioniert Berserker?\n[[YELLOW]]Berserker ist eine aktive F\u00E4higkeit die mit Rechtsklick\n[[YELLOW]]aktiviert wird.\n[[YELLOW]]Im Berserker Modus f\u00FCgst du 50% mehr Schaden zu und\n[[YELLOW]]kannst weiche Materiale wie Gras und Erde sofort abbauen. @@ -834,19 +797,16 @@ Guides.Unarmed.Section.2=[[DARK_AQUA]]Wie funktioniert der Eiserne Arm?\n[[YELLO Guides.Unarmed.Section.3=[[DARK_AQUA]]Wie funktioniert Pfeilablenkung?\n[[YELLOW]]Pfeilablenkung ist eine passive F\u00E4higkeit die ab und zu\n[[YELLOW]]Pfeile von Skeletten und angreifenden Spielern ablenkt.\n[[YELLOW]]Diese Pfeile prallen einfach ab und fallen auf den Boden. Guides.Unarmed.Section.4=[[DARK_AQUA]]Wie funktioniert der Eiserne Griff?\n[[YELLOW]]Eiserner Griff ist eine passive F\u00E4higkeit die Entwaffnung\n[[YELLOW]]verhindert. Mit h\u00F6herem Level ist es umso einfacher\n[[YELLOW]]Entwaffnung zu verhindern. Guides.Unarmed.Section.5=[[DARK_AQUA]]Wie funktioniert Entwaffnen?\n[[YELLOW]]Diese passive F\u00E4higkeit erm\u00F6glich es den Gegner zu\n[[YELLOW]]entwaffnen, sodass seine Waffe auf den Boden f\u00E4llt. - ##Woodcutting Guides.Woodcutting.Section.0=[[DARK_AQUA]]\u00DCber Holzf\u00E4ller:\n[[YELLOW]]Im Holzf\u00E4llen geht es um das F\u00E4llen von B\u00E4umen.\n\n[[DARK_AQUA]]XP ZUWACHS:\n[[YELLOW]]Du kriegst XP f\u00FCr das abholzen von Baumst\u00E4mmen. Guides.Woodcutting.Section.1=[[DARK_AQUA]]Wie funktioniert der Baumf\u00E4ller?\n[[YELLOW]]Baumf\u00E4ller ist eine aktive F\u00E4higkeit. Mache mit der Axt in der\n[[YELLOW]]Hand einen Rechtsklick um sie zu aktivieren. Der Baum\n[[YELLOW]]wird sofortig gef\u00E4llt und alle St\u00E4mme abgebaut. Guides.Woodcutting.Section.2=[[DARK_AQUA]]Wie funktioniert Bl\u00E4ttersturm?\n[[YELLOW]]Bl\u00E4ttersturm ist eine passive F\u00E4higkeit die Bl\u00E4tter\n[[YELLOW]]bei Ber\u00FChrung mit der Axt sofortig bricht. Standardm\u00E4\u00DFig\n[[YELLOW]]wird diese F\u00E4higkeit bei Level 100 freigeschaltet. Guides.Woodcutting.Section.3=[[DARK_AQUA]]Wie funktionieren Doppel-Drops?\n[[YELLOW]]Diese passive F\u00E4higkeit gibt dir ab und zu doppelten\n[[YELLOW]]Ertrag f\u00FCr jeden Stamm den du f\u00E4llst. - #INSPECT -Inspect.Offline= [[RED]]Du hast nicht die Rechte um offline Spieler zu inspizieren! +Inspect.Offline=[[RED]]Du hast nicht die Rechte um offline Spieler zu inspizieren! Inspect.OfflineStats=mcMMO Stats f\u00FCr Offline Spieler [[YELLOW]]{0} Inspect.Stats=[[GREEN]]mcMMO Stats f\u00FCr [[YELLOW]]{0} Inspect.TooFar=Du bist zu weit entfernt um den Spieler zu inspizieren! - #ITEMS Item.ChimaeraWing.Fail=**CHIMAERA FL\u00DCGEL GESCHEITERT!** Item.ChimaeraWing.Pass=**CHIMAERA FL\u00DCGEL* @@ -857,34 +817,30 @@ Item.Injured.Wait=Du wurdest vor kurzem verletzt und musst warten bis du das ver Item.FluxPickaxe.Name=Flux Spitzhacke Item.FluxPickaxe.Lore.1=[[GRAY]]Hat eine Wahrscheinlichkeit Erze sofort zu schmelzen. Item.FluxPickaxe.Lore.2=[[GRAY]]Ben\u00F6tigt Schmelzen Level {0}+ - #TELEPORTATION Teleport.Commencing=[[GRAY]]Beginne Teleport in [[GOLD]]({0}) [[GRAY]]Sekunden, bitte stillhalten... Teleport.Cancelled=[[DARK_RED]]Teleport abgebrochen! - #SKILLS Skills.Child=[[GOLD]](VERWANDTER SKILL) Skills.Disarmed=[[DARK_RED]]Du wurdest entwaffnet! Skills.Header=-----[][[GREEN]]{0}[[RED]][]----- Skills.NeedMore=[[DARK_RED]]Du brauchst mehr[[GRAY]]{0} -Skills.Parents = ELTERN +Skills.Parents=ELTERN Skills.Stats={0}[[GREEN]]{1}[[DARK_AQUA]] XP([[GRAY]]{2}[[DARK_AQUA]]/[[GRAY]]{3}[[DARK_AQUA]]) Skills.ChildStats={0}[[GREEN]]{1} Skills.TooTired=Du bist zu m\u00FCde um diese F\u00E4higkeit zu verwenden. [[YELLOW]]({0}s) Skills.Cancelled={0} abgebrochen! Skills.ConfirmOrCancel=[[GREEN]]Erneuter Rechtsklick zur Best\u00E4tigung [[GOLD]]{0}[[GREEN]]. Linksklick zum abbrechen. - #STATISTICS Stats.Header.Combat=[[GOLD]]-=KAMPFSKILLS=- Stats.Header.Gathering=[[GOLD]]-=SAMMELSKILLS=- Stats.Header.Misc=[[GOLD]]-=DIV.SKILLS=- Stats.Own.Stats=[[GREEN]][mcMMO] Stats - #PERKS Perks.XP.Name=Erfahrung Perks.XP.Desc=Erhalte mehr Erfahrung in bestimmen Skills. Perks.Lucky.Name=Gl\u00FCck -Perks.Lucky.Desc= {0} Skills und F\u00E4higkeiten werden um 33.3% \u00F6fter aktiviert. +Perks.Lucky.Desc={0} Skills und F\u00E4higkeiten werden um 33.3% \u00F6fter aktiviert. Perks.Lucky.Desc.Login=Bestimmte Skills und F\u00E4higkeiten werden um 33.3% \u00F6fter aktiviert. Perks.Lucky.Bonus=[[GOLD]] ({0} mit Gl\u00FCcksbonus) Perks.Cooldowns.Name=Schnelle Erholung @@ -892,7 +848,6 @@ Perks.Cooldowns.Desc=Verk\u00FCrzt die Abklingzeit um {0}. Perks.ActivationTime.Name=Ausdauer Perks.ActivationTime.Desc=Erh\u00F6ht die F\u00E4higkeitszeit um {0} Sekunden. Perks.ActivationTime.Bonus=[[GOLD]] ({0}s mit Ausdauer Bonus) - #HARDCORE Hardcore.Mode.Disabled=[[GOLD]][mcMMO] Hardcore Modus {0} deaktiviert f\u00FCr {1}. Hardcore.Mode.Enabled=[[GOLD]][mcMMO] Hardcore Modus {0} aktiviert f\u00FCr {1}. @@ -905,7 +860,6 @@ Hardcore.Vampirism.Killer.Success=[[GOLD]][mcMMO] [[DARK_AQUA]]Du hast [[BLUE]]{ Hardcore.Vampirism.Victim.Failure=[[GOLD]][mcMMO] [[YELLOW]]{0}[[GRAY]] hat es nicht geschafft Wissen von dir zu stehlen! Hardcore.Vampirism.Victim.Success=[[GOLD]][mcMMO] [[YELLOW]]{0}[[DARK_RED]] hat[[BLUE]]{1}[[DARK_RED]] Level von dir gestohlen! Hardcore.Vampirism.PercentageChanged=[[GOLD]][mcMMO] Der Vampirismus Prozentsatz wurde auf {0} ge\u00E4ndert. - #MOTD MOTD.Donate=[[DARK_AQUA]]Spenden Info: MOTD.Hardcore.Enabled=[[GOLD]][mcMMO] [[DARK_AQUA]]Hardcore Modus aktiviert: [[DARK_RED]]{0} @@ -914,7 +868,6 @@ MOTD.Hardcore.Vampirism.Stats=[[GOLD]][mcMMO] [[DARK_AQUA]]Vampirismus Prozentsa MOTD.PerksPrefix=[mcMMO Boni] MOTD.Version=[[GOLD]][mcMMO] Verwende Version[[DARK_AQUA]]{0} MOTD.Website=[[GOLD]][mcMMO] [[GREEN]]{0}[[YELLOW]] - mcMMO Webseite - #SMELTING Smelting.Ability.FluxMining=Schmelztiegel: [[YELLOW]]{0} Smelting.Ability.FuelEfficiency=Brennstoff Effizienz Multiplikator: [[YELLOW]]{0}x @@ -932,7 +885,6 @@ Smelting.SubSkill.FluxMining.Name=Schmelztiegel Smelting.SubSkill.FluxMining.Description=M\u00F6glichkeit, Erze direkt beim Abbauen zu Schmelzen Smelting.Listener=Schmelzen: Smelting.SkillName=SCHMELZEN - #COMMAND DESCRIPTIONS Commands.Description.addlevels=Gib einem Spieler mcMMO Level Commands.Description.adminchat=Schalte den mcMMO Adminchat an/aus oder sende Adminchat Nachrichten @@ -964,11 +916,9 @@ Commands.Description.skillreset=Setze die mcMMO Level f\u00FCr einen Spieler zur Commands.Description.vampirism=Schalte Vampirismus an/aus / \u00E4ndere den Vampirismus Prozentsatz Commands.Description.xplock=Setze deine mcMMO XP-Leiste auf einen bestimmten Skill fest Commands.Description.xprate=\u00C4ndere die mcMMO XP Rate oder starte ein XP Event - #UPDATE CHECKER UpdateChecker.Outdated=Du verwendest eine veraltete mcMMO Version! UpdateChecker.NewAvailable=Eine neue Version ist auf BukkitDev erh\u00E4ltlich. - #SCOREBOARD HEADERS Scoreboard.Header.PlayerStats=mcMMO Stats Scoreboard.Header.PlayerCooldowns=mcMMO Abklingzeiten @@ -982,7 +932,6 @@ Scoreboard.Misc.RemainingXP=Verbliebene XP Scoreboard.Misc.Cooldown=[[LIGHT_PURPLE]]Abklingzeit Scoreboard.Misc.Overall=[[GOLD]]Insgesamt Scoreboard.Misc.Ability=F\u00E4higkeit - #DATABASE RECOVERY Profile.Loading.Success=[[GREEN]]Your mcMMO profile has been loaded. Profile.Loading.Failure=mcMMO still cannot load your data. You may want to [[AQUA]]contact the server owner.\n[[YELLOW]]You can still play on the server, but you will have [[BOLD]]no mcMMO levels[[YELLOW]] and any XP you get [[BOLD]]will not be saved[[YELLOW]]. diff --git a/bukkit/src/main/resources/locale/locale_en_US.properties b/bukkit/src/main/resources/locale/locale_en_US.properties index f978e815d..1c8484d20 100644 --- a/bukkit/src/main/resources/locale/locale_en_US.properties +++ b/bukkit/src/main/resources/locale/locale_en_US.properties @@ -1,5 +1,4 @@ #I'm going to try to normalize our locale file, forgive the mess for now. - #DO NOT USE COLOR CODES IN THE JSON KEYS #COLORS ARE DEFINED IN advanced.yml IF YOU WISH TO CHANGE THEM JSON.Rank=Rank @@ -47,17 +46,13 @@ JSON.Hover.SuperAbility=[[DARK_PURPLE]]{0}&r JSON.Hover.MaxRankSkillName=[[GOLD]]{0}&r JSON.Hover.AtSymbolSkills=[[YELLOW]]@ JSON.Hover.AtSymbolURL=[[YELLOW]]@ - #This is the message sent to players when an ability is activated JSON.Notification.SuperAbility={0} - #These are the JSON Strings used for SubSkills JSON.Acrobatics.Roll.Interaction.Activated=Test [[RED]]Rolled Test JSON.Acrobatics.SubSkill.Roll.Details.Tips=If you hold sneak while falling you can prevent up to twice the damage that you would normally take! - #DO NOT USE COLOR CODES IN THE JSON KEYS #COLORS ARE DEFINED IN advanced.yml IF YOU WISH TO CHANGE THEM - # BEGIN STYLING Ability.Generic.Refresh=[[GREEN]]**ABILITIES REFRESHED!** Ability.Generic.Template.Lock=[[GRAY]]{0} @@ -123,7 +118,6 @@ XPBar.Complex.Template={0} [[DARK_AQUA]] {4}[[WHITE]]% [[DARK_AQUA]]([[WHITE]]{1 # XP BAR Allows for the following variables -- {0} = Skill Level, {1} Current XP, {2} XP Needed for next level, {3} Power Level, {4} Percentage of Level # Make sure you turn on Experience_Bars.ThisMayCauseLag.AlwaysUpdateTitlesWhenXPIsGained if you want the XP bar title to update every time a player gains XP! # END STYLING - #ACROBATICS Acrobatics.Ability.Proc=[[GREEN]]**Graceful Landing** Acrobatics.Combat.Proc=[[GREEN]]**Dodged** @@ -155,8 +149,6 @@ Alchemy.Listener=Alchemy: Alchemy.Ability.Locked.0=LOCKED UNTIL {0}+ SKILL (CATALYSIS) Alchemy.SkillName=ALCHEMY #ARCHERY - - Archery.SubSkill.SkillShot.Name=Skill Shot Archery.SubSkill.SkillShot.Description=Increases damage done with bows Archery.SubSkill.SkillShot.Stat=Skill Shot Bonus Damage @@ -303,7 +295,6 @@ Mining.SubSkill.BiggerBombs.Description=Increases TNT explosion radius Mining.SubSkill.DemolitionsExpertise.Name=Demolitions Expertise Mining.SubSkill.DemolitionsExpertise.Description=Decreases damage from TNT explosions Mining.SubSkill.DemolitionsExpertise.Stat=Demolitions Expert Damage Decrease - Mining.Listener=Mining: Mining.SkillName=MINING Mining.Skills.SuperBreaker.Off=**Super Breaker has worn off** @@ -457,7 +448,7 @@ Taming.Listener.Wolf=[[DARK_GRAY]]Your wolf scurries back to you... Taming.Listener=Taming: Taming.SkillName=TAMING Taming.Summon.Complete=[[GREEN]]Summoning complete -Taming.Summon.Lifespan= (Lifespan: {0}s) +Taming.Summon.Lifespan=(Lifespan: {0}s) Taming.Summon.Fail.Ocelot=[[RED]]You have too many ocelots nearby to summon any more. 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. @@ -521,7 +512,6 @@ Woodcutting.Skills.TreeFeller.Other.On=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED Woodcutting.Skills.TreeFeller.Splinter=YOUR AXE SPLINTERS INTO DOZENS OF PIECES! Woodcutting.Skills.TreeFeller.Threshold=That tree is too large! #ABILITIY - #COMBAT Combat.ArrowDeflect=[[WHITE]]**ARROW DEFLECT** Combat.BeastLore=[[GREEN]]**BEAST LORE** @@ -553,7 +543,7 @@ Commands.Cooldowns.Row.Y=\ [[AQUA]]{0}[[WHITE]] - [[DARK_GREEN]]Ready! Commands.Database.Cooldown=You must wait {0} seconds before using this command again. Commands.Database.Processing=Your previous command is still being processed. Please wait. Commands.Disabled=This command is disabled. -Commands.DoesNotExist= [[RED]]Player does not exist in the database! +Commands.DoesNotExist=[[RED]]Player does not exist in the database! Commands.GodMode.Disabled=mcMMO Godmode Disabled Commands.GodMode.Enabled=mcMMO Godmode Enabled Commands.AdminChatSpy.Enabled=mcMMO Party Chat Spy Enabled @@ -727,7 +717,7 @@ Party.NotOwner=[[DARK_RED]]You are not the party leader. Party.Target.NotOwner=[[DARK_RED]]{0} is not the party leader. Party.Owner.New=[[GREEN]]{0} is the new party leader. Party.Owner.NotLeader=[[DARK_RED]]You are no longer the party leader. -Party.Owner.Player =[[GREEN]]You are now the party leader. +Party.Owner.Player=[[GREEN]]You are now the party leader. Party.Password.None=[[RED]]This party is password protected. Please provide a password to join. Party.Password.Incorrect=[[RED]]Party password is incorrect. Party.Password.Set=[[GREEN]]Party password set to {0} @@ -807,14 +797,13 @@ Commands.Event.Stop.Subtitle=[[GREEN]]I hope you had fun! Commands.Event.XP=[[DARK_AQUA]]XP Rate is now [[GOLD]]{0}[[DARK_AQUA]]x Commands.xprate.started.0=[[GOLD]]XP EVENT FOR mcMMO HAS STARTED! Commands.xprate.started.1=[[GOLD]]mcMMO XP RATE IS NOW {0}x! -XPRate.Event= [[GOLD]]mcMMO is currently in an XP rate event! XP rate is {0}x! - +XPRate.Event=[[GOLD]]mcMMO is currently in an XP rate event! XP rate is {0}x! #GUIDES Guides.Available=[[GRAY]]Guide for {0} available - type /{1} ? [page] Guides.Header=[[GOLD]]-=[[GREEN]]{0} Guide[[GOLD]]=- Guides.Page.Invalid=Not a valid page number! Guides.Page.OutOfRange=That page does not exist, there are only {0} total pages. -Guides.Usage= Usage is /{0} ? [page] +Guides.Usage=Usage is /{0} ? [page] ##Acrobatics Guides.Acrobatics.Section.0=[[DARK_AQUA]]About Acrobatics:\n[[YELLOW]]Acrobatics is the art of moving Gracefuly in mcMMO.\n[[YELLOW]]It provides combat bonuses and environment damage bonuses.\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you need to perform a dodge\n[[YELLOW]]in combat or survive falls from heights that damage you. Guides.Acrobatics.Section.1=[[DARK_AQUA]]How does Rolling work?\n[[YELLOW]]You have a passive chance when you take fall damage\n[[YELLOW]]to negate the damage done. You can hold the sneak button to\n[[YELLOW]]double your chances during the fall.\n[[YELLOW]]This triggers a Graceful Roll instead of a standard one.\n[[YELLOW]]Graceful Rolls are like regular rolls but are twice as likely to\n[[YELLOW]]occur and provide more damage safety than regular rolls.\n[[YELLOW]]Rolling chance is tied to your skill level @@ -912,7 +901,7 @@ Guides.Woodcutting.Section.1=[[DARK_AQUA]]How does Tree Feller work?\n[[YELLOW]] 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. #INSPECT -Inspect.Offline= [[RED]]You do not have permission to inspect offline players! +Inspect.Offline=[[RED]]You do not have permission to inspect offline players! Inspect.OfflineStats=mcMMO Stats for Offline Player [[YELLOW]]{0} Inspect.Stats=[[GREEN]]mcMMO Stats for [[YELLOW]]{0} Inspect.TooFar=You are too far away to inspect that player! @@ -937,7 +926,7 @@ Skills.Disarmed=[[DARK_RED]]You have been disarmed! Skills.Header=-----[] [[GREEN]]{0}[[RED]] []----- Skills.NeedMore=[[DARK_RED]]You need more [[GRAY]]{0} Skills.NeedMore.Extra=[[DARK_RED]]You need more [[GRAY]]{0}{1} -Skills.Parents= PARENTS +Skills.Parents=PARENTS Skills.Stats={0}[[GREEN]]{1}[[DARK_AQUA]] XP([[GRAY]]{2}[[DARK_AQUA]]/[[GRAY]]{3}[[DARK_AQUA]]) Skills.ChildStats={0}[[GREEN]]{1} Skills.TooTired=You are too tired to use that ability again. [[YELLOW]]({0}s) diff --git a/bukkit/src/main/resources/locale/locale_es.properties b/bukkit/src/main/resources/locale/locale_es.properties index afdbffff4..6f4d0e969 100644 --- a/bukkit/src/main/resources/locale/locale_es.properties +++ b/bukkit/src/main/resources/locale/locale_es.properties @@ -296,7 +296,7 @@ Unarmed.Ability.Bonus.1=+{0} Mejora de DA\u00d1O Unarmed.Ability.Chance.ArrowDeflect=Probabilidad de Desviar Flechas: [[YELLOW]]{0}% Unarmed.Ability.Chance.Disarm=Probabilidad de Desarmar: [[YELLOW]]{0} Unarmed.Ability.Chance.IronGrip=Probabilidad de agarre de hierro: [[YELLOW]]{0} -Unarmed.Ability.IronGrip.Attacker= Tu oponente tiene agarre de hierro! +Unarmed.Ability.IronGrip.Attacker=Tu oponente tiene agarre de hierro! Unarmed.Ability.IronGrip.Defender=[[GREEN]]Tu agarre de hierro te salvo de ser desarmado! Unarmed.Ability.Lower=[[GRAY]]**BAJAS TUS PU\u00d1OS** Unarmed.Ability.Ready=[[GREEN]]**LEVANTASTE LA GUARDIA** @@ -561,7 +561,7 @@ Guides.Available=[[GRAY]]Guia para {0} disponible - tipo /{1} ? [page] Guides.Header=[[GOLD]]-=[[GREEN]]{0} Guia[[GOLD]]=- Guides.Page.Invalid=Numero de pagina no disponible Guides.Page.OutOfRange=La pagina no existe, solo hay {0} paginas en total -Guides.Usage= El uso es /{0} ? [page] +Guides.Usage=El uso es /{0} ? [page] Guides.Smelting.Section.0=Muy pronto... Inspect.Offline=\u00a1No tienen permiso para inspeccionar jugadores fuera de linea! Inspect.OfflineStats=Estad\u00edsticas de mcMMO para el Jugador Desconectado [[YELLOW]]{0} diff --git a/bukkit/src/main/resources/locale/locale_fr.properties b/bukkit/src/main/resources/locale/locale_fr.properties index 230bab883..87a00b7c9 100644 --- a/bukkit/src/main/resources/locale/locale_fr.properties +++ b/bukkit/src/main/resources/locale/locale_fr.properties @@ -69,10 +69,7 @@ Axes.Skills.SS.Refresh=[[GREEN]]Votre comp\u00e9tence [[YELLOW]]Tranche-cr\u00e2 Axes.Skills.SS.Other.Off=Tranche-cr\u00e2ne[[GREEN]] s\'est termin\u00e9 pour [[YELLOW]]{0} Axes.Skills.SS.Other.On=[[GREEN]]{0}[[DARK_GREEN]] a utilis\u00e9 [[RED]]Tranche-cr\u00e2ne ! Axes.Skillup=Le talent Haches augmente de {0}. Total ({1}) - - Axes.Ability.Bonus.0=Ma\u00eetrise des haches - Excavation.Ability.Lower=[[GRAY]]**VOUS ABAISSEZ VOTRE PELLE** Excavation.Ability.Ready=[[GREEN]]**VOUS LEVEZ VOTRE PELLE** Excavation.SubSkill.GigaDrillBreaker.Name=Foreur (Comp\u00e9tence) @@ -94,7 +91,7 @@ Fishing.Ability.Locked.0=BLOCKE JUSQU\'A {0}+ COMPETENCE (SHAKE) Fishing.Ability.Locked.1=Bloqu\u00e9 jusqu\'\u00e0 {0}+ niveaux de talent (PECHEUR SUR GLACE) Fishing.Ability.Locked.2=Bloqu\u00e9 jusqu\'\u00e0 {0}+ niveau(x) (Ma\u00eetre P\u00eacheur) Fishing.Ability.Rank=Chasseur de tr\u00e9sors : [[YELLOW]]{0}/{1} -Fishing.Ability.TH.DropRate= Taux de Loot: [[DARK_RED]]Pi\u00e8ge: [[YELLOW]]{0} [[GRAY]]Commun: [[YELLOW]]{1} [[GREEN]]Non commun: [[YELLOW]]{2}\n[[BLUE]]Rare: [[YELLOW]]{3} [[LIGHT_PURPLE]]\u00c9pique: [[YELLOW]]{4} [[GOLD]]L\u00e9gendaire: [[YELLOW]]{5} [[AQUA]]Record: [[YELLOW]]{6} +Fishing.Ability.TH.DropRate=Taux de Loot: [[DARK_RED]]Pi\u00e8ge: [[YELLOW]]{0} [[GRAY]]Commun: [[YELLOW]]{1} [[GREEN]]Non commun: [[YELLOW]]{2}\n[[BLUE]]Rare: [[YELLOW]]{3} [[LIGHT_PURPLE]]\u00c9pique: [[YELLOW]]{4} [[GOLD]]L\u00e9gendaire: [[YELLOW]]{5} [[AQUA]]Record: [[YELLOW]]{6} Fishing.Ability.TH.MagicRate=Chasse magique: [[YELLOW]]{0} Fishing.Ability.Shake=Chance d\'esquive : [[YELLOW]]{0} Fishing.Ability.IceFishing=P\u00eache sur Glace: Allez p\u00eacher sur de la glace @@ -124,7 +121,7 @@ Herbalism.Ability.GTe.Length=Dur\u00e9e de Main verte : [[YELLOW]]{0}s Herbalism.Ability.GTe.NeedMore=Vous avez besoin de plus de graines pour r\u00e9pandre la terre verte Herbalism.Ability.GTh.Chance=Chances de Mains Vertes: [[YELLOW]]{0} Herbalism.Ability.GTh.Fail=**MAINS VERTES \u00c9CHOU\u00c9ES** -Herbalism.Ability.GTh.Stage= Vos sens de jardinier vous indique que [[YELLOW]] Ce champ est en train de pousser {0} +Herbalism.Ability.GTh.Stage=Vos sens de jardinier vous indique que [[YELLOW]] Ce champ est en train de pousser {0} Herbalism.Ability.GTh=[[GREEN]]**DOIGTS VERTS** Herbalism.Ability.HylianLuck=Probabilit\u00e9 de chance d\'Hylian: [[YELLOW]]{0} Herbalism.Ability.Lower=[[GRAY]]**VOUS ABAISSEZ VOTRE HOUE** @@ -330,7 +327,7 @@ Taming.Skills.Charge.NoneNearby=**AUCUN LOUP DISPONIBLE A PROXIMIT\u00c9** Taming.Skills.Charge.NoTarget=**AUCUNE CIBLE TROUV\u00c9E** Taming.Skillup=Le talent Apprivoisement augmente de {0}. Total ({1}) Taming.Summon.Complete=[[GREEN]]Appel r\u00e9ussi -Taming.Summon.Lifespan= (Dur\u00e9e de vie: {0}s) +Taming.Summon.Lifespan=(Dur\u00e9e de vie: {0}s) Taming.Summon.Fail.Ocelot=Il y a d\u00e9j\u00e0 trop d\'ocelots dans les environs. Taming.Summon.Fail.Wolf=Il y a d\u00e9j\u00e0 trop de loups dans les environs. Taming.Summon.Fail.Horse=Il y a d\u00e9j\u00e0 trop de chevaux dans les environs. @@ -502,7 +499,7 @@ Commands.Party.Alliance.Invite.Accepted=[[GREEN]]Invitation d\'alliance accept\u Commands.Party.Alliance.None=Votre groupe n\'a pas d\'alli\u00e9. Commands.Party.Alliance.AlreadyAllies=Votre groupe a d\u00e9j\u00e0 une alliance. D\u00e9faites-la avec [[DARK_AQUA]]/party alliance disband Commands.Party.Alliance.Help.0=Cette guilde n\'a pas form\u00e9 d\'alliance. Invitez un chef de groupe. -Commands.Party.Alliance.Help.1= \u00e0 une alliance [[DARK_AQUA]]/party alliance invite [[RED]]. +Commands.Party.Alliance.Help.1=\u00e0 une alliance [[DARK_AQUA]]/party alliance invite [[RED]]. Commands.ptp.Enabled=T\u00e9l\u00e9portation de guilde [[GREEN]]activ\u00e9e Commands.ptp.Disabled=T\u00e9l\u00e9portation de guilde [[RED]]d\u00e9sactiv\u00e9e Commands.ptp.NoRequests=Vous n\'avez pas de requ\u00eates de t\u00e9l\u00e9portation en ce moment @@ -660,7 +657,7 @@ Guides.Available=[[GRAY]]Guide pour le/la {0} est disponible - \u00e9crivez /{1} Guides.Header=[[GOLD]]-=[[GREEN]]{0} Guide[[GOLD]]=- Guides.Page.Invalid=Le num\u00e9ro de page est invalide Guides.Page.OutOfRange=Cette page n\'existe pas, il y a seulement {0} pages totales. -Guides.Usage= L\'utilisation est /{0} ? [page] +Guides.Usage=L\'utilisation est /{0} ? [page] Guides.Acrobatics.Section.0=[[DARK_AQUA]]A propos de l\'Acrobatie:\n[[YELLOW]]L\'acrobatie est l\'art de bouger gracieusement dans mcMMO.\n[[YELLOW]]Donne des bonus au combat et de r\u00e9sistance aux d\u00e9g\u00e2ts physiques.\n[[DARK_AQUA]]GAIN D\'XP:\n[[YELLOW]]Pour gagner de l\'exp\u00e9rience, vous devez esquiver des d\u00e9g\u00e2ts\n[[YELLOW]]en combat ou encaisser des d\u00e9g\u00e2ts de chute. Guides.Acrobatics.Section.1=[[DARK_AQUA]]Comment fonctionne la Roulade?\n[[YELLOW]]Vous avez une chance, lorsque vous prenez des d\u00e9g\u00e2ts dus \u00e0 une chute,\n[[YELLOW]]d\'esquiver ces d\u00e9g\u00e2ts. Maintenez la touche pour s\'accroupir\n[[YELLOW]]pour doubler les chances d\'esquiver ces d\u00e9g\u00e2ts.\n[[YELLOW]]Cette manipulation activera la Roulade Gracieuse. \n[[YELLOW]]La Roulade Gracieuse fonctionne comme une Roulade classique,\n[[YELLOW]]mais vous avez deux fois plus de chance d\'\u00e9chapper aux d\u00e9g\u00e2ts.\n[[YELLOW]]Votre pourcentage de chance de Roulade d\u00e9pend du niveau de votre Comp\u00e9tence. Guides.Acrobatics.Section.2=[[DARK_AQUA]]Comment fonctionne l\'esquive?\n[[YELLOW]]L\'esquive est une capacit\u00e9 passive qui peut vous permettre de\n[[YELLOW]]diminuer les d\u00e9g\u00e2ts de moiti\u00e9 lorsque vous \u00eates bless\u00e9 au combat.\n[[YELLOW]]Les chances d\'esquiver sont fonction de votre niveau de comp\u00e9tence. diff --git a/bukkit/src/main/resources/locale/locale_hu_HU.properties b/bukkit/src/main/resources/locale/locale_hu_HU.properties index 6d809d666..b1364aa3c 100644 --- a/bukkit/src/main/resources/locale/locale_hu_HU.properties +++ b/bukkit/src/main/resources/locale/locale_hu_HU.properties @@ -41,12 +41,12 @@ Mining.Skillup=B\u00e1ny\u00e1szat fejl\u0151d\u00f6tt {0} szinttel. \u00d6sszes Mining.Blast.Refresh=[[GREEN]]A [[YELLOW]]Robban\u00f3 B\u00e1ny\u00e1szat [[GREEN]]k\u00e9pess\u00e9ged \u00fajra el\u00e9rhet\u0151! Repair.SubSkill.Repair.Name=Jav\u00edt\u00e1s Repair.SubSkill.Repair.Description=Eszk\u00f6z\u00f6k \u00e9s felszerel\u00e9sek jav\u00edt\u00e1sa -Repair.SubSkill.GoldRepair.Description= Arany eszk\u00f6z\u00f6k \u00e9s felszerel\u00e9sek jav\u00edt\u00e1sa -Repair.SubSkill.IronRepair.Description= Vas eszk\u00f6z\u00f6k \u00e9s felszerel\u00e9sek jav\u00edt\u00e1sa +Repair.SubSkill.GoldRepair.Description=Arany eszk\u00f6z\u00f6k \u00e9s felszerel\u00e9sek jav\u00edt\u00e1sa +Repair.SubSkill.IronRepair.Description=Vas eszk\u00f6z\u00f6k \u00e9s felszerel\u00e9sek jav\u00edt\u00e1sa Repair.SubSkill.StoneRepair.Description=K\u0151 eszk\u00f6z\u00f6k jav\u00edt\u00e1sa Repair.SubSkill.RepairMastery.Name=Jav\u00edt\u00f3 mester Repair.SubSkill.SuperRepair.Name=Szuper jav\u00edt\u00e1s -Repair.SubSkill.DiamondRepair.Description= Gy\u00e9m\u00e1nt eszk\u00f6z\u00f6k \u00e9s felszerel\u00e9sek jav\u00edt\u00e1sa +Repair.SubSkill.DiamondRepair.Description=Gy\u00e9m\u00e1nt eszk\u00f6z\u00f6k \u00e9s felszerel\u00e9sek jav\u00edt\u00e1sa Repair.SubSkill.ArcaneForging.Description=M\u00e1gikus t\u00e1rgyak megjav\u00edt\u00e1sa Repair.Listener=Jav\u00edt\u00e1s: Repair.SkillName=JAV\u00cdT\u00c1S diff --git a/bukkit/src/main/resources/locale/locale_it.properties b/bukkit/src/main/resources/locale/locale_it.properties index 7c939b768..b1cce913e 100644 --- a/bukkit/src/main/resources/locale/locale_it.properties +++ b/bukkit/src/main/resources/locale/locale_it.properties @@ -14,7 +14,6 @@ Acrobatics.SubSkill.Roll.GraceChance=Possibilit\u00E0 di Capriola Aggraziata: [[ Acrobatics.Roll.Text=**Capriola Eseguita** Acrobatics.SkillName=ACROBATICA Acrobatics.Skillup=L'abilit\u00E0 Acrobatica \u00E8 aumentata di {0}. Totale ({1}) - #ALCHEMY Alchemy.SubSkill.Catalysis.Name=Catalisi Alchemy.SubSkill.Catalysis.Description=Aumenta la velocit\u00E0 di produzione delle pozioni @@ -27,7 +26,6 @@ Alchemy.Concoctions.Rank=Grado Intrugli: [[YELLOW]]{0}/{1} Alchemy.Concoctions.Ingredients=Ingredienti [[[YELLOW]]{0}[[RED]]]: [[YELLOW]]{1} Alchemy.SkillName=ALCHIMIA Alchemy.Skillup=L'abilit\u00E0 Alchimia \u00E8 aumentata di {0}. Totale ({1}) - #ARCHERY Archery.Combat.DazeChance=Possibilit\u00E0 di Stordire: [[YELLOW]]{0} Archery.Combat.RetrieveChance=Possibilit\u00E0 di Recuperare Frecce: [[YELLOW]]{0} @@ -41,7 +39,6 @@ Archery.SubSkill.ArrowRetrieval.Description=Probabilit\u00E0 di recuperare frecc Archery.Listener=Tiro con l'Arco: Archery.SkillName=Arco Archery.Skillup=L'abilit\u00E0 Tiro con l'Arco \u00E8 aumentata di {0}. Totale ({1}) - #AXES Axes.Ability.Bonus.0=Maestria con l'Ascia Axes.Ability.Bonus.1={0} Danni Bonus @@ -76,7 +73,6 @@ Axes.Skills.SS.Refresh=[[GREEN]]La tua capacit\u00E0 [[YELLOW]]Spacca Crani [[GR Axes.Skills.SS.Other.Off=Spacca Crani[[GREEN]] si \u00E8 esaurito per [[YELLOW]]{0} Axes.Skills.SS.Other.On=[[GREEN]]{0}[[DARK_GREEN]] ha usato [[RED]]Spacca Crani! Axes.Skillup=L'abilit\u00E0 Asce \u00E8 aumentata di {0}. Totale ({1}) - #EXCAVATION Excavation.Ability.Lower=[[GRAY]]**ABBASSI LA PALA** Excavation.Ability.Ready=[[GREEN]]**PREPARI LA PALA** @@ -93,7 +89,6 @@ Excavation.Skills.GigaDrillBreaker.Refresh=[[GREEN]]La tua capacit\u00E0 [[YELLO Excavation.Skills.GigaDrillBreaker.Other.Off=Giga-Trivella Demolitrice[[GREEN]] si \u00E8 esaurita per [[YELLOW]]{0} Excavation.Skills.GigaDrillBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]] ha usato [[RED]]Giga-Trivella Demolitrice! Excavation.Skillup=L'abilit\u00E0 Escavazione \u00E8 aumentata di {0}. Totale ({1}) - #FISHING Fishing.Ability.Chance=Possibilit\u00E0 di Morso: [[YELLOW]]{0} Fishing.Ability.Info=Cacciatore di Magia: [[GRAY]] **Migliora insieme al Grado di Cacciatore di Tesori** @@ -101,7 +96,7 @@ Fishing.Ability.Locked.0=BLOCCATO FINO AD ABILIT\u00C0 {0}+ (SCUOTERE) Fishing.Ability.Locked.1=BLOCCATO FINO AD ABILIT\u00C0 {0}+ (PESCA SUL GHIACCIO) Fishing.Ability.Locked.2=BLOCCATO FINO AD ABILIT\u00C0 {0}+ (PESCATORE PROVETTO) Fishing.Ability.Rank=Grado di Cacciatore di Tesori: [[YELLOW]]{0}/5 -Fishing.Ability.TH.DropRate= Tasso di Drop: [[DARK_RED]]Trap: [[YELLOW]]{0} [[GRAY]]Comune: [[YELLOW]]{1} [[GREEN]]Non Comune: [[YELLOW]]{2}\n[[BLUE]]Raro: [[YELLOW]]{3} [[LIGHT_PURPLE]]Epico: [[YELLOW]]{4} [[GOLD]]Leggendario: [[YELLOW]]{5} [[AQUA]]Record: [[YELLOW]]{6} +Fishing.Ability.TH.DropRate=Tasso di Drop: [[DARK_RED]]Trap: [[YELLOW]]{0} [[GRAY]]Comune: [[YELLOW]]{1} [[GREEN]]Non Comune: [[YELLOW]]{2}\n[[BLUE]]Raro: [[YELLOW]]{3} [[LIGHT_PURPLE]]Epico: [[YELLOW]]{4} [[GOLD]]Leggendario: [[YELLOW]]{5} [[AQUA]]Record: [[YELLOW]]{6} Fishing.Ability.TH.MagicRate=Possibilit\u00E0 di Cacciatore di Magia: [[YELLOW]]{0} Fishing.Ability.Shake=Probabilit\u00E0 di Scuotere: [[YELLOW]]{0} Fishing.Ability.IceFishing=Pesca sul Ghiaccio: Vai a pescare sul ghiaccio @@ -125,14 +120,13 @@ Fishing.Ability.TH.Boom=[[GRAY]]TEMPO DI BOOM!!! Fishing.Ability.TH.Poison=[[GRAY]]C'\u00E8 qualcosa che non va bene... Fishing.SkillName=PESCA Fishing.Skillup=L'abilit\u00E0 Pesca \u00E8 aumentata di {0}. Totale ({1}) - #HERBALISM Herbalism.Ability.DoubleDropChance=Possibilit\u00E0 di Doppio Drop: [[YELLOW]]{0} Herbalism.Ability.FD=Dieta del Contadino: [[YELLOW]]Grado {0} Herbalism.Ability.GTe.Length=Durata di Terra Verde: [[YELLOW]]{0}s Herbalism.Ability.GTe.NeedMore=Ti servono pi\u00F9 semi per diffondere Terra Verde. Herbalism.Ability.GTh.Chance=Possibilit\u00E0 di Pollice Verde: [[YELLOW]]{0} -Herbalism.Ability.GTh.Fail= [[RED]]**POLLICE VERDE FALLITO** +Herbalism.Ability.GTh.Fail=[[RED]]**POLLICE VERDE FALLITO** Herbalism.Ability.GTh.Stage=Stadio di Pollice Verde: [[YELLOW]] Il raccolto cresce allo stadio {0} Herbalism.Ability.GTh=[[GREEN]]**POLLICE VERDE** Herbalism.Ability.HylianLuck=Probabilit\u00E0 di Fortuna Hylian: [[YELLOW]]{0} @@ -163,7 +157,6 @@ Herbalism.Skills.GTe.Refresh=[[GREEN]]La tua abilit\u00E0 [[YELLOW]]Terra Verde Herbalism.Skills.GTe.Other.Off=Terra Verde[[GREEN]] si \u00E8 esaurita per [[YELLOW]]{0} Herbalism.Skills.GTe.Other.On=[[GREEN]]{0}[[DARK_GREEN]] ha usato [[RED]]Terra Verde! Herbalism.Skillup=L'abilit\u00E0 Erboristeria \u00E8 aumentata di {0}. Totale ({1}) - #MINING Mining.Ability.Length=Durata di Super Demolitore: [[YELLOW]]{0}s Mining.Ability.Locked.0=BLOCCATO FINO AD ABILIT\u00C0 {0}+ (ESTRAZIONE ESPLOSIVA) @@ -191,7 +184,6 @@ Mining.Skills.SuperBreaker.Other.Off=Super Demolitore[[GREEN]] si \u00E8 esaurit Mining.Skills.SuperBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]] ha usato [[RED]]Super Demolitore! Mining.Skills.SuperBreaker.Refresh=[[GREEN]]La tua capacit\u00E0 [[YELLOW]]Super Demolitore [[GREEN]]si \u00E8 rigenerata! Mining.Skillup=L'abilit\u00E0 Estrazione \u00E8 aumentata di {0}. Totale ({1}) - #Blast Mining Mining.Blast.Boom=[[GRAY]]**BOOM** Mining.Blast.Effect=+{0} minerale raccolto, -{1} macerie prodotte, drop x{2} @@ -199,7 +191,6 @@ Mining.Blast.Radius.Increase=Incremento del Raggio di Esplosione: [[YELLOW]]+{0} Mining.Blast.Rank=Estrazione Esplosiva: [[YELLOW]] Grado {0}/8 [[GRAY]]({1}) Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] ha usato [[RED]]Estrazione Esplosiva! Mining.Blast.Refresh=[[GREEN]]La tua capacit\u00E0 [[YELLOW]]Estrazione Esplosiva [[GREEN]]si \u00E8 rigenerata! - #REPAIR Repair.SubSkill.Repair.Name=Riparazione Repair.SubSkill.Repair.Description=Ripara Attrezzi & Armature @@ -221,7 +212,7 @@ Repair.Error=[[DARK_RED]]mcMMO si \u00E8 imbattuto in un errore mentre tentava d Repair.Listener.Anvil=[[DARK_RED]]Hai piazzato un'incudine; le incudini possono riparare attrezzi e armature. Repair.Listener=Riparazione: Repair.SkillName=RIPARAZIONE -Repair.Skills.AdeptDiamond= [[DARK_RED]]Non sei abbastanza abile da riparare il Diamante. +Repair.Skills.AdeptDiamond=[[DARK_RED]]Non sei abbastanza abile da riparare il Diamante. Repair.Skills.AdeptGold=[[DARK_RED]]Non sei abbastanza abile da riparare l'Oro. Repair.Skills.AdeptIron=[[DARK_RED]]Non sei abbastanza abile da riparare il Ferro. Repair.Skills.AdeptStone=[[DARK_RED]]Non sei abbastanza abile da riparare la Pietra. @@ -233,7 +224,6 @@ Repair.Skills.StackedItems=[[DARK_RED]]Non puoi riparare oggetti ammucchiati. Repair.Skills.Super.Chance=Possibilit\u00E0 Super Riparazione: [[YELLOW]]{0} Repair.Skillup=L'abilit\u00E0 Riparazione \u00E8 aumentata di {0}. Totale ({1}) Repair.Pretty.Name=Riparazione - #Arcane Forging Repair.Arcane.Chance.Downgrade=[[GRAY]]Probabilit\u00E0 di Degradazione di FA: [[YELLOW]]{0}% Repair.Arcane.Chance.Success=[[GRAY]]Tasso di Successo di FA: [[YELLOW]]{0}% @@ -242,7 +232,6 @@ Repair.Arcane.Fail=Il potere arcano ha abbandonato l'oggetto permanentemente. Repair.Arcane.Lost=Non sei stato abbastanza abile da mantenere alcun incantesimo. Repair.Arcane.Perfect=[GREEN]]Hai mantenuto le energie arcane in questo oggetto. Repair.Arcane.Rank=Forgiatura Arcana: [[YELLOW]]Grado {0}/4 - #SALVAGE Salvage.Pretty.Name=Rottamazione Salvage.SubSkill.AdvancedSalvage.Name=Rottamazione Avanzata @@ -258,14 +247,13 @@ Salvage.Arcane.ExtractPartial=[[GRAY]]Probabilit\u00E0 di incantamento AS parzia Salvage.Skills.Success=[[GREEN]]Oggetto rottamato! Salvage.Skills.Adept.Damaged=[[DARK_RED]]Non sei abbastanza abile da rottamare gli oggetti danneggiati. Salvage.Skills.Adept.Level=Devi essere di livello [[YELLOW]]{0}[[RED]] per rottamare [[YELLOW]]{1} -Salvage.Skills.TooDamaged= [[DARK_RED]]Questo oggetto \u00E8 troppo danneggiato per essere rottamato. +Salvage.Skills.TooDamaged=[[DARK_RED]]Questo oggetto \u00E8 troppo danneggiato per essere rottamato. Salvage.Skills.ArcaneFailed=Non sei stato capace di estrarre la conoscenza contenuta in questo oggetto. Salvage.Skills.ArcanePartial=Sei stato solo in grado di estrarre alcune delle conoscenze contenute all'interno di questo oggetto. Salvage.Skills.ArcaneSuccess=[[GREEN]]Sei in grado di estrarre tutte le conoscenze contenute in questo oggetto! Salvage.Listener.Anvil=[[DARK_RED]]Hai piazzato un'incudine da Rottamazione, usala per Rottamare attrezzi e armature. Salvage.Listener=Rottamazione: Salvage.SkillName=ROTTAMAZIONE - #SWORDS Swords.Ability.Lower=[[GRAY]]**ABBASSI LA SPADA** Swords.Ability.Ready=[[GREEN]]**PREPARI LA SPADA** @@ -296,7 +284,6 @@ Swords.Skills.SS.Other.Off=Colpi Seghettati[[GREEN]] si \u00E8 esaurito per [[YE Swords.Skills.SS.Other.On=[[GREEN]]{0}[[DARK_GREEN]] ha usato [[RED]]Colpi Seghettati! Swords.Skillup=L'abilit\u00E0 Spade \u00E8 aumentata di {0}. Totale ({1}) Swords.SS.Length=Durata di Colpi Seghettati: [[YELLOW]]{0}s - #TAMING Taming.Ability.Bonus.0=Sicurezza Ambientale Taming.Ability.Bonus.1=I lupi evitano il pericolo @@ -341,13 +328,12 @@ Taming.Listener=Addomesticamento: Taming.SkillName=ADDOMESTICAMENTO Taming.Skillup=L'abilit\u00E0 Addomesticamento \u00E8 aumentata di {0}. Totale ({1}) Taming.Summon.Complete=[[GREEN]]Evocazione completa -Taming.Summon.Lifespan= (Durata: {0}s) +Taming.Summon.Lifespan=(Durata: {0}s) Taming.Summon.Fail.Ocelot=Hai troppi ocelot vicino per poterne evocare degli altri. Taming.Summon.Fail.Wolf=Hai troppi lupi vicino per poterne evocare degli altri. Taming.Summon.Fail.Horse=Hai troppi cavalli nelle vicinanze per evocarne altri. Taming.Summon.Fail.TooMany=Hai raggiunto il limite massimo di animali evocabili. [[YELLOW]]({0}) Taming.Summon.Name.Format={1} di {0} - #UNARMED Unarmed.Ability.Berserk.Length=Durata di Furore: [[YELLOW]]{0}s Unarmed.Ability.Bonus.0=Stile del Braccio di Ferro @@ -377,7 +363,6 @@ Unarmed.Skills.Berserk.Other.Off=Furore[[GREEN]] si \u00E8 esaurito per [[YELLOW Unarmed.Skills.Berserk.Other.On=[[GREEN]]{0}[[DARK_GREEN]] ha usato [[RED]]Furore! Unarmed.Skills.Berserk.Refresh=[[GREEN]]La tua capacit\u00E0 [[YELLOW]]Furore [[GREEN]]si \u00E8 rigenerata! Unarmed.Skillup=L'abilit\u00E0 Lotta \u00E8 aumentata di {0}. Totale ({1}) - #WOODCUTTING Woodcutting.Ability.0=Soffia Foglie Woodcutting.Ability.1=Soffia via le foglie @@ -400,13 +385,11 @@ Woodcutting.Skills.TreeFeller.Other.On=[[GREEN]]{0}[[DARK_GREEN]] ha usato [[RED Woodcutting.Skills.TreeFeller.Splinter=LA TUA ASCIA SI FRANTUMA IN DECINE DI PEZZI! Woodcutting.Skills.TreeFeller.Threshold=Quell'albero \u00E8 troppo grande! Woodcutting.Skillup=L'abilit\u00E0 Taglialegna \u00E8 aumentata di {0}. Totale ({1}) - #ABILITIY ##generic Ability.Generic.Refresh=[[GREEN]]**CAPACIT\u00C0 RIGENERATE!** Ability.Generic.Template.Lock=[[GRAY]]{0} Ability.Generic.Template=[[GOLD]]{0}: [[DARK_AQUA]]{1} - #COMBAT Combat.ArrowDeflect=[[WHITE]]**FRECCIA DEVIATA** Combat.BeastLore=[[GREEN]]**CONOSCENZA DELLE BESTIE** @@ -416,7 +399,6 @@ Combat.Gore=[[GREEN]]**SBRANATO** Combat.StruckByGore=**SEI STATO SBRANATO** Combat.TargetDazed=Il bersaglio \u00E8 rimasto [[DARK_RED]]Stordito Combat.TouchedFuzzy=Urto Stordino. Vado nel Pallone. - #COMMANDS ##generic mcMMO.Description=[[DARK_AQUA]]Riguardo il [[DARK_AQUA]]Progetto [[YELLOW]]mcMMO:,[[GOLD]]mcMMO \u00E8 una mod GdR [[RED]]open source[[GOLD]] creata nel Febbraio 2011,[[GOLD]]da [[BLUE]]com.gmail.nossr50[[GOLD]]. L'obiettivo \u00E8 quello di fornire un'esperienza GdR di qualit\u00E0.,[[DARK_AQUA]]Suggerimenti:,[[GOLD]] - [[GREEN]]Usa [[RED]]/mcmmo help[[GREEN]] per vedere i comandi,[[GOLD]] - [[GREEN]]Digita [[RED]]/NOMEABILIT\u00C0[[GREEN]] per vedere informazioni dettagliate su un'abilit\u00E0,[[DARK_AQUA]]Sviluppatori:,[[GOLD]] - [[GREEN]]com.gmail.nossr50 [[BLUE]](Fondatore),[[GOLD]] - [[GREEN]]GJ [[BLUE]](Capo Progetto),[[GOLD]] - [[GREEN]]NuclearW [[BLUE]](Sviluppatore),[[GOLD]] - [[GREEN]]bm01 [[BLUE]](Sviluppatore),[[GOLD]] - [[GREEN]]TfT_02 [[BLUE]](Sviluppatore),[[GOLD]] - [[GREEN]]Glitchfinder [[BLUE]](Sviluppatore),[[GOLD]] - [[GREEN]]t00thpick1 [[BLUE]](Sviluppatore),[[DARK_AQUA]]Link Utili:,[[GOLD]] - [[GREEN]]https://github.com/mcMMO-Dev/mcMMO/issues[[GOLD]] Segnalazione Bug,[[GOLD]] - [[GREEN]]#mcmmo @ irc.esper.net[[GOLD]] IRC Chat, @@ -525,7 +507,7 @@ Commands.Party.Alliance.Invite.Accepted=[[GREEN]]Invito di alleanza accettato. Commands.Party.Alliance.None=Il tuo gruppo non ha un alleato. Commands.Party.Alliance.AlreadyAllies=Il tuo gruppo ha gi\u00E0 un'alleato. Sciogli l'alleanza con [[DARK_AQUA]]/party alliance disband Commands.Party.Alliance.Help.0=Questo gruppo non ha formato un'alleanza. Invita un capo gruppo. -Commands.Party.Alliance.Help.1= fai un'alleanza con [[DARK_AQUA]]/party alliance invite [[RED]]. +Commands.Party.Alliance.Help.1=fai un'alleanza con [[DARK_AQUA]]/party alliance invite [[RED]]. Commands.ptp.Enabled=Teletrasporto del gruppo [[GREEN]]abilitato Commands.ptp.Disabled=Teletrasporto del gruppo [[RED]]disabilitato Commands.ptp.NoRequests=Non hai richieste di teletrasporto in questo momento @@ -557,7 +539,7 @@ Commands.SkillInfo=[[GREEN]]- Vedi informazioni dettagliate su un'abilit\u00E0 Commands.Stats.Self=LE TUE STATISTICHE Commands.Stats=[[GREEN]]- Visualizza le tue statistiche mcMMO Commands.ToggleAbility=[[GREEN]]- Attiva o disattiva l'attivazione delle abilit\u00E0 con click destro -Commands.Usage.0= [[RED]]L'uso appropriato \u00E8 /{0} +Commands.Usage.0=[[RED]]L'uso appropriato \u00E8 /{0} Commands.Usage.1=L'uso appropriato \u00E8 /{0} {1} Commands.Usage.2=L'uso appropriato \u00E8 /{0} {1} {2} Commands.Usage.3=L'uso appropriato \u00E8 /{0} {1} {2} {3} @@ -574,7 +556,6 @@ Commands.Usage.XP=xp mcMMO.NoInvites=Non hai inviti in questo momento mcMMO.NoPermission=[[DARK_RED]]Permessi insufficienti. mcMMO.NoSkillNote=[[DARK_GRAY]]Se non hai accesso a un'abilit\u00E0 non sar\u00E0 mostrata qui. - ##party Party.Forbidden=[mcMMO] I gruppi non sono permessi in questo mondo (vedi i Permessi) Party.Help.0=L'uso appropriato \u00E8 [[DARK_AQUA]]{0} [password]. @@ -651,7 +632,6 @@ Party.ItemShare.Category.Mining=Estrazione Party.ItemShare.Category.Herbalism=Erboristeria Party.ItemShare.Category.Woodcutting=Taglialegna Party.ItemShare.Category.Misc=Varie - ##xp Commands.XPGain.Acrobatics=Cadere Commands.XPGain.Alchemy=Preparazione Pozioni @@ -678,27 +658,23 @@ Commands.xprate.proper.2=Per favore specifica "true" o "false" per indicare se q Commands.xprate.started.0=[[GOLD]]\u00C8 INIZIATO UN EVENTO XP PER mcMMO! Commands.xprate.started.1=[[GOLD]]IL TASSO DI XP DI mcMMO ORA \u00C8 {0}x! XPRate.Event=[[GOLD]]\u00C8 in corso un evento mcMMO sul tasso XP! Il tasso XP \u00E8 {0}x! - #EFFECTS ##generic Effects.Effects=EFFETTI Effects.Child=[[DARK_GRAY]]LVL: [[GREEN]]{0} Effects.Level=[[DARK_GRAY]]LVL: [[GREEN]]{0} [[DARK_AQUA]]XP[[YELLOW]]([[GOLD]]{1}[[YELLOW]]/[[GOLD]]{2}[[YELLOW]]) -Effects.Parent= [[GOLD]]{0} - +Effects.Parent=[[GOLD]]{0} - Effects.Template=[[DARK_AQUA]]{0}: [[GREEN]]{1} - #GUIDES Guides.Available=[[GRAY]]Guida per {0} disponibile - digita /{1} ? [pagina] Guides.Header=[[GOLD]]-=[[GREEN]]{0} Guida[[GOLD]]=- Guides.Page.Invalid=Non \u00E8 un numero di pagina valido! Guides.Page.OutOfRange=Quella pagina non esiste, ci sono solo {0} pagine in totale. -Guides.Usage= L'uso \u00E8 /{0} ? [pagina] - +Guides.Usage=L'uso \u00E8 /{0} ? [pagina] ##Acrobatics Guides.Acrobatics.Section.0=[[DARK_AQUA]]Riguardo L'Acrobatica:\n[[YELLOW]]L'Acrobatica \u00E8 l'arte di muoversi con grazia in mcMMO.\n[[YELLOW]]Essa fornisce bonus di combattimento e bonus di danni ambientali.\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Per guadagnare XP in questa abilit\u00E0 \u00E8 necessario\n[[YELLOW]]eseguire schivate in combattimento\n[[YELLOW]]o sopravvivere a cadute che danneggiano. Guides.Acrobatics.Section.1=[[DARK_AQUA]]Come funziona Rotolamento?\n[[YELLOW]]Hai una possibilit\u00E0 passiva quando prendi danni da caduta\n[[YELLOW]]di annullare il danno subito. Puoi tenere premuto il pulsante di\n[[YELLOW]]accovacciata per raddoppiare la possibilit\u00E0 durante la caduta.\n[[YELLOW]]Questo attiva una Capriola Aggraziata invece di quella\n[[YELLOW]]standard. Le Capriole Aggraziate sono come quelle normali\n[[YELLOW]]ma hanno il doppio delle probabilit\u00E0 di verificarsi e forniscono\n[[YELLOW]]pi\u00F9 sicurezza. La possibilit\u00E0 di capriola \u00E8 legata al livello abilit\u00E0 Guides.Acrobatics.Section.2=[[DARK_AQUA]]Come funziona la Schivata?\n[[YELLOW]]La Schivata \u00E8 una possibilit\u00E0 passiva quando si \u00E8\n[[YELLOW]]feriti in combattimento di dimezzare il danno preso.\n[[YELLOW]]\u00C8 legato al tuo livello di abilit\u00E0. - ##Alchemy Guides.Alchemy.Section.0=[[DARK_AQUA]]Riguardo l'Alchimia:\n[[YELLOW]]L'Alchimia riguarda il preparare pozioni.\n[[YELLOW]]Fornisce un aumento di velocit\u00E0 nella produzione di pozioni, cos\u00EC\n[[YELLOW]]come l'aggiunta di nuove (prima) pozioni introvabili.\n\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Per guadagnare XP in questa abilit\u00E0 devi preparare pozioni. Guides.Alchemy.Section.1=[[DARK_AQUA]]Come funziona la Catalisi?\n[[YELLOW]]La Catalisi accelera il processo di preparazione,\n[[YELLOW]]con una velocit\u00E0 massima di 4x al livello 1000.\n[[YELLOW]]Questa abilit\u00E0 \u00E8 sbloccata al livello 100 di default. @@ -707,13 +683,11 @@ Guides.Alchemy.Section.3=[[DARK_AQUA]]Ingredienti Intrugli livello 1:\n[[YELLOW] Guides.Alchemy.Section.4=[[DARK_AQUA]]Ingredienti Intrugli livello 2:\n[[YELLOW]]Carota (Pozione della Velocit\u00E0)\n[[YELLOW]]Palla di Gelatina (Pozione di Noia)\n\n[[DARK_AQUA]]Ingredienti Intrugli livello 3:\n[[YELLOW]]Quarzo (Pozione di Assorbimento)\n[[YELLOW]]Fungo Rosso (Pozione del Salto) Guides.Alchemy.Section.5=[[DARK_AQUA]]Ingredienti Intrugli livello 4:\n[[YELLOW]]Mela (Pozione di Potenziamento Salute)\n[[YELLOW]]Carne Marcia (Pozione della Fame)\n\n[[DARK_AQUA]]Ingredienti Intrugli livello 5:\n[[YELLOW]]Fungo Marrone (Pozione di Nausea)\n[[YELLOW]]Sacca d'Inchiostro (Pozione di Cecit\u00E0) Guides.Alchemy.Section.6=[[DARK_AQUA]]Ingredienti Intrugli livello 6:\n[[YELLOW]]Felce (Pozione di Saturazione)\n\n[[DARK_AQUA]]Ingredienti Intrugli livello 7:\n[[YELLOW]]Patata Velenosa (Pozione di Decadimento)\n\n[[DARK_AQUA]]Concoctions tier 8 ingredients:\n[[YELLOW]]Mela d'Oro (Pozione di Resistenza) - ##Archery Guides.Archery.Section.0=[[DARK_AQUA]]Riguardo Tiro con l'Arco:\n[[YELLOW]]Tiro con l'Arco riguarda il tirare con arco e freccia.\n[[YELLOW]]Fornisce vari bonus di combattimento, come un incremento\n[[YELLOW]]di danno che scala con il livello e l'abilit\u00E0 di stordire i tuoi\n[[YELLOW]]avversari in PvP. Inoltre puoi recuperare alcune delle\n[[YELLOW]]frecce spese dai cadaveri dei tuoi nemici.\n\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Per guadagnare XP in questa abilit\u00E0 \u00E8 necessario\n[[YELLOW]]colpire i mob o gli altri giocatori. Guides.Archery.Section.1=[[DARK_AQUA]]Come funziona Tiro da Maestro?\n[[YELLOW]]Tiro da Maestro fornisce un danno aggiuntivo ai tuoi colpi.\n[[YELLOW]]Il danno bonus da Tiro da Maestro aumenta\n[[YELLOW]]all'aumentare del livello di Tiro con l'Arco.\n[[YELLOW]]Con le impostazioni di default, il danno dei tiri con l'arco\n[[YELLOW]]aumenta del 10% ogni 50 livelli, fino a un massimo del 200%. Guides.Archery.Section.2=[[DARK_AQUA]]Come funziona Stordire?\n[[YELLOW]]Hai una possibilit\u00E0 passiva di stordire gli altri giocatori quando\n[[YELLOW]]li colpisci. Quando Stordire si innesca costringe gli avversari\n[[YELLOW]]a guardare verso l'alto per una breve durata.\n[[YELLOW]]Un colpo di Stordire procura anche ulteriori 4 danni (2 cuori). Guides.Archery.Section.3=[[DARK_AQUA]]Come funziona Recupero Frecce?\n[[YELLOW]]Hai una possibilit\u00E0 passiva di recuperare alcune\n[[YELLOW]]delle tue frecce quando uccidi un mob con l'arco.\n[[YELLOW]]Questa possibilit\u00E0 \u00E8 aumentata dal livello in Tiro con l'Arco.\n[[YELLOW]Di default, questa capacit\u00E0 aumenta di 0.1% per livello,\n[[YELLOW]]fino al 100% al livello 1000. - ##Axes Guides.Axes.Section.0=[[DARK_AQUA]]Riguardo Asce:\n[[YELLOW]]Con l'abilit\u00E0 Asce \u00E8 possibile utilizzare l'ascia per molto di\n[[YELLOW]]pi\u00F9 che solo deforestare! \u00E8 possibile incidere e sgretolare\n[[YELLOW]]mob e giocatori per guadagnare XP, colpire mob con l'effetto\n[[YELLOW]]di contraccolpo e infliggere danni critici MORTALI sui mob e\n[[YELLOW]]giocatori. La tua ascia diventa anche un biotrituratore\n[[YELLOW]]portatile, abbattendo l'armatura del nemico con facilit\u00E0 con\n[[YELLOW]]l'aumentare del livello.\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Per guadagnare XP in questa abilit\u00E0 devi colpire mob\n[[YELLOW]]o altri giocatori con la tua Ascia. Guides.Axes.Section.1=[[DARK_AQUA]]Come funziona Spacca Crani?\n[[YELLOW]]Questa capacit\u00E0 consente di fare un colpo EaA\n[[YELLOW]](Effetto ad Area). Questo EaA infligger\u00E0 la met\u00E0 del danno\n[[YELLOW]]fatto all'obbiettivo principale, quindi \u00E8 ottimo per sgombrare\n[[YELLOW]]grandi mucchi di mob. @@ -721,7 +695,6 @@ Guides.Axes.Section.2=[[DARK_AQUA]]Come funziona Colpi Critici?\n[[YELLOW]]Colpi Guides.Axes.Section.3=[[DARK_AQUA]]Come funziona Mestria con l'Ascia?\n[[YELLOW]]Maestria con l'Ascia \u00E8 una capacit\u00E0 passiva\n[[YELLOW]]che aggiunge danno ai tuoi colpi quando usi delle Asce.\n[[YELLOW]]Di default il bonus danno aumenta di 1 ogni 50 livelli,\n[[YELLOW]]fino a 4 danni extra al livello 200. Guides.Axes.Section.4=[[DARK_AQUA]]Come funziona Sfonda Armature?\n[[YELLOW]]Un attacco con abbastanza forza da frantumare un armatura!\n[[YELLOW]]Sfonda Armature ha una possibilit\u00E0 passiva di danneggiare\n[[YELLOW]]l'armatura dell'avversario. Il livello in Asce aumenta il danno. Guides.Axes.Section.5=[[DARK_AQUA]]Come funziona Impatto Maggiore?\n[[YELLOW]]Hai una possibilit\u00E0 passiva di ottenere un maggiore impatto\n[[YELLOW]]colpendo i mob o i giocatori con un'ascia.\n[[YELLOW]]Di default la possibilit\u00E0 \u00E8 del 25%. Questa capacit\u00E0\n[[YELLOW]]ha un estremo effetto contraccolpo, simile all'incantesimo\n[[YELLOW]]Contraccolpo. Inoltre, infligge danno bonus al bersaglio. - ##Excavation Guides.Excavation.Section.0=[[DARK_AQUA]]Riguardo l'Escavazione:\n[[YELLOW]]L'Escavazione \u00E8 l'atto di scavare per trovare tesori.\n[[YELLOW]]Scavando la terra si trovano tesori.\n[[YELLOW]]Quanto pi\u00F9 si esegue questa operazione\n[[YELLOW]]pi\u00F9 tesori si possono trovare.\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Per guadagnare XP devi scavare con una pala in mano.\n[[YELLOW]]Solo alcuni materiali possono essere scavati per tesori e XP. Guides.Excavation.Section.1=[[DARK_AQUA]]Materiali Compatibili:\n[[YELLOW]]Erba, Terra, Sabbia, Argilla, Ghiaia, Micelio,\n[[YELLOW]]Sabbia delle Anime, Neve @@ -729,7 +702,6 @@ Guides.Excavation.Section.2=[[DARK_AQUA]]Come usare Giga-Trivella Demolitrice:\n Guides.Excavation.Section.3=[[DARK_AQUA]]Cos'\u00E8 Giga-Trivella Demolitrice?\n[[YELLOW]]Giga-Trivella Demolitrice \u00E8 una capacit\u00E0 con raffreddamento\n[[YELLOW]]legata all'abilit\u00E0 Escavazione. Triplica la possibilit\u00E0\n[[YELLOW]]di trovare tesori e abilita la rottura istantanea\n[[YELLOW]]sui materiali di Escavazione. Guides.Excavation.Section.4=[[DARK_AQUA]]Come funziona Cacciatore di Tesori?\n[[YELLOW]]Ogni possibile tesoro per Escavazione ha il suo livello\n[[YELLOW]]di abilit\u00E0 richiesto per essere droppato, di conseguenza \u00E8\n[[YELLOW]]difficile dire quanto ti sta aiutando.\n[[YELLOW]]Basta tenere a mente che pi\u00F9 alta \u00E8 l'abilit\u00E0 di Escavazione,\n[[YELLOW]]pi\u00F9 tesori si possono trovare.\n[[YELLOW]]E anche tenere a mente che ogni tipo di materiale\n[[YELLOW]]di Escavazione compatibile ha la sua lista di tesori unici.\n[[YELLOW]]In altre parole si trovano diversi tesori nella Terra\n[[YELLOW]]da quelli che si troverebbero nella Ghiaia. Guides.Excavation.Section.5=[[DARK_AQUA]]Note sull'Escavazione:\n[[YELLOW]]I drop dell'Escavazione sono completamente personalizzabili\n[[YELLOW]]Quindi, i risultati variano da server a server. - ##Fishing Guides.Fishing.Section.0=[[DARK_AQUA]]Riguardo la Pesca:\n[[YELLOW]]Con l'abilit\u00E0 Pesca, pescare \u00E8 di nuovo emozionante!\n[[YELLOW]]Trovare tesori nascosti, e scrollare oggetti dai mob.\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Catturare pesci. Guides.Fishing.Section.1=[[DARK_AQUA]]Come funziona Cacciatore di Tesori?\n[[YELLOW]]Questa capacit\u00E0 consente di trovare tesori pescando\n[[YELLOW]]con una piccola possibilit\u00E0 di oggetti incantati.\n[[YELLOW]]Ogni possibile tesoro di pesca ha una possibilit\u00E0\n[[YELLOW]]di uscire a ogni livello. Dipende per\u00F2 dalla\n[[YELLOW]]rarit\u00E0 dell'oggetto ogni quanto esce.\n[[YELLOW]]Pi\u00F9 \u00E8 alta la tua abilit\u00E0 di Pesca, maggiori\n[[YELLOW]]sono le possibilit\u00E0 di trovare tesori migliori. @@ -738,7 +710,6 @@ Guides.Fishing.Section.3=[[DARK_AQUA]]Come funziona Pescatore Provetto?\n[[YELLO Guides.Fishing.Section.4=[[DARK_AQUA]]Come funziona Scuotere?\n[[YELLOW]]Questa capacit\u00E0 attiva consente di scrollare oggetti sciolti\n[[YELLOW]]dai mob agganciandoli con una canna da pesca.\n[[YELLOW]]I mob dropperanno gli oggetti che normalmente droppano\n[[YELLOW]]alla morte. \u00C8 anche possibile acquisire le teste dei mob,\n[[YELLOW]]che sono normalmente inottenibili in modalit\u00E0 sopravvivenza. Guides.Fishing.Section.5=[[DARK_AQUA]]Come funziona Dieta del Pescatore?\n[[YELLOW]]Questa capacit\u00E0 passiva aumenta la fame ripristinata \n[[YELLOW]]mangiando pesce. Guides.Fishing.Section.6=[[DARK_AQUA]]Note sulla Pesca:\n[[YELLOW]]I drop di pesca sono completamente personalizzabili,\n[[YELLOW]]quindi variano da server a server. - ##Herbalism Guides.Herbalism.Section.0=[[DARK_AQUA]]Riguardo l'Erboristeria:\n[[YELLOW]]L'Erboristeria riguarda il raccogliere le erbe e le piante.\n\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Raccogliendo piante ed erbe. Guides.Herbalism.Section.1=[[DARK_AQUA]]Blocchi Compatibili\n[[YELLOW]]Grano, Patate, Carote, Meloni, \n[[YELLOW]]Zucchine, Canne da Zucchero, Fave di Cacao, Fiori, Cactus,\n[[YELLOW]]Funghi, Verruche del Nether, Ninfee, e Rampicanti. @@ -748,7 +719,6 @@ Guides.Herbalism.Section.4=[[DARK_AQUA]]Come funziona Pollice Verde (Pietre/Matt Guides.Herbalism.Section.5=[[DARK_AQUA]]Come funziona Dieta del Contadino?\n[[YELLOW]]Questa capacit\u00E0 passiva aumenta la fame ripristinata \n[[YELLOW]]mangiando Pane, Biscotti, Meloni, Zuppe di Funghi, Carote,\n[[YELLOW]]e Patate. Guides.Herbalism.Section.6=[[DARK_AQUA]]Come funziona Fortuna Hylian?\n[[YELLOW]]Questa capacit\u00E0 passiva d\u00E0 una possibilit\u00E0 di trovare\n[[YELLOW]]oggetti rari quando certi blocchi sono rotti con una spada. Guides.Herbalism.Section.7=[[DARK_AQUA]]Come funziona il Doppio Drop?\n[[YELLOW]]Questa abilit\u00E0 passiva d\u00E0 ai giocatori pi\u00F9 resa\n[[YELLOW]]dai loro raccolti. - ##Mining Guides.Mining.Section.0=[[DARK_AQUA]]Riguardo l'Estrazione:\n[[YELLOW]]L'Estrazione consiste nell'estrarre pietra e minerali.\n[[YELLOW]]Fornisce bonus alla quantit\u00E0 di materiali droppati minando.\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Per guadagnare XP in questa abilit\u00E0, devi minare con un piccone.\n[[YELLOW]]Solo alcuni blocchi assegnano XP. Guides.Mining.Section.1=[[DARK_AQUA]]Materiali compatibili:\n[[YELLOW]]Pietra, Carbone Grezzo, Ferro Grezzo, Oro Grezzo, Diamante Grezzo, Pietrarossa Grezza,\n[[YELLOW]]Lapislazzuli Grezzo, Ossidiana, Pietra Muschiosa, Pietra dell'End,\n[[YELLOW]]Luminite e Netherrack. @@ -756,30 +726,25 @@ Guides.Mining.Section.2=[[DARK_AQUA]]Come usare il Super Demolitore:\n[[YELLOW]] Guides.Mining.Section.3=[[DARK_AQUA]]Cos'\u00E8 il Super Demolitore?\n[[YELLOW]]Il Super Demolitore \u00E8 una capacit\u00E0 a tempo legata all'abilit\u00E0\n[[YELLOW]]Estrazione. Triplica la possibilit\u00E0 di drop di oggetti extra e\n[[YELLOW]]abilita la rottura istantanea dei materiali estratti. Guides.Mining.Section.4=[[DARK_AQUA]]Come usare l'Estrazione Esplosiva:\n[[YELLOW]]Con un detonatore in mano, un acciarino di default,\n[[YELLOW]]accovacciati e fai click destro su TNT a distanza. Questo causer\u00E0\n[[YELLOW]]l'esplosione istantanea della TNT. Guides.Mining.Section.5=[[DARK_AQUA]]Come funziona Estrazione Esplosiva?\n[[YELLOW]]Estrazione Esplosiva \u00E8 una capacit\u00E0 legata all'abilit\u00E0\n[[YELLOW]]Estrazione. Da bonus minando con la TNT e consente di\n[[YELLOW]]detonare da lontano la TNT. Ci sono tre parti di Estrazione\n[[YELLOW]]Esplosiva. La prima parte \u00E8 Bombe Pi\u00F9 Grandi, che aumenta il\n[[YELLOW]]raggio d'esplosione. La seconda parte \u00E8 Esperto di Demolizioni,\n[[YELLOW]]che riduce il danno dalle esplosioni di TNT. La terza parte\n[[YELLOW]]aumenta semplicemente la quantit\u00E0 di minerali droppati dalla \n[[YELLOW]]TNT e riduce i detriti droppati. - ##Repair Guides.Repair.Section.0=[[DARK_AQUA]]Riguardo la Riparazione:\n[[YELLOW]]La Riparazione consente di utilizzare un blocco di ferro\n[[YELLOW]]per riparare armature e strumenti.\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Riparando strumenti e armature con l'incudine mcMMO.\n[[YELLOW]]Questa \u00E8 di default un blocco di ferro e non deve essere\n[[YELLOW]]confusa con l'incudine di Minecraft Vanilla. Guides.Repair.Section.1=[[DARK_AQUA]]Come posso usare Riparazione?\n[[YELLOW]]Piazza un'incudine mcMMO e fai click destro per riparare \n[[YELLOW]]l'oggetto in mano. Questo consuma 1 oggetto per ogni uso. Guides.Repair.Section.2=[[DARK_AQUA]]Come funziona Maestria nella Riparazione?\n[[YELLOW]]Maestria nella Riparazione aumenta la quantit\u00E0 di riparazione.\n[[YELLOW]]La riparazione extra dipende dal tuo livello di Riparazione. Guides.Repair.Section.3=[[DARK_AQUA]]Come funziona Super Riparazione?\n[[YELLOW]]Super Riparazione \u00E8 una capacit\u00E0 passiva. Riparando un oggetto,\n[[YELLOW]]concede ai giocatori una possibilit\u00E0 di riparare un oggetto con\n[[YELLOW]]doppia efficacia. Guides.Repair.Section.4=[[DARK_AQUA]]Come funziona Forgiatura Arcana?\n[[YELLOW]]Questa capacit\u00E0 passiva consente di riparare oggetti con\n[[YELLOW]]una certa possibilit\u00E0 di mantenere i suoi incantesimi. Gli\n[[YELLOW]]incantesimi possono essere mantenuti ai loro livelli,\n[[YELLOW]]degradati a livelli pi\u00F9 bassi, o persi del tutto. - ##Salvage Guides.Salvage.Section.0=[[DARK_AQUA]]Riguardo la Rottamazione:\n[[YELLOW]]La Rottamazione consente di usare un blocco d'oro\n[[YELLOW]]per rottamare armature e strumenti.\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Rottamazione \u00E8 un'abilit\u00E0 figlia di Riparazione\n[[YELLOW]]e Pesca, il livello di abilit\u00E0 \u00E8 basato sui livelli\n[[YELLOW]]di Pesca e Riparazione. Guides.Salvage.Section.1=[[DARK_AQUA]]Come posso usare la Rottamazione?\n[[YELLOW]]Piazza un'incudine di Rottamazione mcMMO e facci click\n[[YELLOW]]destro per rottamare l'oggetto che hai in mano. Esso si\n[[YELLOW]]romper\u00E0 e restituir\u00E0 i materiali usati per costruirlo.\n\n[[YELLOW]]Per esempio, rottamando un piccone di ferro dar\u00E0 lingotti\n[[YELLOW]]di ferro. Guides.Salvage.Section.2=[[DARK_AQUA]]Come funziona la Rottamazione Avanzata?\n[[YELLOW]]Quando sbloccata, questa capacit\u00E0 consente di rottamare\n[[YELLOW]]oggetti danneggiati. La percentuale di resa aumenta con\n[[YELLOW]]il salire di livello. Una resa maggiore significa che si possono\n[[YELLOW]]ottenere pi\u00F9 materiali indietro. Con la Rottamazione\n[[YELLOW]]Avanzata si otterr\u00E0 sempre 1 materiale indietro, a meno che\n[[YELLOW]]non sia troppo danneggiato. Quindi non ci si deve preoccupare\n[[YELLOW]]di distruggere oggetti senza ottenere nulla in cambio. Guides.Salvage.Section.3=[[DARK_AQUA]]Per illustrare come funziona, ecco un esempio:\n[[YELLOW]]Diciamo che rottamiamo un piccone d'oro danneggiato per il 20%,\n[[YELLOW]]ci\u00F2 significa che l'importo massimo che potrebbe ottenere solo 2\n[[YELLOW]](Perch\u00E9 il piccone \u00E8 fatto con 3 lingotti - ciascuno del valore di\n[[YELLOW]]33,33% durabilit\u00E0) che \u00E8 uguale a 66%. Se la percentuale di\n[[YELLOW]]resa \u00E8 sotto il 66% non si \u00E8 in grado di ottenere 2 lingotti.\n[[YELLOW]]Se \u00E8 al di sopra di questo valore si \u00E8 in grado di ottenere lo\n[[YELLOW]]"intero importo", il che significa che si otterranno 2 lingotti. Guides.Salvage.Section.4=[[DARK_AQUA]]Come funziona la Rottamazione Arcana?\n[[YELLOW]]Questa capacit\u00E0 consente di ottenere libri incantati\n[[YELLOW]]durante la rottamazione di oggetti incantati. A seconda del\n[[YELLOW]]livello la possibilit\u00E0 di estrarre con successo\n[[YELLOW]]un incantesimo totale o parziale varia.\n\n[[YELLOW]]Quando un incantesimo \u00E8 parzialmente estratto, il libro\n[[YELLOW]]incantato avr\u00E0 un livello inferiore. - ##Smelting Guides.Smelting.Section.0=Prossimamente... - ##Swords Guides.Swords.Section.0=[[DARK_AQUA]]Riguardo Spade:\n[[YELLOW]]Questa abilit\u00E0 d\u00E0 bonus di combattimento a chi\n[[YELLOW]]combatte con una spada.\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Il guadagno degli XP \u00E8 basato sul danno inflitto\n[[YELLOW]]ai mob o ad altri giocatori con una spada. Guides.Swords.Section.1=[[DARK_AQUA]]Come funziona Colpi Seghettati?\n[[YELLOW]]Colpi Seghettati \u00E8 una capacit\u00E0 attiva, puoi attivarla facendo\n[[YELLOW]]click destro con una spada. Questa capacit\u00E0 permette di fare\n[[YELLOW]]un colpo EaA (Effetto ad Area). Questo EaA far\u00E0 il 25% in pi\u00F9\n[[YELLOW]]di danni e infligger\u00E0 un effetto di sanguinamento che dura 5 tick. Guides.Swords.Section.2=[[DARK_AQUA]]Come funziona Contrattacco?\n[[YELLOW]]Contrattacco \u00E8 una capacit\u00E0 attiva. Quando si ricevono\n[[YELLOW]]colpi dai mob, hai una possibilit\u00E0 di riflettere il 50% \n[[YELLOW]]del danno preso. Guides.Swords.Section.3=[[DARK_AQUA]]Come funziona Emorragia?\n[[YELLOW]]Emorragia causa ai nemici danno ogni due secondi. Il \n[[YELLOW]]bersaglio sanguina fino allo svanire dell'effetto,\n[[YELLOW]]o alla morte, quello che viene prima.\n[[YELLOW]]La durata dell'Emorragia \u00E8 aumentata dall'abilit\u00E0 Spade. - ##Taming Guides.Taming.Section.0=[[DARK_AQUA]]Riguardo l'Addomesticamento:\n[[YELLOW]]L'Addomesticamento dar\u00E0 ai giocatori vari bonus di combattimento\n[[YELLOW]]quando si usano lupi addomesticati.\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Per guadagnare XP in questa abilit\u00E0, devi addomesticare\n[[YELLOW]]lupi/ocelot o entrare in combattimento con i tuoi lupi. Guides.Taming.Section.1=[[DARK_AQUA]]Come funziona Richiamo della Natura?\n[[YELLOW]]Richiamo della Natura \u00E8 una capacit\u00E0 attiva che consente\n[[YELLOW]]di evocare un lupo o un ocelot al proprio fianco. Puoi\n[[YELLOW]]farlo facendo click sinistro con in mano ossa o pesce. @@ -790,7 +755,6 @@ Guides.Taming.Section.5=[[DARK_AQUA]]Come funziona Sicurezza Ambientale?\n[[YELL Guides.Taming.Section.6=[[DARK_AQUA]]Come funziona Pelliccia Folta?\n[[YELLOW]]Questa capacit\u00E0 passiva riduce il danno\n[[YELLOW]]e rende i lupi resistenti al fuoco. Guides.Taming.Section.7=[[DARK_AQUA]]Come funziona A Prova d'Urto?\n[[YELLOW]]Questa capacit\u00E0 passiva riduce il danno fatto ai lupi\n[[YELLOW]]dalle esplosioni. Guides.Taming.Section.8=[[DARK_AQUA]]Come funziona il Servizio Fast Food?\n[[YELLOW]]Questa capacit\u00E0 passiva d\u00E0 ai lupi la possibilit\u00E0 di guarire\n[[YELLOW]]ogni volta che fanno un attacco. - ##Unarmed Guides.Unarmed.Section.0=[[DARK_AQUA]]Riguardo la Lotta:\n[[YELLOW]]La Lotta dar\u00E0 ai giocatori vari bonus di combattimento\n[[YELLOW]]quando si usano i pugni come arma.\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Gli XP si ottengono in base alla quantit\u00E0 di danno\n[[YELLOW]]inflitto ai mob o agli altri giocatori senza armi. Guides.Unarmed.Section.1=[[DARK_AQUA]]Come funziona Furore?\n[[YELLOW]]Furore \u00E8 una capacit\u00E0 attiva che si attiva con il click\n[[YELLOW]]destro. In modalit\u00E0 Furore, Fai il 50% di danni\n[[YELLOW]]in pi\u00F9 e puoi rompere istantaneamente i materiali\n[[YELLOW]]deboli, come Terra ed Erba. @@ -798,19 +762,16 @@ Guides.Unarmed.Section.2=[[DARK_AQUA]]Come funziona Braccio di Ferro?\n[[YELLOW] Guides.Unarmed.Section.3=[[DARK_AQUA]]Come funziona Deviazione Frecce?\n[[YELLOW]]Deviare Frecce \u00E8 una capacit\u00E0 passiva che d\u00E0 la\n[[YELLOW]]possibilit\u00E0 di deviare frecce tirate da Scheletri o altri\n[[YELLOW]]giocatori. La freccia cadr\u00E0 a terra innocuamente. Guides.Unarmed.Section.4=[[DARK_AQUA]]Come funziona Presa di Ferro?\n[[YELLOW]]Presa di Ferro \u00E8 una capacit\u00E0 passiva che disarma.\n[[YELLOW]]Come sale il livello di lotta, aumenta la possibilit\u00E0\n[[YELLOW]]di prevenire un disarmo. Guides.Unarmed.Section.5=[[DARK_AQUA]]Come funziona Disarmo?\n[[YELLOW]]Questa capacit\u00E0 passiva permette ai giocatori di\n[[YELLOW]]disarmare gli altri giocatori, facendo cadere\n[[YELLOW]]a terra l'oggetto in mano del bersaglio. - ##Woodcutting Guides.Woodcutting.Section.0=[[DARK_AQUA]]Riguardo Taglialegna:\n[[YELLOW]]Taglialegna sta tutto nell'abbattere alberi.\n\n[[DARK_AQUA]]GUADAGNO XP:\n[[YELLOW]]Gli XP si guadagnano ogni volta che si rompono ceppi di legno. Guides.Woodcutting.Section.1=[[DARK_AQUA]]Come funziona Abbattitore d'Alberi?\n[[YELLOW]]Abbattitore d'Alberi \u00E8 una capacit\u00E0 attiva, puoi fare\n[[YELLOW]]click destro con in mano un'Ascia. Questo causer\u00E0\n[[YELLOW]]la rottura istantanea dell'albero, droppando tutto\n[[YELLOW]]il suo legno contemporaneamente. Guides.Woodcutting.Section.2=[[DARK_AQUA]]Come funziona Soffia Foglie?\n[[YELLOW]]Soffia Foglie \u00E8 una capacit\u00E0 passiva che causer\u00E0 la\n[[YELLOW]]rottura istantanea dei blocchi di foglie colpiti con un ascia.\n[[YELLOW]]Di default, questa capacit\u00E0 si sblocca al livello 100. Guides.Woodcutting.Section.3=[[DARK_AQUA]]Come funziona Doppi Drop?\n[[YELLOW]]Questa \u00E8 una capacit\u00E0 passiva che permette di ottenere\n[[YELLOW]]un blocco extra per ogni ceppo di legno che si taglia. - #INSPECT Inspect.Offline=Non hai il permesso di esaminare giocatori disconnessi! Inspect.OfflineStats=Statistiche mcMMO del Giocatore Disconnesso [[YELLOW]]{0} Inspect.Stats=[[GREEN]]Statistiche mcMMO di [[YELLOW]]{0} Inspect.TooFar=Sei troppo lontano da quel giocatore per esaminarlo! - #ITEMS Item.ChimaeraWing.Fail=**ALA CHIMERICA FALLITA!** Item.ChimaeraWing.Pass=**ALA CHIMERICA** @@ -821,11 +782,9 @@ Item.Injured.Wait=Sei stato ferito di recente e devi aspettare per usarlo. [[YEL Item.FluxPickaxe.Name=Piccone Cuocente Item.FluxPickaxe.Lore.1=[[GRAY]]Ha la possibilit\u00E0 di fusione immediata dei minerali. Item.FluxPickaxe.Lore.2=[[GRAY]]Richiede livello di Fusione {0}+ - #TELEPORTATION Teleport.Commencing=[[GRAY]]Il teletrasporto avr\u00E0 inizio fra [[GOLD]]({0}) [[GRAY]]secondi, resta fermo per favore... Teleport.Cancelled=[[DARK_RED]]Teletrasporto annullato! - #SKILLS Skills.Child=[[GOLD]](ABILIT\u00C0 FIGLIA) Skills.Disarmed=[[DARK_RED]]Sei stato disarmato! @@ -837,13 +796,11 @@ Skills.ChildStats={0}[[GREEN]]{1} Skills.TooTired=Sei troppo stanco per usare ancora questa capacit\u00E0. [[YELLOW]]({0}s) Skills.Cancelled={0} annullata! Skills.ConfirmOrCancel=[[GREEN]]Clicca ancora col destro per confermare [[GOLD]]{0}[[GREEN]]. Clicca col sinistro per annullare. - #STATISTICS Stats.Header.Combat=[[GOLD]]-=ABILIT\u00C0 DI COMBATTIMENTO=- Stats.Header.Gathering=[[GOLD]]-=ABILIT\u00C0 DI RACCOLTA=- Stats.Header.Misc=[[GOLD]]-=ABILIT\u00C0 VARIE=- Stats.Own.Stats=[[GREEN]][mcMMO] Statistiche - #PERKS Perks.XP.Name=Esperienza Perks.XP.Desc=Ricevi XP incrementati in determinate abilit\u00E0. @@ -856,7 +813,6 @@ Perks.Cooldowns.Desc=Riduce la durata della ricarica di {0}. Perks.ActivationTime.Name=Resistenza Perks.ActivationTime.Desc=Incrementa il tempo di attivazione della capacit\u00E0 di {0} secondi. Perks.ActivationTime.Bonus=[[GOLD]] ({0}s con il Vantaggio Resistenza) - #HARDCORE Hardcore.Mode.Disabled=[[GOLD]][mcMMO] Modalit\u00E0 Hardcore {0} disattivata per {1}. Hardcore.Mode.Enabled=[[GOLD]][mcMMO] Modalit\u00E0 Hardcore {0} attivata per {1}. @@ -869,7 +825,6 @@ Hardcore.Vampirism.Killer.Success=[[GOLD]][mcMMO] [[DARK_AQUA]]Hai rubato [[BLUE Hardcore.Vampirism.Victim.Failure=[[GOLD]][mcMMO] [[YELLOW]]{0}[[GRAY]] non \u00E8 riuscito a rubarti ci\u00F2 che conosci! Hardcore.Vampirism.Victim.Success=[[GOLD]][mcMMO] [[YELLOW]]{0}[[DARK_RED]] ti ha rubato [[BLUE]]{1}[[DARK_RED]] livelli! Hardcore.Vampirism.PercentageChanged=[[GOLD]][mcMMO] La percentuale di perdita \u00E8 cambiata a {0}. - #MOTD MOTD.Donate=[[DARK_AQUA]]Info Donazioni: MOTD.Hardcore.Enabled=[[GOLD]][mcMMO] [[DARK_AQUA]]Modalit\u00E0 hardcore abilitata: [[DARK_RED]]{0} @@ -878,7 +833,6 @@ MOTD.Hardcore.Vampirism.Stats=[[GOLD]][mcMMO] [[DARK_AQUA]]Salasso di Statistich MOTD.PerksPrefix=[Vantaggi mcMMO] MOTD.Version=[[GOLD]][mcMMO] versione [[DARK_AQUA]]{0} MOTD.Website=[[GOLD]][mcMMO] [[GREEN]]{0}[[YELLOW]] - Sito di mcMMO - #SMELTING Smelting.Ability.FluxMining=Possibilit\u00E0 di Estrazione Cuocente: [[YELLOW]]{0} Smelting.Ability.FuelEfficiency=Moltiplicatore di Efficienza Combustibile: [[YELLOW]]{0}x @@ -896,17 +850,16 @@ Smelting.SubSkill.FluxMining.Name=Estrazione Cuocente Smelting.SubSkill.FluxMining.Description=Probabilit\u00E0 che i minerali siano fusi istantaneamente mentre li si estrae Smelting.Listener=Fusione: Smelting.SkillName=FUSIONE - #COMMAND DESCRIPTIONS Commands.Description.addlevels=Aggiungi XP di mcMMO a un utente -Commands.Description.adminchat= Attiva o disattiva la chat amministratori di mcMMO o invia messaggi in chat amministratori +Commands.Description.adminchat=Attiva o disattiva la chat amministratori di mcMMO o invia messaggi in chat amministratori Commands.Description.addxp=Aggiunge XP mcMMO a un utente Commands.Description.hardcore=Modifica la percentuale hardcore di mcMMO o attiva/disattiva la modalit\u00E0 hardcore Commands.Description.inspect=Visualizza dettagliate informazioni mcMMO su un altro giocatore Commands.Description.mcability=Attiva o disattiva il fatto che le capacit\u00E0 mcMMO vengano preparate con un clic destro. Commands.Description.mccooldown=Vedi tutto sulle ricariche delle abilit\u00E0 mcMMO Commands.Description.mcgod=Attiva o Disattiva la modalit\u00E0 dio mcMMO -Commands.Description.mchud= Cambia il tuo stile di HUD di mcMMO +Commands.Description.mchud=Cambia il tuo stile di HUD di mcMMO Commands.Description.mcmmo=Mostra una breve descrizione di mcMMO Commands.Description.mcnotify=Attiva o disattiva la visualizzazione delle notifiche delle capacit\u00E0 di mcMMO in chat Commands.Description.mcpurge=Elimina dal database mcMMO gli utenti senza livelli mcMMO e quelli che non si sono connessi negli ultimi {0} mesi. @@ -928,11 +881,9 @@ Commands.Description.skillreset=Azzera i livelli mcMMO di un utente Commands.Description.vampirism=Modify the mcMMO vampirism percentage or toggle vampirism mode on/off Commands.Description.xplock=Blocca la tua barra XP di mcMMO su una specifica abilit\u00E0 di mcMMO Commands.Description.xprate=Modifica il tasso XP di mcMMO o d\u00E0 inizio a un evento XP mcMMO. - #UPDATE CHECKER UpdateChecker.Outdated=Stai usando una versione non aggiornata di mcMMO! UpdateChecker.NewAvailable=\u00C8 disponibile una nuova versione su BukkitDev. - #SCOREBOARD HEADERS Scoreboard.Header.PlayerStats=Statistiche mcMMO Scoreboard.Header.PlayerCooldowns=Ricariche mcMMO @@ -946,7 +897,6 @@ Scoreboard.Misc.RemainingXP=XP restanti Scoreboard.Misc.Cooldown=[[LIGHT_PURPLE]]Ricarica Scoreboard.Misc.Overall=[[GOLD]]Complessivo Scoreboard.Misc.Ability=Capacit\u00E0 - #DATABASE RECOVERY Profile.Loading.Success=[[GREEN]]Il tuo profilo mcMMO \u00E8 stato caricato. Profile.Loading.Failure=mcMMO non pu\u00F2 ancora caricare i tuoi dati. Si consiglia di [[AQUA]]contattare il proprietario del server.\n[[YELLOW]]Puoi ancora giocare sul server, ma non avrai [[BOLD]]livelli mcMMO[[YELLOW]] e gli XP che otterrai [[BOLD]]non verranno salvati[[YELLOW]]. diff --git a/bukkit/src/main/resources/locale/locale_ko.properties b/bukkit/src/main/resources/locale/locale_ko.properties index a974ee7f2..ea45ff82b 100644 --- a/bukkit/src/main/resources/locale/locale_ko.properties +++ b/bukkit/src/main/resources/locale/locale_ko.properties @@ -14,7 +14,6 @@ # Axes.Ability.Refresh.1 # # --wolfwork - #ACROBATICS Acrobatics.Ability.Proc=[[GREEN]]**\uC6B0\uC544\uD55C \uAD6C\uB974\uAE30** Acrobatics.Combat.Proc=[[GREEN]]**\uD68C\uD53C** @@ -31,7 +30,6 @@ Acrobatics.SubSkill.Roll.GraceChance=\uC6B0\uC544\uD55C \uAD6C\uB974\uAE30 \uD65 Acrobatics.Roll.Text=**\uAD6C\uB974\uAE30** Acrobatics.SkillName=\uACE1\uC608 Acrobatics.Skillup=\uB099\uBC95 \uAE30\uC220\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 - #ALCHEMY Alchemy.SubSkill.Catalysis.Name=\uCD09\uB9E4 Alchemy.SubSkill.Catalysis.Description=\uD3EC\uC158 \uC591\uC870 \uC18D\uB3C4 \uC99D\uAC00 @@ -44,7 +42,6 @@ Alchemy.Concoctions.Rank=\uD63C\uD569 \uB7AD\uD06C: [[YELLOW]]{0}/{1} Alchemy.Concoctions.Ingredients=\uC131\uBD84 [[[YELLOW]]{0}[[RED]]]: [[YELLOW]]{1} Alchemy.SkillName=\uC5F0\uAE08\uC220 Alchemy.Skillup=\uC5F0\uAE08\uC220 \uAE30\uC220\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 - #ARCHERY Archery.Combat.DazeChance=\uD604\uD639 \uD655\uB960: [[YELLOW]]{0} Archery.Combat.RetrieveChance=\uD654\uC0B4 \uD68C\uC218 \uD655\uB960: [[YELLOW]]{0} @@ -58,7 +55,6 @@ Archery.SubSkill.ArrowRetrieval.Description=\uC2DC\uCCB4\uC5D0\uC11C \uD654\uC0B Archery.Listener=\uAD81\uC220(ARCHERY): Archery.SkillName=\uAD81\uC220 Archery.Skillup=\uAD81\uC220 \uAE30\uC220\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 - #AXES Axes.Ability.Bonus.0=\uB3C4\uB07C \uB9C8\uC2A4\uD130\uB9AC Axes.Ability.Bonus.1={0} \uCD94\uAC00 \uD53C\uD574 @@ -93,7 +89,6 @@ Axes.Skills.SS.Refresh=[[GREEN]]\uB2F9\uC2E0\uC758 [[YELLOW]]\uBF08 \uCABC\uAC1C Axes.Skills.SS.Other.Off={0}\uB2D8\uC774 [[RED]]\uBF08 \uCABC\uAC1C\uAE30\uB97C[[GREEN]] \uC900\uBE44 \uD574\uC81C\uD588\uC2B5\uB2C8\uB2E4 Axes.Skills.SS.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\uB2D8\uC774 [[RED]]\uBF08 \uCABC\uAC1C\uAE30\uB97C \uC0AC\uC6A9\uD588\uC2B5\uB2C8\uB2E4! Axes.Skillup=\uBD80\uC220 \uAE30\uC220\uC774 {0} \uC62C\uB77C \uCD1D ({1}) \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 - #EXCAVATION Excavation.Ability.Lower=[[GRAY]]**\uC0BD \uC900\uBE44 \uD574\uC81C** Excavation.Ability.Ready=[[GREEN]]**\uC0BD \uC900\uBE44 \uC644\uB8CC** @@ -110,7 +105,6 @@ Excavation.Skills.GigaDrillBreaker.Refresh=[[GREEN]]\uB2F9\uC2E0\uC758 [[YELLOW] Excavation.Skills.GigaDrillBreaker.Other.Off={0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uAE30\uAC00 \uB4DC\uB9B4 \uBC84\uC11C\uCEE4\uB97C \uC0AC\uC6A9\uD588\uC2B5\uB2C8\uB2E4! Excavation.Skills.GigaDrillBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uAE30\uAC00 \uB4DC\uB9B4 \uBC84\uC11C\uCEE4\uB97C \uC0AC\uC6A9 \uD588\uC2B5\uB2C8\uB2E4! Excavation.Skillup=\uBC1C\uAD74 \uAE30\uC220\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 - #FISHING Fishing.Ability.Chance=\uC785\uC9C8 \uD655\uB960: [[YELLOW]]{0} Fishing.Ability.Info=\uB9E4\uC9C1 \uD5CC\uD130: [[GRAY]] **\uD2B8\uB808\uC838 \uD5CC\uD130 \uB7AD\uD06C \uD5A5\uC0C1** @@ -118,7 +112,7 @@ Fishing.Ability.Locked.0={0}\uB808\uBCA8 \uB54C \uAE30\uC220 \uD574\uC81C (\uD75 Fishing.Ability.Locked.1={0}\uB808\uBCA8 \uB54C \uAE30\uC220 \uD574\uC81C (\uC5BC\uC74C \uB09A\uC2DC) Fishing.Ability.Locked.2={0}\uB808\uBCA8 \uB54C \uAE30\uC220 \uD574\uC81C (\uB09A\uC2DC\uAFBC \uC7A5\uC778) Fishing.Ability.Rank=\uD2B8\uB808\uC838 \uD5CC\uD130 \uB7AD\uD06C: [[YELLOW]]{0}/5\uB7AD\uD06C -Fishing.Ability.TH.DropRate= \uB4DC\uB86D \uBE44\uC728: [[DARK_RED]]\uD568\uC815: [[YELLOW]]{0} [[GRAY]]\uACF5\uD1B5: [[YELLOW]]{1} [[GREEN]]\uBE44\uACF5\uD1B5: [[YELLOW]]{2}\n[[BLUE]]\uB808\uC5B4: [[YELLOW]]{3} [[LIGHT_PURPLE]]\uC5D0\uD53D: [[YELLOW]]{4} [[GOLD]]\uB808\uC804\uB4DC\uB9AC: [[YELLOW]]{5} [[AQUA]]\uB808\uCF54\uB4DC: [[YELLOW]]{6} +Fishing.Ability.TH.DropRate=\uB4DC\uB86D \uBE44\uC728: [[DARK_RED]]\uD568\uC815: [[YELLOW]]{0} [[GRAY]]\uACF5\uD1B5: [[YELLOW]]{1} [[GREEN]]\uBE44\uACF5\uD1B5: [[YELLOW]]{2}\n[[BLUE]]\uB808\uC5B4: [[YELLOW]]{3} [[LIGHT_PURPLE]]\uC5D0\uD53D: [[YELLOW]]{4} [[GOLD]]\uB808\uC804\uB4DC\uB9AC: [[YELLOW]]{5} [[AQUA]]\uB808\uCF54\uB4DC: [[YELLOW]]{6} Fishing.Ability.TH.MagicRate=\uB9E4\uC9C1 \uD5CC\uD130 \uD655\uB960: [[YELLOW]]{0} Fishing.Ability.Shake=\uD754\uB4E4\uAE30 \uD655\uB960: [[YELLOW]]{0} Fishing.Ability.IceFishing=\uC5BC\uC74C \uB09A\uC2DC: \uC5BC\uC74C\uC5D0\uC11C \uB09A\uC2DC @@ -142,7 +136,6 @@ Fishing.Ability.TH.Boom=[[GRAY]]\uD3ED\uBC1C \uC2DC\uAC04!!! Fishing.Ability.TH.Poison=[[GRAY]]\uB08C\uC0C8\uAC00 \uC88B\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4... Fishing.SkillName=\uB09A\uC2DC Fishing.Skillup=\uB09A\uC2DC \uAE30\uC220\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 - #HERBALISM Herbalism.Ability.DoubleDropChance=2\uBC30 \uB4DC\uB86D \uD655\uB960: [[YELLOW]]{0} Herbalism.Ability.FD=\uB18D\uBD80\uC758 \uB2E4\uC774\uC5B4\uD2B8: [[YELLOW]]{0}\uB7AD\uD06C @@ -180,7 +173,6 @@ Herbalism.Skills.GTe.Refresh=[[GREEN]]\uB2F9\uC2E0\uC758 [[YELLOW]]\uC7AC\uBC30\ Herbalism.Skills.GTe.Other.Off={0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uC7AC\uBC30\uC758 \uB300\uC9C0\uB97C \uC0AC\uC6A9\uD588\uC2B5\uB2C8\uB2E4! Herbalism.Skills.GTe.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uC7AC\uBC30\uC758 \uB300\uC9C0\uB97C \uC0AC\uC6A9\uD588\uC2B5\uB2C8\uB2E4! Herbalism.Skillup=\uC57D\uCD08\uD559 \uAE30\uC220\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 - #MINING Mining.Ability.Length=\uD30C\uAD34\uC790 \uC9C0\uC18D\uC2DC\uAC04: [[YELLOW]]{0}s Mining.Ability.Locked.0={0}\uB808\uBCA8 \uB54C \uAE30\uC220 \uD574\uC81C (\uD3ED\uBC1C \uCC44\uAD74) @@ -208,7 +200,6 @@ Mining.Skills.SuperBreaker.Other.Off={0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uD30C Mining.Skills.SuperBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uD30C\uAD34\uC790\uB97C \uC0AC\uC6A9\uD588\uC2B5\uB2C8\uB2E4! Mining.Skills.SuperBreaker.Refresh=[[GREEN]]\uB2F9\uC2E0\uC758 [[YELLOW]]\uD30C\uAD34\uC790\uB294 [[GREEN]]\uC774\uC81C \uC0AC\uC6A9 \uAC00\uB2A5\uD569\uB2C8\uB2E4! Mining.Skillup=\uCC44\uAD11 \uAE30\uC220\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 - #Blast Mining Mining.Blast.Boom=[[GRAY]]**\uD3ED\uBC1C** Mining.Blast.Effect=+{0} \uAD11\uBB3C \uC774\uC775, -{1} \uD30C\uD3B8 \uC0B0\uCD9C, {2}x \uB4DC\uB86D @@ -216,7 +207,6 @@ Mining.Blast.Radius.Increase=\uD3ED\uBC1C \uBC18\uACBD \uC99D\uAC00: [[YELLOW]]+ Mining.Blast.Rank=\uD3ED\uBC1C \uCC44\uAD74: [[YELLOW]]{0}/8\uB7AD\uD06C [[GRAY]]({1}) Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uD3ED\uBC1C \uCC44\uAD74\uC744 \uC0AC\uC6A9\uD558\uC168\uC2B5\uB2C8\uB2E4! Mining.Blast.Refresh=[[GREEN]]\uB2F9\uC2E0\uC758 [[YELLOW]]\uD3ED\uBC1C \uCC44\uAD74 [[GREEN]]\uAE30\uC220\uC740 \uC774\uC81C \uC0AC\uC6A9 \uAC00\uB2A5\uD569\uB2C8\uB2E4! - #REPAIR Repair.SubSkill.Repair.Name=\uC218\uB9AC Repair.SubSkill.Repair.Description=\uB3C4\uAD6C & \uBC29\uC5B4\uAD6C \uC218\uB9AC @@ -250,7 +240,6 @@ Repair.Skills.StackedItems=[[DARK_RED]]\uD55C\uBC88\uC5D0 \uB9CE\uC740 \uC544\uC Repair.Skills.Super.Chance=\uC288\uD37C \uC218\uB9AC \uD655\uB960: [[YELLOW]]{0} Repair.Skillup=\uC218\uB9AC \uAE30\uC220\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 Repair.Pretty.Name=\uC218\uB9AC - #Arcane Forging Repair.Arcane.Chance.Downgrade=[[GRAY]]\uC778\uCC48\uD2B8 \uC218\uB9AC \uACA9\uD558 \uD655\uB960: [[YELLOW]]{0}% Repair.Arcane.Chance.Success=[[GRAY]]\uC778\uCC48\uD2B8 \uC218\uB9AC \uC131\uACF5 \uD655\uB960: [[YELLOW]]{0}% @@ -259,7 +248,6 @@ Repair.Arcane.Fail=\uC774 \uC544\uC774\uD15C\uC758 \uC778\uCC48\uD2B8\uB294 \uC6 Repair.Arcane.Lost=\uB2F9\uC2E0\uC740 \uBAA8\uB4E0 \uC778\uCC48\uD2B8\uB97C \uC720\uC9C0\uD560 \uAE30\uC220\uC774 \uCDA9\uBD84\uCE58 \uC54A\uC2B5\uB2C8\uB2E4. Repair.Arcane.Perfect=[[GREEN]]\uC774 \uC544\uC774\uD15C\uC758 \uC778\uCC48\uD2B8\uB97C \uC9C0\uC18D\uC2DC\uCF30\uC2B5\uB2C8\uB2E4. Repair.Arcane.Rank=\uC778\uCC48\uD2B8 \uC218\uB9AC: [[YELLOW]]{0}/{1}\uB7AD\uD06C - #SALVAGE Salvage.Pretty.Name=\uD68C\uC218 Salvage.SubSkill.AdvancedSalvage.Name=\uC804\uBB38\uC801\uC778 \uD68C\uC218 @@ -282,7 +270,6 @@ Salvage.Skills.ArcaneSuccess=[[GREEN]]\uB2F9\uC2E0\uC740 \uC774 \uC544\uC774\uD1 Salvage.Listener.Anvil=[[DARK_RED]]\uB2F9\uC2E0\uC740 \uD68C\uC218 \uBAA8\uB8E8\uB97C \uB193\uC558\uC2B5\uB2C8\uB2E4, \uB3C4\uAD6C\uB098 \uBC29\uC5B4\uAD6C \uD68C\uC218\uC5D0 \uC4F0\uC785\uB2C8\uB2E4. Salvage.Listener=\uD68C\uC218(SALVAGE): Salvage.SkillName=\uD68C\uC218 - #SWORDS Swords.Ability.Lower=[[GRAY]]**\uAC80 \uC900\uBE44 \uD574\uC81C** Swords.Ability.Ready=[[GREEN]]**\uAC80 \uC900\uBE44 \uC644\uB8CC** @@ -313,7 +300,6 @@ Swords.Skills.SS.Other.Off={0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uD1B1\uB0A0 \uA Swords.Skills.SS.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uD1B1\uB0A0 \uACF5\uACA9 \uC2A4\uD0AC\uC744 \uC0AC\uC6A9\uD588\uC2B5\uB2C8\uB2E4! Swords.Skillup=\uAC80\uC220 \uC2A4\uD0AC\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 Swords.SS.Length=\uD1B1\uB0A0 \uACF5\uACA9 \uC9C0\uC18D\uC2DC\uAC04: [[YELLOW]]{0}\uCD08 - #TAMING Taming.Ability.Bonus.0=\uD658\uACBD \uC778\uC2DD Taming.Ability.Bonus.1=\uB291\uB300 \uC704\uD5D8 \uD68C\uD53C @@ -364,7 +350,6 @@ Taming.Summon.Fail.Ocelot=\uB2F9\uC2E0 \uADFC\uCC98\uC5D0 \uC774\uBBF8 \uB9CE\uC Taming.Summon.Fail.Wolf=\uB2F9\uC2E0 \uADFC\uCC98\uC5D0 \uC774\uBBF8 \uB9CE\uC740 \uB291\uB300\uAC00 \uC788\uC5B4 \uB354\uB294 \uC18C\uD658\uC2DC\uD0AC \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. Taming.Summon.Fail.Horse=\uB2F9\uC2E0 \uADFC\uCC98\uC5D0 \uC774\uBBF8 \uB9CE\uC740 \uB9D0\uC774 \uC788\uC5B4 \uB354\uB294 \uC18C\uD658\uC2DC\uD0AC \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. Taming.Summon.Name.Format={0}\uC758 {1} - #UNARMED Unarmed.Ability.Berserk.Length=\uBC84\uC11C\uCEE4 \uC9C0\uC18D\uC2DC\uAC04: [[YELLOW]]{0}\uCD08 Unarmed.Ability.Bonus.0=\uC544\uC774\uC5B8 \uC554 \uC2A4\uD0C0\uC77C @@ -394,7 +379,6 @@ Unarmed.Skills.Berserk.Other.Off={0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uBC84\uC1 Unarmed.Skills.Berserk.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\uB2D8\uC740 [[RED]]\uBC84\uC11C\uCEE4\uB97C \uC0AC\uC6A9\uD569\uB2C8\uB2E4! Unarmed.Skills.Berserk.Refresh=[[GREEN]]\uB2F9\uC2E0\uC758 [[YELLOW]]\uBC84\uC11C\uCEE4 [[GREEN]]\uC2A4\uD0AC\uC740 \uC774\uC81C \uC0AC\uC6A9 \uAC00\uB2A5\uD569\uB2C8\uB2E4! Unarmed.Skillup=\uBE44\uBB34\uC7A5 \uC2A4\uD0AC\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 - #WOODCUTTING Woodcutting.Ability.0=\uB098\uBB47\uC78E \uB5A8\uC5B4\uD2B8\uB9AC\uAE30 Woodcutting.Ability.1=\uB098\uBB47\uC78E \uCCAD\uC18C @@ -417,13 +401,11 @@ Woodcutting.Skills.TreeFeller.Other.On=[[GREEN]]{0}[[DARK_GREEN]]\uB2D8\uC740 [[ Woodcutting.Skills.TreeFeller.Splinter=\uB3C4\uB07C \uD30C\uD3B8 \uC870\uAC01 \uC218\uC9D1! Woodcutting.Skills.TreeFeller.Threshold=\uADF8 \uB098\uBB34\uB294 \uB108\uBB34 \uD07D\uB2C8\uB2E4! Woodcutting.Skillup=\uBC8C\uBAA9 \uC2A4\uD0AC\uC774 {0} \uC62C\uB77C \uCD1D {1} \uB808\uBCA8\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4 - #ABILITIY ##generic Ability.Generic.Refresh=[[GREEN]]**\uB2A5\uB825\uC774 \uC7AC \uACF5\uAE09 \uB418\uC5C8\uC2B5\uB2C8\uB2E4!** Ability.Generic.Template.Lock=[[GRAY]]{0} Ability.Generic.Template=[[GOLD]]{0}: [[DARK_AQUA]]{1} - #COMBAT Combat.ArrowDeflect=[[WHITE]]**\uD654\uC0B4 \uD68C\uD53C** Combat.BeastLore=[[GREEN]]**\uC9D0\uC2B9\uC758 \uD3EC\uD6A8** @@ -433,7 +415,6 @@ Combat.Gore=[[GREEN]]**\uB3CC\uC9C4** Combat.StruckByGore=**\uB3CC\uC9C4\uC5D0 \uB9DE\uC558\uC2B5\uB2C8\uB2E4** Combat.TargetDazed=\uBAA9\uD45C\uAC00 [[DARK_RED]]\uD63C\uB780\uC2A4\uB7EC\uC6CC\uD569\uB2C8\uB2E4 Combat.TouchedFuzzy=[[DARK_RED]]\uD63C\uB780\uC774 \uC77C\uC5B4\uB0AC\uC2B5\uB2C8\uB2E4. \uC544~ \uC5B4\uC9C0\uB7EC\uC6CC. - #COMMANDS ##generic mcMMO.Description=mcMMO[[DARK_AQUA]] \uD504\uB85C\uC81D\uD2B8\uC5D0 \uB300\uD574\uC11C:,[[GOLD]]mcMMO\uB294 \uD55C [[RED]]\uC624\uD508 \uC18C\uC2A4[[GOLD]] RPG \uBAA8\uB4DC\uB85C 2011\uB144 2\uC6D4\uC5D0 [[BLUE]]com.gmail.nossr50[[GOLD]]\uB2D8\uC774 \uB9CC\uB4E4\uC5C8\uC2B5\uB2C8\uB2E4. \uBAA9\uD45C\uB294 \uC9C8\uC88B\uC740 RPG \uACBD\uD5D8\uC744 \uC81C\uACF5\uD558\uB294 \uAC83 \uC785\uB2C8\uB2E4.,[[DARK_AQUA]]\uD301:,[[GOLD]] - [[RED]]/mcmmo help[[GREEN]] \uBA85\uB839\uC5B4\uB4E4\uC744 \uBD05\uB2C8\uB2E4,[[GOLD]] - [[GREEN]]\uD0C0\uC785 [[RED]]/\uC2A4\uD0AC\uC774\uB984[[GREEN]] \uC790\uC138\uD55C \uC2A4\uD0AC \uC815\uBCF4\uB97C \uBD05\uB2C8\uB2E4,[[DARK_AQUA]]\uAC1C\uBC1C\uC790\uB4E4:,[[GOLD]] - [[GREEN]]com.gmail.nossr50 [[BLUE]](\uC81C\uC791\uC790),[[GOLD]] - [[GREEN]]GJ [[BLUE]](\uD504\uB85C\uC81D\uD2B8 \uC8FC\uC7A5),[[GOLD]] - [[GREEN]]NuclearW [[BLUE]](\uAC1C\uBC1C\uC790),[[GOLD]] - [[GREEN]]bm01 [[BLUE]](\uAC1C\uBC1C\uC790),[[GOLD]] - [[GREEN]]TfT_02 [[BLUE]](\uAC1C\uBC1C\uC790),[[GOLD]] - [[GREEN]]Glitchfinder [[BLUE]](\uAC1C\uBC1C\uC790),[[GOLD]] - [[GREEN]]t00thpick1 [[BLUE]](\uAC1C\uBC1C\uC790),[[DARK_AQUA]]\uC720\uC6A9\uD55C \uB9C1\uD06C:,[[GOLD]] - [[GREEN]]https://github.com/mcMMO-Dev/mcMMO/issues[[GOLD]] \uBC84\uADF8 \uBCF4\uACE0,[[GOLD]] - [[GREEN]]#mcmmo @ irc.esper.net[[GOLD]] IRC \uCC44\uD305, @@ -456,7 +437,7 @@ Commands.Cooldowns.Row.Y=\ [[AQUA]]{0}[[WHITE]] - [[DARK_GREEN]]\uC900\uBE44! Commands.Database.Cooldown=\uC774 \uBA85\uB839\uC5B4\uB97C \uB2E4\uC2DC \uCE58\uAE30\uC804\uC5D0 1\uCD08\uB97C \uAE30\uB2EC\uB824\uC57C\uB9CC \uD569\uB2C8\uB2E4. Commands.Database.Processing=\uB2F9\uC2E0\uC758 \uC774\uC804 \uBA85\uB839\uC5B4\uB294 \uC5EC\uC804\uD788 \uC791\uC5C5\uC911\uC785\uB2C8\uB2E4. \uAE30\uB2E4\uB824\uC8FC\uC138\uC694. Commands.Disabled=\uC774 \uBA85\uB839\uC5B4\uB294 \uBE44\uD65C\uC131\uD654 \uB418\uC788\uC2B5\uB2C8\uB2E4. -Commands.DoesNotExist= [[RED]]\uD50C\uB808\uC774\uC5B4\uB294 \uB370\uC774\uD130\uBCA0\uC774\uC2A4\uC5D0 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4! +Commands.DoesNotExist=[[RED]]\uD50C\uB808\uC774\uC5B4\uB294 \uB370\uC774\uD130\uBCA0\uC774\uC2A4\uC5D0 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4! Commands.GodMode.Disabled=mcMMO \uBD88\uC0AC\uC2E0 \uBAA8\uB4DC \uBE44\uD65C\uC131\uD654 Commands.GodMode.Enabled=mcMMO \uBD88\uC0AC\uC2E0 \uBAA8\uB4DC \uD65C\uC131\uD654 Commands.GodMode.Forbidden=[mcMMO] \uC774 \uC6D4\uB4DC\uC5D0\uC11C \uBD88\uC0AC\uC2E0 \uBAA8\uB4DC\uB294 \uD5C8\uC6A9 \uAE08\uC9C0\uC785\uB2C8\uB2E4 (\uD384\uBBF8\uC120 \uD655\uC778) @@ -542,7 +523,7 @@ Commands.Party.Alliance.Invite.Accepted=[[GREEN]]\uB3D9\uB9F9 \uCD08\uB300 \uC21 Commands.Party.Alliance.None=\uB2F9\uC2E0\uC740 \uB3D9\uB9F9\uC744 \uAC00\uC9C0\uACE0 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. Commands.Party.Alliance.AlreadyAllies=\uB2F9\uC2E0\uC758 \uD30C\uD2F0\uB294 \uC774\uBBF8 \uB3D9\uB9F9\uC744 \uAC00\uC9C0\uACE0 \uC788\uC2B5\uB2C8\uB2E4. \uAD00\uACC4\uB97C \uD574\uC9C0\uD558\uB824\uBA74 [[DARK_AQUA]]/party alliance disband Commands.Party.Alliance.Help.0=\uC774 \uD30C\uD2F0\uB294 \uB3D9\uB9F9 \uD615\uD0DC\uB97C \uAC00\uC9C0\uACE0 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uD30C\uD2F0\uC7A5\uC744 \uCD08\uB300\uD558\uC138\uC694 -Commands.Party.Alliance.Help.1= \uB3D9\uB9F9\uC744 \uD558\uB824\uBA74 [[DARK_AQUA]]/party alliance invite [[RED]]. +Commands.Party.Alliance.Help.1=\uB3D9\uB9F9\uC744 \uD558\uB824\uBA74 [[DARK_AQUA]]/party alliance invite [[RED]]. Commands.ptp.Enabled=\uD30C\uD2F0 \uD154\uB808\uD3EC\uD2B8 [[GREEN]]\uD65C\uC131\uD654\uB428 Commands.ptp.Disabled=\uD30C\uD2F0 \uD154\uB808\uD3EC\uD2B8 [[RED]]\uBE44\uD65C\uC131\uD654\uB428 Commands.ptp.NoRequests=\uB2F9\uC2E0\uC740 \uC774 \uC2DC\uAC04\uC5D0 \uD154\uB808\uD3EC\uD2B8 \uC694\uCCAD\uC744 \uD558\uC2E4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 @@ -591,7 +572,6 @@ Commands.Usage.XP=xp mcMMO.NoInvites=\uC774 \uC2DC\uAC04\uC5D0 \uB2F9\uC2E0\uC740 \uCD08\uB300\uD558\uC9C0 \uBABB\uD569\uB2C8\uB2E4 mcMMO.NoPermission=[[DARK_RED]]\uAD8C\uD55C\uC774 \uBD80\uC871\uD569\uB2C8\uB2E4. mcMMO.NoSkillNote=[[DARK_GRAY]]\uB9CC\uC57D \uB2F9\uC2E0\uC774 \uC2A4\uD0AC\uC744 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uB2E4\uBA74 \uC5EC\uAE30\uC5D0 \uD45C\uC2DC\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. - ##party Party.Forbidden=[mcMMO] \uC774 \uC6D4\uB4DC\uC5D0\uC11C \uD30C\uD2F0\uB97C \uD558\uC2E4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 (\uD384\uBBF8\uC120 \uD655\uC778) Party.Help.0=\uC62C\uBC14\uB978 \uC0AC\uC6A9\uBC95 [[DARK_AQUA]]{0} <\uD50C\uB808\uC774\uC5B4> [\uBE44\uBC00\uBC88\uD638]. @@ -618,7 +598,7 @@ Party.NotOwner=[[DARK_RED]]\uB2F9\uC2E0\uC740 \uD30C\uD2F0\uC7A5\uC774 \uC544\uB Party.Target.NotOwner=[[DARK_RED]]{0}\uB2D8\uC740 \uD30C\uD2F0\uC7A5\uC774 \uC544\uB2D9\uB2C8\uB2E4. Party.Owner.New=[[GREEN]]{0}\uB2D8\uC774 \uC0C8 \uD30C\uD2F0\uC7A5\uC774 \uB418\uC5C8\uC2B5\uB2C8\uB2E4. Party.Owner.NotLeader=[[DARK_RED]]\uB2F9\uC2E0\uC740 \uC774\uC81C \uD30C\uD2F0\uC7A5\uC774 \uC544\uB2D9\uB2C8\uB2E4. -Party.Owner.Player =[[GREEN]]\uB2F9\uC2E0\uC740 \uC774\uC81C \uD30C\uD2F0\uC7A5\uC785\uB2C8\uB2E4. +Party.Owner.Player=[[GREEN]]\uB2F9\uC2E0\uC740 \uC774\uC81C \uD30C\uD2F0\uC7A5\uC785\uB2C8\uB2E4. Party.Password.None=\uC774 \uD30C\uD2F0\uB294 \uBE44\uBC00\uBC88\uD638\uB85C \uBCF4\uD638\uB418\uACE0 \uC788\uC2B5\uB2C8\uB2E4. \uAC00\uC785\uD560\uB54C \uBE44\uBC00\uBC88\uD638\uB97C \uC81C\uACF5\uD574\uC8FC\uC138\uC694. Party.Password.Incorrect=\uD30C\uD2F0 \uBE44\uBC00\uBC88\uD638\uAC00 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. Party.Password.Set=[[GREEN]]\uC124\uC815\uD55C \uD30C\uD2F0 \uBE44\uBC00\uBC88\uD638\uB294 {0} \uC785\uB2C8\uB2E4 @@ -668,7 +648,6 @@ Party.ItemShare.Category.Mining=\uCC44\uAD11 Party.ItemShare.Category.Herbalism=\uC57D\uCD08\uD559 Party.ItemShare.Category.Woodcutting=\uBC8C\uBAA9 Party.ItemShare.Category.Misc=\uAE30\uD0C0 - ##xp Commands.XPGain.Acrobatics=\uB5A8\uC5B4\uC9C0\uAE30 Commands.XPGain.Alchemy=\uD3EC\uC158 \uC591\uC870\uD558\uAE30 @@ -694,28 +673,24 @@ Commands.xprate.proper.1=\uACBD\uD5D8\uCE58 \uBC30\uC728\uC744 \uCD08\uAE30\uD65 Commands.xprate.proper.2=\uC774\uAC83\uC740 XP \uC774\uBCA4\uD2B8\uC778\uC9C0 \uC544\uB2CC\uC9C0 true \uB610\uB294 false\uB85C \uB098\uD0C0\uB0B4\uAE30 \uC704\uD574 \uC9C0\uC815\uD558\uC2ED\uC2DC\uC624 Commands.xprate.started.0=[[GOLD]]mcMMO \uACBD\uD5D8\uCE58 \uC774\uBCA4\uD2B8\uAC00 \uC2DC\uC791\uB418\uC5C8\uC2B5\uB2C8\uB2E4! Commands.xprate.started.1=[[GOLD]]mcMMO \uACBD\uD5D8\uCE58 \uBC30\uC728\uC740 {0}\uBC30 \uC785\uB2C8\uB2E4! -XPRate.Event= [[GOLD]]mcMMO \uB294 \uD604\uC7AC \uACBD\uD5D8\uCE58 \uC774\uBCA4\uD2B8 \uC911\uC785\uB2C8\uB2E4! \uACBD\uD5D8\uCE58\uB294 {0}\uBC30 \uC785\uB2C8\uB2E4! - +XPRate.Event=[[GOLD]]mcMMO \uB294 \uD604\uC7AC \uACBD\uD5D8\uCE58 \uC774\uBCA4\uD2B8 \uC911\uC785\uB2C8\uB2E4! \uACBD\uD5D8\uCE58\uB294 {0}\uBC30 \uC785\uB2C8\uB2E4! #EFFECTS ##generic Effects.Effects=\uD6A8\uACFC Effects.Child=[[DARK_GRAY]]LVL: [[GREEN]]{0} Effects.Level=[[DARK_GRAY]]LVL: [[GREEN]]{0} [[DARK_AQUA]]XP[[YELLOW]]([[GOLD]]{1}[[YELLOW]]/[[GOLD]]{2}[[YELLOW]]) -Effects.Parent= [[GOLD]]{0} - +Effects.Parent=[[GOLD]]{0} - Effects.Template=[[DARK_AQUA]]{0}: [[GREEN]]{1} - #GUIDES Guides.Available=[[GRAY]]{0} \uAC00\uC774\uB4DC\uAC00 \uC788\uC2B5\uB2C8\uB2E4 - \uD0C0\uC785 /{1} ? [\uD398\uC774\uC9C0] Guides.Header=[[GOLD]]-=[[GREEN]]{0} \uAC00\uC774\uB4DC[[GOLD]]=- Guides.Page.Invalid=\uC62C\uBC14\uB978 \uD398\uC774\uC9C0 \uBC88\uD638\uAC00 \uC544\uB2D9\uB2C8\uB2E4! Guides.Page.OutOfRange=\uADF8 \uD398\uC774\uC9C0\uB294 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4, \uC624\uC9C1 \uCD1D {0} \uD398\uC774\uC9C0\uAC00 \uC788\uC2B5\uB2C8\uB2E4. -Guides.Usage= \uC0AC\uC6A9\uBC95 /{0} ? [\uD398\uC774\uC9C0] - +Guides.Usage=\uC0AC\uC6A9\uBC95 /{0} ? [\uD398\uC774\uC9C0] ##Acrobatics Guides.Acrobatics.Section.0=[[DARK_AQUA]]\uACE1\uC608\uC5D0 \uB300\uD558\uC5EC:\n[[YELLOW]]\uACE1\uC608\uB294 mcMMO\uC758 \uC6B0\uC640\uD558\uAC8C \uC6C0\uC9C1\uC774\uB294 \uC608\uC220\uC785\uB2C8\uB2E4.\n[[YELLOW]]\uC804\uD22C \uD2B9\uD61C\uC640 \uD658\uACBD \uC190\uC0C1 \uD2B9\uD61C\uB97C \uC99D\uAC00\uC2DC\uD0B5\uB2C8\uB2E4.\n\n[[DARK_AQUA]]XP \uC5BB\uAE30:\n[[YELLOW]]\uC774 \uC2A4\uD0AC\uC758 XP\uB97C \uC5BB\uC744\uB824\uBA74 \uC804\uD22C\uB098 \uC0DD\uC874\uC5D0\uC11C \uD53C\uD574\uB97C \n[[YELLOW]]\uC785\uB294 \uB099\uD558\uC5D0\uC11C \uCC29\uC9C0 \uD589\uB3D9\uC774 \uC694\uAD6C\uB429\uB2C8\uB2E4. Guides.Acrobatics.Section.1=[[DARK_AQUA]]\uC5B4\uB5BB\uAC8C \uAD6C\uB974\uAE30\uB97C \uD558\uB098\uC694?\n[[YELLOW]]\uB2F9\uC2E0\uC774 \uB099\uD558 \uD53C\uD574\uB97C \uBC1B\uC744 \uB54C \uD53C\uD574\uB97C \uBB34\uD6A8\uD654\uD560\n[[YELLOW]]\uC9C0\uC18D\uC801\uC778 \uAE30\uD68C\uB97C \uAC00\uC9C0\uAC8C \uB429\uB2C8\uB2E4. \uCB48\uAD6C\uB9AC\uAE30 \uBC84\uD2BC\uC744 \uB204\uB974\uACE0 \uC788\uC73C\uBA74\n[[YELLOW]]\uB5A8\uC5B4\uC9C0\uB294 \uB3D9\uC548 \uB450\uBC30\uC758 \uAE30\uD68C\uB97C \uAC00\uC9C0\uAC8C \uB429\uB2C8\uB2E4.\n[[YELLOW]]This triggers a Graceful Roll instead of a standard one.\n[[YELLOW]]Graceful Rolls are like regular rolls but are twice as likely to\n[[YELLOW]]occur and provide more damage safety than regular rolls.\n[[YELLOW]]Rolling chance is tied to your skill level Guides.Acrobatics.Section.2=[[DARK_AQUA]]\uC5B4\uB5BB\uAC8C \uD68C\uD53C\uB97C \uD558\uB098\uC694?\n[[YELLOW]]\uD68C\uD53C\uB294 \uB2F9\uC2E0\uC774 \uC804\uD22C\uC5D0\uC11C \uC0C1\uCC98\uB97C \uC785\uC744 \uB54C \uC785\uB294\n[[YELLOW]]\uD53C\uD574\uB97C \uBC18\uAC10\uC2DC\uD0A4\uB294 \uC9C0\uC18D\uC801\uC778 \uAE30\uD68C\uC785\uB2C8\uB2E4.\n[[YELLOW]]\uC774\uAC83\uC740 \uB2F9\uC2E0\uC758 \uC2A4\uD0AC \uB808\uBCA8\uACFC \uC5F0\uACB0\uB429\uB2C8\uB2E4. - ##Alchemy Guides.Alchemy.Section.0=[[DARK_AQUA]]About Alchemy:\n[[YELLOW]]Alchemy is about brewing potions.\n[[YELLOW]]It provides a speed increase in the potion brew time, as well\n[[YELLOW]]as the addition of new (previously) unobtainable potions.\n\n\n[[DARK_AQUA]]XP GAIN:\n[[YELLOW]]To gain XP in this skill you need to brew potions. Guides.Alchemy.Section.1=[[DARK_AQUA]]How does Catalysis work?\n[[YELLOW]]Catalysis speeds of the brewing process, with a\n[[YELLOW]]max speed of 4x at level 1000.\n[[YELLOW]]This ability is unlocked at level 100 by default. @@ -724,13 +699,11 @@ Guides.Alchemy.Section.3=[[DARK_AQUA]]Concoctions tier 1 ingredients:\n[[YELLOW] Guides.Alchemy.Section.4=[[DARK_AQUA]]Concoctions tier 2 ingredients:\n[[YELLOW]]Carrot (Potion of Haste)\n[[YELLOW]]Slimeball (Potion of Dullness)\n\n[[DARK_AQUA]]Concoctions tier 3 ingredients:\n[[YELLOW]]Quartz (Potion of Absorption)\n[[YELLOW]]Red Mushroom (Potion of Leaping) 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]]\uAD81\uC220\uC5D0 \uB300\uD558\uC5EC:\n[[YELLOW]]\uAD81\uC220\uC740 \uD65C\uACFC \uD654\uC0B4\uB85C \uC3D8\uB294 \uAC83\uC744 \uB73B\uD569\uB2C8\uB2E4.\n[[YELLOW]]\uAD81\uC220\uC740 PVP\uC5D0\uC11C \uB2F9\uC2E0\uC774 \uC801\uC744 \uD604\uD639\uC2DC\uD0A4\uB294 \uB2A5\uB825\uACFC\n[[YELLOW]]\uB808\uBCA8 \uD06C\uAE30\uC758 \uB370\uBBF8\uC9C0 \uBD80\uC2A4\uD130\uB97C \uAC19\uC740 \uAC83\uC73C\uB85C\n[[YELLOW]]\uC804\uD22C \uBCF4\uB108\uC2A4\uB97C \uC81C\uACF5\uD569\uB2C8\uB2E4. 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.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. @@ -738,7 +711,6 @@ Guides.Axes.Section.2=[[DARK_AQUA]]How does Critical Strikes work?\n[[YELLOW]]Cr 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.1=[[DARK_AQUA]]Compatible Materials:\n[[YELLOW]]Grass, Dirt, Sand, Clay, Gravel, Mycelium, Soul Sand, Snow @@ -746,7 +718,6 @@ Guides.Excavation.Section.2=[[DARK_AQUA]]How to use Giga Drill Breaker:\n[[YELLO 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 Treasure Hunter 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.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. @@ -755,7 +726,6 @@ Guides.Fishing.Section.3=[[DARK_AQUA]]How does Master Angler work?\n[[YELLOW]]Th Guides.Fishing.Section.4=[[DARK_AQUA]]How does Shake work?\n[[YELLOW]]This active ability allows you to shake items loose from mobs\n[[YELLOW]]by hooking them with the fishing rod. \n[[YELLOW]]Mobs will drop items they would normally drop on death.\n[[YELLOW]]It is also possible to acquire mob skulls, which are normally \n[[YELLOW]]unobtainable in survival mode. 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.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. @@ -765,7 +735,6 @@ Guides.Herbalism.Section.4=[[DARK_AQUA]]How does Green Thumb (Cobble/Stone Brick Guides.Herbalism.Section.5=[[DARK_AQUA]]How does Farmer's Diet work?\n[[YELLOW]]This passive skill increases the amount of hunger restored \n[[YELLOW]]when eating Bread, Cookies, Melons, Mushroom Soup, Carrots,\n[[YELLOW]]and Potatoes. 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.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. @@ -773,30 +742,25 @@ Guides.Mining.Section.2=[[DARK_AQUA]]How to use Super Breaker:\n[[YELLOW]]With a 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 detonator in hand, which is a flint & steel by default,\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, or a gold block to salvage armor and 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.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. Guides.Salvage.Section.4=[[DARK_AQUA]]How does Arcane Salvage work?\n[[YELLOW]]This ability allows you to get enchanted books when salvaging\n[[YELLOW]]enchanted items. Depending on your level the chance of\n[[YELLOW]]successfully extracting a full or partial enchantment varies.\n\n[[YELLOW]]When an enchantment is partially extracted, the enchantment\n[[YELLOW]]book will have a lower level enchantment compared to what\n[[YELLOW]]it was on the item. - ##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.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 Bleed work?\n[[YELLOW]]Bleed 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. @@ -807,7 +771,6 @@ Guides.Taming.Section.5=[[DARK_AQUA]]How does Environmentally Aware work?\n[[YEL Guides.Taming.Section.6=[[DARK_AQUA]]How does Thick Fur work?\n[[YELLOW]]This passive ability will reduce damage and make wolves\n[[YELLOW]]fire resistant. 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.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. @@ -815,19 +778,16 @@ Guides.Unarmed.Section.2=[[DARK_AQUA]]How does Iron Arm work?\n[[YELLOW]]Iron Ar 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.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. - #INSPECT -Inspect.Offline= [[RED]]\uADF8 \uD50C\uB808\uC774\uC5B4\uB294 \uC624\uD504\uB77C\uC778 \uC785\uB2C8\uB2E4, \uC624\uC9C1 op\uB4E4\uB9CC \uAC80\uC0AC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4! +Inspect.Offline=[[RED]]\uADF8 \uD50C\uB808\uC774\uC5B4\uB294 \uC624\uD504\uB77C\uC778 \uC785\uB2C8\uB2E4, \uC624\uC9C1 op\uB4E4\uB9CC \uAC80\uC0AC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4! Inspect.OfflineStats=mcMMO \uC624\uD504\uB77C\uC778 \uC720\uC800 \uC2A4\uD15F\uC740 [[YELLOW]]{0} \uC785\uB2C8\uB2E4 Inspect.Stats=[[GREEN]]mcMMO \uC2A4\uD15F\uC740 [[YELLOW]]{0} \uC785\uB2C8\uB2E4 Inspect.TooFar=\uB2F9\uC2E0\uC740 \uADF8 \uD50C\uB808\uC774\uC5B4\uC640 \uB108\uBB34 \uBA40\uB9AC \uB5A8\uC5B4\uC838 \uC788\uC5B4 \uAC80\uC0AC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4! - #ITEMS Item.ChimaeraWing.Fail=**\uD0A4\uBA54\uB77C\uC758 \uB0A0\uAC1C \uC2E4\uD328!** Item.ChimaeraWing.Pass=**\uD0A4\uBA54\uB77C \uB0A0\uAC1C** @@ -838,29 +798,25 @@ Item.Injured.Wait=\uB2F9\uC2E0\uC740 \uCD5C\uADFC\uC5D0 \uBD80\uC0C1\uC744 \uB2F Item.FluxPickaxe.Name=\uC6A9\uD574 \uACE1\uAD2D\uC774 Item.FluxPickaxe.Lore.1=[[GRAY]]\uAD11\uBB3C\uC744 \uC989\uC2DC \uC81C\uB828\uD560 \uAE30\uD68C\uB97C \uAC00\uC9D1\uB2C8\uB2E4. Item.FluxPickaxe.Lore.2=[[GRAY]]\uC81C\uB828 \uC694\uAD6C \uB808\uBCA8 {0} \uC774\uC0C1 - #TELEPORTATION Teleport.Commencing=[[GRAY]]\uD154\uB808\uD3EC\uD2B8\uAC00 [[GOLD]]({0}) [[GRAY]]\uCD08\uC548\uC5D0 \uC2DC\uC791\uB429\uB2C8\uB2E4, \uAC00\uB9CC\uD788 \uAE30\uB2EC\uB824\uC8FC\uC138\uC694... Teleport.Cancelled=[[DARK_RED]]\uD154\uB808\uD3EC\uD2B8 \uCDE8\uC18C\uB428! - #SKILLS Skills.Child=[[GOLD]](\uD558\uC704 \uC2A4\uD0AC) Skills.Disarmed=[[DARK_RED]]\uB2F9\uC2E0\uC740 \uBB34\uC7A5 \uD574\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4! Skills.Header=-----[][[GREEN]]{0}[[RED]][]----- Skills.NeedMore=[[DARK_RED]]\uB2F9\uC2E0\uC740 [[GRAY]]{0}\uAC00 \uB354 \uD544\uC694\uD569\uB2C8\uB2E4 -Skills.Parents = \uC0C1\uC704\uB4E4 +Skills.Parents=\uC0C1\uC704\uB4E4 Skills.Stats={0}[[GREEN]]{1}[[DARK_AQUA]] XP([[GRAY]]{2}[[DARK_AQUA]]/[[GRAY]]{3}[[DARK_AQUA]]) Skills.ChildStats={0}[[GREEN]]{1} Skills.TooTired=\uC2A4\uD0AC \uC7AC \uC0AC\uC6A9 \uB300\uAE30\uC2DC\uAC04: ({0}\uCD08) Skills.Cancelled={0} \uCDE8\uC18C\uB428! Skills.ConfirmOrCancel=[[GREEN]]\uB2E4\uC2DC \uC6B0-\uD074\uB9AD\uC744 \uD558\uBA74 \uD655\uC778 [[GOLD]]{0}[[GREEN]]. \uC88C-\uD074\uB9AD\uC744 \uD558\uBA74 \uCDE8\uC18C\uAC00 \uB429\uB2C8\uB2E4. - #STATISTICS Stats.Header.Combat=[[GOLD]]-=\uC804\uD22C \uC2A4\uD0AC=- Stats.Header.Gathering=[[GOLD]]-=\uC218\uC9D1 \uC2A4\uD0AC=- Stats.Header.Misc=[[GOLD]]-=\uAE30\uD0C0 \uC2A4\uD0AC=- Stats.Own.Stats=[[GREEN]][mcMMO] \uC2A4\uD15F - #PERKS Perks.XP.Name=\uACBD\uD5D8\uCE58 Perks.XP.Desc=\uD2B9\uC815 \uC2A4\uD0AC\uC5D0 \uACBD\uD5D8\uCE58 \uBD80\uC2A4\uD2B8\uB97C \uBC1B\uC74C. @@ -873,7 +829,6 @@ Perks.Cooldowns.Desc=\uC7AC\uC0AC\uC6A9\uB300\uAE30\uC2DC\uAC04\uC744 {0}\uB9CC\ Perks.ActivationTime.Name=\uC778\uB0B4\uB825 Perks.ActivationTime.Desc=\uB2A5\uB825 \uD65C\uC131 \uC2DC\uAC04\uC774 {0}\uCD08\uB85C \uC99D\uAC00\uD569\uB2C8\uB2E4. Perks.ActivationTime.Bonus=[[GOLD]] ({0}\uCD08\uC758 \uC778\uB0B4\uB825 \uD2B9\uC804) - #HARDCORE Hardcore.Mode.Disabled=[[GOLD]][mcMMO] \uD558\uB4DC\uCF54\uC5B4 \uBAA8\uB4DC {0}\uAC00 {1}\uC5D0 \uBE44\uD65C\uC131\uD654\uB428. Hardcore.Mode.Enabled=[[GOLD]][mcMMO] \uD558\uB4DC\uCF54\uC5B4 \uBAA8\uB4DC {0}\uAC00 {1}\uC5D0 \uD65C\uC131\uD654\uB428. @@ -886,7 +841,6 @@ Hardcore.Vampirism.Killer.Success=[[GOLD]][mcMMO] [[DARK_AQUA]]\uB2F9\uC2E0\uC74 Hardcore.Vampirism.Victim.Failure=[[GOLD]][mcMMO] [[YELLOW]]{0}[[GRAY]]\uB2D8\uC740 \uB2F9\uC2E0\uC758 \uC9C0\uC2DD\uC744 \uAC00\uC838\uAC08\uC218 \uC5C6\uC5C8\uC2B5\uB2C8\uB2E4! Hardcore.Vampirism.Victim.Success=[[GOLD]][mcMMO] [[YELLOW]]{0}[[DARK_RED]]\uB2D8\uC740 \uB2F9\uC2E0\uC5D0\uAC8C\uC11C [[BLUE]]{1}[[DARK_RED]] \uB808\uBCA8\uC744 \uD6D4\uCCD0\uAC14\uC2B5\uB2C8\uB2E4! Hardcore.Vampirism.PercentageChanged=[[GOLD]][mcMMO] \uC2A4\uD15F \uD761\uD608 \uBE44\uC728\uC774 {0}\uB85C \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4. - #MOTD MOTD.Donate=[[DARK_AQUA]]\uAE30\uBD80 \uC815\uBCF4: MOTD.Hardcore.Enabled=[[GOLD]][mcMMO] [[DARK_AQUA]]\uD558\uB4DC\uCF54\uC5B4 \uBAA8\uB4DC \uD65C\uC131\uD654\uB428: [[DARK_RED]]{0} @@ -895,7 +849,6 @@ MOTD.Hardcore.Vampirism.Stats=[[GOLD]][mcMMO] [[DARK_AQUA]]\uBC40\uD30C\uC774\uC MOTD.PerksPrefix=[mcMMO \uD2B9\uC804] MOTD.Version=[[GOLD]][mcMMO] \uAD6C\uB3D9\uC911\uC778 \uBC84\uC804 [[DARK_AQUA]]{0} MOTD.Website=[[GOLD]][mcMMO] [[GREEN]]{0}[[YELLOW]] - mcMMO \uC6F9\uC0AC\uC774\uD2B8 - #SMELTING Smelting.Ability.FluxMining=\uC720\uB3D9 \uCC44\uAD74 \uD655\uB960: [[YELLOW]]{0} Smelting.Ability.FuelEfficiency=\uC720\uB3D9 \uD6A8\uC728\uC131 \uBC30\uC728: [[YELLOW]]{0}x @@ -914,7 +867,6 @@ Smelting.SubSkill.FluxMining.Description=\uCC44\uAD74\uC911 \uAD11\uBB3C \uC989\ Smelting.FluxMining.Success=[[GREEN]]\uAD11\uBB3C\uC774 \uC7AC\uB828\uB418\uC5C8\uC2B5\uB2C8\uB2E4! Smelting.Listener=\uC81C\uB828(Smelting): Smelting.SkillName=\uC81C\uB828 - #COMMAND DESCRIPTIONS Commands.Description.addlevels=mcMMO \uB808\uBCA8\uC744 \uC720\uC800\uC5D0\uAC8C \uCD94\uAC00 Commands.Description.adminchat=mcMMO \uAD00\uB9AC\uC790 \uCC44\uD305 \uCF1C\uAE30/\uB044\uAE30\uB098 \uAD00\uB9AC\uC790 \uCC44\uD305 \uBA54\uC138\uC9C0 \uBCF4\uB0B4\uAE30 @@ -946,11 +898,9 @@ Commands.Description.skillreset=\uC720\uC800\uC758 mcMMO \uB808\uBCA8 \uC7AC\uC1 Commands.Description.vampirism=mcMMO \uBC40\uD30C\uC774\uC5B4\uB9AC\uC810 \uBE44\uC728\uC774\uB098 \uBC40\uD30C\uC774\uC5B4\uB9AC\uC810 \uBAA8\uB4DC \uCF1C\uAE30/\uB044\uAE30 Commands.Description.xplock=\uBA85\uD655\uD55C mcMMO \uAE30\uC220\uC758 mcMMO xp \uBC14\uB97C \uC7A0\uAE08 Commands.Description.xprate=mcMMO XP \uBC30\uC728 \uC218\uC815\uC774\uB098 mcMMO XP \uC774\uBCA4\uD2B8 \uC2DC\uC791 - #UPDATE CHECKER UpdateChecker.outdated=\uB2F9\uC2E0\uC740 mcMMO \uAD6C\uBC84\uC804\uC744 \uC0AC\uC6A9\uC911\uC785\uB2C8\uB2E4! UpdateChecker.newavailable=\uC2E0 \uBC84\uC804\uC774 BukkitDev\uC5D0 \uC5C5\uB85C\uB4DC\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4. - #SCOREBOARD HEADERS Scoreboard.Header.PlayerStats=mcMMO \uC2A4\uD15F Scoreboard.Header.PlayerCooldowns=mcMMO \uC7AC \uC0AC\uC6A9 \uB300\uAE30\uC2DC\uAC04 @@ -963,7 +913,6 @@ Scoreboard.Misc.CurrentXP=[[GREEN]]\uD604\uC7AC XP Scoreboard.Misc.RemainingXP=\uB0A8\uC740 XP Scoreboard.Misc.Cooldown=[[LIGHT_PURPLE]]\uC7AC \uC0AC\uC6A9 \uB300\uAE30\uC2DC\uAC04 Scoreboard.Misc.Overall=[[GOLD]]\uC885\uD569 - #DATABASE RECOVERY Profile.Loading.Success=[[GREEN]]\uB2F9\uC2E0\uC758 mcMMO \uD504\uB85C\uD30C\uC77C\uC774 \uBD88\uB7EC\uC640\uC84C\uC2B5\uB2C8\uB2E4. Profile.Loading.Failure=mcMMO\uB294 \uC5EC\uC804\uD788 \uB2F9\uC2E0\uC758 \uB370\uC774\uD130\uB97C \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uB2F9\uC2E0\uC740 \uC544\uB9C8\uB3C4 [[AQUA]]\uC11C\uBC84\uAD00\uB9AC\uC790\uC640 \uC5F0\uB77D[[RED]]\uD558\uAE30\uB97C \uC6D0\uD560 \uAC83\uC785\uB2C8\uB2E4.\n[[YELLOW]]\uB2F9\uC2E0\uC740 \uC5EC\uC804\uD788 \uC11C\uBC84\uC5D0\uC11C \uAC8C\uC784\uC911\uC774\uC9C0\uB9CC, \uB2F9\uC2E0\uC740 [[BOLD]]mcMMO \uB808\uBCA8\uC774 \uC5C6\uACE0[[YELLOW]] \uB2F9\uC2E0\uC774 \uC5BB\uC740 \uC5B4\uB290 XP\uB3C4 [[BOLD]]\uC800\uC7A5\uB418\uC9C0 \uC54A\uC744 \uAC81\uB2C8\uB2E4[[YELLOW]]. diff --git a/bukkit/src/main/resources/locale/locale_nl.properties b/bukkit/src/main/resources/locale/locale_nl.properties index 83479f641..193e9188a 100644 --- a/bukkit/src/main/resources/locale/locale_nl.properties +++ b/bukkit/src/main/resources/locale/locale_nl.properties @@ -17,7 +17,7 @@ Archery.SubSkill.Daze.Description=Verward tegenstanders en doet {0} schade Archery.SubSkill.ArrowRetrieval.Description=Kans om pijlen te krijgen van lijken Archery.Listener=Boogschieten: Archery.SkillName=BOOGSCHIETEN -Archery.Skillup= Boogschieten ervaring toegenomen met {0}. Totaal ({1}) +Archery.Skillup=Boogschieten ervaring toegenomen met {0}. Totaal ({1}) Axes.Ability.Bonus.0=Bijl Meesterschap Axes.Ability.Bonus.1=Bonus {0} schade Axes.Ability.Bonus.4=Grotere impact @@ -39,7 +39,7 @@ Axes.SubSkill.GreaterImpact.Name=Grotere impact Axes.SubSkill.GreaterImpact.Description=Deal bonus schade aan unarmored vijanden Axes.Listener=Bijlen Axes.SkillName=BIJLEN -Axes.Skills.SS.Off= ** Skull Splitter is uitgewerkt ** +Axes.Skills.SS.Off=** Skull Splitter is uitgewerkt ** Axes.Skills.SS.On=[[GREEN]]**SCHEDEL SPLIJTER GEACTIVEERD** Axes.Skills.SS.Refresh=[[GREEN]]Je [[YELLOW]]Schedel Splijter [[GREEN]]kracht is hersteld! Axes.Skills.SS.Other.Off=Skull Splitter [[GREEN]]is uitgewerkt voor [[GEEL]]{0} @@ -53,15 +53,15 @@ Excavation.SubSkill.TreasureHunter.Name=Schatten Jager Excavation.SubSkill.TreasureHunter.Description=Mogelijkheid om te graven naar schatten Excavation.Listener=Uitgraving: Excavation.SkillName=Uitgraving -Excavation.Skills.GigaDrillBreaker.Off= ** Giga Drill Breeker is uitgewerkt ** +Excavation.Skills.GigaDrillBreaker.Off=** Giga Drill Breeker is uitgewerkt ** Excavation.Skills.GigaDrillBreaker.On=[[GREEN]]**GIGA DRILL BREKER GEACTIVEERD** Excavation.Skills.GigaDrillBreaker.Refresh=[[GREEN]]Je [[YELLOW]]Giga Drill Breeker [[GREEN]] kracht is hersteld! -Excavation.Skills.GigaDrillBreaker.Other.Off= Giga Drill Breaker [[GREEN]] is uitgewerkt voor [[GEEL]] {0} +Excavation.Skills.GigaDrillBreaker.Other.Off=Giga Drill Breaker [[GREEN]] is uitgewerkt voor [[GEEL]] {0} Excavation.Skills.GigaDrillBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]] heeft [[RED]]Giga Drill Breaker [[DARK_GREEN]]gebruikt! Excavation.Skillup=Uitgravings ervaring toegenomen met {0}. Totaal ({1}) Fishing.Ability.Info=Magische Jager: [[GRAY]] ** verbetert bij Treasure Hunter Rank ** Fishing.Ability.Shake=Schud Kans: [[YELLOW]]{0} -Fishing.Ability.IceFishing= Ice Vissen: Ga vissen in ijs +Fishing.Ability.IceFishing=Ice Vissen: Ga vissen in ijs Fishing.SubSkill.TreasureHunter.Name=Schatten Jager (Passief) Fishing.SubSkill.TreasureHunter.Description=Vis misc. objecten op Fishing.SubSkill.MagicHunter.Name=Magische Jager @@ -108,12 +108,12 @@ Mining.SubSkill.BiggerBombs.Description=Verhoogt TNT explosie radius Mining.SubSkill.DemolitionsExpertise.Description=Vermindert schade door TNT explosies Mining.Listener=Mijnbouw: Mining.SkillName=MIJNBOUW -Mining.Skills.SuperBreaker.Off= ** Super Breaker is uitgewerkt ** +Mining.Skills.SuperBreaker.Off=** Super Breaker is uitgewerkt ** Mining.Skills.SuperBreaker.Other.Off=Super Breker [[GREEN]]is uitgewerkt voor [[YELLOW]]{0} Mining.Skills.SuperBreaker.Refresh=[[GREEN]]Je[[YELLOW]]Super Breeker [[GREEN]]kracht is hersteld! Mining.Skillup=Mijn ervaring toegenomen met {0}. Totaal: ({1}) Mining.Blast.Boom=[[GRAY]]**BOEM** -Mining.Blast.Radius.Increase= Ontploffings Radius Verhoging: [[YELLOW]] {0} +Mining.Blast.Radius.Increase=Ontploffings Radius Verhoging: [[YELLOW]] {0} Mining.Blast.Rank=Explosie Mining: [[YELLOW]] Rang {0}/8 [[GRAY]]({1}) Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] heeft [[RED]] Blast Mining![DARK_GREEN] gebruikt Mining.Blast.Refresh=[[GREEN]]Je [[YELLOW]]explosie mijn [[GREEN]]kracht is hersteld! @@ -218,7 +218,7 @@ Unarmed.Skills.Berserk.Other.On=[[GREEN]]{0}[[DARK_GREEN]] heeft [[RED]]Razernij Unarmed.Skills.Berserk.Refresh=[[GREEN]]Je [[YELLOW]]Razernij [[GREEN]]kracht is hersteld! Woodcutting.Ability.0=Bladblazer Woodcutting.Ability.1=Bladeren wegblazen -Woodcutting.Ability.Length= Boom Feller Lengte: [[GEEL]]{0}s +Woodcutting.Ability.Length=Boom Feller Lengte: [[GEEL]]{0}s Woodcutting.Ability.Locked.0=Vergrendeld totdat {0}+ VAARDIGHEID (BLADBLAZER) Woodcutting.SubSkill.TreeFeller.Name=Tree Feller Woodcutting.SubSkill.TreeFeller.Description=Laat bomen ontploffen @@ -228,10 +228,10 @@ Woodcutting.SubSkill.HarvestLumber.Name=Dubbele drops Woodcutting.SubSkill.HarvestLumber.Description=Het dubbele van de normale buit Woodcutting.Listener=Houthakken: Woodcutting.SkillName=Houthakken -Woodcutting.Skills.TreeFeller.Off= ** Boom Feller is uitgewerkt ** +Woodcutting.Skills.TreeFeller.Off=** Boom Feller is uitgewerkt ** Woodcutting.Skills.TreeFeller.On=[[GREEN]]**BOOM FELLER GEACTIVEERD** Woodcutting.Skills.TreeFeller.Refresh=[[GREEN]]Je [[YELLOW]]Boom Feller [[GREEN]]kracht is hersteld! -Woodcutting.Skills.TreeFeller.Other.Off= Boom Feller [[GREEN]] is uitgewerkt voor [[GEEL]]{0} +Woodcutting.Skills.TreeFeller.Other.Off=Boom Feller [[GREEN]] is uitgewerkt voor [[GEEL]]{0} Woodcutting.Skills.TreeFeller.Other.On=[[GREEN]]{0}[[DARK)GREEN]]heeft[[RED]]Tree Feller[[DARK_GREEN]]gebruikt! Woodcutting.Skills.TreeFeller.Splinter=JOU BIJL SPLINTERT IN DUIZENDEN STUKJES! Woodcutting.Skills.TreeFeller.Threshold=Die boom is te groot! @@ -264,8 +264,8 @@ Commands.mcrank.Player=DOELWIT: [[WHITE]]{0} Commands.mmoedit=[player] [[RED]] - Pas doel aan Commands.mmoedit.Modified.1=[[GREEN]]Uw level in {0} is veranderd naar {1} Commands.mmoedit.Modified.2={0} is aangepast voor {1}. -Commands.mcconvert.Database.Same= Je makt al gebruik van de {0} database! -Commands.mcconvert.Database.InvalidType= {0} is geen geldig soort database. +Commands.mcconvert.Database.Same=Je makt al gebruik van de {0} database! +Commands.mcconvert.Database.InvalidType={0} is geen geldig soort database. Commands.ModDescription=- Lees instructie mod beschrijving Commands.NoConsole=Deze commando wordt niet ondersteund vanuit de console. Commands.Other=[[GREEN]]--OVERIGE COMMANDS-- @@ -293,16 +293,16 @@ Commands.Party.Teleport= [[RED]]- Teleport naar een groepslid Commands.Party.Toggle=- Zet Party Chat aan/uit Commands.Party.1=- Maak een nieuwe groep Commands.Party.2=- Ga bij een spelers groep -Commands.ptp.NoRequests= Je hebt geen teleporteren aanvragen op dit moment +Commands.ptp.NoRequests=Je hebt geen teleporteren aanvragen op dit moment Commands.ptp.RequestExpired=Groep\'s teleport verzoek is verlopen! Commands.PowerLevel.Leaderboard=--mcMMO[[BLUE]] Kracht Level [[YELLOW]]Leiderbord-- Commands.PowerLevel=[[DARK_RED]]KRACHT LEVEL: [[GREEN]]{0} Commands.Reset=Reset een niveau level naar 0 -Commands.Skill.Invalid= Dat is geen geldig skillname! +Commands.Skill.Invalid=Dat is geen geldig skillname! Commands.Skill.Leaderboard=--mcMMO [[BLUE]]{0}[[YELLOW]] Ranglijst -- Commands.Stats.Self=Je status Commands.Stats=- Laat je mcMMO statussen zien -Commands.ToggleAbility= - Toggle Kracht activering met rechts klikken +Commands.ToggleAbility=- Toggle Kracht activering met rechts klikken Commands.Usage.Level=niveau Commands.Usage.Message=bericht Commands.Usage.PartyName=naam diff --git a/bukkit/src/main/resources/locale/locale_pl.properties b/bukkit/src/main/resources/locale/locale_pl.properties index 22a0f5fed..0f37b39d6 100644 --- a/bukkit/src/main/resources/locale/locale_pl.properties +++ b/bukkit/src/main/resources/locale/locale_pl.properties @@ -512,7 +512,7 @@ Guides.Available=[[GRAY]]Przewodnik dla {0} jest dost\u0119pny - wpisz /{1} ? [s Guides.Header=[[GOLD]]-=[[GREEN]]{0} Przewodnik[[GOLD]]=- Guides.Page.Invalid=Niew\u0142a\u015bciwa strona! Guides.Page.OutOfRange=Ta strona nie istnieje, jest tylko {0} stron. -Guides.Usage= W\u0142a\u015bciwa Komenda to /{0} ? [strona] +Guides.Usage=W\u0142a\u015bciwa Komenda to /{0} ? [strona] Guides.Smelting.Section.0=Wkrotce... Inspect.Offline=Nie masz odpowiednich uprawnie\u0144 aby przygl\u0105da\u0107 si\u0119 graczom offline! Inspect.OfflineStats=Statystyki Gracza Offline [[YELLOW]]{0} diff --git a/bukkit/src/main/resources/locale/locale_ru.properties b/bukkit/src/main/resources/locale/locale_ru.properties index 82da31f19..8da1c6ee4 100644 --- a/bukkit/src/main/resources/locale/locale_ru.properties +++ b/bukkit/src/main/resources/locale/locale_ru.properties @@ -26,7 +26,7 @@ Archery.Listener=\u0421\u0442\u0440\u0435\u043b\u044c\u0431\u0430 \u0438\u0437 \ Archery.SkillName=\u0421\u0422\u0420\u0415\u041b\u042c\u0411\u0410 \u0418\u0417 \u041b\u0423\u041a\u0410 Archery.Skillup=\u0423\u0440\u043e\u0432\u0435\u043d\u044c \u043d\u0430\u0432\u044b\u043a\u0430 \"\u0421\u0442\u0440\u0435\u043b\u044c\u0431\u0430 \u0438\u0437 \u043b\u0443\u043a\u0430\" \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d \u043d\u0430 {0}. \u0412\u0441\u0435\u0433\u043e ({1}) Axes.Ability.Bonus.0=\u041c\u0430\u0441\u0442\u0435\u0440 \u0422\u043e\u043f\u043e\u0440\u0430 -Axes.Ability.Bonus.1= \u041d\u0430\u043d\u043e\u0441\u0438\u0442 {0} \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0423\u0440\u043e\u043d\u0430 +Axes.Ability.Bonus.1=\u041d\u0430\u043d\u043e\u0441\u0438\u0442 {0} \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0423\u0440\u043e\u043d\u0430 Axes.Ability.Bonus.2=\u0411\u0440\u043e\u043d\u0435\u0431\u043e\u0439\u043d\u044b\u0439 \u0423\u0434\u0430\u0440 Axes.Ability.Bonus.3=\u041d\u0430\u043d\u043e\u0441\u0438\u0442 {0} \u0414\u043e\u043f\u043e\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0423\u0440\u043e\u043d\u0430 \u0431\u0440\u043e\u043d\u0435 Axes.Ability.Bonus.4=\u0412\u0435\u043b\u0438\u043a\u0438\u0439 \u0423\u0434\u0430\u0440 @@ -501,7 +501,7 @@ Party.Help.2=\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 Party.Help.3=\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 [[DARK_AQUA]]{0} [password] [[RED]]\u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0435\u043d\u0438\u0442\u044c\u0441\u044f \u0438\u043b\u0438 [[DARK_AQUA]]{1} [[RED]]\u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0439\u0442\u0438 Party.Help.4=\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043b\u0438 \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0448\u0443 \u0433\u0440\u0443\u043f\u043f\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 [[DARK_AQUA]]{0} Party.Help.5=\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u0435\u043c \u0432\u0430\u0448\u0443 \u0433\u0440\u0443\u043f\u043f\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 [[DARK_AQUA]]{0} -Party.Help.6= \u0427\u0442\u043e\u0431\u044b \u0432\u044b\u0433\u043d\u0430\u0442\u044c \u0438\u0433\u0440\u043e\u043a\u0430 \u0438\u0437 \u0432\u0430\u0448\u0435\u0439 \u043f\u0430\u0442\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 [[DARK_AQUA]] {0} +Party.Help.6=\u0427\u0442\u043e\u0431\u044b \u0432\u044b\u0433\u043d\u0430\u0442\u044c \u0438\u0433\u0440\u043e\u043a\u0430 \u0438\u0437 \u0432\u0430\u0448\u0435\u0439 \u043f\u0430\u0442\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 [[DARK_AQUA]] {0} Party.Help.7=\u0427\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0435\u0439 \u0433\u0440\u0443\u043f\u043f\u043e\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 [[DARK_AQUA]]{0} Party.Help.8=\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u0430\u0448\u0443 \u0433\u0440\u0443\u043f\u043f\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 [[DARK_AQUA]]{0} Party.Help.9=\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 [[DARK_AQUA]]{0} [[RED]]\u0434\u043b\u044f \u0434\u0435\u043b\u0435\u0436\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u0430\u043c\u0438 \u043c\u0435\u0436\u0434\u0443 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0430\u043c\u0438 \u0433\u0440\u0443\u043f\u043f\u044b @@ -585,7 +585,7 @@ Guides.Available=[[GRAY]]\u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\ Guides.Header=[[GOLD]]-=[[GREEN]]{0} \u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e[[GOLD]]=- Guides.Page.Invalid=\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b! Guides.Page.OutOfRange=\u042d\u0442\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0432\u0441\u0435\u0433\u043e \u0435\u0441\u0442\u044c {0} \u0441\u0442\u0440\u0430\u043d\u0438\u0446. -Guides.Usage= \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 /{0} ? [\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430] +Guides.Usage=\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 /{0} ? [\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430] Guides.Acrobatics.Section.0=[[DARK_AQUA]]\u041e \u043d\u0430\u0432\u044b\u043a\u0435 \u0410\u043a\u0440\u043e\u0431\u0430\u0442\u0438\u043a\u0430:\n[[YELLOW]]\u0410\u043a\u0440\u043e\u0431\u0430\u0442\u0438\u043a\u0430 - \u044d\u0442\u043e \u043d\u0430\u0432\u044b\u043a \u0433\u0440\u0430\u0446\u0438\u043e\u0437\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0432 mcMMO.\n[[YELLOW]]\u041e\u043d \u0434\u0430\u0435\u0442 \u0431\u043e\u043d\u0443\u0441\u044b \u0432 \u0431\u043e\u044e \u0438 \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u043e\u0442 \u043f\u0440\u0438\u0440\u043e\u0434\u043d\u044b\u0445 \u043f\u043e\u0432\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439.\n\n[[DARK_AQUA]]\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u043f\u044b\u0442\u0430:\n[[YELLOW]]\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u043f\u044b\u0442 \u0432 \u044d\u0442\u043e\u043c \u043d\u0430\u0432\u044b\u043a\u0435, \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0443\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \n[[YELLOW]]\u0432 \u0431\u043e\u044e \u0438\u043b\u0438 \u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u044b\u0441\u043e\u0442\u044b, \u043f\u043e\u043b\u0443\u0447\u0430\u044f \u0443\u0440\u043e\u043d. Guides.Acrobatics.Section.1=[[DARK_AQUA]]\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0443\u043c\u0435\u043d\u0438\u0435 \u041f\u0440\u044b\u0436\u043e\u043a?\n[[YELLOW]]\u0423 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0448\u0430\u043d\u0441 \u0441\u0432\u0435\u0441\u0442\u0438 \u043d\u0430 \u043d\u0435\u0442 \u0443\u0440\u043e\u043d \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438 \u043f\u0430\u0434\u0435\u043d\u0438\u0438.\n[[YELLOW]]\u0415\u0441\u043b\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u044b\u0436\u043a\u0430 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u043a\u0440\u0430\u0441\u0442\u044c\u0441\u044f (Left Shift),\n[[YELLOW]]\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0432\u043e\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0448\u0430\u043d\u0441.\n[[YELLOW]]\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u0418\u0437\u044f\u0449\u043d\u044b\u0439 \u041f\u0440\u044b\u0436\u043e\u043a \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e.\n[[YELLOW]]\u0418\u0437\u044f\u0449\u043d\u044b\u0435 \u041f\u0440\u044b\u0436\u043a\u0438 \u043f\u043e\u0445\u043e\u0436\u0438 \u043d\u0430 \u043e\u0431\u044b\u0447\u043d\u044b\u0435, \u043d\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0432 \u0434\u0432\u0430\n[[YELLOW]]\u0440\u0430\u0437\u0430 \u0440\u0435\u0436\u0435 \u0438 \u0434\u0430\u044e\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0437\u0430\u0449\u0438\u0442\u0443 \u043f\u0440\u0438 \u043f\u0430\u0434\u0435\u043d\u0438\u0438.\n[[YELLOW]]\u0428\u0430\u043d\u0441 \u043d\u0430 \u0443\u0434\u0430\u0447\u043d\u044b\u0439 \u043f\u0440\u044b\u0436\u043e\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043d\u0430\u0432\u044b\u043a\u0430. Guides.Acrobatics.Section.2=[[DARK_AQUA]]\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0443\u043c\u0435\u043d\u0438\u0435 \u0423\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435?\n[[YELLOW]]\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u0443\u043c\u0435\u043d\u0438\u044e \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0430\u0441\u0441\u0438\u0432\u043d\u044b\u0439 \u0448\u0430\u043d\u0441 \u0443\u043a\u043b\u043e\u043d\u0438\u0442\u044c\u0441\u044f\n[[YELLOW]]\u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0431\u044b\u0442\u0432\u044b, \u0447\u0442\u043e \u0432\u0434\u0432\u043e\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0443\u0440\u043e\u043d.\n[[YELLOW]]\u0428\u0430\u043d\u0441 \u043d\u0430 \u0443\u0434\u0430\u0447\u043d\u043e\u0435 \u0443\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043d\u0430\u0432\u044b\u043a\u0430. diff --git a/bukkit/src/main/resources/locale/locale_th_TH.properties b/bukkit/src/main/resources/locale/locale_th_TH.properties index 83b273567..1544c9ac0 100644 --- a/bukkit/src/main/resources/locale/locale_th_TH.properties +++ b/bukkit/src/main/resources/locale/locale_th_TH.properties @@ -545,7 +545,7 @@ Guides.Available=[[GRAY]]\u0e41\u0e19\u0e30\u0e19\u0e33 {0} \u0e04\u0e27\u0e23\u Guides.Header=[[GOLD]]-=[[GREEN]]{0} \u0e41\u0e19\u0e30\u0e19\u0e33[[GOLD]]=- Guides.Page.Invalid=\u0e44\u0e21\u0e48\u0e43\u0e0a\u0e48\u0e15\u0e31\u0e27\u0e40\u0e25\u0e02\u0e17\u0e35\u0e48\u0e16\u0e39\u0e01\u0e15\u0e49\u0e2d\u0e07! Guides.Page.OutOfRange=\u0e44\u0e21\u0e48\u0e21\u0e35\u0e2b\u0e19\u0e49\u0e32\u0e19\u0e35\u0e2d\u0e22\u0e39\u0e48 \u0e21\u0e35\u0e40\u0e1e\u0e35\u0e22\u0e07 {0} \u0e2b\u0e19\u0e49\u0e32. -Guides.Usage= \u0e43\u0e0a\u0e49 /{0} ? [\u0e2b\u0e19\u0e49\u0e32] +Guides.Usage=\u0e43\u0e0a\u0e49 /{0} ? [\u0e2b\u0e19\u0e49\u0e32] Guides.Smelting.Section.0=\u0e40\u0e23\u0e47\u0e27\u0e46\u0e19\u0e35\u0e49... Inspect.Offline=\u0e04\u0e38\u0e13\u0e44\u0e21\u0e48\u0e44\u0e14\u0e49\u0e23\u0e31\u0e1a\u0e2a\u0e34\u0e17\u0e18\u0e34\u0e4c\u0e43\u0e19\u0e01\u0e32\u0e23\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a\u0e1c\u0e39\u0e49\u0e40\u0e25\u0e48\u0e19 Offline! Inspect.OfflineStats=mcMMO \u0e2a\u0e16\u0e34\u0e15\u0e34\u0e1c\u0e39\u0e49\u0e40\u0e25\u0e48\u0e19 Offline [[YELLOW]]{0} diff --git a/bukkit/src/main/resources/locale/locale_zh_CN.properties b/bukkit/src/main/resources/locale/locale_zh_CN.properties index 314e9e138..f8b848f77 100644 --- a/bukkit/src/main/resources/locale/locale_zh_CN.properties +++ b/bukkit/src/main/resources/locale/locale_zh_CN.properties @@ -284,7 +284,7 @@ Taming.Ability.Bonus.8=\u5feb\u9910\u670d\u52a1 Taming.Ability.Bonus.9={0} \u7684\u51e0\u7387\u653b\u51fb\u65f6\u56de\u8840 Taming.Ability.Bonus.10=\u72ac\u795e\u7684\u5e87\u62a4 Taming.Ability.Bonus.11=\u53d7\u5230\u9b54\u6cd5\u6216\u4e2d\u6bd2\u4f24\u5bb3\u65f6\u6062\u590d\u751f\u547d\u503c -Taming.Ability.Locked.0= {0}+ \u7ea7\u540e\u89e3\u9501 (\u73af\u5883\u611f\u77e5) +Taming.Ability.Locked.0={0}+ \u7ea7\u540e\u89e3\u9501 (\u73af\u5883\u611f\u77e5) Taming.Ability.Locked.1=\u9501\u5b9a\u76f4\u5230 {0}+ \u6280\u80fd (\u539a\u5b9e\u7684\u76ae\u6bdb) Taming.Ability.Locked.2=\u9501\u5b9a\u76f4\u5230 {0}+ \u6280\u80fd (\u51b2\u51fb\u62b5\u6297) Taming.Ability.Locked.3=\u9501\u5b9a\u76f4\u5230 {0}+ \u6280\u80fd (\u5229\u722a) @@ -646,7 +646,7 @@ Guides.Available=[[GRAY]]{0} \u7684\u5411\u5bfc - \u8f93\u5165/{1} ? [\u9875\u65 Guides.Header=[[GOLD]]-=[[GREEN]]{0} \u5411\u5bfc[[GOLD]]=- Guides.Page.Invalid=\u4e0d\u662f\u4e00\u4e2a\u6709\u6548\u7684\u9875\u6570! Guides.Page.OutOfRange=\u90a3\u9875\u4e0d\u5b58\u5728, \u603b\u5171\u53ea\u6709 {0} \u9875 -Guides.Usage= \u7528\u6cd5 /{0} ? [\u9875\u6570] +Guides.Usage=\u7528\u6cd5 /{0} ? [\u9875\u6570] Guides.Acrobatics.Section.0=[[DARK_AQUA]]\u5173\u4e8e\u6742\u6280:\n[[YELLOW]]\u6742\u6280\u662f mcMMO \u4e2d\u4f18\u96c5\u79fb\u52a8\u7684\u827a\u672f\u3002\n[[YELLOW]]\u5b83\u63d0\u4f9b\u4e86\u6218\u6597\u52a0\u6210\u548c\u73af\u5883\u4f24\u5bb3\u52a0\u6210\u3002\n\n[[DARK_AQUA]]\u7ecf\u9a8c\u83b7\u53d6:\n[[YELLOW]]\u901a\u8fc7\u5728\u6218\u6597\u4e2d\u95ea\u907f\u6216\u8005\u4ece\u9ad8\u5904\n[[YELLOW]]\u8dcc\u843d\u65f6\u53d7\u4f24\u5e76\u5e78\u5b58\u6765\u83b7\u5f97\u7ecf\u9a8c\u3002 Guides.Acrobatics.Section.1=[[DARK_AQUA]]\u7ffb\u6eda\u662f\u5982\u4f55\u5de5\u4f5c\u7684\uff1f\n[[YELLOW]]\u5f53\u60a8\u53d7\u5230\u8dcc\u843d\u4f24\u5bb3\u65f6\u60a8\u6709\u88ab\u52a8\u673a\u4f1a\u6765\u514d\u53d7\u4f24\u5bb3\u3002\n[[YELLOW]]\u60a8\u53ef\u4ee5\u5728\u8dcc\u843d\u4e2d\u6309\u4f4f\u6f5c\u884c\u952e\u6765\u63d0\u5347\u89e6\u53d1\u51e0\u7387\u3002\n[[YELLOW]]\u8fd9\u5c06\u89e6\u53d1\u4e00\u4e2a\u4f18\u96c5\u5730\u7ffb\u6eda\u800c\u4e0d\u662f\u666e\u901a\u7684\u7ffb\u6eda\u3002\n[[YELLOW]]\u4f18\u96c5\u5730\u7ffb\u6eda\u7c7b\u4f3c\u666e\u901a\u7684\u7ffb\u6eda\u4f46\u662f\u5b83\u6709\u53cc\u500d\u51e0\u7387\n[[YELLOW]]\u53d1\u751f\uff0c\u5e76\u4e14\u80fd\u591f\u63d0\u4f9b\u6bd4\u666e\u901a\u5730\u7ffb\u6eda\u66f4\u9ad8\u7684\u4f24\u5bb3\u51cf\u514d\u3002\n[[YELLOW]]\u7ffb\u6eda\u51e0\u7387\u53d6\u51b3\u4e8e\u60a8\u7684\u6280\u80fd\u7b49\u7ea7 Guides.Acrobatics.Section.2=[[DARK_AQUA]]\u95ea\u907f\u662f\u5982\u4f55\u5de5\u4f5c\u7684?\n[[YELLOW]]\u95ea\u907f\u662f\u4e00\u4e2a\u88ab\u52a8\u6280\u80fd\n[[YELLOW]]\u4ed6\u5728\u4f60\u88ab\u653b\u51fb\u65f6\u6709\u4e00\u5b9a\u51e0\u7387\u88ab\u6fc0\u53d1\n[[YELLOW]]\u8fd9\u4e2a\u51e0\u7387\u548c\u4f60\u7684\u6280\u80fd\u7b49\u7ea7\u6709\u5173 diff --git a/bukkit/src/main/resources/locale/locale_zh_TW.properties b/bukkit/src/main/resources/locale/locale_zh_TW.properties index 5c7140072..6909761e4 100644 --- a/bukkit/src/main/resources/locale/locale_zh_TW.properties +++ b/bukkit/src/main/resources/locale/locale_zh_TW.properties @@ -449,7 +449,7 @@ Commands.Party.2=- \u52a0\u5165\u73a9\u5bb6\u7684\u968a\u4f0d\u88e1 Commands.ptp.Enabled=\u968a\u4f0d\u50b3\u9001 [[GREEN]]\u5141\u8a31 Commands.ptp.Disabled=\u968a\u4f0d\u50b3\u9001 [[RED]]\u4e0d\u5141\u8a31 Commands.ptp.NoRequests=\u4f60\u73fe\u5728\u4e0d\u53ef\u4ee5\u50b3\u9001 -Commands.ptp.NoWorldPermissions= [mcMMO]\u60a8\u6c92\u6709\u6b0a\u9650\u50b3\u9001\u5230\u4e16\u754c{0}. +Commands.ptp.NoWorldPermissions=[mcMMO]\u60a8\u6c92\u6709\u6b0a\u9650\u50b3\u9001\u5230\u4e16\u754c{0}. Commands.ptp.Request1={0} [[GREEN]]\u5df2\u50b3\u9001\u81f3\u4f60\u65c1\u908a. Commands.ptp.Request2=[[GREEN]]\u4f60\u50b3\u9001\u7684\u8a71\u8acb\u8f38\u5165[[YELLOW]]/ptp accept. [[GREEN]]\u5728[[RED]]{0} [[GREEN]]\u79d2\u5167\u5fc5\u9808\u5b8c\u6210 Commands.ptp.AcceptAny.Enabled=\u968a\u4f0d\u50b3\u9001\u8acb\u6c42\u78ba\u8a8d [[GREEN]]\u555f\u7528 @@ -534,7 +534,7 @@ Party.Teleport.Player=[[GREEN]]\u4f60\u5df2\u7d93\u50b3\u9001\u5230 {0}. Party.Teleport.Self=\u4f60\u7121\u6cd5\u50b3\u9001\u5230\u4f60\u81ea\u5df1\u8eab\u65c1! Party.Teleport.Target=[[GREEN]]{0} \u5df2\u7d93\u50b3\u9001\u5230\u4f60\u8eab\u908a. Party.Teleport.Disabled={0} \u4e0d\u5141\u8a31\u968a\u4f0d\u50b3\u9001. -Party.Rename.Same= {0}\u4f60\u7684\u968a\u4f0d\u5df2\u7d93\u662f\u9019\u500b\u540d\u5b57\u4e86! +Party.Rename.Same={0}\u4f60\u7684\u968a\u4f0d\u5df2\u7d93\u662f\u9019\u500b\u540d\u5b57\u4e86! Party.Join.Self=\u4f60\u7121\u6cd5\u52a0\u5165\u81ea\u5df1! Party.Unlocked=[[GRAY]]\u968a\u4f0d\u5df2\u89e3\u9396! Party.Disband=[[GRAY]]\u968a\u4f0d\u5df2\u89e3\u6563 @@ -739,7 +739,7 @@ Commands.Description.mcgod=\u5207\u63dbmcMMo\u795e\u4e4b\u6a21\u5f0f(\u958b/\u95 Commands.Description.mchud=\u66f4\u63db\u4f60\u7684McMMO HUD\u98a8\u683c Commands.Description.mcmmo=\u986f\u793amcMMO\u7684\u7c21\u8981\u8aaa\u660e Commands.Description.mcnotify=\u5207\u63dbmcMMO\u7684\u804a\u5929\u986f\u793a\u901a\u77e5 (\u958b/\u95dc) -Commands.Description.mcpurge= \u6e05\u9664mcMMO\u6280\u80fd\u7b49\u7d1a\u70ba0\u6216\u8d85\u904e{0}\u500b\u6708\u672a\u767b\u5165\u7684\u7528\u6236\u8cc7\u6599. +Commands.Description.mcpurge=\u6e05\u9664mcMMO\u6280\u80fd\u7b49\u7d1a\u70ba0\u6216\u8d85\u904e{0}\u500b\u6708\u672a\u767b\u5165\u7684\u7528\u6236\u8cc7\u6599. Commands.Description.mcrank=\u986f\u793a\u6240\u6709mcMMO\u7684\u6392\u540d Commands.Description.mcrefresh=\u66f4\u65b0\u6240\u6709McMMO\u6280\u80fd\u51b7\u537b\u6642\u9593 Commands.Description.mcremove=\u5f9emcMMO\u8cc7\u6599\u5eab\u4e2d\u522a\u9664\u4f7f\u7528\u8005 diff --git a/bukkit/src/main/resources/plugin.yml b/bukkit/src/main/resources/plugin.yml index 6777dbdc7..ca9c6a039 100644 --- a/bukkit/src/main/resources/plugin.yml +++ b/bukkit/src/main/resources/plugin.yml @@ -1,14 +1,14 @@ name: mcMMO version: ${project.version} description: > - The goal of mcMMO is to take core Minecraft game mechanics and expand them into - add an extensive and quality RPG experience. Everything in mcMMO has been carefully - thought out and is constantly being improved upon. Currently, mcMMO adds thirteen - 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. + The goal of mcMMO is to take core Minecraft game mechanics and expand them into + add an extensive and quality RPG experience. Everything in mcMMO has been carefully + thought out and is constantly being improved upon. Currently, mcMMO adds thirteen + 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. author: com.gmail.nossr50 authors: [GJ, NuclearW, bm01, Glitchfinder, TfT_02, t00thpick1, Riking] @@ -715,8 +715,8 @@ permissions: mcmmo.chat.all: description: Implies all mcmmo.chat permissions. (Warning, contains adminchat) children: - mcmmo.chat.adminchat: true - mcmmo.chat.partychat: true + mcmmo.chat.adminchat: true + mcmmo.chat.partychat: true mcmmo.chat.adminchat: description: Allows participation in admin chat mcmmo.chat.partychat: @@ -1270,7 +1270,7 @@ permissions: children: mcmmo.chat.partychat: true mcmmo.commands.defaults: true - mcmmo.motd: true + mcmmo.motd: true mcmmo.skills.all: true mcmmo.defaultsop: default: op @@ -1308,7 +1308,7 @@ permissions: default: false description: implies access to all mcmmo perks children: - mcmmo.perks.all: true + mcmmo.perks.all: true mcmmo.perks.all: default: false description: implies access to all mcmmo perks @@ -2045,7 +2045,7 @@ permissions: default: false description: Implies all mcmmo.tools permissions. children: - mcmmo.tools.all: true + mcmmo.tools.all: true mcmmo.tools.all: default: false description: Implies all mcmmo.tools permissions. diff --git a/bukkit/src/main/resources/potions.yml b/bukkit/src/main/resources/potions.yml index b85bd9739..18b0082dd 100644 --- a/bukkit/src/main/resources/potions.yml +++ b/bukkit/src/main/resources/potions.yml @@ -4,40 +4,40 @@ ### Concoctions: Tier_One_Ingredients: - - BLAZE_POWDER - - FERMENTED_SPIDER_EYE - - GHAST_TEAR - - GLOWSTONE_DUST - - GOLDEN_CARROT - - MAGMA_CREAM - - NETHER_WART - - REDSTONE - - GLISTERING_MELON_SLICE - - SPIDER_EYE - - SUGAR - - GUNPOWDER - - WATER_LILY - - PUFFERFISH - - DRAGON_BREATH + - BLAZE_POWDER + - FERMENTED_SPIDER_EYE + - GHAST_TEAR + - GLOWSTONE_DUST + - GOLDEN_CARROT + - MAGMA_CREAM + - NETHER_WART + - REDSTONE + - GLISTERING_MELON_SLICE + - SPIDER_EYE + - SUGAR + - GUNPOWDER + - WATER_LILY + - PUFFERFISH + - DRAGON_BREATH Tier_Two_Ingredients: - - CARROT - - SLIME_BALL - - PHANTOM_MEMBRANE + - CARROT + - SLIME_BALL + - PHANTOM_MEMBRANE Tier_Three_Ingredients: - - QUARTZ - - RED_MUSHROOM + - QUARTZ + - RED_MUSHROOM Tier_Four_Ingredients: - - APPLE - - ROTTEN_FLESH + - APPLE + - ROTTEN_FLESH Tier_Five_Ingredients: - - BROWN_MUSHROOM - - INK_SAC + - BROWN_MUSHROOM + - INK_SAC Tier_Six_Ingredients: - - FERN + - FERN Tier_Seven_Ingredients: - - POISONOUS_POTATO + - POISONOUS_POTATO Tier_Eight_Ingredients: - - GOLDEN_APPLE + - GOLDEN_APPLE # # Settings for Potions diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 811984bae..3b371f30b 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -1,4 +1,3 @@ - plugins { java } diff --git a/core/src/main/java/com/gmail/nossr50/core/api/AbilityAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/AbilityAPI.java index fb66dc2a6..ed84f56f3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/api/AbilityAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/AbilityAPI.java @@ -1,14 +1,15 @@ package com.gmail.nossr50.core.api; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.runnables.skills.BleedTimerTask; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; public final class AbilityAPI { - private AbilityAPI() {} + private AbilityAPI() { + } public static boolean berserkEnabled(Player player) { return UserManager.getPlayer(player).getAbilityMode(SuperAbilityType.BERSERK); diff --git a/core/src/main/java/com/gmail/nossr50/core/api/ChatAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/ChatAPI.java index 58b6ca907..bcdb7b498 100644 --- a/core/src/main/java/com/gmail/nossr50/core/api/ChatAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/ChatAPI.java @@ -3,25 +3,26 @@ package com.gmail.nossr50.core.api; import com.gmail.nossr50.chat.ChatManager; import com.gmail.nossr50.chat.ChatManagerFactory; import com.gmail.nossr50.chat.PartyChatManager; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; public final class ChatAPI { - private ChatAPI() {} + private ChatAPI() { + } /** * Send a message to all members of a party *
* This function is designed for API usage. * - * @param plugin The plugin sending the message - * @param sender The name of the sender + * @param plugin The plugin sending the message + * @param sender The name of the sender * @param displayName The display name of the sender - * @param party The name of the party to send to - * @param message The message to send + * @param party The name of the party to send to + * @param message The message to send */ public static void sendPartyChat(Plugin plugin, String sender, String displayName, String party, String message) { getPartyChatManager(plugin, party).handleChat(sender, displayName, message); @@ -32,9 +33,9 @@ public final class ChatAPI { *
* This function is designed for API usage. * - * @param plugin The plugin sending the message - * @param sender The name of the sender to display in the chat - * @param party The name of the party to send to + * @param plugin The plugin sending the message + * @param sender The name of the sender to display in the chat + * @param party The name of the party to send to * @param message The message to send */ public static void sendPartyChat(Plugin plugin, String sender, String party, String message) { @@ -46,10 +47,10 @@ public final class ChatAPI { *
* This function is designed for API usage. * - * @param plugin The plugin sending the message - * @param sender The name of the sender + * @param plugin The plugin sending the message + * @param sender The name of the sender * @param displayName The display name of the sender - * @param message The message to send + * @param message The message to send */ public static void sendAdminChat(Plugin plugin, String sender, String displayName, String message) { ChatManagerFactory.getChatManager(plugin, ChatMode.ADMIN).handleChat(sender, displayName, message); @@ -60,8 +61,8 @@ public final class ChatAPI { *
* This function is designed for API usage. * - * @param plugin The plugin sending the message - * @param sender The name of the sender to display in the chat + * @param plugin The plugin sending the message + * @param sender The name of the sender to display in the chat * @param message The message to send */ public static void sendAdminChat(Plugin plugin, String sender, String message) { diff --git a/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java index fa20f3215..d37cb51ac 100644 --- a/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/ExperienceAPI.java @@ -1,9 +1,10 @@ package com.gmail.nossr50.core.api; import com.gmail.nossr50.api.exceptions.*; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.api.exceptions.*; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; @@ -12,7 +13,6 @@ import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.child.FamilyTree; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.block.BlockState; import org.bukkit.entity.Player; @@ -21,7 +21,8 @@ import java.util.Set; import java.util.UUID; public final class ExperienceAPI { - private ExperienceAPI() {} + private ExperienceAPI() { + } /** * Returns whether given string is a valid type of skill suitable for the @@ -62,10 +63,9 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to + * @param player The player to add XP to * @param skillType The skill to add XP to - * @param XP The amount of XP to add - * + * @param XP The amount of XP to add * @throws InvalidSkillException if the given skill is not valid */ @Deprecated @@ -78,12 +78,11 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to - * @param skillType The skill to add XP to - * @param XP The amount of XP to add + * @param player The player to add XP to + * @param skillType The skill to add XP to + * @param XP The amount of XP to add * @param xpGainReason The reason to gain XP - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidXPGainReasonException if the given xpGainReason is not valid */ public static void addRawXP(Player player, String skillType, float XP, String xpGainReason) { @@ -95,13 +94,12 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to - * @param skillType The skill to add XP to - * @param XP The amount of XP to add + * @param player The player to add XP to + * @param skillType The skill to add XP to + * @param XP The amount of XP to add * @param xpGainReason The reason to gain XP - * @param isUnshared true if the XP cannot be shared with party members - * - * @throws InvalidSkillException if the given skill is not valid + * @param isUnshared true if the XP cannot be shared with party members + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidXPGainReasonException if the given xpGainReason is not valid */ public static void addRawXP(Player player, String skillType, float XP, String xpGainReason, boolean isUnshared) { @@ -131,15 +129,13 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * + * @param playerName The player to add XP to + * @param skillType The skill to add XP to + * @param XP The amount of XP to add + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @deprecated We're using uuids to get an offline player * replaced by {@link #addRawXPOffline(UUID uuid, String skillType, float XP)} - * - * @param playerName The player to add XP to - * @param skillType The skill to add XP to - * @param XP The amount of XP to add - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database */ @Deprecated public static void addRawXPOffline(String playerName, String skillType, float XP) { @@ -151,11 +147,10 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The UUID of player to add XP to + * @param uuid The UUID of player to add XP to * @param skillType The skill to add XP to - * @param XP The amount of XP to add - * - * @throws InvalidSkillException if the given skill is not valid + * @param XP The amount of XP to add + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidPlayerException if the given player does not exist in the database */ public static void addRawXPOffline(UUID uuid, String skillType, float XP) { @@ -167,10 +162,9 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to + * @param player The player to add XP to * @param skillType The skill to add XP to - * @param XP The amount of XP to add - * + * @param XP The amount of XP to add * @throws InvalidSkillException if the given skill is not valid */ @Deprecated @@ -183,12 +177,11 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to - * @param skillType The skill to add XP to - * @param XP The amount of XP to add + * @param player The player to add XP to + * @param skillType The skill to add XP to + * @param XP The amount of XP to add * @param xpGainReason The reason to gain XP - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidXPGainReasonException if the given xpGainReason is not valid */ public static void addMultipliedXP(Player player, String skillType, int XP, String xpGainReason) { @@ -201,10 +194,9 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to add XP to - * @param skillType The skill to add XP to - * @param XP The amount of XP to add - * - * @throws InvalidSkillException if the given skill is not valid + * @param skillType The skill to add XP to + * @param XP The amount of XP to add + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidPlayerException if the given player does not exist in the database */ @Deprecated @@ -217,10 +209,9 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to + * @param player The player to add XP to * @param skillType The skill to add XP to - * @param XP The amount of XP to add - * + * @param XP The amount of XP to add * @throws InvalidSkillException if the given skill is not valid */ @Deprecated @@ -233,12 +224,11 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to - * @param skillType The skill to add XP to - * @param XP The amount of XP to add + * @param player The player to add XP to + * @param skillType The skill to add XP to + * @param XP The amount of XP to add * @param xpGainReason The reason to gain XP - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidXPGainReasonException if the given xpGainReason is not valid */ public static void addModifiedXP(Player player, String skillType, int XP, String xpGainReason) { @@ -250,13 +240,12 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to - * @param skillType The skill to add XP to - * @param XP The amount of XP to add + * @param player The player to add XP to + * @param skillType The skill to add XP to + * @param XP The amount of XP to add * @param xpGainReason The reason to gain XP - * @param isUnshared true if the XP cannot be shared with party members - * - * @throws InvalidSkillException if the given skill is not valid + * @param isUnshared true if the XP cannot be shared with party members + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidXPGainReasonException if the given xpGainReason is not valid */ public static void addModifiedXP(Player player, String skillType, int XP, String xpGainReason, boolean isUnshared) { @@ -276,10 +265,9 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to add XP to - * @param skillType The skill to add XP to - * @param XP The amount of XP to add - * - * @throws InvalidSkillException if the given skill is not valid + * @param skillType The skill to add XP to + * @param XP The amount of XP to add + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidPlayerException if the given player does not exist in the database */ @Deprecated @@ -295,10 +283,9 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to + * @param player The player to add XP to * @param skillType The skill to add XP to - * @param XP The amount of XP to add - * + * @param XP The amount of XP to add * @throws InvalidSkillException if the given skill is not valid */ @Deprecated @@ -312,12 +299,11 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to - * @param skillType The skill to add XP to - * @param XP The amount of XP to add + * @param player The player to add XP to + * @param skillType The skill to add XP to + * @param XP The amount of XP to add * @param xpGainReason The reason to gain XP - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidXPGainReasonException if the given xpGainReason is not valid */ public static void addXP(Player player, String skillType, int XP, String xpGainReason) { @@ -330,13 +316,12 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add XP to - * @param skillType The skill to add XP to - * @param XP The amount of XP to add + * @param player The player to add XP to + * @param skillType The skill to add XP to + * @param XP The amount of XP to add * @param xpGainReason The reason to gain XP - * @param isUnshared true if the XP cannot be shared with party members - * - * @throws InvalidSkillException if the given skill is not valid + * @param isUnshared true if the XP cannot be shared with party members + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidXPGainReasonException if the given xpGainReason is not valid */ public static void addXP(Player player, String skillType, int XP, String xpGainReason, boolean isUnshared) { @@ -353,11 +338,10 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to get XP for + * @param player The player to get XP for * @param skillType The skill to get XP for * @return the amount of XP in a given skill - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws UnsupportedOperationException if the given skill is a child skill */ public static int getXP(Player player, String skillType) { @@ -370,11 +354,10 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to get XP for - * @param skillType The skill to get XP for + * @param skillType The skill to get XP for * @return the amount of XP in a given skill - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ @Deprecated @@ -387,12 +370,11 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The player to get XP for + * @param uuid The player to get XP for * @param skillType The skill to get XP for * @return the amount of XP in a given skill - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ public static int getOfflineXP(UUID uuid, String skillType) { @@ -404,11 +386,10 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to get XP for + * @param player The player to get XP for * @param skillType The skill to get XP for * @return the amount of XP in a given skill - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws UnsupportedOperationException if the given skill is a child skill */ public static float getXPRaw(Player player, String skillType) { @@ -421,11 +402,10 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to get XP for - * @param skillType The skill to get XP for + * @param skillType The skill to get XP for * @return the amount of XP in a given skill - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ @Deprecated @@ -438,12 +418,11 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The player to get XP for + * @param uuid The player to get XP for * @param skillType The skill to get XP for * @return the amount of XP in a given skill - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ public static float getOfflineXPRaw(UUID uuid, String skillType) { @@ -455,11 +434,10 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to get the XP amount for + * @param player The player to get the XP amount for * @param skillType The skill to get the XP amount for * @return the total amount of XP needed to reach the next level - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws UnsupportedOperationException if the given skill is a child skill */ public static int getXPToNextLevel(Player player, String skillType) { @@ -472,11 +450,10 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to get XP for - * @param skillType The skill to get XP for + * @param skillType The skill to get XP for * @return the total amount of XP needed to reach the next level - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ @Deprecated @@ -489,12 +466,11 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The player to get XP for + * @param uuid The player to get XP for * @param skillType The skill to get XP for * @return the total amount of XP needed to reach the next level - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ public static int getOfflineXPToNextLevel(UUID uuid, String skillType) { @@ -506,11 +482,10 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to get the XP amount for + * @param player The player to get the XP amount for * @param skillType The skill to get the XP amount for * @return the amount of XP remaining until the next level - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws UnsupportedOperationException if the given skill is a child skill */ public static int getXPRemaining(Player player, String skillType) { @@ -527,11 +502,10 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to get XP for - * @param skillType The skill to get XP for + * @param skillType The skill to get XP for * @return the amount of XP needed to reach the next level - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ @Deprecated @@ -547,12 +521,11 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The player to get XP for + * @param uuid The player to get XP for * @param skillType The skill to get XP for * @return the amount of XP needed to reach the next level - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ public static float getOfflineXPRemaining(UUID uuid, String skillType) { @@ -567,10 +540,9 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to add levels to + * @param player The player to add levels to * @param skillType Type of skill to add levels to - * @param levels Number of levels to add - * + * @param levels Number of levels to add * @throws InvalidSkillException if the given skill is not valid */ public static void addLevel(Player player, String skillType, int levels) { @@ -583,10 +555,9 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to add levels to - * @param skillType Type of skill to add levels to - * @param levels Number of levels to add - * - * @throws InvalidSkillException if the given skill is not valid + * @param skillType Type of skill to add levels to + * @param levels Number of levels to add + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidPlayerException if the given player does not exist in the database */ @Deprecated @@ -614,11 +585,10 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The player to add levels to + * @param uuid The player to add levels to * @param skillType Type of skill to add levels to - * @param levels Number of levels to add - * - * @throws InvalidSkillException if the given skill is not valid + * @param levels Number of levels to add + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidPlayerException if the given player does not exist in the database */ public static void addLevelOffline(UUID uuid, String skillType, int levels) { @@ -645,10 +615,9 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to get the level for + * @param player The player to get the level for * @param skillType The skill to get the level for * @return the level of a given skill - * * @throws InvalidSkillException if the given skill is not valid */ public static int getLevel(Player player, String skillType) { @@ -661,10 +630,9 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to get the level for - * @param skillType The skill to get the level for + * @param skillType The skill to get the level for * @return the level of a given skill - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidPlayerException if the given player does not exist in the database */ @Deprecated @@ -677,11 +645,10 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The player to get the level for + * @param uuid The player to get the level for * @param skillType The skill to get the level for * @return the level of a given skill - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidPlayerException if the given player does not exist in the database */ public static int getLevelOffline(UUID uuid, String skillType) { @@ -707,7 +674,6 @@ public final class ExperienceAPI { * * @param playerName The player to get the power level for * @return the power level of the player - * * @throws InvalidPlayerException if the given player does not exist in the database */ @Deprecated @@ -729,7 +695,6 @@ public final class ExperienceAPI { * * @param uuid The player to get the power level for * @return the power level of the player - * * @throws InvalidPlayerException if the given player does not exist in the database */ public static int getPowerLevelOffline(UUID uuid) { @@ -750,7 +715,6 @@ public final class ExperienceAPI { * * @param skillType The skill to get the level cap for * @return the level cap of a given skill - * * @throws InvalidSkillException if the given skill is not valid */ public static int getLevelCap(String skillType) { @@ -774,13 +738,11 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The name of the player to check - * @param skillType The skill to check - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database - * @throws UnsupportedOperationException if the given skill is a child skill - * + * @param skillType The skill to check * @return the position on the leaderboard + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database + * @throws UnsupportedOperationException if the given skill is a child skill */ @Deprecated public static int getPlayerRankSkill(String playerName, String skillType) { @@ -792,14 +754,12 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The name of the player to check + * @param uuid The name of the player to check * @param skillType The skill to check - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database - * @throws UnsupportedOperationException if the given skill is a child skill - * * @return the position on the leaderboard + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database + * @throws UnsupportedOperationException if the given skill is a child skill */ public static int getPlayerRankSkill(UUID uuid, String skillType) { return mcMMO.getDatabaseManager().readRank(getOfflineProfile(uuid).getPlayerName()).get(getNonChildSkillType(skillType)); @@ -811,10 +771,8 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The name of the player to check - * - * @throws InvalidPlayerException if the given player does not exist in the database - * * @return the position on the power level leaderboard + * @throws InvalidPlayerException if the given player does not exist in the database */ @Deprecated public static int getPlayerRankOverall(String playerName) { @@ -827,10 +785,8 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param uuid The name of the player to check - * - * @throws InvalidPlayerException if the given player does not exist in the database - * * @return the position on the power level leaderboard + * @throws InvalidPlayerException if the given player does not exist in the database */ public static int getPlayerRankOverall(UUID uuid) { return mcMMO.getDatabaseManager().readRank(getOfflineProfile(uuid).getPlayerName()).get(null); @@ -841,10 +797,9 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to set the level of - * @param skillType The skill to set the level for + * @param player The player to set the level of + * @param skillType The skill to set the level for * @param skillLevel The value to set the level to - * * @throws InvalidSkillException if the given skill is not valid */ public static void setLevel(Player player, String skillType, int skillLevel) { @@ -857,10 +812,9 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to set the level of - * @param skillType The skill to set the level for + * @param skillType The skill to set the level for * @param skillLevel The value to set the level to - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidPlayerException if the given player does not exist in the database */ @Deprecated @@ -873,11 +827,10 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The player to set the level of - * @param skillType The skill to set the level for + * @param uuid The player to set the level of + * @param skillType The skill to set the level for * @param skillLevel The value to set the level to - * - * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidSkillException if the given skill is not valid * @throws InvalidPlayerException if the given player does not exist in the database */ public static void setLevelOffline(UUID uuid, String skillType, int skillLevel) { @@ -889,11 +842,10 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to set the XP of + * @param player The player to set the XP of * @param skillType The skill to set the XP for - * @param newValue The value to set the XP to - * - * @throws InvalidSkillException if the given skill is not valid + * @param newValue The value to set the XP to + * @throws InvalidSkillException if the given skill is not valid * @throws UnsupportedOperationException if the given skill is a child skill */ public static void setXP(Player player, String skillType, int newValue) { @@ -906,11 +858,10 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to set the XP of - * @param skillType The skill to set the XP for - * @param newValue The value to set the XP to - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @param skillType The skill to set the XP for + * @param newValue The value to set the XP to + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ @Deprecated @@ -923,12 +874,11 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The player to set the XP of + * @param uuid The player to set the XP of * @param skillType The skill to set the XP for - * @param newValue The value to set the XP to - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @param newValue The value to set the XP to + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ public static void setXPOffline(UUID uuid, String skillType, int newValue) { @@ -940,11 +890,10 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param player The player to change the XP of + * @param player The player to change the XP of * @param skillType The skill to change the XP for - * @param xp The amount of XP to remove - * - * @throws InvalidSkillException if the given skill is not valid + * @param xp The amount of XP to remove + * @throws InvalidSkillException if the given skill is not valid * @throws UnsupportedOperationException if the given skill is a child skill */ public static void removeXP(Player player, String skillType, int xp) { @@ -957,11 +906,10 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param playerName The player to change the XP of - * @param skillType The skill to change the XP for - * @param xp The amount of XP to remove - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @param skillType The skill to change the XP for + * @param xp The amount of XP to remove + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ @Deprecated @@ -974,12 +922,11 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param uuid The player to change the XP of + * @param uuid The player to change the XP of * @param skillType The skill to change the XP for - * @param xp The amount of XP to remove - * - * @throws InvalidSkillException if the given skill is not valid - * @throws InvalidPlayerException if the given player does not exist in the database + * @param xp The amount of XP to remove + * @throws InvalidSkillException if the given skill is not valid + * @throws InvalidPlayerException if the given player does not exist in the database * @throws UnsupportedOperationException if the given skill is a child skill */ public static void removeXPOffline(UUID uuid, String skillType, int xp) { @@ -992,7 +939,6 @@ public final class ExperienceAPI { * This function is designed for API usage. * * @param level The level to get the amount of XP for - * * @throws InvalidFormulaTypeException if the given formulaType is not valid */ public static int getXpNeededToLevel(int level) { @@ -1004,9 +950,8 @@ public final class ExperienceAPI { *
* This function is designed for API usage. * - * @param level The level to get the amount of XP for + * @param level The level to get the amount of XP for * @param formulaType The formula type to get the amount of XP for - * * @throws InvalidFormulaTypeException if the given formulaType is not valid */ public static int getXpNeededToLevel(int level, String formulaType) { @@ -1015,17 +960,14 @@ public final class ExperienceAPI { /** * Will add the appropriate type of XP from the block to the player based on the material of the blocks given + * * @param blockStates the blocks to reward XP for * @param mcMMOPlayer the target player */ - public static void addXpFromBlocks(ArrayList blockStates, McMMOPlayer mcMMOPlayer) - { - for(BlockState bs : blockStates) - { - for(PrimarySkillType skillType : PrimarySkillType.values()) - { - if(ExperienceConfig.getInstance().getXp(skillType, bs.getType()) > 0) - { + public static void addXpFromBlocks(ArrayList blockStates, McMMOPlayer mcMMOPlayer) { + for (BlockState bs : blockStates) { + for (PrimarySkillType skillType : PrimarySkillType.values()) { + if (ExperienceConfig.getInstance().getXp(skillType, bs.getType()) > 0) { mcMMOPlayer.applyXpGain(skillType, ExperienceConfig.getInstance().getXp(skillType, bs.getType()), XPGainReason.PVE, XPGainSource.SELF); } } @@ -1034,16 +976,14 @@ public final class ExperienceAPI { /** * Will add the appropriate type of XP from the block to the player based on the material of the blocks given if it matches the given skillType + * * @param blockStates the blocks to reward XP for * @param mcMMOPlayer the target player - * @param skillType target primary skill + * @param skillType target primary skill */ - public static void addXpFromBlocksBySkill(ArrayList blockStates, McMMOPlayer mcMMOPlayer, PrimarySkillType skillType) - { - for(BlockState bs : blockStates) - { - if(ExperienceConfig.getInstance().getXp(skillType, bs.getType()) > 0) - { + public static void addXpFromBlocksBySkill(ArrayList blockStates, McMMOPlayer mcMMOPlayer, PrimarySkillType skillType) { + for (BlockState bs : blockStates) { + if (ExperienceConfig.getInstance().getXp(skillType, bs.getType()) > 0) { mcMMOPlayer.applyXpGain(skillType, ExperienceConfig.getInstance().getXp(skillType, bs.getType()), XPGainReason.PVE, XPGainSource.SELF); } } @@ -1051,15 +991,13 @@ public final class ExperienceAPI { /** * Will add the appropriate type of XP from the block to the player based on the material of the blocks given - * @param blockState The target blockstate + * + * @param blockState The target blockstate * @param mcMMOPlayer The target player */ - public static void addXpFromBlock(BlockState blockState, McMMOPlayer mcMMOPlayer) - { - for(PrimarySkillType skillType : PrimarySkillType.values()) - { - if(ExperienceConfig.getInstance().getXp(skillType, blockState.getType()) > 0) - { + public static void addXpFromBlock(BlockState blockState, McMMOPlayer mcMMOPlayer) { + for (PrimarySkillType skillType : PrimarySkillType.values()) { + if (ExperienceConfig.getInstance().getXp(skillType, blockState.getType()) > 0) { mcMMOPlayer.applyXpGain(skillType, ExperienceConfig.getInstance().getXp(skillType, blockState.getType()), XPGainReason.PVE, XPGainSource.SELF); } } @@ -1067,20 +1005,18 @@ public final class ExperienceAPI { /** * Will add the appropriate type of XP from the block to the player based on the material of the blocks given if it matches the given skillType - * @param blockState The target blockstate + * + * @param blockState The target blockstate * @param mcMMOPlayer The target player - * @param skillType target primary skill + * @param skillType target primary skill */ - public static void addXpFromBlockBySkill(BlockState blockState, McMMOPlayer mcMMOPlayer, PrimarySkillType skillType) - { - if(ExperienceConfig.getInstance().getXp(skillType, blockState.getType()) > 0) - { + public static void addXpFromBlockBySkill(BlockState blockState, McMMOPlayer mcMMOPlayer, PrimarySkillType skillType) { + if (ExperienceConfig.getInstance().getXp(skillType, blockState.getType()) > 0) { mcMMOPlayer.applyXpGain(skillType, ExperienceConfig.getInstance().getXp(skillType, blockState.getType()), XPGainReason.PVE, XPGainSource.SELF); } } - // Utility methods follow. private static void addOfflineXP(UUID playerUniqueId, PrimarySkillType skill, int XP) { PlayerProfile profile = getOfflineProfile(playerUniqueId); diff --git a/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java index ae0da4952..99c98ddc9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/PartyAPI.java @@ -1,20 +1,21 @@ package com.gmail.nossr50.core.api; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyLeader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.OfflinePlayer; import org.bukkit.entity.Player; import java.util.*; public final class PartyAPI { - private PartyAPI() {} + private PartyAPI() { + } /** * Get the name of the party a player is in. @@ -73,7 +74,7 @@ public final class PartyAPI { *
* This function is designed for API usage. * - * @param player The player to add to the party + * @param player The player to add to the party * @param partyName The party to add the player to * @deprecated parties can have limits, use the other method */ @@ -84,8 +85,7 @@ public final class PartyAPI { if (party == null) { party = new Party(new PartyLeader(player.getUniqueId(), player.getName()), partyName); } else { - if(PartyManager.isPartyFull(player, party)) - { + if (PartyManager.isPartyFull(player, party)) { NotificationManager.sendPlayerInformation(player, NotificationType.PARTY_MESSAGE, "Commands.Party.PartyFull", party.toString()); return; } @@ -97,10 +97,10 @@ public final class PartyAPI { /** * The max party size of the server * 0 or less for no size limit + * * @return the max party size on this server */ - public static int getMaxPartySize() - { + public static int getMaxPartySize() { return Config.getInstance().getPartyMaxSize(); } @@ -109,8 +109,8 @@ public final class PartyAPI { *
* This function is designed for API usage. * - * @param player The player to add to the party - * @param partyName The party to add the player to + * @param player The player to add to the party + * @param partyName The party to add the player to * @param bypassLimit if true bypasses party size limits */ public static void addToParty(Player player, String partyName, boolean bypassLimit) { @@ -151,7 +151,7 @@ public final class PartyAPI { *
* This function is designed for API usage. * - * @param partyName The name of the party to set the leader of + * @param partyName The name of the party to set the leader of * @param playerName The playerName to set as leader */ @Deprecated diff --git a/core/src/main/java/com/gmail/nossr50/core/api/SkillAPI.java b/core/src/main/java/com/gmail/nossr50/core/api/SkillAPI.java index 53a7eb5d1..8d8514ee3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/api/SkillAPI.java +++ b/core/src/main/java/com/gmail/nossr50/core/api/SkillAPI.java @@ -7,7 +7,8 @@ import java.util.Arrays; import java.util.List; public final class SkillAPI { - private SkillAPI() {} + private SkillAPI() { + } /** * Returns a list of strings with mcMMO's skills diff --git a/core/src/main/java/com/gmail/nossr50/core/chat/ChatManager.java b/core/src/main/java/com/gmail/nossr50/core/chat/ChatManager.java index 2cc23d292..92bfc7067 100644 --- a/core/src/main/java/com/gmail/nossr50/core/chat/ChatManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/chat/ChatManager.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.core.chat; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.party.Party; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.events.chat.McMMOChatEvent; import com.gmail.nossr50.events.chat.McMMOPartyChatEvent; -import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; @@ -40,24 +40,20 @@ public abstract class ChatManager { * Party Chat Spying * Party messages will be copied to people with the mcmmo.admin.chatspy permission node */ - if(event instanceof McMMOPartyChatEvent) - { + if (event instanceof McMMOPartyChatEvent) { //We need to grab the party chat name McMMOPartyChatEvent partyChatEvent = (McMMOPartyChatEvent) event; //Find the people with permissions - for(Player player : event.getPlugin().getServer().getOnlinePlayers()) - { + for (Player player : event.getPlugin().getServer().getOnlinePlayers()) { //Check for toggled players - if(UserManager.getPlayer(player).isPartyChatSpying()) - { + if (UserManager.getPlayer(player).isPartyChatSpying()) { Party adminParty = UserManager.getPlayer(player).getParty(); //Only message admins not part of this party - if(adminParty != null) - { + if (adminParty != null) { //TODO: Incorporate JSON - if(!adminParty.getName().equalsIgnoreCase(partyChatEvent.getParty())) + if (!adminParty.getName().equalsIgnoreCase(partyChatEvent.getParty())) player.sendMessage(LocaleLoader.getString("Commands.AdminChatSpy.Chat", partyChatEvent.getParty(), message)); } else { player.sendMessage(LocaleLoader.getString("Commands.AdminChatSpy.Chat", partyChatEvent.getParty(), message)); diff --git a/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java b/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java index 5c79f2687..da8410b73 100644 --- a/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/chat/PartyChatManager.java @@ -2,8 +2,8 @@ package com.gmail.nossr50.core.chat; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.party.Party; -import com.gmail.nossr50.events.chat.McMMOPartyChatEvent; import com.gmail.nossr50.core.runnables.party.PartyChatTask; +import com.gmail.nossr50.events.chat.McMMOPartyChatEvent; import org.bukkit.plugin.Plugin; public class PartyChatManager extends ChatManager { diff --git a/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java index 7c27e25f1..0d4b3ad23 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/experience/ExperienceConfig.java @@ -32,7 +32,8 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { } @Override - protected void loadKeys() {} + protected void loadKeys() { + } @Override protected boolean validateKeys() { @@ -142,59 +143,115 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { */ /* EXPLOIT TOGGLES */ - public boolean isEndermanEndermiteFarmingPrevented() { return config.getBoolean("ExploitFix.EndermanEndermiteFarms", true); } + public boolean isEndermanEndermiteFarmingPrevented() { + return config.getBoolean("ExploitFix.EndermanEndermiteFarms", 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); } + 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"); } + 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); } + 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); } + 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); } + 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())); } + 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); } + 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); } + 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); } + public double getExpModifier() { + return config.getDouble("Conversion.Exp_Modifier", 1); + } /* * XP SETTINGS */ /* General Settings */ - public boolean getExperienceGainsPlayerVersusPlayerEnabled() { return config.getBoolean("Experience.PVP.Rewards", true); } + public boolean getExperienceGainsPlayerVersusPlayerEnabled() { + return config.getBoolean("Experience.PVP.Rewards", true); + } /* Combat XP Multipliers */ - public double getCombatXP(EntityType entity) { return config.getDouble("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); } - public double getAnimalsXP(EntityType entity) { return config.getDouble("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_"), getAnimalsXP()); } - public double getAnimalsXP() { return config.getDouble("Experience.Combat.Multiplier.Animals", 1.0); } - public boolean hasCombatXP(EntityType entity) {return config.contains("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); } + public double getCombatXP(EntityType entity) { + return config.getDouble("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); + } + + public double getAnimalsXP(EntityType entity) { + return config.getDouble("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_"), getAnimalsXP()); + } + + public double getAnimalsXP() { + return config.getDouble("Experience.Combat.Multiplier.Animals", 1.0); + } + + public boolean hasCombatXP(EntityType entity) { + return config.contains("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); + } /* Materials */ - public int getXp(PrimarySkillType skill, Material data) - { + public int getXp(PrimarySkillType skill, Material data) { String baseString = "Experience." + StringUtils.getCapitalized(skill.toString()) + "."; String explicitString = baseString + StringUtils.getExplicitConfigMaterialString(data); if (config.contains(explicitString)) @@ -209,8 +266,7 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { } /* Materials */ - public int getXp(PrimarySkillType skill, BlockData data) - { + public int getXp(PrimarySkillType skill, BlockData data) { String baseString = "Experience." + StringUtils.getCapitalized(skill.toString()) + "."; String explicitString = baseString + StringUtils.getExplicitConfigBlockDataString(data); if (config.contains(explicitString)) @@ -224,8 +280,7 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { return 0; } - public boolean doesBlockGiveSkillXP(PrimarySkillType skill, Material data) - { + public boolean doesBlockGiveSkillXP(PrimarySkillType skill, Material data) { String baseString = "Experience." + StringUtils.getCapitalized(skill.toString()) + "."; String explicitString = baseString + StringUtils.getExplicitConfigMaterialString(data); if (config.contains(explicitString)) @@ -237,8 +292,7 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { return config.contains(wildcardString); } - public boolean doesBlockGiveSkillXP(PrimarySkillType skill, BlockData data) - { + public boolean doesBlockGiveSkillXP(PrimarySkillType skill, BlockData data) { String baseString = "Experience." + StringUtils.getCapitalized(skill.toString()) + "."; String explicitString = baseString + StringUtils.getExplicitConfigBlockDataString(data); if (config.contains(explicitString)) @@ -254,32 +308,35 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { * Experience Bar Stuff */ - public boolean isPartyExperienceBarsEnabled() - { + public boolean isPartyExperienceBarsEnabled() { return config.getBoolean("Experience_Bars.Update.Party", true); } - public boolean isPassiveGainsExperienceBarsEnabled() - { + public boolean isPassiveGainsExperienceBarsEnabled() { return config.getBoolean("Experience_Bars.Update.Passive", true); } - public boolean getDoExperienceBarsAlwaysUpdateTitle() - { + 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 boolean getAddExtraDetails() { + return config.getBoolean("Experience_Bars.ThisMayCauseLag.AlwaysUpdateTitlesWhenXPIsGained.ExtraDetails", false); + } - public BarColor getExperienceBarColor(PrimarySkillType primarySkillType) - { - String colorValueFromConfig = config.getString("Experience_Bars."+StringUtils.getCapitalized(primarySkillType.toString())+".Color"); + public boolean isExperienceBarsEnabled() { + return config.getBoolean("Experience_Bars.Enable", true); + } - for(BarColor barColor : BarColor.values()) - { - if(barColor.toString().equalsIgnoreCase(colorValueFromConfig)) + 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; } @@ -287,13 +344,11 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { return BarColor.WHITE; } - public BarStyle getExperienceBarStyle(PrimarySkillType primarySkillType) - { - String colorValueFromConfig = config.getString("Experience_Bars."+StringUtils.getCapitalized(primarySkillType.toString())+".BarStyle"); + 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)) + for (BarStyle barStyle : BarStyle.values()) { + if (barStyle.toString().equalsIgnoreCase(colorValueFromConfig)) return barStyle; } @@ -302,27 +357,47 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { } /* Acrobatics */ - public int getDodgeXPModifier() { return config.getInt("Experience.Acrobatics.Dodge", 120); } - public int getRollXPModifier() { return config.getInt("Experience.Acrobatics.Roll", 80); } - public int getFallXPModifier() { return config.getInt("Experience.Acrobatics.Fall", 120); } + public int getDodgeXPModifier() { + return config.getInt("Experience.Acrobatics.Dodge", 120); + } - public double getFeatherFallXPModifier() { return config.getDouble("Experience.Acrobatics.FeatherFall_Multiplier", 2.0); } + public int getRollXPModifier() { + return config.getInt("Experience.Acrobatics.Roll", 80); + } + + public int getFallXPModifier() { + return config.getInt("Experience.Acrobatics.Fall", 120); + } + + public double getFeatherFallXPModifier() { + return config.getDouble("Experience.Acrobatics.FeatherFall_Multiplier", 2.0); + } /* Alchemy */ - public double getPotionXP(PotionStage stage) { return config.getDouble("Experience.Alchemy.Potion_Stage_" + stage.toNumerical(), 10D); } + public double getPotionXP(PotionStage stage) { + return config.getDouble("Experience.Alchemy.Potion_Stage_" + stage.toNumerical(), 10D); + } /* Archery */ - public double getArcheryDistanceMultiplier() { return config.getDouble("Experience.Archery.Distance_Multiplier", 0.025); } + public double getArcheryDistanceMultiplier() { + return config.getDouble("Experience.Archery.Distance_Multiplier", 0.025); + } - public int getFishingShakeXP() { return config.getInt("Experience.Fishing.Shake", 50); } + public int getFishingShakeXP() { + return config.getInt("Experience.Fishing.Shake", 50); + } /* Repair */ - public double getRepairXPBase() { return config.getDouble("Experience.Repair.Base", 1000.0); } - public double getRepairXP(MaterialType repairMaterialType) { return config.getDouble("Experience.Repair." + StringUtils.getCapitalized(repairMaterialType.toString())); } + public double getRepairXPBase() { + return config.getDouble("Experience.Repair.Base", 1000.0); + } + + public double getRepairXP(MaterialType repairMaterialType) { + return config.getDouble("Experience.Repair." + StringUtils.getCapitalized(repairMaterialType.toString())); + } /* Taming */ - public int getTamingXP(EntityType type) - { + public int getTamingXP(EntityType type) { return config.getInt("Experience.Taming.Animal_Taming." + StringUtils.getPrettyEntityTypeString(type)); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java index 915fd6cfa..c5bbfa04e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomArmorConfig.java @@ -15,14 +15,12 @@ import java.util.List; import java.util.Set; public class CustomArmorConfig extends ConfigLoader { - private boolean needsUpdate = false; - - public List customBoots = new ArrayList(); + public List customBoots = new ArrayList(); public List customChestplates = new ArrayList(); - public List customHelmets = new ArrayList(); - public List customLeggings = new ArrayList(); - + public List customHelmets = new ArrayList(); + public List customLeggings = new ArrayList(); public List repairables = new ArrayList(); + private boolean needsUpdate = false; protected CustomArmorConfig(String fileName) { super("mods", fileName); diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java index 2c2afadc1..73bf3d0bb 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomBlockConfig.java @@ -11,17 +11,15 @@ import java.util.List; import java.util.Set; public class CustomBlockConfig extends ConfigLoader { - private boolean needsUpdate = false; - - public List customExcavationBlocks = new ArrayList<>(); - public List customHerbalismBlocks = new ArrayList<>(); - public List customMiningBlocks = new ArrayList<>(); - public List customOres = new ArrayList<>(); - public List customLogs = new ArrayList<>(); - public List customLeaves = new ArrayList<>(); - public List customAbilityBlocks = new ArrayList<>(); - + public List customExcavationBlocks = new ArrayList<>(); + public List customHerbalismBlocks = new ArrayList<>(); + public List customMiningBlocks = new ArrayList<>(); + public List customOres = new ArrayList<>(); + public List customLogs = new ArrayList<>(); + public List customLeaves = new ArrayList<>(); + public List customAbilityBlocks = new ArrayList<>(); public HashMap customBlockMap = new HashMap<>(); + private boolean needsUpdate = false; protected CustomBlockConfig(String fileName) { super("mods", fileName); @@ -84,12 +82,10 @@ public class CustomBlockConfig extends ConfigLoader { if (skillType.equals("Mining") && config.getBoolean(skillType + "." + blockName + ".Is_Ore")) { customOres.add(blockMaterial); smeltingXp = config.getInt(skillType + "." + blockName + ".Smelting_XP_Gain", xp / 10); - } - else if (skillType.equals("Woodcutting")) { + } else if (skillType.equals("Woodcutting")) { if (config.getBoolean(skillType + "." + blockName + ".Is_Log")) { customLogs.add(blockMaterial); - } - else { + } else { customLeaves.add(blockMaterial); xp = 0; // Leaves don't grant XP } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java index e0ebd99de..e4ad18bde 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomEntityConfig.java @@ -10,7 +10,7 @@ import java.util.HashMap; public class CustomEntityConfig extends ConfigLoader { public HashMap customEntityClassMap = new HashMap(); - public HashMap customEntityTypeMap = new HashMap(); + public HashMap customEntityTypeMap = new HashMap(); protected CustomEntityConfig(String fileName) { super("mods", fileName); @@ -30,8 +30,7 @@ public class CustomEntityConfig extends ConfigLoader { try { clazz = ClassUtils.getClass(className); - } - catch (ClassNotFoundException e) { + } catch (ClassNotFoundException e) { plugin.getLogger().warning("Invalid class (" + className + ") detected for " + entityName + "."); plugin.getLogger().warning("This custom entity may not function properly."); } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java index 1f3a429b0..5f859ae85 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/mods/CustomToolConfig.java @@ -17,18 +17,15 @@ import java.util.List; import java.util.Set; public class CustomToolConfig extends ConfigLoader { - private boolean needsUpdate = false; - - public List customAxes = new ArrayList(); - public List customBows = new ArrayList(); - public List customHoes = new ArrayList(); + public List customAxes = new ArrayList(); + public List customBows = new ArrayList(); + public List customHoes = new ArrayList(); public List customPickaxes = new ArrayList(); - public List customShovels = new ArrayList(); - public List customSwords = new ArrayList(); - + public List customShovels = new ArrayList(); + public List customSwords = new ArrayList(); public HashMap customToolMap = new HashMap(); - public List repairables = new ArrayList(); + private boolean needsUpdate = false; protected CustomToolConfig(String fileName) { super("mods", fileName); diff --git a/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java index df57b7d32..793ea2434 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/party/ItemWeightConfig.java @@ -39,5 +39,6 @@ public class ItemWeightConfig extends ConfigLoader { } @Override - protected void loadKeys() {} + protected void loadKeys() { + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/AdvancedConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/AdvancedConfig.java index 13dc1a48e..6e4dd5155 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/AdvancedConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/AdvancedConfig.java @@ -131,8 +131,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { } /* AXES */ - if(getAxeMasteryRankDamageMultiplier() < 0) - { + if (getAxeMasteryRankDamageMultiplier() < 0) { reason.add("Skills.Axes.AxeMastery.RankDamageMultiplier should be at least 0!"); } @@ -645,18 +644,22 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { } @Override - protected void loadKeys() {} + protected void loadKeys() { + } /* GENERAL */ - public int getStartingLevel() { return config.getInt("Skills.General.StartingLevel", 1); } + public int getStartingLevel() { + return config.getInt("Skills.General.StartingLevel", 1); + } /** * This returns the maximum level at which superabilities will stop lengthening from scaling alongside skill level. * It returns a different value depending on whether or not the server is in retro mode + * * @return the level at which abilities stop increasing in length */ public int getAbilityLengthCap() { - if(!mcMMO.isRetroModeEnabled()) + if (!mcMMO.isRetroModeEnabled()) return config.getInt("Skills.General.Ability.Length.Standard.CapLevel", 50); else return config.getInt("Skills.General.Ability.Length.RetroMode.CapLevel", 500); @@ -665,27 +668,31 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { /** * This returns the frequency at which abilities will increase in length * It returns a different value depending on whether or not the server is in retro mode + * * @return the number of levels required per ability length increase */ public int getAbilityLength() { - if(!mcMMO.isRetroModeEnabled()) + if (!mcMMO.isRetroModeEnabled()) return config.getInt("Skills.General.Ability.Length.Standard.IncreaseLevel", 5); else return config.getInt("Skills.General.Ability.Length.RetroMode.IncreaseLevel", 50); } - public int getEnchantBuff() { return config.getInt("Skills.General.Ability.EnchantBuff", 5); } + public int getEnchantBuff() { + return config.getInt("Skills.General.Ability.EnchantBuff", 5); + } /** * Grabs the max bonus level for a skill used in RNG calculations * All max level values in the config are multiplied by 10 if the server is in retro mode as the values in the config are based around the new 1-100 skill system scaling * A value of 10 in the file will be returned as 100 for retro mode servers to accommodate the change in scaling + * * @param subSkillType target subskill * @return the level at which this skills max benefits will be reached on the curve */ public int getMaxBonusLevel(SubSkillType subSkillType) { String keyPath = subSkillType.getAdvConfigAddress() + ".MaxBonusLevel."; - return mcMMO.isRetroModeEnabled() ? config.getInt(keyPath+"RetroMode", 1000) : config.getInt(keyPath+"Standard", 100); + return mcMMO.isRetroModeEnabled() ? config.getInt(keyPath + "RetroMode", 1000) : config.getInt(keyPath + "Standard", 100); } public int getMaxBonusLevel(AbstractSubSkill abstractSubSkill) { @@ -698,30 +705,25 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { return maximumProbability; } - public double getMaximumProbability(AbstractSubSkill abstractSubSkill) - { + public double getMaximumProbability(AbstractSubSkill abstractSubSkill) { return getMaximumProbability(abstractSubSkill.getSubSkillType()); } /* Notification Settings */ - public boolean doesSkillCommandSendBlankLines() - { + public boolean doesSkillCommandSendBlankLines() { return config.getBoolean("Feedback.SkillCommand.BlankLinesAboveHeader", true); } - public boolean doesNotificationUseActionBar(NotificationType notificationType) - { - return config.getBoolean("Feedback.ActionBarNotifications."+notificationType.toString()+".Enabled", true); + public boolean doesNotificationUseActionBar(NotificationType notificationType) { + return config.getBoolean("Feedback.ActionBarNotifications." + notificationType.toString() + ".Enabled", true); } - public boolean doesNotificationSendCopyToChat(NotificationType notificationType) - { - return config.getBoolean("Feedback.ActionBarNotifications."+notificationType.toString()+".SendCopyOfMessageToChat", false); + public boolean doesNotificationSendCopyToChat(NotificationType notificationType) { + return config.getBoolean("Feedback.ActionBarNotifications." + notificationType.toString() + ".SendCopyOfMessageToChat", false); } - public boolean useTitlesForXPEvent() - { + public boolean useTitlesForXPEvent() { return config.getBoolean("Feedback.Events.XP.SendTitles", true); } @@ -740,6 +742,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { /** * Used to color our details header in our JSON Hover Object tooltips + * * @return the ChatColor for this element */ /*public ChatColor getJSONStatHoverDetailsColor() @@ -788,7 +791,6 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { { return getChatColor(config.getString("Style.JSON.Notification."+notificationType.toString()+".Color")); }*/ - private ChatColor getChatColorFromKey(String keyLocation) { String colorName = config.getString(keyLocation); @@ -829,180 +831,365 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { /** * Some SubSkills have the ability to retain classic functionality + * * @param subSkillType SubSkillType with classic functionality * @return true if the subskill is in classic mode */ - public boolean isSubSkillClassic(SubSkillType subSkillType) - { - return config.getBoolean(subSkillType.getAdvConfigAddress()+".Classic"); + public boolean isSubSkillClassic(SubSkillType subSkillType) { + return config.getBoolean(subSkillType.getAdvConfigAddress() + ".Classic"); } /* ACROBATICS */ - public double getDodgeDamageModifier() { return config.getDouble("Skills.Acrobatics.Dodge.DamageModifier", 2.0D); } + public double getDodgeDamageModifier() { + return config.getDouble("Skills.Acrobatics.Dodge.DamageModifier", 2.0D); + } - public double getRollDamageThreshold() { return config.getDouble("Skills.Acrobatics.Roll.DamageThreshold", 7.0D); } + public double getRollDamageThreshold() { + return config.getDouble("Skills.Acrobatics.Roll.DamageThreshold", 7.0D); + } - public double getGracefulRollDamageThreshold() { return config.getDouble("Skills.Acrobatics.GracefulRoll.DamageThreshold", 14.0D); } + public double getGracefulRollDamageThreshold() { + return config.getDouble("Skills.Acrobatics.GracefulRoll.DamageThreshold", 14.0D); + } /* ALCHEMY */ /*public int getCatalysisUnlockLevel() { return config.getInt("Skills.Alchemy.Catalysis.UnlockLevel", 100); }*/ - public int getCatalysisMaxBonusLevel() { return config.getInt("Skills.Alchemy.Catalysis.MaxBonusLevel", 1000); } + public int getCatalysisMaxBonusLevel() { + return config.getInt("Skills.Alchemy.Catalysis.MaxBonusLevel", 1000); + } - public double getCatalysisMinSpeed() { return config.getDouble("Skills.Alchemy.Catalysis.MinSpeed", 1.0D); } - public double getCatalysisMaxSpeed() { return config.getDouble("Skills.Alchemy.Catalysis.MaxSpeed", 4.0D); } + public double getCatalysisMinSpeed() { + return config.getDouble("Skills.Alchemy.Catalysis.MinSpeed", 1.0D); + } + + public double getCatalysisMaxSpeed() { + return config.getDouble("Skills.Alchemy.Catalysis.MaxSpeed", 4.0D); + } //public int getConcoctionsTierLevel(Alchemy.Tier tier) { return config.getInt("Skills.Alchemy.Rank_Levels.Rank_" + rank); } /* ARCHERY */ - public double getSkillShotRankDamageMultiplier() { return config.getDouble("Skills.Archery.SkillShot.RankDamageMultiplier", 10.0D); } - public double getSkillShotDamageMax() { return config.getDouble("Skills.Archery.SkillShot.MaxDamage", 9.0D); } + public double getSkillShotRankDamageMultiplier() { + return config.getDouble("Skills.Archery.SkillShot.RankDamageMultiplier", 10.0D); + } - public double getDazeBonusDamage() { return config.getDouble("Skills.Archery.Daze.BonusDamage", 4.0D); } + public double getSkillShotDamageMax() { + return config.getDouble("Skills.Archery.SkillShot.MaxDamage", 9.0D); + } - public double getForceMultiplier() { return config.getDouble("Skills.Archery.ForceMultiplier", 2.0D); } + public double getDazeBonusDamage() { + return config.getDouble("Skills.Archery.Daze.BonusDamage", 4.0D); + } + + public double getForceMultiplier() { + return config.getDouble("Skills.Archery.ForceMultiplier", 2.0D); + } /* AXES */ - public double getAxeMasteryRankDamageMultiplier() { return config.getDouble("Skills.Axes.AxeMastery.RankDamageMultiplier", 1.0D); } + public double getAxeMasteryRankDamageMultiplier() { + return config.getDouble("Skills.Axes.AxeMastery.RankDamageMultiplier", 1.0D); + } - public double getCriticalStrikesPVPModifier() { return config.getDouble("Skills.Axes.CriticalStrikes.PVP_Modifier", 1.5D); } - public double getCriticalStrikesPVEModifier() { return config.getDouble("Skills.Axes.CriticalStrikes.PVE_Modifier", 2.0D); } + public double getCriticalStrikesPVPModifier() { + return config.getDouble("Skills.Axes.CriticalStrikes.PVP_Modifier", 1.5D); + } - public double getGreaterImpactChance() { return config.getDouble("Skills.Axes.GreaterImpact.Chance", 25.0D); } - public double getGreaterImpactModifier() { return config.getDouble("Skills.Axes.GreaterImpact.KnockbackModifier", 1.5D); } - public double getGreaterImpactBonusDamage() { return config.getDouble("Skills.Axes.GreaterImpact.BonusDamage", 2.0D); } + public double getCriticalStrikesPVEModifier() { + return config.getDouble("Skills.Axes.CriticalStrikes.PVE_Modifier", 2.0D); + } + + public double getGreaterImpactChance() { + return config.getDouble("Skills.Axes.GreaterImpact.Chance", 25.0D); + } + + public double getGreaterImpactModifier() { + return config.getDouble("Skills.Axes.GreaterImpact.KnockbackModifier", 1.5D); + } + + public double getGreaterImpactBonusDamage() { + return config.getDouble("Skills.Axes.GreaterImpact.BonusDamage", 2.0D); + } public int getArmorImpactIncreaseLevel() { int increaseLevel = config.getInt("Skills.Axes.ArmorImpact.IncreaseLevel", 5); - if(mcMMO.isRetroModeEnabled()) + if (mcMMO.isRetroModeEnabled()) return increaseLevel * 10; return increaseLevel; } - public double getImpactChance() { return config.getDouble("Skills.Axes.ArmorImpact.Chance", 25.0D); } - public double getArmorImpactMaxDurabilityDamage() { return config.getDouble("Skills.Axes.ArmorImpact.MaxPercentageDurabilityDamage", 20.0D); } + public double getImpactChance() { + return config.getDouble("Skills.Axes.ArmorImpact.Chance", 25.0D); + } - public double getSkullSplitterModifier() { return config.getDouble("Skills.Axes.SkullSplitter.DamageModifier", 2.0D); } + public double getArmorImpactMaxDurabilityDamage() { + return config.getDouble("Skills.Axes.ArmorImpact.MaxPercentageDurabilityDamage", 20.0D); + } + + public double getSkullSplitterModifier() { + return config.getDouble("Skills.Axes.SkullSplitter.DamageModifier", 2.0D); + } /* EXCAVATION */ //Nothing to configure, everything is already configurable in config.yml /* FISHING */ //public int getFishingTierLevel(int rank) { return config.getInt("Skills.Fishing.Rank_Levels.Rank_" + rank); } - public double getShakeChance(int rank) { return config.getDouble("Skills.Fishing.ShakeChance.Rank_" + rank); } - public int getFishingVanillaXPModifier(int rank) { return config.getInt("Skills.Fishing.VanillaXPMultiplier.Rank_" + rank); } + public double getShakeChance(int rank) { + return config.getDouble("Skills.Fishing.ShakeChance.Rank_" + rank); + } - public int getFishermanDietRankChange() { return config.getInt("Skills.Fishing.FishermansDiet.RankChange", 200); } + public int getFishingVanillaXPModifier(int rank) { + return config.getInt("Skills.Fishing.VanillaXPMultiplier.Rank_" + rank); + } + + public int getFishermanDietRankChange() { + return config.getInt("Skills.Fishing.FishermansDiet.RankChange", 200); + } /*public int getIceFishingUnlockLevel() { return config.getInt("Skills.Fishing.IceFishing.UnlockLevel", 50); } public int getMasterAnglerUnlockLevel() {return config.getInt("Skills.Fishing.MasterAngler.UnlockLevel", 125); }*/ - public double getMasterAnglerBoatModifier() {return config.getDouble("Skills.Fishing.MasterAngler.BoatModifier", 2.0); } - public double getMasterAnglerBiomeModifier() {return config.getDouble("Skills.Fishing.MasterAngler.BiomeModifier", 2.0); } + public double getMasterAnglerBoatModifier() { + return config.getDouble("Skills.Fishing.MasterAngler.BoatModifier", 2.0); + } + + public double getMasterAnglerBiomeModifier() { + return config.getDouble("Skills.Fishing.MasterAngler.BiomeModifier", 2.0); + } /* HERBALISM */ - public int getFarmerDietRankChange() { return config.getInt("Skills.Herbalism.FarmersDiet.RankChange", 200); } + public int getFarmerDietRankChange() { + return config.getInt("Skills.Herbalism.FarmersDiet.RankChange", 200); + } - public int getGreenThumbStageChange() { return config.getInt("Skills.Herbalism.GreenThumb.StageChange", 200); } + public int getGreenThumbStageChange() { + return config.getInt("Skills.Herbalism.GreenThumb.StageChange", 200); + } /* MINING */ - public int getBlastMiningRankLevel(int rank) { return config.getInt("Skills.Mining.BlastMining.Rank_Levels.Rank_" + rank); } - public double getBlastDamageDecrease(int rank) { return config.getDouble("Skills.Mining.BlastMining.BlastDamageDecrease.Rank_" + rank); } - public double getOreBonus(int rank) { return config.getDouble("Skills.Mining.BlastMining.OreBonus.Rank_" + rank); } - public double getDebrisReduction(int rank) { return config.getDouble("Skills.Mining.BlastMining.DebrisReduction.Rank_" + rank); } - public int getDropMultiplier(int rank) { return config.getInt("Skills.Mining.BlastMining.DropMultiplier.Rank_" + rank); } - public double getBlastRadiusModifier(int rank) { return config.getDouble("Skills.Mining.BlastMining.BlastRadiusModifier.Rank_" + rank); } + public int getBlastMiningRankLevel(int rank) { + return config.getInt("Skills.Mining.BlastMining.Rank_Levels.Rank_" + rank); + } + + public double getBlastDamageDecrease(int rank) { + return config.getDouble("Skills.Mining.BlastMining.BlastDamageDecrease.Rank_" + rank); + } + + public double getOreBonus(int rank) { + return config.getDouble("Skills.Mining.BlastMining.OreBonus.Rank_" + rank); + } + + public double getDebrisReduction(int rank) { + return config.getDouble("Skills.Mining.BlastMining.DebrisReduction.Rank_" + rank); + } + + public int getDropMultiplier(int rank) { + return config.getInt("Skills.Mining.BlastMining.DropMultiplier.Rank_" + rank); + } + + public double getBlastRadiusModifier(int rank) { + return config.getDouble("Skills.Mining.BlastMining.BlastRadiusModifier.Rank_" + rank); + } /* REPAIR */ - public double getRepairMasteryMaxBonus() { return config.getDouble("Skills.Repair.RepairMastery.MaxBonusPercentage", 200.0D); } - public int getRepairMasteryMaxLevel() { return config.getInt("Skills.Repair.RepairMastery.MaxBonusLevel", 100); } + public double getRepairMasteryMaxBonus() { + return config.getDouble("Skills.Repair.RepairMastery.MaxBonusPercentage", 200.0D); + } + + public int getRepairMasteryMaxLevel() { + return config.getInt("Skills.Repair.RepairMastery.MaxBonusLevel", 100); + } /* Arcane Forging */ //public int getArcaneForgingRankLevel(int rank) { return config.getInt("Skills.Repair.ArcaneForging.Rank_Levels.Rank_" + rank); } - public boolean getArcaneForgingEnchantLossEnabled() { return config.getBoolean("Skills.Repair.ArcaneForging.May_Lose_Enchants", true); } - public double getArcaneForgingKeepEnchantsChance(int rank) { return config.getDouble("Skills.Repair.ArcaneForging.Keep_Enchants_Chance.Rank_" + rank); } + public boolean getArcaneForgingEnchantLossEnabled() { + return config.getBoolean("Skills.Repair.ArcaneForging.May_Lose_Enchants", true); + } - public boolean getArcaneForgingDowngradeEnabled() { return config.getBoolean("Skills.Repair.ArcaneForging.Downgrades_Enabled", true); } - public double getArcaneForgingDowngradeChance(int rank) { return config.getDouble("Skills.Repair.ArcaneForging.Downgrades_Chance.Rank_" + rank); } + public double getArcaneForgingKeepEnchantsChance(int rank) { + return config.getDouble("Skills.Repair.ArcaneForging.Keep_Enchants_Chance.Rank_" + rank); + } + + public boolean getArcaneForgingDowngradeEnabled() { + return config.getBoolean("Skills.Repair.ArcaneForging.Downgrades_Enabled", true); + } + + public double getArcaneForgingDowngradeChance(int rank) { + return config.getDouble("Skills.Repair.ArcaneForging.Downgrades_Chance.Rank_" + rank); + } /* SALVAGE */ //public double getSalvageMaxPercentage() { return config.getDouble("Skills.Salvage.MaxPercentage", 100.0D); } //public int getSalvageMaxPercentageLevel() { return config.getInt("Skills.Salvage.MaxPercentageLevel", 1000); } - public boolean getArcaneSalvageEnchantDowngradeEnabled() { return config.getBoolean("Skills.Salvage.ArcaneSalvage.EnchantDowngradeEnabled", true); } - public boolean getArcaneSalvageEnchantLossEnabled() { return config.getBoolean("Skills.Salvage.ArcaneSalvage.EnchantLossEnabled", true); } + public boolean getArcaneSalvageEnchantDowngradeEnabled() { + return config.getBoolean("Skills.Salvage.ArcaneSalvage.EnchantDowngradeEnabled", true); + } + + public boolean getArcaneSalvageEnchantLossEnabled() { + return config.getBoolean("Skills.Salvage.ArcaneSalvage.EnchantLossEnabled", true); + } //public int getArcaneSalvageRankLevel(int rank) { return config.getInt("Skills.Salvage.ArcaneSalvage.Rank_Levels.Rank_" + rank); } - public double getArcaneSalvageExtractFullEnchantsChance(int rank) { return config.getDouble("Skills.Salvage.ArcaneSalvage.ExtractFullEnchant.Rank_" + rank); } - public double getArcaneSalvageExtractPartialEnchantsChance(int rank) { return config.getDouble("Skills.Salvage.ArcaneSalvage.ExtractPartialEnchant.Rank_" + rank); } + public double getArcaneSalvageExtractFullEnchantsChance(int rank) { + return config.getDouble("Skills.Salvage.ArcaneSalvage.ExtractFullEnchant.Rank_" + rank); + } + + public double getArcaneSalvageExtractPartialEnchantsChance(int rank) { + return config.getDouble("Skills.Salvage.ArcaneSalvage.ExtractPartialEnchant.Rank_" + rank); + } /* SMELTING */ - public int getBurnModifierMaxLevel() { return config.getInt("Skills.Smelting.FuelEfficiency.MaxBonusLevel", 100); } - public double getBurnTimeMultiplier() { return config.getDouble("Skills.Smelting.FuelEfficiency.Multiplier", 3.0D); } + public int getBurnModifierMaxLevel() { + return config.getInt("Skills.Smelting.FuelEfficiency.MaxBonusLevel", 100); + } + + public double getBurnTimeMultiplier() { + return config.getDouble("Skills.Smelting.FuelEfficiency.Multiplier", 3.0D); + } /*public int getFluxMiningUnlockLevel() { return config.getInt("Skills.Smelting.FluxMining.UnlockLevel", 250); }*/ - public double getFluxMiningChance() { return config.getDouble("Skills.Smelting.FluxMining.Chance", 33.0D); } + public double getFluxMiningChance() { + return config.getDouble("Skills.Smelting.FluxMining.Chance", 33.0D); + } - public int getSmeltingRankLevel(int rank) { return config.getInt("Skills.Smelting.Rank_Levels.Rank_" + rank); } + public int getSmeltingRankLevel(int rank) { + return config.getInt("Skills.Smelting.Rank_Levels.Rank_" + rank); + } - public int getSmeltingVanillaXPBoostMultiplier(int rank) { return config.getInt("Skills.Smelting.VanillaXPMultiplier.Rank_" + rank); } + public int getSmeltingVanillaXPBoostMultiplier(int rank) { + return config.getInt("Skills.Smelting.VanillaXPMultiplier.Rank_" + rank); + } /* SWORDS */ - public double getRuptureDamagePlayer() { return config.getDouble("Skills.Swords.Rupture.DamagePlayer", 1.0); } - public double getRuptureDamageMobs() { return config.getDouble("Skills.Swords.Rupture.DamageMobs", 2.0); } + public double getRuptureDamagePlayer() { + return config.getDouble("Skills.Swords.Rupture.DamagePlayer", 1.0); + } - public int getRuptureMaxTicks() { return config.getInt("Skills.Swords.Rupture.MaxTicks", 8); } - public int getRuptureBaseTicks() { return config.getInt("Skills.Swords.Rupture.BaseTicks", 2); } + public double getRuptureDamageMobs() { + return config.getDouble("Skills.Swords.Rupture.DamageMobs", 2.0); + } - public double getCounterModifier() { return config.getDouble("Skills.Swords.CounterAttack.DamageModifier", 2.0D); } + public int getRuptureMaxTicks() { + return config.getInt("Skills.Swords.Rupture.MaxTicks", 8); + } - public double getSerratedStrikesModifier() { return config.getDouble("Skills.Swords.SerratedStrikes.DamageModifier", 4.0D); } - public int getSerratedStrikesTicks() { return config.getInt("Skills.Swords.SerratedStrikes.RuptureTicks", 5); } + public int getRuptureBaseTicks() { + return config.getInt("Skills.Swords.Rupture.BaseTicks", 2); + } + + public double getCounterModifier() { + return config.getDouble("Skills.Swords.CounterAttack.DamageModifier", 2.0D); + } + + public double getSerratedStrikesModifier() { + return config.getDouble("Skills.Swords.SerratedStrikes.DamageModifier", 4.0D); + } + + public int getSerratedStrikesTicks() { + return config.getInt("Skills.Swords.SerratedStrikes.RuptureTicks", 5); + } /* TAMING */ //public int getGoreRuptureTicks() { return config.getInt("Skills.Taming.Gore.RuptureTicks", 2); } - public double getGoreModifier() { return config.getDouble("Skills.Taming.Gore.Modifier", 2.0D); } + public double getGoreModifier() { + return config.getDouble("Skills.Taming.Gore.Modifier", 2.0D); + } /*public int getFastFoodUnlock() { return config.getInt("Skills.Taming.FastFood.UnlockLevel", 50); }*/ - public double getFastFoodChance() { return config.getDouble("Skills.Taming.FastFoodService.Chance", 50.0D); } - public double getPummelChance() { return config.getDouble("Skills.Taming.Pummel.Chance", 10.0D); } + public double getFastFoodChance() { + return config.getDouble("Skills.Taming.FastFoodService.Chance", 50.0D); + } + + public double getPummelChance() { + return config.getDouble("Skills.Taming.Pummel.Chance", 10.0D); + } //public int getEnviromentallyAwareUnlock() { return config.getInt("Skills.Taming.EnvironmentallyAware.UnlockLevel", 100); } /*public int getThickFurUnlock() { return config.getInt("Skills.Taming.ThickFur.UnlockLevel", 250); }*/ - public double getThickFurModifier() { return config.getDouble("Skills.Taming.ThickFur.Modifier", 2.0D); } + public double getThickFurModifier() { + return config.getDouble("Skills.Taming.ThickFur.Modifier", 2.0D); + } /*public int getHolyHoundUnlock() {return config.getInt("Skills.Taming.HolyHound.UnlockLevel", 375); }*/ /*public int getShockProofUnlock() { return config.getInt("Skills.Taming.ShockProof.UnlockLevel", 500); }*/ - public double getShockProofModifier() { return config.getDouble("Skills.Taming.ShockProof.Modifier", 6.0D); } + public double getShockProofModifier() { + return config.getDouble("Skills.Taming.ShockProof.Modifier", 6.0D); + } /*public int getSharpenedClawsUnlock() { return config.getInt("Skills.Taming.SharpenedClaws.UnlockLevel", 750); }*/ - public double getSharpenedClawsBonus() { return config.getDouble("Skills.Taming.SharpenedClaws.Bonus", 2.0D); } + public double getSharpenedClawsBonus() { + return config.getDouble("Skills.Taming.SharpenedClaws.Bonus", 2.0D); + } - public double getMinHorseJumpStrength() { return config.getDouble("Skills.Taming.CallOfTheWild.MinHorseJumpStrength", 0.7D); } - public double getMaxHorseJumpStrength() { return config.getDouble("Skills.Taming.CallOfTheWild.MaxHorseJumpStrength", 2.0D); } + public double getMinHorseJumpStrength() { + return config.getDouble("Skills.Taming.CallOfTheWild.MinHorseJumpStrength", 0.7D); + } + + public double getMaxHorseJumpStrength() { + return config.getDouble("Skills.Taming.CallOfTheWild.MaxHorseJumpStrength", 2.0D); + } /* UNARMED */ - public boolean getDisarmProtected() { return config.getBoolean("Skills.Unarmed.Disarm.AntiTheft", false); } + public boolean getDisarmProtected() { + return config.getBoolean("Skills.Unarmed.Disarm.AntiTheft", false); + } /* WOODCUTTING */ /*public int getLeafBlowUnlockLevel() { return config.getInt("Skills.Woodcutting.LeafBlower.UnlockLevel", 100); }*/ /* KRAKEN STUFF */ - public boolean getKrakenEnabled() { return config.getBoolean("Kraken.Enabled", true); } - public int getKrakenTriesBeforeRelease() { return config.getInt("Kraken.Tries_Before_Release", 50); } - public double getKrakenHealth() { return config.getDouble("Kraken.Health", 50.0D); } - public String getKrakenName() { return config.getString("Kraken.Name", "The Kraken"); } - public int getKrakenAttackInterval() { return config.getInt("Kraken.Attack_Interval_Seconds", 1); } - public double getKrakenAttackDamage() { return config.getDouble("Kraken.Attack_Damage", 1.0D); } - public boolean getKrakenGlobalEffectsEnabled() { return config.getBoolean("Kraken.Global_Effects", false); } - public boolean getKrakenEscapeAllowed() { return config.getBoolean("Kraken.Allow_Escaping", false); } - public String getServerUnleashMessage() { return config.getString("Kraken.Unleashed_Message.Server", ""); } - public String getPlayerUnleashMessage() { return config.getString("Kraken.Unleashed_Message.Player", ""); } - public String getPlayerDefeatMessage() { return config.getString("Kraken.Defeated_Message.Killed", ""); } - public String getPlayerEscapeMessage() { return config.getString("Kraken.Defeated_Message.Escape", ""); } + public boolean getKrakenEnabled() { + return config.getBoolean("Kraken.Enabled", true); + } + + public int getKrakenTriesBeforeRelease() { + return config.getInt("Kraken.Tries_Before_Release", 50); + } + + public double getKrakenHealth() { + return config.getDouble("Kraken.Health", 50.0D); + } + + public String getKrakenName() { + return config.getString("Kraken.Name", "The Kraken"); + } + + public int getKrakenAttackInterval() { + return config.getInt("Kraken.Attack_Interval_Seconds", 1); + } + + public double getKrakenAttackDamage() { + return config.getDouble("Kraken.Attack_Damage", 1.0D); + } + + public boolean getKrakenGlobalEffectsEnabled() { + return config.getBoolean("Kraken.Global_Effects", false); + } + + public boolean getKrakenEscapeAllowed() { + return config.getBoolean("Kraken.Allow_Escaping", false); + } + + public String getServerUnleashMessage() { + return config.getString("Kraken.Unleashed_Message.Server", ""); + } + + public String getPlayerUnleashMessage() { + return config.getString("Kraken.Unleashed_Message.Player", ""); + } + + public String getPlayerDefeatMessage() { + return config.getString("Kraken.Defeated_Message.Killed", ""); + } + + public String getPlayerEscapeMessage() { + return config.getString("Kraken.Defeated_Message.Escape", ""); + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/AutoUpdateConfigLoader.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/AutoUpdateConfigLoader.java index 09f32b1e2..da46aa542 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/AutoUpdateConfigLoader.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/AutoUpdateConfigLoader.java @@ -73,16 +73,15 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader { while ((line = reader.readLine()) != null) { if (line.contains("#")) { temp += line + "\n"; - } - else if (line.contains(":")) { + } else if (line.contains(":")) { line = line.substring(0, line.indexOf(":") + 1); if (!temp.isEmpty()) { - if(comments.containsKey(line)) { + if (comments.containsKey(line)) { int index = 0; - while(comments.containsKey(line + index)) { + while (comments.containsKey(line + index)) { index++; } - + line = line + index; } @@ -98,7 +97,7 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader { String actualkey = key.substring(0, key.indexOf(":") + 1); int index = 0; - if(indexed.containsKey(actualkey)) { + if (indexed.containsKey(actualkey)) { index = indexed.get(actualkey); } boolean isAtTop = !output.contains("\n" + actualkey); @@ -109,8 +108,7 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader { indexed.put(actualkey, index + comments.get(key).length() + actualkey.length() + 1); } } - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); } @@ -126,8 +124,7 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader { writer.write(output); writer.flush(); writer.close(); - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/Config.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/Config.java index 6fea3abc7..50aeb0b10 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/Config.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/Config.java @@ -246,104 +246,279 @@ public class Config extends AutoUpdateConfigLoader { */ /* General Settings */ - public boolean getIsMetricsEnabled() { return config.getBoolean("Metrics.bstats", true); } + public boolean getIsMetricsEnabled() { + return config.getBoolean("Metrics.bstats", true); + } //Retro mode will default the value to true if the config file doesn't contain the entry (server is from a previous mcMMO install) - public boolean getIsRetroMode() { return config.getBoolean("General.RetroMode.Enabled", true); } + public boolean getIsRetroMode() { + return config.getBoolean("General.RetroMode.Enabled", true); + } - public String getLocale() { return config.getString("General.Locale", "en_us"); } - public boolean getMOTDEnabled() { return config.getBoolean("General.MOTD_Enabled", true); } - public boolean getShowProfileLoadedMessage() { return config.getBoolean("General.Show_Profile_Loaded", true); } - public boolean getDonateMessageEnabled() { return config.getBoolean("Commands.mcmmo.Donate_Message", true); } - public int getSaveInterval() { return config.getInt("General.Save_Interval", 10); } - public boolean getStatsTrackingEnabled() { return config.getBoolean("General.Stats_Tracking", true); } - public boolean getUpdateCheckEnabled() { return config.getBoolean("General.Update_Check", true); } - public boolean getPreferBeta() { return config.getBoolean("General.Prefer_Beta", false); } - public boolean getVerboseLoggingEnabled() { return config.getBoolean("General.Verbose_Logging", false); } + public String getLocale() { + return config.getString("General.Locale", "en_us"); + } - public String getPartyChatPrefix() { return config.getString("Commands.partychat.Chat_Prefix_Format", "[[GREEN]]([[WHITE]]{0}[[GREEN]])"); } - public boolean getPartyChatColorLeaderName() { return config.getBoolean("Commands.partychat.Gold_Leader_Name", true); } - public boolean getPartyDisplayNames() { return config.getBoolean("Commands.partychat.Use_Display_Names", true); } - public String getPartyChatPrefixAlly() { return config.getString("Commands.partychat.Chat_Prefix_Format_Ally", "[[GREEN]](A)[[RESET]]"); } + public boolean getMOTDEnabled() { + return config.getBoolean("General.MOTD_Enabled", true); + } - public String getAdminChatPrefix() { return config.getString("Commands.adminchat.Chat_Prefix_Format", "[[AQUA]][[[WHITE]]{0}[[AQUA]]]"); } - public boolean getAdminDisplayNames() { return config.getBoolean("Commands.adminchat.Use_Display_Names", true); } + public boolean getShowProfileLoadedMessage() { + return config.getBoolean("General.Show_Profile_Loaded", true); + } - public boolean getMatchOfflinePlayers() { return config.getBoolean("Commands.Generic.Match_OfflinePlayers", false); } - public long getDatabasePlayerCooldown() { return config.getLong("Commands.Database.Player_Cooldown", 1750); } + public boolean getDonateMessageEnabled() { + return config.getBoolean("Commands.mcmmo.Donate_Message", true); + } - public boolean getLevelUpSoundsEnabled() { return config.getBoolean("General.LevelUp_Sounds", true); } - public boolean getRefreshChunksEnabled() { return config.getBoolean("General.Refresh_Chunks", false); } + public int getSaveInterval() { + return config.getInt("General.Save_Interval", 10); + } - public boolean getMobHealthbarEnabled() { return config.getBoolean("Mob_Healthbar.Enabled", true); } + public boolean getStatsTrackingEnabled() { + return config.getBoolean("General.Stats_Tracking", true); + } + + public boolean getUpdateCheckEnabled() { + return config.getBoolean("General.Update_Check", true); + } + + public boolean getPreferBeta() { + return config.getBoolean("General.Prefer_Beta", false); + } + + public boolean getVerboseLoggingEnabled() { + return config.getBoolean("General.Verbose_Logging", false); + } + + public String getPartyChatPrefix() { + return config.getString("Commands.partychat.Chat_Prefix_Format", "[[GREEN]]([[WHITE]]{0}[[GREEN]])"); + } + + public boolean getPartyChatColorLeaderName() { + return config.getBoolean("Commands.partychat.Gold_Leader_Name", true); + } + + public boolean getPartyDisplayNames() { + return config.getBoolean("Commands.partychat.Use_Display_Names", true); + } + + public String getPartyChatPrefixAlly() { + return config.getString("Commands.partychat.Chat_Prefix_Format_Ally", "[[GREEN]](A)[[RESET]]"); + } + + public String getAdminChatPrefix() { + return config.getString("Commands.adminchat.Chat_Prefix_Format", "[[AQUA]][[[WHITE]]{0}[[AQUA]]]"); + } + + public boolean getAdminDisplayNames() { + return config.getBoolean("Commands.adminchat.Use_Display_Names", true); + } + + public boolean getMatchOfflinePlayers() { + return config.getBoolean("Commands.Generic.Match_OfflinePlayers", false); + } + + public long getDatabasePlayerCooldown() { + return config.getLong("Commands.Database.Player_Cooldown", 1750); + } + + public boolean getLevelUpSoundsEnabled() { + return config.getBoolean("General.LevelUp_Sounds", true); + } + + public boolean getRefreshChunksEnabled() { + return config.getBoolean("General.Refresh_Chunks", false); + } + + public boolean getMobHealthbarEnabled() { + return config.getBoolean("Mob_Healthbar.Enabled", true); + } /* Mob Healthbar */ public MobHealthbarType getMobHealthbarDefault() { try { return MobHealthbarType.valueOf(config.getString("Mob_Healthbar.Display_Type", "HEARTS").toUpperCase().trim()); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { return MobHealthbarType.HEARTS; } } - public int getMobHealthbarTime() { return config.getInt("Mob_Healthbar.Display_Time", 3); } + public int getMobHealthbarTime() { + return config.getInt("Mob_Healthbar.Display_Time", 3); + } /* Scoreboards */ - public boolean getScoreboardsEnabled() { return config.getBoolean("Scoreboard.UseScoreboards", true); } - public boolean getPowerLevelTagsEnabled() { return config.getBoolean("Scoreboard.Power_Level_Tags", false); } - public boolean getAllowKeepBoard() { return config.getBoolean("Scoreboard.Allow_Keep", true); } - public int getTipsAmount() { return config.getInt("Scoreboard.Tips_Amount", 5); } - public boolean getShowStatsAfterLogin() { return config.getBoolean("Scoreboard.Show_Stats_After_Login", false); } - public boolean getScoreboardRainbows() { return config.getBoolean("Scoreboard.Rainbows", false); } - public boolean getShowAbilityNames() { return config.getBoolean("Scoreboard.Ability_Names", true); } + public boolean getScoreboardsEnabled() { + return config.getBoolean("Scoreboard.UseScoreboards", true); + } - public boolean getRankUseChat() { return config.getBoolean("Scoreboard.Types.Rank.Print", false); } - public boolean getRankUseBoard() { return config.getBoolean("Scoreboard.Types.Rank.Board", true); } - public int getRankScoreboardTime() { return config.getInt("Scoreboard.Types.Rank.Display_Time", 10); } + public boolean getPowerLevelTagsEnabled() { + return config.getBoolean("Scoreboard.Power_Level_Tags", false); + } - public boolean getTopUseChat() { return config.getBoolean("Scoreboard.Types.Top.Print", true); } - public boolean getTopUseBoard() { return config.getBoolean("Scoreboard.Types.Top.Board", true); } - public int getTopScoreboardTime() { return config.getInt("Scoreboard.Types.Top.Display_Time", 15); } + public boolean getAllowKeepBoard() { + return config.getBoolean("Scoreboard.Allow_Keep", true); + } - public boolean getStatsUseChat() { return config.getBoolean("Scoreboard.Types.Stats.Print", true); } - public boolean getStatsUseBoard() { return config.getBoolean("Scoreboard.Types.Stats.Board", true); } - public int getStatsScoreboardTime() { return config.getInt("Scoreboard.Types.Stats.Display_Time", 10); } + public int getTipsAmount() { + return config.getInt("Scoreboard.Tips_Amount", 5); + } - public boolean getInspectUseChat() { return config.getBoolean("Scoreboard.Types.Inspect.Print", true); } - public boolean getInspectUseBoard() { return config.getBoolean("Scoreboard.Types.Inspect.Board", true); } - public int getInspectScoreboardTime() { return config.getInt("Scoreboard.Types.Inspect.Display_Time", 25); } + public boolean getShowStatsAfterLogin() { + return config.getBoolean("Scoreboard.Show_Stats_After_Login", false); + } - public boolean getCooldownUseChat() { return config.getBoolean("Scoreboard.Types.Cooldown.Print", false); } - public boolean getCooldownUseBoard() { return config.getBoolean("Scoreboard.Types.Cooldown.Board", true); } - public int getCooldownScoreboardTime() { return config.getInt("Scoreboard.Types.Cooldown.Display_Time", 41); } + public boolean getScoreboardRainbows() { + return config.getBoolean("Scoreboard.Rainbows", false); + } - public boolean getSkillUseBoard() { return config.getBoolean("Scoreboard.Types.Skill.Board", true); } - public int getSkillScoreboardTime() { return config.getInt("Scoreboard.Types.Skill.Display_Time", 30); } - public boolean getSkillLevelUpBoard() { return config.getBoolean("Scoreboard.Types.Skill.LevelUp_Board", true); } - public int getSkillLevelUpTime() { return config.getInt("Scoreboard.Types.Skill.LevelUp_Time", 5); } + public boolean getShowAbilityNames() { + return config.getBoolean("Scoreboard.Ability_Names", true); + } + + public boolean getRankUseChat() { + return config.getBoolean("Scoreboard.Types.Rank.Print", false); + } + + public boolean getRankUseBoard() { + return config.getBoolean("Scoreboard.Types.Rank.Board", true); + } + + public int getRankScoreboardTime() { + return config.getInt("Scoreboard.Types.Rank.Display_Time", 10); + } + + public boolean getTopUseChat() { + return config.getBoolean("Scoreboard.Types.Top.Print", true); + } + + public boolean getTopUseBoard() { + return config.getBoolean("Scoreboard.Types.Top.Board", true); + } + + public int getTopScoreboardTime() { + return config.getInt("Scoreboard.Types.Top.Display_Time", 15); + } + + public boolean getStatsUseChat() { + return config.getBoolean("Scoreboard.Types.Stats.Print", true); + } + + public boolean getStatsUseBoard() { + return config.getBoolean("Scoreboard.Types.Stats.Board", true); + } + + public int getStatsScoreboardTime() { + return config.getInt("Scoreboard.Types.Stats.Display_Time", 10); + } + + public boolean getInspectUseChat() { + return config.getBoolean("Scoreboard.Types.Inspect.Print", true); + } + + public boolean getInspectUseBoard() { + return config.getBoolean("Scoreboard.Types.Inspect.Board", true); + } + + public int getInspectScoreboardTime() { + return config.getInt("Scoreboard.Types.Inspect.Display_Time", 25); + } + + public boolean getCooldownUseChat() { + return config.getBoolean("Scoreboard.Types.Cooldown.Print", false); + } + + public boolean getCooldownUseBoard() { + return config.getBoolean("Scoreboard.Types.Cooldown.Board", true); + } + + public int getCooldownScoreboardTime() { + return config.getInt("Scoreboard.Types.Cooldown.Display_Time", 41); + } + + public boolean getSkillUseBoard() { + return config.getBoolean("Scoreboard.Types.Skill.Board", true); + } + + public int getSkillScoreboardTime() { + return config.getInt("Scoreboard.Types.Skill.Display_Time", 30); + } + + public boolean getSkillLevelUpBoard() { + return config.getBoolean("Scoreboard.Types.Skill.LevelUp_Board", true); + } + + public int getSkillLevelUpTime() { + return config.getInt("Scoreboard.Types.Skill.LevelUp_Time", 5); + } /* Database Purging */ - public int getPurgeInterval() { return config.getInt("Database_Purging.Purge_Interval", -1); } - public int getOldUsersCutoff() { return config.getInt("Database_Purging.Old_User_Cutoff", 6); } + public int getPurgeInterval() { + return config.getInt("Database_Purging.Purge_Interval", -1); + } + + public int getOldUsersCutoff() { + return config.getInt("Database_Purging.Old_User_Cutoff", 6); + } /* Backups */ - public boolean getBackupsEnabled() { return config.getBoolean("Backups.Enabled", true); } - public boolean getKeepLast24Hours() { return config.getBoolean("Backups.Keep.Last_24_Hours", true); } - public boolean getKeepDailyLastWeek() { return config.getBoolean("Backups.Keep.Daily_Last_Week", true); } - public boolean getKeepWeeklyPastMonth() { return config.getBoolean("Backups.Keep.Weekly_Past_Months", true); } + public boolean getBackupsEnabled() { + return config.getBoolean("Backups.Enabled", true); + } + + public boolean getKeepLast24Hours() { + return config.getBoolean("Backups.Keep.Last_24_Hours", true); + } + + public boolean getKeepDailyLastWeek() { + return config.getBoolean("Backups.Keep.Daily_Last_Week", true); + } + + public boolean getKeepWeeklyPastMonth() { + return config.getBoolean("Backups.Keep.Weekly_Past_Months", true); + } /* mySQL */ - public boolean getUseMySQL() { return config.getBoolean("MySQL.Enabled", false); } - public String getMySQLTablePrefix() { return config.getString("MySQL.Database.TablePrefix", "mcmmo_"); } - public String getMySQLDatabaseName() { return getStringIncludingInts("MySQL.Database.Name"); } - public String getMySQLUserName() { return getStringIncludingInts("MySQL.Database.User_Name"); } - public int getMySQLServerPort() { return config.getInt("MySQL.Server.Port", 3306); } - public String getMySQLServerName() { return config.getString("MySQL.Server.Address", "localhost"); } - public String getMySQLUserPassword() { return getStringIncludingInts("MySQL.Database.User_Password"); } - public int getMySQLMaxConnections(SQLDatabaseManager.PoolIdentifier identifier) { return config.getInt("MySQL.Database.MaxConnections." + StringUtils.getCapitalized(identifier.toString()), 30); } - public int getMySQLMaxPoolSize(SQLDatabaseManager.PoolIdentifier identifier) { return config.getInt("MySQL.Database.MaxPoolSize." + StringUtils.getCapitalized(identifier.toString()), 10); } - public boolean getMySQLSSL() { return config.getBoolean("MySQL.Server.SSL", true); } + public boolean getUseMySQL() { + return config.getBoolean("MySQL.Enabled", false); + } + + public String getMySQLTablePrefix() { + return config.getString("MySQL.Database.TablePrefix", "mcmmo_"); + } + + public String getMySQLDatabaseName() { + return getStringIncludingInts("MySQL.Database.Name"); + } + + public String getMySQLUserName() { + return getStringIncludingInts("MySQL.Database.User_Name"); + } + + public int getMySQLServerPort() { + return config.getInt("MySQL.Server.Port", 3306); + } + + public String getMySQLServerName() { + return config.getString("MySQL.Server.Address", "localhost"); + } + + public String getMySQLUserPassword() { + return getStringIncludingInts("MySQL.Database.User_Password"); + } + + public int getMySQLMaxConnections(SQLDatabaseManager.PoolIdentifier identifier) { + return config.getInt("MySQL.Database.MaxConnections." + StringUtils.getCapitalized(identifier.toString()), 30); + } + + public int getMySQLMaxPoolSize(SQLDatabaseManager.PoolIdentifier identifier) { + return config.getInt("MySQL.Database.MaxPoolSize." + StringUtils.getCapitalized(identifier.toString()), 10); + } + + public boolean getMySQLSSL() { + return config.getBoolean("MySQL.Server.SSL", true); + } private String getStringIncludingInts(String key) { String str = config.getString(key); @@ -359,111 +534,282 @@ public class Config extends AutoUpdateConfigLoader { } /* Hardcore Mode */ - public boolean getHardcoreStatLossEnabled(PrimarySkillType primarySkillType) { return config.getBoolean("Hardcore.Death_Stat_Loss.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), false); } - public void setHardcoreStatLossEnabled(PrimarySkillType primarySkillType, boolean enabled) { config.set("Hardcore.Death_Stat_Loss.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), enabled); } + public boolean getHardcoreStatLossEnabled(PrimarySkillType primarySkillType) { + return config.getBoolean("Hardcore.Death_Stat_Loss.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), false); + } - public double getHardcoreDeathStatPenaltyPercentage() { return config.getDouble("Hardcore.Death_Stat_Loss.Penalty_Percentage", 75.0D); } - public void setHardcoreDeathStatPenaltyPercentage(double value) { config.set("Hardcore.Death_Stat_Loss.Penalty_Percentage", value); } + public void setHardcoreStatLossEnabled(PrimarySkillType primarySkillType, boolean enabled) { + config.set("Hardcore.Death_Stat_Loss.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), enabled); + } - public int getHardcoreDeathStatPenaltyLevelThreshold() { return config.getInt("Hardcore.Death_Stat_Loss.Level_Threshold", 0); } + public double getHardcoreDeathStatPenaltyPercentage() { + return config.getDouble("Hardcore.Death_Stat_Loss.Penalty_Percentage", 75.0D); + } - public boolean getHardcoreVampirismEnabled(PrimarySkillType primarySkillType) { return config.getBoolean("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), false); } - public void setHardcoreVampirismEnabled(PrimarySkillType primarySkillType, boolean enabled) { config.set("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), enabled); } + public void setHardcoreDeathStatPenaltyPercentage(double value) { + config.set("Hardcore.Death_Stat_Loss.Penalty_Percentage", value); + } - public double getHardcoreVampirismStatLeechPercentage() { return config.getDouble("Hardcore.Vampirism.Leech_Percentage", 5.0D); } - public void setHardcoreVampirismStatLeechPercentage(double value) { config.set("Hardcore.Vampirism.Leech_Percentage", value); } + public int getHardcoreDeathStatPenaltyLevelThreshold() { + return config.getInt("Hardcore.Death_Stat_Loss.Level_Threshold", 0); + } - public int getHardcoreVampirismLevelThreshold() { return config.getInt("Hardcore.Vampirism.Level_Threshold", 0); } + public boolean getHardcoreVampirismEnabled(PrimarySkillType primarySkillType) { + return config.getBoolean("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), false); + } + + public void setHardcoreVampirismEnabled(PrimarySkillType primarySkillType, boolean enabled) { + config.set("Hardcore.Vampirism.Enabled." + StringUtils.getCapitalized(primarySkillType.toString()), enabled); + } + + public double getHardcoreVampirismStatLeechPercentage() { + return config.getDouble("Hardcore.Vampirism.Leech_Percentage", 5.0D); + } + + public void setHardcoreVampirismStatLeechPercentage(double value) { + config.set("Hardcore.Vampirism.Leech_Percentage", value); + } + + public int getHardcoreVampirismLevelThreshold() { + return config.getInt("Hardcore.Vampirism.Level_Threshold", 0); + } /* SMP Mods */ - public boolean getToolModsEnabled() { return config.getBoolean("Mods.Tool_Mods_Enabled", false); } - public boolean getArmorModsEnabled() { return config.getBoolean("Mods.Armor_Mods_Enabled", false); } - public boolean getBlockModsEnabled() { return config.getBoolean("Mods.Block_Mods_Enabled", false); } - public boolean getEntityModsEnabled() { return config.getBoolean("Mods.Entity_Mods_Enabled", false); } + public boolean getToolModsEnabled() { + return config.getBoolean("Mods.Tool_Mods_Enabled", false); + } + + public boolean getArmorModsEnabled() { + return config.getBoolean("Mods.Armor_Mods_Enabled", false); + } + + public boolean getBlockModsEnabled() { + return config.getBoolean("Mods.Block_Mods_Enabled", false); + } + + public boolean getEntityModsEnabled() { + return config.getBoolean("Mods.Entity_Mods_Enabled", false); + } /* Items */ - public int getChimaeraUseCost() { return config.getInt("Items.Chimaera_Wing.Use_Cost", 1); } - public int getChimaeraRecipeCost() { return config.getInt("Items.Chimaera_Wing.Recipe_Cost", 5); } - public Material getChimaeraItem() { return Material.matchMaterial(config.getString("Items.Chimaera_Wing.Item_Name", "Feather")); } - public boolean getChimaeraEnabled() { return config.getBoolean("Items.Chimaera_Wing.Enabled", true); } - public boolean getChimaeraPreventUseUnderground() { return config.getBoolean("Items.Chimaera_Wing.Prevent_Use_Underground", true); } - public boolean getChimaeraUseBedSpawn() { return config.getBoolean("Items.Chimaera_Wing.Use_Bed_Spawn", true); } - public int getChimaeraCooldown() { return config.getInt("Items.Chimaera_Wing.Cooldown", 240); } - public int getChimaeraWarmup() { return config.getInt("Items.Chimaera_Wing.Warmup", 5); } - public int getChimaeraRecentlyHurtCooldown() { return config.getInt("Items.Chimaera_Wing.RecentlyHurt_Cooldown", 60); } - public boolean getChimaeraSoundEnabled() { return config.getBoolean("Items.Chimaera_Wing.Sound_Enabled", true); } + public int getChimaeraUseCost() { + return config.getInt("Items.Chimaera_Wing.Use_Cost", 1); + } - public boolean getFluxPickaxeSoundEnabled() { return config.getBoolean("Items.Flux_Pickaxe.Sound_Enabled", true); } + public int getChimaeraRecipeCost() { + return config.getInt("Items.Chimaera_Wing.Recipe_Cost", 5); + } + + public Material getChimaeraItem() { + return Material.matchMaterial(config.getString("Items.Chimaera_Wing.Item_Name", "Feather")); + } + + public boolean getChimaeraEnabled() { + return config.getBoolean("Items.Chimaera_Wing.Enabled", true); + } + + public boolean getChimaeraPreventUseUnderground() { + return config.getBoolean("Items.Chimaera_Wing.Prevent_Use_Underground", true); + } + + public boolean getChimaeraUseBedSpawn() { + return config.getBoolean("Items.Chimaera_Wing.Use_Bed_Spawn", true); + } + + public int getChimaeraCooldown() { + return config.getInt("Items.Chimaera_Wing.Cooldown", 240); + } + + public int getChimaeraWarmup() { + return config.getInt("Items.Chimaera_Wing.Warmup", 5); + } + + public int getChimaeraRecentlyHurtCooldown() { + return config.getInt("Items.Chimaera_Wing.RecentlyHurt_Cooldown", 60); + } + + public boolean getChimaeraSoundEnabled() { + return config.getBoolean("Items.Chimaera_Wing.Sound_Enabled", true); + } + + public boolean getFluxPickaxeSoundEnabled() { + return config.getBoolean("Items.Flux_Pickaxe.Sound_Enabled", true); + } /* Particles */ - public boolean getAbilityActivationEffectEnabled() { return config.getBoolean("Particles.Ability_Activation", true); } - public boolean getAbilityDeactivationEffectEnabled() { return config.getBoolean("Particles.Ability_Deactivation", true); } - public boolean getBleedEffectEnabled() { return config.getBoolean("Particles.Bleed", true); } - public boolean getDodgeEffectEnabled() { return config.getBoolean("Particles.Dodge", true); } - public boolean getFluxEffectEnabled() { return config.getBoolean("Particles.Flux", true); } - public boolean getGreaterImpactEffectEnabled() { return config.getBoolean("Particles.Greater_Impact", true); } - public boolean getCallOfTheWildEffectEnabled() { return config.getBoolean("Particles.Call_of_the_Wild", true); } - public boolean getLevelUpEffectsEnabled() { return config.getBoolean("Particles.LevelUp_Enabled", true); } - public int getLevelUpEffectsTier() { return config.getInt("Particles.LevelUp_Tier", 100); } - public boolean getLargeFireworks() { return config.getBoolean("Particles.LargeFireworks", true); } + public boolean getAbilityActivationEffectEnabled() { + return config.getBoolean("Particles.Ability_Activation", true); + } + + public boolean getAbilityDeactivationEffectEnabled() { + return config.getBoolean("Particles.Ability_Deactivation", true); + } + + public boolean getBleedEffectEnabled() { + return config.getBoolean("Particles.Bleed", true); + } + + public boolean getDodgeEffectEnabled() { + return config.getBoolean("Particles.Dodge", true); + } + + public boolean getFluxEffectEnabled() { + return config.getBoolean("Particles.Flux", true); + } + + public boolean getGreaterImpactEffectEnabled() { + return config.getBoolean("Particles.Greater_Impact", true); + } + + public boolean getCallOfTheWildEffectEnabled() { + return config.getBoolean("Particles.Call_of_the_Wild", true); + } + + public boolean getLevelUpEffectsEnabled() { + return config.getBoolean("Particles.LevelUp_Enabled", true); + } + + public int getLevelUpEffectsTier() { + return config.getInt("Particles.LevelUp_Tier", 100); + } + + public boolean getLargeFireworks() { + return config.getBoolean("Particles.LargeFireworks", true); + } /* PARTY SETTINGS */ - public boolean getPartyFriendlyFire() { return config.getBoolean("Party.FriendlyFire", false);} - public int getPartyMaxSize() {return config.getInt("Party.MaxSize", -1); } - public int getAutoPartyKickInterval() { return config.getInt("Party.AutoKick_Interval", 12); } - public int getAutoPartyKickTime() { return config.getInt("Party.Old_Party_Member_Cutoff", 7); } + public boolean getPartyFriendlyFire() { + return config.getBoolean("Party.FriendlyFire", false); + } - public double getPartyShareBonusBase() { return config.getDouble("Party.Sharing.ExpShare_bonus_base", 1.1D); } - public double getPartyShareBonusIncrease() { return config.getDouble("Party.Sharing.ExpShare_bonus_increase", 0.05D); } - public double getPartyShareBonusCap() { return config.getDouble("Party.Sharing.ExpShare_bonus_cap", 1.5D); } - public double getPartyShareRange() { return config.getDouble("Party.Sharing.Range", 75.0D); } + public int getPartyMaxSize() { + return config.getInt("Party.MaxSize", -1); + } + + public int getAutoPartyKickInterval() { + return config.getInt("Party.AutoKick_Interval", 12); + } + + public int getAutoPartyKickTime() { + return config.getInt("Party.Old_Party_Member_Cutoff", 7); + } + + public double getPartyShareBonusBase() { + return config.getDouble("Party.Sharing.ExpShare_bonus_base", 1.1D); + } + + public double getPartyShareBonusIncrease() { + return config.getDouble("Party.Sharing.ExpShare_bonus_increase", 0.05D); + } + + public double getPartyShareBonusCap() { + return config.getDouble("Party.Sharing.ExpShare_bonus_cap", 1.5D); + } + + public double getPartyShareRange() { + return config.getDouble("Party.Sharing.Range", 75.0D); + } public int getPartyLevelCap() { int cap = config.getInt("Party.Leveling.Level_Cap", 10); return (cap <= 0) ? Integer.MAX_VALUE : cap; } - public int getPartyXpCurveMultiplier() { return config.getInt("Party.Leveling.Xp_Curve_Modifier", 3); } - public boolean getPartyXpNearMembersNeeded() { return config.getBoolean("Party.Leveling.Near_Members_Needed", false); } - public boolean getPartyInformAllMembers() { return config.getBoolean("Party.Leveling.Inform_All_Party_Members_On_LevelUp", false); } + public int getPartyXpCurveMultiplier() { + return config.getInt("Party.Leveling.Xp_Curve_Modifier", 3); + } - public int getPartyFeatureUnlockLevel(PartyFeature partyFeature) { return config.getInt("Party.Leveling." + StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", "") + "_UnlockLevel", 0); } + public boolean getPartyXpNearMembersNeeded() { + return config.getBoolean("Party.Leveling.Near_Members_Needed", false); + } + + public boolean getPartyInformAllMembers() { + return config.getBoolean("Party.Leveling.Inform_All_Party_Members_On_LevelUp", false); + } + + public int getPartyFeatureUnlockLevel(PartyFeature partyFeature) { + return config.getInt("Party.Leveling." + StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", "") + "_UnlockLevel", 0); + } /* Party Teleport Settings */ - public int getPTPCommandCooldown() { return config.getInt("Commands.ptp.Cooldown", 120); } - public int getPTPCommandWarmup() { return config.getInt("Commands.ptp.Warmup", 5); } - public int getPTPCommandRecentlyHurtCooldown() { return config.getInt("Commands.ptp.RecentlyHurt_Cooldown", 60); } - public int getPTPCommandTimeout() { return config.getInt("Commands.ptp.Request_Timeout", 300); } - public boolean getPTPCommandConfirmRequired() { return config.getBoolean("Commands.ptp.Accept_Required", true); } - public boolean getPTPCommandWorldPermissions() { return config.getBoolean("Commands.ptp.World_Based_Permissions", false); } + public int getPTPCommandCooldown() { + return config.getInt("Commands.ptp.Cooldown", 120); + } + + public int getPTPCommandWarmup() { + return config.getInt("Commands.ptp.Warmup", 5); + } + + public int getPTPCommandRecentlyHurtCooldown() { + return config.getInt("Commands.ptp.RecentlyHurt_Cooldown", 60); + } + + public int getPTPCommandTimeout() { + return config.getInt("Commands.ptp.Request_Timeout", 300); + } + + public boolean getPTPCommandConfirmRequired() { + return config.getBoolean("Commands.ptp.Accept_Required", true); + } + + public boolean getPTPCommandWorldPermissions() { + return config.getBoolean("Commands.ptp.World_Based_Permissions", false); + } /* Inspect command distance */ - public double getInspectDistance() { return config.getDouble("Commands.inspect.Max_Distance", 30.0D); } + public double getInspectDistance() { + return config.getDouble("Commands.inspect.Max_Distance", 30.0D); + } /* * ABILITY SETTINGS */ /* General Settings */ - public boolean getUrlLinksEnabled() { return config.getBoolean("Commands.Skills.URL_Links"); } - public boolean getAbilityMessagesEnabled() { return config.getBoolean("Abilities.Messages", true); } - public boolean getAbilitiesEnabled() { return config.getBoolean("Abilities.Enabled", true); } - public boolean getAbilitiesOnlyActivateWhenSneaking() { return config.getBoolean("Abilities.Activation.Only_Activate_When_Sneaking", false); } - public boolean getAbilitiesGateEnabled() { return config.getBoolean("Abilities.Activation.Level_Gate_Abilities"); } + public boolean getUrlLinksEnabled() { + return config.getBoolean("Commands.Skills.URL_Links"); + } - public int getCooldown(SuperAbilityType ability) { return config.getInt("Abilities.Cooldowns." + ability.toString()); } - public int getMaxLength(SuperAbilityType ability) { return config.getInt("Abilities.Max_Seconds." + ability.toString()); } + public boolean getAbilityMessagesEnabled() { + return config.getBoolean("Abilities.Messages", true); + } + + public boolean getAbilitiesEnabled() { + return config.getBoolean("Abilities.Enabled", true); + } + + public boolean getAbilitiesOnlyActivateWhenSneaking() { + return config.getBoolean("Abilities.Activation.Only_Activate_When_Sneaking", false); + } + + public boolean getAbilitiesGateEnabled() { + return config.getBoolean("Abilities.Activation.Level_Gate_Abilities"); + } + + public int getCooldown(SuperAbilityType ability) { + return config.getInt("Abilities.Cooldowns." + ability.toString()); + } + + public int getMaxLength(SuperAbilityType ability) { + return config.getInt("Abilities.Max_Seconds." + ability.toString()); + } /* Durability Settings */ - public int getAbilityToolDamage() { return config.getInt("Abilities.Tools.Durability_Loss", 1); } + public int getAbilityToolDamage() { + return config.getInt("Abilities.Tools.Durability_Loss", 1); + } /* Thresholds */ - public int getTreeFellerThreshold() { return config.getInt("Abilities.Limits.Tree_Feller_Threshold", 500); } + public int getTreeFellerThreshold() { + return config.getInt("Abilities.Limits.Tree_Feller_Threshold", 500); + } /* * SKILL SETTINGS */ - public boolean getDoubleDropsEnabled(PrimarySkillType skill, Material material) { return config.getBoolean("Double_Drops." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); } + public boolean getDoubleDropsEnabled(PrimarySkillType skill, Material material) { + return config.getBoolean("Double_Drops." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); + } public boolean getDoubleDropsDisabled(PrimarySkillType skill) { String skillName = StringUtils.getCapitalized(skill.toString()); @@ -484,70 +830,177 @@ public class Config extends AutoUpdateConfigLoader { } /* Axes */ - public int getAxesGate() { return config.getInt("Skills.Axes.Ability_Activation_Level_Gate", 10); } + public int getAxesGate() { + return config.getInt("Skills.Axes.Ability_Activation_Level_Gate", 10); + } /* Acrobatics */ - public boolean getDodgeLightningDisabled() { return config.getBoolean("Skills.Acrobatics.Prevent_Dodge_Lightning", false); } - public int getXPAfterTeleportCooldown() { return config.getInt("Skills.Acrobatics.XP_After_Teleport_Cooldown", 5); } + public boolean getDodgeLightningDisabled() { + return config.getBoolean("Skills.Acrobatics.Prevent_Dodge_Lightning", false); + } + + public int getXPAfterTeleportCooldown() { + return config.getInt("Skills.Acrobatics.XP_After_Teleport_Cooldown", 5); + } /* Alchemy */ - public boolean getEnabledForHoppers() { return config.getBoolean("Skills.Alchemy.Enabled_for_Hoppers", true); } - public boolean getPreventHopperTransferIngredients() { return config.getBoolean("Skills.Alchemy.Prevent_Hopper_Transfer_Ingredients", false); } - public boolean getPreventHopperTransferBottles() { return config.getBoolean("Skills.Alchemy.Prevent_Hopper_Transfer_Bottles", false); } + public boolean getEnabledForHoppers() { + return config.getBoolean("Skills.Alchemy.Enabled_for_Hoppers", true); + } + + public boolean getPreventHopperTransferIngredients() { + return config.getBoolean("Skills.Alchemy.Prevent_Hopper_Transfer_Ingredients", false); + } + + public boolean getPreventHopperTransferBottles() { + return config.getBoolean("Skills.Alchemy.Prevent_Hopper_Transfer_Bottles", false); + } /* Fishing */ - public boolean getFishingDropsEnabled() { return config.getBoolean("Skills.Fishing.Drops_Enabled", true); } - public boolean getFishingOverrideTreasures() { return config.getBoolean("Skills.Fishing.Override_Vanilla_Treasures", true); } - public boolean getFishingExtraFish() { return config.getBoolean("Skills.Fishing.Extra_Fish", true); } - public double getFishingLureModifier() { return config.getDouble("Skills.Fishing.Lure_Modifier", 4.0D); } + public boolean getFishingDropsEnabled() { + return config.getBoolean("Skills.Fishing.Drops_Enabled", true); + } + + public boolean getFishingOverrideTreasures() { + return config.getBoolean("Skills.Fishing.Override_Vanilla_Treasures", true); + } + + public boolean getFishingExtraFish() { + return config.getBoolean("Skills.Fishing.Extra_Fish", true); + } + + public double getFishingLureModifier() { + return config.getDouble("Skills.Fishing.Lure_Modifier", 4.0D); + } /* Mining */ - public Material getDetonatorItem() { return Material.matchMaterial(config.getString("Skills.Mining.Detonator_Name", "FLINT_AND_STEEL")); } - public int getMiningGate() { return config.getInt("Skills.Mining.Ability_Activation_Level_Gate", 10); } + public Material getDetonatorItem() { + return Material.matchMaterial(config.getString("Skills.Mining.Detonator_Name", "FLINT_AND_STEEL")); + } + + public int getMiningGate() { + return config.getInt("Skills.Mining.Ability_Activation_Level_Gate", 10); + } /* Excavation */ - public int getExcavationGate() { return config.getInt("Skills.Excavation.Ability_Activation_Level_Gate", 10); } + public int getExcavationGate() { + return config.getInt("Skills.Excavation.Ability_Activation_Level_Gate", 10); + } /* Repair */ - public boolean getRepairAnvilMessagesEnabled() { return config.getBoolean("Skills.Repair.Anvil_Messages", true); } - public boolean getRepairAnvilPlaceSoundsEnabled() { return config.getBoolean("Skills.Repair.Anvil_Placed_Sounds", true); } - public boolean getRepairAnvilUseSoundsEnabled() { return config.getBoolean("Skills.Repair.Anvil_Use_Sounds", true); } - public Material getRepairAnvilMaterial() { return Material.matchMaterial(config.getString("Skills.Repair.Anvil_Material", "IRON_BLOCK")); } - public boolean getRepairConfirmRequired() { return config.getBoolean("Skills.Repair.Confirm_Required", true); } + public boolean getRepairAnvilMessagesEnabled() { + return config.getBoolean("Skills.Repair.Anvil_Messages", true); + } + + public boolean getRepairAnvilPlaceSoundsEnabled() { + return config.getBoolean("Skills.Repair.Anvil_Placed_Sounds", true); + } + + public boolean getRepairAnvilUseSoundsEnabled() { + return config.getBoolean("Skills.Repair.Anvil_Use_Sounds", true); + } + + public Material getRepairAnvilMaterial() { + return Material.matchMaterial(config.getString("Skills.Repair.Anvil_Material", "IRON_BLOCK")); + } + + public boolean getRepairConfirmRequired() { + return config.getBoolean("Skills.Repair.Confirm_Required", true); + } /* Salvage */ - public boolean getSalvageAnvilMessagesEnabled() { return config.getBoolean("Skills.Salvage.Anvil_Messages", true); } - public boolean getSalvageAnvilPlaceSoundsEnabled() { return config.getBoolean("Skills.Salvage.Anvil_Placed_Sounds", true); } - public boolean getSalvageAnvilUseSoundsEnabled() { return config.getBoolean("Skills.Salvage.Anvil_Use_Sounds", true); } - public Material getSalvageAnvilMaterial() { return Material.matchMaterial(config.getString("Skills.Salvage.Anvil_Material", "GOLD_BLOCK")); } - public boolean getSalvageConfirmRequired() { return config.getBoolean("Skills.Salvage.Confirm_Required", true); } + public boolean getSalvageAnvilMessagesEnabled() { + return config.getBoolean("Skills.Salvage.Anvil_Messages", true); + } + + public boolean getSalvageAnvilPlaceSoundsEnabled() { + return config.getBoolean("Skills.Salvage.Anvil_Placed_Sounds", true); + } + + public boolean getSalvageAnvilUseSoundsEnabled() { + return config.getBoolean("Skills.Salvage.Anvil_Use_Sounds", true); + } + + public Material getSalvageAnvilMaterial() { + return Material.matchMaterial(config.getString("Skills.Salvage.Anvil_Material", "GOLD_BLOCK")); + } + + public boolean getSalvageConfirmRequired() { + return config.getBoolean("Skills.Salvage.Confirm_Required", true); + } /* Unarmed */ - public boolean getUnarmedBlockCrackerSmoothbrickToCracked() { return config.getBoolean("Skills.Unarmed.Block_Cracker.SmoothBrick_To_CrackedBrick", true); } - public boolean getUnarmedItemPickupDisabled() { return config.getBoolean("Skills.Unarmed.Item_Pickup_Disabled_Full_Inventory", true); } - public boolean getUnarmedItemsAsUnarmed() { return config.getBoolean("Skills.Unarmed.Items_As_Unarmed", false); } - public int getUnarmedGate() { return config.getInt("Skills.Unarmed.Ability_Activation_Level_Gate", 10); } + public boolean getUnarmedBlockCrackerSmoothbrickToCracked() { + return config.getBoolean("Skills.Unarmed.Block_Cracker.SmoothBrick_To_CrackedBrick", true); + } + + public boolean getUnarmedItemPickupDisabled() { + return config.getBoolean("Skills.Unarmed.Item_Pickup_Disabled_Full_Inventory", true); + } + + public boolean getUnarmedItemsAsUnarmed() { + return config.getBoolean("Skills.Unarmed.Items_As_Unarmed", false); + } + + public int getUnarmedGate() { + return config.getInt("Skills.Unarmed.Ability_Activation_Level_Gate", 10); + } /* Swords */ - public int getSwordsGate() { return config.getInt("Skills.Swords.Ability_Activation_Level_Gate", 10); } + public int getSwordsGate() { + return config.getInt("Skills.Swords.Ability_Activation_Level_Gate", 10); + } /* Taming */ - public Material getTamingCOTWMaterial(EntityType type) { return Material.matchMaterial(config.getString("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Item_Material")); } - public int getTamingCOTWCost(EntityType type) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Item_Amount"); } - public int getTamingCOTWAmount(EntityType type) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Summon_Amount"); } - public int getTamingCOTWLength(EntityType type) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type)+ ".Summon_Length"); } - public int getTamingCOTWMaxAmount(EntityType type) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type)+ ".Summon_Max_Amount"); } - public double getTamingCOTWRange() { return config.getDouble("Skills.Taming.Call_Of_The_Wild.Range", 40.0D); } + public Material getTamingCOTWMaterial(EntityType type) { + return Material.matchMaterial(config.getString("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Item_Material")); + } + + public int getTamingCOTWCost(EntityType type) { + return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Item_Amount"); + } + + public int getTamingCOTWAmount(EntityType type) { + return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Summon_Amount"); + } + + public int getTamingCOTWLength(EntityType type) { + return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Summon_Length"); + } + + public int getTamingCOTWMaxAmount(EntityType type) { + return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type) + ".Summon_Max_Amount"); + } + + public double getTamingCOTWRange() { + return config.getDouble("Skills.Taming.Call_Of_The_Wild.Range", 40.0D); + } /* Woodcutting */ - public boolean getWoodcuttingDoubleDropsEnabled(BlockData material) { return config.getBoolean("Double_Drops.Woodcutting." + StringUtils.getFriendlyConfigBlockDataString(material)); } - public boolean getTreeFellerSoundsEnabled() { return config.getBoolean("Skills.Woodcutting.Tree_Feller_Sounds", true); } - public int getWoodcuttingGate() { return config.getInt("Skills.Woodcutting.Ability_Activation_Level_Gate", 10); } + public boolean getWoodcuttingDoubleDropsEnabled(BlockData material) { + return config.getBoolean("Double_Drops.Woodcutting." + StringUtils.getFriendlyConfigBlockDataString(material)); + } + + public boolean getTreeFellerSoundsEnabled() { + return config.getBoolean("Skills.Woodcutting.Tree_Feller_Sounds", true); + } + + public int getWoodcuttingGate() { + return config.getInt("Skills.Woodcutting.Ability_Activation_Level_Gate", 10); + } /* AFK Leveling */ - public boolean getAcrobaticsPreventAFK() { return config.getBoolean("Skills.Acrobatics.Prevent_AFK_Leveling", true); } - public int getAcrobaticsAFKMaxTries() { return config.getInt("Skills.Acrobatics.Max_Tries_At_Same_Location", 3); } - public boolean getHerbalismPreventAFK() { return config.getBoolean("Skills.Herbalism.Prevent_AFK_Leveling", true); } + public boolean getAcrobaticsPreventAFK() { + return config.getBoolean("Skills.Acrobatics.Prevent_AFK_Leveling", true); + } + + public int getAcrobaticsAFKMaxTries() { + return config.getInt("Skills.Acrobatics.Max_Tries_At_Same_Location", 3); + } + + public boolean getHerbalismPreventAFK() { + return config.getBoolean("Skills.Herbalism.Prevent_AFK_Leveling", true); + } /* Level Caps */ public int getPowerLevelCap() { @@ -565,11 +1018,18 @@ public class Config extends AutoUpdateConfigLoader { return config.getInt("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Ability_Activation_Level_Gate"); }*/ - public boolean getTruncateSkills() { return config.getBoolean("General.TruncateSkills", false); } + public boolean getTruncateSkills() { + return config.getBoolean("General.TruncateSkills", false); + } /* PVP & PVE Settings */ - public boolean getPVPEnabled(PrimarySkillType skill) { return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVP", true); } - public boolean getPVEEnabled(PrimarySkillType skill) { return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVE", true); } - + public boolean getPVPEnabled(PrimarySkillType skill) { + return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVP", true); + } + + public boolean getPVEEnabled(PrimarySkillType skill) { + return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVE", true); + } + //public float getMasterVolume() { return (float) config.getDouble("Sounds.MasterVolume", 1.0); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/ConfigLoader.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/ConfigLoader.java index d98cd94bd..56196ab17 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/ConfigLoader.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/ConfigLoader.java @@ -10,8 +10,8 @@ import java.util.List; public abstract class ConfigLoader { protected static final mcMMO plugin = mcMMO.p; protected String fileName; - private File configFile; protected FileConfiguration config; + private File configFile; public ConfigLoader(String relativePath, String fileName) { this.fileName = fileName; @@ -31,12 +31,10 @@ public abstract class ConfigLoader { try { plugin.saveResource(fileName, false); // Normal files - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { plugin.saveResource(configFile.getParentFile().getName() + File.separator + fileName, false); // Mod files } - } - else { + } else { plugin.debug("Loading mcMMO " + fileName + " File..."); } @@ -60,8 +58,7 @@ public abstract class ConfigLoader { protected void validate() { if (validateKeys()) { plugin.debug("No errors found in " + fileName + "!"); - } - else { + } else { plugin.getLogger().warning("Errors were found in " + fileName + "! mcMMO was disabled!"); plugin.getServer().getPluginManager().disablePlugin(plugin); plugin.noErrorsInConfigFiles = false; diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/CoreSkillsConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/CoreSkillsConfig.java index 4f7fcb753..7283bc759 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/CoreSkillsConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/CoreSkillsConfig.java @@ -7,25 +7,23 @@ import com.gmail.nossr50.util.StringUtils; public class CoreSkillsConfig extends AutoUpdateConfigLoader { private static CoreSkillsConfig instance; - public CoreSkillsConfig() - { + public CoreSkillsConfig() { super("coreskills.yml"); validate(); } + public static CoreSkillsConfig getInstance() { + if (instance == null) + return new CoreSkillsConfig(); + + return instance; + } + @Override protected void loadKeys() { } - public static CoreSkillsConfig getInstance() - { - if(instance == null) - return new CoreSkillsConfig(); - - return instance; - } - @Override protected boolean validateKeys() { @@ -39,21 +37,21 @@ public class CoreSkillsConfig extends AutoUpdateConfigLoader { /** * Whether or not a skill is enabled * Defaults true + * * @param abstractSubSkill SubSkill definition to check * @return true if subskill is enabled */ - public boolean isSkillEnabled(AbstractSubSkill abstractSubSkill) - { - return config.getBoolean(StringUtils.getCapitalized(abstractSubSkill.getPrimarySkill().toString())+"."+ abstractSubSkill.getConfigKeyName()+".Enabled", true); + public boolean isSkillEnabled(AbstractSubSkill abstractSubSkill) { + return config.getBoolean(StringUtils.getCapitalized(abstractSubSkill.getPrimarySkill().toString()) + "." + abstractSubSkill.getConfigKeyName() + ".Enabled", true); } /** * Whether or not this primary skill is enabled + * * @param primarySkillType target primary skill * @return true if enabled */ - public boolean isPrimarySkillEnabled(PrimarySkillType primarySkillType) - { - return config.getBoolean(StringUtils.getCapitalized(primarySkillType.toString())+".Enabled", true); + public boolean isPrimarySkillEnabled(PrimarySkillType primarySkillType) { + return config.getBoolean(StringUtils.getCapitalized(primarySkillType.toString()) + ".Enabled", true); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/RankConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/RankConfig.java index 0f169b27d..3bb05e439 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/RankConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/RankConfig.java @@ -9,26 +9,24 @@ import java.util.List; public class RankConfig extends AutoUpdateConfigLoader { private static RankConfig instance; - public RankConfig() - { + public RankConfig() { super("skillranks.yml"); validate(); this.instance = this; } - @Override - protected void loadKeys() { - - } - - public static RankConfig getInstance() - { - if(instance == null) + public static RankConfig getInstance() { + if (instance == null) return new RankConfig(); return instance; } + @Override + protected void loadKeys() { + + } + @Override protected boolean validateKeys() { List reason = new ArrayList(); @@ -43,12 +41,12 @@ public class RankConfig extends AutoUpdateConfigLoader { /** * Returns the unlock level for a subskill depending on the gamemode + * * @param subSkillType target subskill - * @param rank the rank we are checking + * @param rank the rank we are checking * @return the level requirement for a subskill at this particular rank */ - public int getSubSkillUnlockLevel(SubSkillType subSkillType, int rank) - { + public int getSubSkillUnlockLevel(SubSkillType subSkillType, int rank) { String key = subSkillType.getRankConfigAddress(); return findRankByRootAddress(rank, key); @@ -56,20 +54,21 @@ public class RankConfig extends AutoUpdateConfigLoader { /** * Returns the unlock level for a subskill depending on the gamemode + * * @param abstractSubSkill target subskill - * @param rank the rank we are checking + * @param rank the rank we are checking * @return the level requirement for a subskill at this particular rank */ - public int getSubSkillUnlockLevel(AbstractSubSkill abstractSubSkill, int rank) - { - String key = abstractSubSkill.getPrimaryKeyName()+"."+abstractSubSkill.getConfigKeyName(); + public int getSubSkillUnlockLevel(AbstractSubSkill abstractSubSkill, int rank) { + String key = abstractSubSkill.getPrimaryKeyName() + "." + abstractSubSkill.getConfigKeyName(); return findRankByRootAddress(rank, key); } /** * Returns the unlock level for a subskill depending on the gamemode - * @param key root address of the subskill in the rankskills.yml file + * + * @param key root address of the subskill in the rankskills.yml file * @param rank the rank we are checking * @return the level requirement for a subskill at this particular rank */ @@ -87,32 +86,27 @@ public class RankConfig extends AutoUpdateConfigLoader { /** * Checks for valid keys for subskill ranks */ - private void checkKeys(List reasons) - { + private void checkKeys(List reasons) { //For now we will only check ranks of stuff I've overhauled - for(SubSkillType subSkillType : SubSkillType.values()) - { + for (SubSkillType subSkillType : SubSkillType.values()) { //Keeping track of the rank requirements and making sure there are no logical errors int curRank = 0; int prevRank = 0; - for(int x = 0; x < subSkillType.getNumRanks(); x++) - { - if(curRank > 0) + for (int x = 0; x < subSkillType.getNumRanks(); x++) { + if (curRank > 0) prevRank = curRank; curRank = getSubSkillUnlockLevel(subSkillType, x); //Do we really care if its below 0? Probably not - if(curRank < 0) - { - reasons.add(subSkillType.getAdvConfigAddress() + ".Rank_Levels.Rank_"+curRank+".LevelReq should be above or equal to 0!"); + if (curRank < 0) { + reasons.add(subSkillType.getAdvConfigAddress() + ".Rank_Levels.Rank_" + curRank + ".LevelReq should be above or equal to 0!"); } - if(prevRank > curRank) - { + if (prevRank > curRank) { //We're going to allow this but we're going to warn them - plugin.getLogger().info("You have the ranks for the subskill "+ subSkillType.toString()+" set up poorly, sequential ranks should have ascending requirements"); + plugin.getLogger().info("You have the ranks for the subskill " + subSkillType.toString() + " set up poorly, sequential ranks should have ascending requirements"); } } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/SoundConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/SoundConfig.java index 05604f686..ec771303a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/SoundConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/SoundConfig.java @@ -5,42 +5,36 @@ import com.gmail.nossr50.util.sounds.SoundType; public class SoundConfig extends AutoUpdateConfigLoader { private static SoundConfig instance; - public SoundConfig() - { + public SoundConfig() { super("sounds.yml"); validate(); this.instance = this; } + public static SoundConfig getInstance() { + if (instance == null) + return new SoundConfig(); + + return instance; + } + @Override protected void loadKeys() { } - public static SoundConfig getInstance() - { - if(instance == null) - return new SoundConfig(); - - return instance; - } - @Override protected boolean validateKeys() { - for(SoundType soundType : SoundType.values()) - { - if(config.getDouble("Sounds."+soundType.toString()+".Volume") < 0) - { - plugin.getLogger().info("[mcMMO] Sound volume cannot be below 0 for "+soundType.toString()); + for (SoundType soundType : SoundType.values()) { + if (config.getDouble("Sounds." + soundType.toString() + ".Volume") < 0) { + plugin.getLogger().info("[mcMMO] Sound volume cannot be below 0 for " + soundType.toString()); return false; } //Sounds with custom pitching don't use pitch values - if(!soundType.usesCustomPitch()) - { - if(config.getDouble("Sounds."+soundType.toString()+".Pitch") < 0) - { - plugin.getLogger().info("[mcMMO] Sound pitch cannot be below 0 for "+soundType.toString()); + if (!soundType.usesCustomPitch()) { + if (config.getDouble("Sounds." + soundType.toString() + ".Pitch") < 0) { + plugin.getLogger().info("[mcMMO] Sound pitch cannot be below 0 for " + soundType.toString()); return false; } } @@ -48,23 +42,22 @@ public class SoundConfig extends AutoUpdateConfigLoader { return true; } - public float getMasterVolume() { return (float) config.getDouble("Sounds.MasterVolume", 1.0); } + public float getMasterVolume() { + return (float) config.getDouble("Sounds.MasterVolume", 1.0); + } - public float getVolume(SoundType soundType) - { - String key = "Sounds."+soundType.toString()+".Volume"; + public float getVolume(SoundType soundType) { + String key = "Sounds." + soundType.toString() + ".Volume"; return (float) config.getDouble(key); } - public float getPitch(SoundType soundType) - { - String key = "Sounds."+soundType.toString()+".Pitch"; + public float getPitch(SoundType soundType) { + String key = "Sounds." + soundType.toString() + ".Pitch"; return (float) config.getDouble(key); } - public boolean getIsEnabled(SoundType soundType) - { - String key = "Sounds."+soundType.toString()+".Enabled"; + public boolean getIsEnabled(SoundType soundType) { + String key = "Sounds." + soundType.toString() + ".Enabled"; return config.getBoolean(key, true); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/WorldBlacklist.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/WorldBlacklist.java index f7364e96a..b1c449221 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/WorldBlacklist.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/WorldBlacklist.java @@ -11,24 +11,31 @@ import java.util.ArrayList; */ public class WorldBlacklist { private static ArrayList blacklist; + private final String blackListFileName = "world_blacklist.txt"; private mcMMO plugin; - private final String blackListFileName = "world_blacklist.txt"; - - public WorldBlacklist(mcMMO plugin) - { + public WorldBlacklist(mcMMO plugin) { this.plugin = plugin; blacklist = new ArrayList<>(); init(); } - public void init() - { + public static boolean isWorldBlacklisted(World world) { + + for (String s : blacklist) { + if (world.getName().equalsIgnoreCase(s)) + return true; + } + + return false; + } + + public void init() { //Make the blacklist file if it doesn't exist File blackListFile = new File(plugin.getDataFolder() + File.separator + blackListFileName); try { - if(!blackListFile.exists()) + if (!blackListFile.exists()) blackListFile.createNewFile(); } catch (IOException e) { e.printStackTrace(); @@ -46,12 +53,11 @@ public class WorldBlacklist { String currentLine; - while((currentLine = bufferedReader.readLine()) != null) - { - if(currentLine.length() == 0) + while ((currentLine = bufferedReader.readLine()) != null) { + if (currentLine.length() == 0) continue; - if(!blacklist.contains(currentLine)) + if (!blacklist.contains(currentLine)) blacklist.add(currentLine); } @@ -60,23 +66,10 @@ public class WorldBlacklist { fileReader.close(); } catch (FileNotFoundException e) { e.printStackTrace(); - } catch (IOException e) - { + } catch (IOException e) { e.printStackTrace(); } - plugin.getLogger().info(blacklist.size()+" entries in mcMMO World Blacklist"); - } - - public static boolean isWorldBlacklisted(World world) - { - - for(String s : blacklist) - { - if(world.getName().equalsIgnoreCase(s)) - return true; - } - - return false; + plugin.getLogger().info(blacklist.size() + " entries in mcMMO World Blacklist"); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java index 1bdf70c9c..4703ecb2e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/alchemy/PotionConfig.java @@ -94,8 +94,7 @@ public class PotionConfig extends ConfigLoader { if (potion != null) { potionMap.put(potionName, potion); pass++; - } - else { + } else { fail++; } } @@ -108,18 +107,17 @@ public class PotionConfig extends ConfigLoader { * Returns null if input cannot be parsed. * * @param potion_section ConfigurationSection to be parsed. - * * @return Parsed AlchemyPotion. */ private AlchemyPotion loadPotion(ConfigurationSection potion_section) { try { - + String name = potion_section.getString("Name"); if (name != null) { name = ChatColor.translateAlternateColorCodes('&', name); } - + PotionData data; if (!potion_section.contains("PotionData")) { // Backwards config compatability short dataValue = Short.parseShort(potion_section.getName()); @@ -129,7 +127,7 @@ public class PotionConfig extends ConfigLoader { ConfigurationSection potionData = potion_section.getConfigurationSection("PotionData"); data = new PotionData(PotionType.valueOf(potionData.getString("PotionType", "WATER")), potionData.getBoolean("Extended", false), potionData.getBoolean("Upgraded", false)); } - + Material material = Material.POTION; String mat = potion_section.getString("Material", null); if (mat != null) { @@ -154,18 +152,16 @@ public class PotionConfig extends ConfigLoader { if (type != null) { effects.add(new PotionEffect(type, duration, amplifier)); - } - else { + } else { mcMMO.p.getLogger().warning("Failed to parse effect for potion " + name + ": " + effect); } } } - + Color color = null; if (potion_section.contains("Color")) { color = Color.fromRGB(potion_section.getInt("Color")); - } - else { + } else { color = this.generateColor(effects); } @@ -175,16 +171,14 @@ public class PotionConfig extends ConfigLoader { ItemStack ingredient = loadIngredient(child); if (ingredient != null) { children.put(ingredient, potion_section.getConfigurationSection("Children").getString(child)); - } - else { + } else { mcMMO.p.getLogger().warning("Failed to parse child for potion " + name + ": " + child); } } } return new AlchemyPotion(material, data, name, lore, effects, color, children); - } - catch (Exception e) { + } catch (Exception e) { mcMMO.p.getLogger().warning("Failed to load Alchemy potion: " + potion_section.getName()); return null; } @@ -196,7 +190,6 @@ public class PotionConfig extends ConfigLoader { * Returns null if input cannot be parsed. * * @param ingredient String representing an ingredient. - * * @return Parsed ingredient. */ private ItemStack loadIngredient(String ingredient) { @@ -242,7 +235,7 @@ public class PotionConfig extends ConfigLoader { public AlchemyPotion getPotion(String name) { return potionMap.get(name); } - + public AlchemyPotion getPotion(ItemStack item) { for (AlchemyPotion potion : potionMap.values()) { if (potion.isSimilar(item)) { @@ -251,7 +244,7 @@ public class PotionConfig extends ConfigLoader { } return null; } - + public Color generateColor(List effects) { if (effects != null && !effects.isEmpty()) { List colors = new ArrayList(); @@ -269,7 +262,7 @@ public class PotionConfig extends ConfigLoader { } return null; } - + public Color calculateAverageColor(List colors) { int red = 0; int green = 0; @@ -279,8 +272,8 @@ public class PotionConfig extends ConfigLoader { green += color.getGreen(); blue += color.getBlue(); } - Color color = Color.fromRGB(red/colors.size(), green/colors.size(), blue/colors.size()); + Color color = Color.fromRGB(red / colors.size(), green / colors.size(), blue / colors.size()); return color; } - + } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java index b676c0ad3..af5d4c18d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/repair/RepairConfig.java @@ -55,31 +55,23 @@ public class RepairConfig extends ConfigLoader { if (ItemUtils.isWoodTool(repairItem)) { repairMaterialType = MaterialType.WOOD; - } - else if (ItemUtils.isStoneTool(repairItem)) { + } else if (ItemUtils.isStoneTool(repairItem)) { repairMaterialType = MaterialType.STONE; - } - else if (ItemUtils.isStringTool(repairItem)) { + } else if (ItemUtils.isStringTool(repairItem)) { repairMaterialType = MaterialType.STRING; - } - else if (ItemUtils.isLeatherArmor(repairItem)) { + } else if (ItemUtils.isLeatherArmor(repairItem)) { repairMaterialType = MaterialType.LEATHER; - } - else if (ItemUtils.isIronArmor(repairItem) || ItemUtils.isIronTool(repairItem)) { + } else if (ItemUtils.isIronArmor(repairItem) || ItemUtils.isIronTool(repairItem)) { repairMaterialType = MaterialType.IRON; - } - else if (ItemUtils.isGoldArmor(repairItem) || ItemUtils.isGoldTool(repairItem)) { + } else if (ItemUtils.isGoldArmor(repairItem) || ItemUtils.isGoldTool(repairItem)) { repairMaterialType = MaterialType.GOLD; - } - else if (ItemUtils.isDiamondArmor(repairItem) || ItemUtils.isDiamondTool(repairItem)) { + } else if (ItemUtils.isDiamondArmor(repairItem) || ItemUtils.isDiamondTool(repairItem)) { repairMaterialType = MaterialType.DIAMOND; } - } - else { + } else { try { repairMaterialType = MaterialType.valueOf(repairMaterialTypeString); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { reason.add(key + " has an invalid MaterialType of " + repairMaterialTypeString); } } @@ -112,16 +104,13 @@ public class RepairConfig extends ConfigLoader { if (ItemUtils.isMinecraftTool(repairItem)) { repairItemType = ItemType.TOOL; - } - else if (ItemUtils.isArmor(repairItem)) { + } else if (ItemUtils.isArmor(repairItem)) { repairItemType = ItemType.ARMOR; } - } - else { + } else { try { repairItemType = ItemType.valueOf(repairItemTypeString); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { reason.add(key + " has an invalid ItemType of " + repairItemTypeString); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java index 76c540838..30a3e7a58 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/skills/salvage/SalvageConfig.java @@ -50,31 +50,23 @@ public class SalvageConfig extends ConfigLoader { if (ItemUtils.isWoodTool(salvageItem)) { salvageMaterialType = MaterialType.WOOD; - } - else if (ItemUtils.isStoneTool(salvageItem)) { + } else if (ItemUtils.isStoneTool(salvageItem)) { salvageMaterialType = MaterialType.STONE; - } - else if (ItemUtils.isStringTool(salvageItem)) { + } else if (ItemUtils.isStringTool(salvageItem)) { salvageMaterialType = MaterialType.STRING; - } - else if (ItemUtils.isLeatherArmor(salvageItem)) { + } else if (ItemUtils.isLeatherArmor(salvageItem)) { salvageMaterialType = MaterialType.LEATHER; - } - else if (ItemUtils.isIronArmor(salvageItem) || ItemUtils.isIronTool(salvageItem)) { + } else if (ItemUtils.isIronArmor(salvageItem) || ItemUtils.isIronTool(salvageItem)) { salvageMaterialType = MaterialType.IRON; - } - else if (ItemUtils.isGoldArmor(salvageItem) || ItemUtils.isGoldTool(salvageItem)) { + } else if (ItemUtils.isGoldArmor(salvageItem) || ItemUtils.isGoldTool(salvageItem)) { salvageMaterialType = MaterialType.GOLD; - } - else if (ItemUtils.isDiamondArmor(salvageItem) || ItemUtils.isDiamondTool(salvageItem)) { + } else if (ItemUtils.isDiamondArmor(salvageItem) || ItemUtils.isDiamondTool(salvageItem)) { salvageMaterialType = MaterialType.DIAMOND; } - } - else { + } else { try { salvageMaterialType = MaterialType.valueOf(salvageMaterialTypeString.replace(" ", "_").toUpperCase()); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { reason.add(key + " has an invalid MaterialType of " + salvageMaterialTypeString); } } @@ -99,16 +91,13 @@ public class SalvageConfig extends ConfigLoader { if (ItemUtils.isMinecraftTool(salvageItem)) { salvageItemType = ItemType.TOOL; - } - else if (ItemUtils.isArmor(salvageItem)) { + } else if (ItemUtils.isArmor(salvageItem)) { salvageItemType = ItemType.ARMOR; } - } - else { + } else { try { salvageItemType = ItemType.valueOf(salvageItemTypeString.replace(" ", "_").toUpperCase()); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { reason.add(key + " has an invalid ItemType of " + salvageItemTypeString); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java b/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java index a645ffb50..aec76a097 100644 --- a/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/config/treasure/TreasureConfig.java @@ -25,10 +25,10 @@ public class TreasureConfig extends ConfigLoader { public HashMap> excavationMap = new HashMap>(); - public HashMap> shakeMap = new HashMap>(); - public HashMap> hylianMap = new HashMap>(); + public HashMap> shakeMap = new HashMap>(); + public HashMap> hylianMap = new HashMap>(); - public HashMap> fishingRewards = new HashMap>(); + public HashMap> fishingRewards = new HashMap>(); public HashMap> fishingEnchantments = new HashMap>(); private TreasureConfig() { diff --git a/core/src/main/java/com/gmail/nossr50/core/data/UserManager.java b/core/src/main/java/com/gmail/nossr50/core/data/UserManager.java index 0768f4829..62f36fbe2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/UserManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/UserManager.java @@ -13,7 +13,8 @@ import java.util.Collection; public final class UserManager { - private UserManager() {} + private UserManager() { + } /** * Track a new user. @@ -50,12 +51,9 @@ public final class UserManager { mcMMO.p.debug("Saving mcMMOPlayers... (" + onlinePlayers.size() + ")"); for (Player player : onlinePlayers) { - try - { + try { getPlayer(player).getProfile().save(); - } - catch (Exception e) - { + } catch (Exception e) { mcMMO.p.getLogger().warning("Could not save mcMMO player data for player: " + player.getName()); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManager.java index 35deedab1..5b6fab200 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/ChunkletManager.java @@ -7,9 +7,9 @@ public interface ChunkletManager { /** * Loads a specific chunklet * - * @param cx Chunklet X coordinate that needs to be loaded - * @param cy Chunklet Y coordinate that needs to be loaded - * @param cz Chunklet Z coordinate that needs to be loaded + * @param cx Chunklet X coordinate that needs to be loaded + * @param cy Chunklet Y coordinate that needs to be loaded + * @param cz Chunklet Z coordinate that needs to be loaded * @param world World that the chunklet needs to be loaded in */ public void loadChunklet(int cx, int cy, int cz, World world); @@ -17,9 +17,9 @@ public interface ChunkletManager { /** * Unload a specific chunklet * - * @param cx Chunklet X coordinate that needs to be unloaded - * @param cy Chunklet Y coordinate that needs to be unloaded - * @param cz Chunklet Z coordinate that needs to be unloaded + * @param cx Chunklet X coordinate that needs to be unloaded + * @param cy Chunklet Y coordinate that needs to be unloaded + * @param cz Chunklet Z coordinate that needs to be unloaded * @param world World that the chunklet needs to be unloaded from */ public void unloadChunklet(int cx, int cy, int cz, World world); @@ -27,8 +27,8 @@ public interface ChunkletManager { /** * Load a given Chunk's Chunklet data * - * @param cx Chunk X coordinate that is to be loaded - * @param cz Chunk Z coordinate that is to be loaded + * @param cx Chunk X coordinate that is to be loaded + * @param cz Chunk Z coordinate that is to be loaded * @param world World that the Chunk is in */ public void loadChunk(int cx, int cz, World world); @@ -36,8 +36,8 @@ public interface ChunkletManager { /** * Unload a given Chunk's Chunklet data * - * @param cx Chunk X coordinate that is to be unloaded - * @param cz Chunk Z coordinate that is to be unloaded + * @param cx Chunk X coordinate that is to be unloaded + * @param cz Chunk Z coordinate that is to be unloaded * @param world World that the Chunk is in */ public void unloadChunk(int cx, int cz, World world); @@ -45,8 +45,8 @@ public interface ChunkletManager { /** * Informs the ChunkletManager a chunk is loaded * - * @param cx Chunk X coordinate that is loaded - * @param cz Chunk Z coordinate that is loaded + * @param cx Chunk X coordinate that is loaded + * @param cz Chunk Z coordinate that is loaded * @param world World that the chunk was loaded in */ public void chunkLoaded(int cx, int cz, World world); @@ -54,8 +54,8 @@ public interface ChunkletManager { /** * Informs the ChunkletManager a chunk is unloaded * - * @param cx Chunk X coordinate that is unloaded - * @param cz Chunk Z coordinate that is unloaded + * @param cx Chunk X coordinate that is unloaded + * @param cz Chunk Z coordinate that is unloaded * @param world World that the chunk was unloaded in */ public void chunkUnloaded(int cx, int cz, World world); @@ -94,9 +94,9 @@ public interface ChunkletManager { /** * Check to see if a given location is set to true * - * @param x X coordinate to check - * @param y Y coordinate to check - * @param z Z coordinate to check + * @param x X coordinate to check + * @param y Y coordinate to check + * @param z Z coordinate to check * @param world World to check in * @return true if the given location is set to true, false if otherwise */ @@ -113,9 +113,9 @@ public interface ChunkletManager { /** * Set a given location to true, should create stores as necessary if the location does not exist * - * @param x X coordinate to set - * @param y Y coordinate to set - * @param z Z coordinate to set + * @param x X coordinate to set + * @param y Y coordinate to set + * @param z Z coordinate to set * @param world World to set in */ public void setTrue(int x, int y, int z, World world); @@ -130,9 +130,9 @@ public interface ChunkletManager { /** * Set a given location to false, should not create stores if one does not exist for the given location * - * @param x X coordinate to set - * @param y Y coordinate to set - * @param z Z coordinate to set + * @param x X coordinate to set + * @param y Y coordinate to set + * @param z Z coordinate to set * @param world World to set in */ public void setFalse(int x, int y, int z, World world); diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/HashChunkletManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/HashChunkletManager.java index ace73a8a3..e80edc8d0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/HashChunkletManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/HashChunkletManager.java @@ -295,7 +295,7 @@ public class HashChunkletManager implements ChunkletManager { } /** - * @param cStore ChunkletStore to save + * @param cStore ChunkletStore to save * @param location Where on the disk to put it */ private void serializeChunkletStore(ChunkletStore cStore, File location) { @@ -309,17 +309,14 @@ public class HashChunkletManager implements ChunkletManager { fileOut = new FileOutputStream(location); objOut = new ObjectOutputStream(fileOut); objOut.writeObject(cStore); - } - catch (IOException ex) { + } catch (IOException ex) { ex.printStackTrace(); - } - finally { + } finally { if (objOut != null) { try { objOut.flush(); objOut.close(); - } - catch (IOException ex) { + } catch (IOException ex) { ex.printStackTrace(); } } @@ -327,8 +324,7 @@ public class HashChunkletManager implements ChunkletManager { if (fileOut != null) { try { fileOut.close(); - } - catch (IOException ex) { + } catch (IOException ex) { ex.printStackTrace(); } } @@ -348,35 +344,29 @@ public class HashChunkletManager implements ChunkletManager { fileIn = new FileInputStream(location); objIn = new ObjectInputStream(fileIn); storeIn = (ChunkletStore) objIn.readObject(); - } - catch (IOException ex) { + } catch (IOException ex) { if (ex instanceof EOFException) { // EOF should only happen on Chunklets that somehow have been corrupted. //mcMMO.p.getLogger().severe("Chunklet data at " + location.toString() + " could not be read due to an EOFException, data in this area will be lost."); return ChunkletStoreFactory.getChunkletStore(); - } - else if (ex instanceof StreamCorruptedException) { + } else if (ex instanceof StreamCorruptedException) { // StreamCorrupted happens when the Chunklet is no good. //mcMMO.p.getLogger().severe("Chunklet data at " + location.toString() + " is corrupted, data in this area will be lost."); return ChunkletStoreFactory.getChunkletStore(); - } - else if (ex instanceof UTFDataFormatException) { + } else if (ex instanceof UTFDataFormatException) { // UTF happens when the Chunklet cannot be read or is corrupted //mcMMO.p.getLogger().severe("Chunklet data at " + location.toString() + " could not be read due to an UTFDataFormatException, data in this area will be lost."); return ChunkletStoreFactory.getChunkletStore(); } ex.printStackTrace(); - } - catch (ClassNotFoundException ex) { + } catch (ClassNotFoundException ex) { ex.printStackTrace(); - } - finally { + } finally { if (objIn != null) { try { objIn.close(); - } - catch (IOException ex) { + } catch (IOException ex) { ex.printStackTrace(); } } @@ -384,8 +374,7 @@ public class HashChunkletManager implements ChunkletManager { if (fileIn != null) { try { fileIn.close(); - } - catch (IOException ex) { + } catch (IOException ex) { ex.printStackTrace(); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/NullChunkletManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/NullChunkletManager.java index 844dfec6f..643bc6c19 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/NullChunkletManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/NullChunkletManager.java @@ -5,7 +5,7 @@ import org.bukkit.block.Block; /** * A ChunkletManager implementation that does nothing and returns false for all checks. - * + *

* Useful for turning off Chunklets without actually doing much work */ public class NullChunkletManager implements ChunkletManager { diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveChunkletStore.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveChunkletStore.java index 7e896b6b0..8ec8e93b6 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveChunkletStore.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveChunkletStore.java @@ -3,7 +3,9 @@ package com.gmail.nossr50.core.data.blockmeta; public class PrimitiveChunkletStore implements ChunkletStore { private static final long serialVersionUID = -3453078050608607478L; - /** X, Z, Y */ + /** + * X, Z, Y + */ public boolean[][][] store = new boolean[16][16][64]; @Override diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveExChunkletStore.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveExChunkletStore.java index 3cf766574..2fd6c0ba8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveExChunkletStore.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/PrimitiveExChunkletStore.java @@ -8,9 +8,42 @@ import java.io.ObjectOutput; public class PrimitiveExChunkletStore implements ChunkletStore, Externalizable { private static final long serialVersionUID = 8603603827094383873L; - /** X, Z, Y */ + /** + * X, Z, Y + */ public boolean[][][] store = new boolean[16][16][64]; + /* + * The address byte: A single byte which contains x and z values which correspond to the x and z Chunklet-coordinates + * + * In Chunklet-coordinates, the only valid values are 0-15, so we can fit both into a single byte. + * + * The top 4 bits of the address byte are for the x value + * The bottom 4 bits of the address byte are for the z value + * + * Examples: + * An address byte with a value 00000001 would be split like so: + * - x = 0000 = 0 + * - z = 0001 = 1 + * => Chunklet coordinates (0, 1) + * + * 01011111 + * - x = 0101 = 5 + * - z = 1111 = 15 + * => Chunklet coordinates (5, 15) + */ + protected static byte makeAddressByte(int x, int z) { + return (byte) ((x << 4) + z); + } + + protected static int addressByteX(byte address) { + return (address & 0xF0) >>> 4; + } + + protected static int addressByteZ(byte address) { + return address & 0x0F; + } + @Override public boolean isTrue(int x, int y, int z) { return store[x][z][y]; @@ -146,35 +179,4 @@ public class PrimitiveExChunkletStore implements ChunkletStore, Externalizable { return column; } - - /* - * The address byte: A single byte which contains x and z values which correspond to the x and z Chunklet-coordinates - * - * In Chunklet-coordinates, the only valid values are 0-15, so we can fit both into a single byte. - * - * The top 4 bits of the address byte are for the x value - * The bottom 4 bits of the address byte are for the z value - * - * Examples: - * An address byte with a value 00000001 would be split like so: - * - x = 0000 = 0 - * - z = 0001 = 1 - * => Chunklet coordinates (0, 1) - * - * 01011111 - * - x = 0101 = 5 - * - z = 1111 = 15 - * => Chunklet coordinates (5, 15) - */ - protected static byte makeAddressByte(int x, int z) { - return (byte) ((x << 4) + z); - } - - protected static int addressByteX(byte address) { - return (address & 0xF0) >>> 4; - } - - protected static int addressByteZ(byte address) { - return address & 0x0F; - } } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManager.java index b48b05c68..fbe6dc900 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/ChunkManager.java @@ -19,9 +19,9 @@ public interface ChunkManager { /** * Loads a specific chunklet * - * @param cx Chunklet X coordinate that needs to be loaded - * @param cy Chunklet Y coordinate that needs to be loaded - * @param cz Chunklet Z coordinate that needs to be loaded + * @param cx Chunklet X coordinate that needs to be loaded + * @param cy Chunklet Y coordinate that needs to be loaded + * @param cz Chunklet Z coordinate that needs to be loaded * @param world World that the chunklet needs to be loaded in */ public void loadChunklet(int cx, int cy, int cz, World world); @@ -29,9 +29,9 @@ public interface ChunkManager { /** * Unload a specific chunklet * - * @param cx Chunklet X coordinate that needs to be unloaded - * @param cy Chunklet Y coordinate that needs to be unloaded - * @param cz Chunklet Z coordinate that needs to be unloaded + * @param cx Chunklet X coordinate that needs to be unloaded + * @param cy Chunklet Y coordinate that needs to be unloaded + * @param cz Chunklet Z coordinate that needs to be unloaded * @param world World that the chunklet needs to be unloaded from */ public void unloadChunklet(int cx, int cy, int cz, World world); @@ -39,8 +39,8 @@ public interface ChunkManager { /** * Load a given Chunk's Chunklet data * - * @param cx Chunk X coordinate that is to be loaded - * @param cz Chunk Z coordinate that is to be loaded + * @param cx Chunk X coordinate that is to be loaded + * @param cz Chunk Z coordinate that is to be loaded * @param world World that the Chunk is in */ public void loadChunk(int cx, int cz, World world, Entity[] entities); @@ -48,8 +48,8 @@ public interface ChunkManager { /** * Unload a given Chunk's Chunklet data * - * @param cx Chunk X coordinate that is to be unloaded - * @param cz Chunk Z coordinate that is to be unloaded + * @param cx Chunk X coordinate that is to be unloaded + * @param cz Chunk Z coordinate that is to be unloaded * @param world World that the Chunk is in */ public void unloadChunk(int cx, int cz, World world); @@ -57,8 +57,8 @@ public interface ChunkManager { /** * Saves a given Chunk's Chunklet data * - * @param cx Chunk X coordinate that is to be saved - * @param cz Chunk Z coordinate that is to be saved + * @param cx Chunk X coordinate that is to be saved + * @param cz Chunk Z coordinate that is to be saved * @param world World that the Chunk is in */ public void saveChunk(int cx, int cz, World world); @@ -68,8 +68,8 @@ public interface ChunkManager { /** * Informs the ChunkletManager a chunk is loaded * - * @param cx Chunk X coordinate that is loaded - * @param cz Chunk Z coordinate that is loaded + * @param cx Chunk X coordinate that is loaded + * @param cz Chunk Z coordinate that is loaded * @param world World that the chunk was loaded in */ public void chunkLoaded(int cx, int cz, World world); @@ -77,8 +77,8 @@ public interface ChunkManager { /** * Informs the ChunkletManager a chunk is unloaded * - * @param cx Chunk X coordinate that is unloaded - * @param cz Chunk Z coordinate that is unloaded + * @param cx Chunk X coordinate that is unloaded + * @param cz Chunk Z coordinate that is unloaded * @param world World that the chunk was unloaded in */ public void chunkUnloaded(int cx, int cz, World world); @@ -117,9 +117,9 @@ public interface ChunkManager { /** * Check to see if a given location is set to true * - * @param x X coordinate to check - * @param y Y coordinate to check - * @param z Z coordinate to check + * @param x X coordinate to check + * @param y Y coordinate to check + * @param z Z coordinate to check * @param world World to check in * @return true if the given location is set to true, false if otherwise */ @@ -144,9 +144,9 @@ public interface ChunkManager { /** * Set a given location to true, should create stores as necessary if the location does not exist * - * @param x X coordinate to set - * @param y Y coordinate to set - * @param z Z coordinate to set + * @param x X coordinate to set + * @param y Y coordinate to set + * @param z Z coordinate to set * @param world World to set in */ public void setTrue(int x, int y, int z, World world); @@ -168,9 +168,9 @@ public interface ChunkManager { /** * Set a given location to false, should not create stores if one does not exist for the given location * - * @param x X coordinate to set - * @param y Y coordinate to set - * @param z Z coordinate to set + * @param x X coordinate to set + * @param y Y coordinate to set + * @param z Z coordinate to set * @param world World to set in */ public void setFalse(int x, int y, int z, World world); diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/HashChunkManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/HashChunkManager.java index 3fbd3487e..60d971d79 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/HashChunkManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/HashChunkManager.java @@ -11,9 +11,9 @@ import java.io.*; import java.util.*; public class HashChunkManager implements ChunkManager { - private HashMap> regionFiles = new HashMap>(); public HashMap store = new HashMap(); public ArrayList converters = new ArrayList(); + private HashMap> regionFiles = new HashMap>(); private HashMap oldData = new HashMap(); @Override @@ -46,19 +46,16 @@ public class HashChunkManager implements ChunkManager { } throw new RuntimeException("Wrong class type read for chunk meta data for " + x + ", " + z); - } - catch (IOException e) { + } catch (IOException e) { // Assume the format changed return null; //throw new RuntimeException("Unable to process chunk meta data for " + x + ", " + z, e); - } - catch (ClassNotFoundException e) { + } catch (ClassNotFoundException e) { // Assume the format changed //System.out.println("[SpoutPlugin] is Unable to find serialized class for " + x + ", " + z + ", " + e.getMessage()); return null; //throw new RuntimeException("Unable to find serialized class for " + x + ", " + z, e); - } - finally { + } finally { objectStream.close(); } } @@ -75,8 +72,7 @@ public class HashChunkManager implements ChunkManager { objectStream.flush(); objectStream.close(); data.setDirty(false); - } - catch (IOException e) { + } catch (IOException e) { throw new RuntimeException("Unable to write chunk meta data for " + x + ", " + z, e); } } @@ -139,8 +135,7 @@ public class HashChunkManager implements ChunkManager { if (!oldData.containsKey(key)) { oldData.put(key, (new File(world.getWorldFolder(), "mcmmo_data")).exists()); - } - else if (oldData.get(key)) { + } else if (oldData.get(key)) { if (convertChunk(new File(world.getWorldFolder(), "mcmmo_data"), cx, cz, world, true)) { return; } @@ -150,8 +145,9 @@ public class HashChunkManager implements ChunkManager { try { chunkStore = readChunkStore(world, cx, cz); + } catch (Exception e) { + e.printStackTrace(); } - catch (Exception e) { e.printStackTrace(); } if (chunkStore == null) { return; @@ -200,7 +196,8 @@ public class HashChunkManager implements ChunkManager { } @Override - public synchronized void chunkLoaded(int cx, int cz, World world) {} + public synchronized void chunkLoaded(int cx, int cz, World world) { + } @Override public synchronized void chunkUnloaded(int cx, int cz, World world) { @@ -226,8 +223,7 @@ public class HashChunkManager implements ChunkManager { if (worldName.equals(info[0])) { try { saveChunk(Integer.parseInt(info[1]), Integer.parseInt(info[2]), world); - } - catch (Exception e) { + } catch (Exception e) { // Ignore } } @@ -249,8 +245,7 @@ public class HashChunkManager implements ChunkManager { if (worldName.equals(info[0])) { try { unloadChunk(Integer.parseInt(info[1]), Integer.parseInt(info[2]), world); - } - catch (Exception e) { + } catch (Exception e) { // Ignore } } @@ -258,7 +253,8 @@ public class HashChunkManager implements ChunkManager { } @Override - public synchronized void loadWorld(World world) {} + public synchronized void loadWorld(World world) { + } @Override public synchronized void saveAll() { @@ -414,7 +410,8 @@ public class HashChunkManager implements ChunkManager { } @Override - public synchronized void cleanUp() {} + public synchronized void cleanUp() { + } public synchronized void convertChunk(File dataDir, int cx, int cz, World world) { convertChunk(dataDir, cx, cz, world, false); diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/McMMOSimpleRegionFile.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/McMMOSimpleRegionFile.java index 96107af81..53bf0d93d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/McMMOSimpleRegionFile.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/McMMOSimpleRegionFile.java @@ -25,21 +25,21 @@ import java.util.zip.DeflaterOutputStream; import java.util.zip.InflaterInputStream; public class McMMOSimpleRegionFile { - private RandomAccessFile file; + @SuppressWarnings("unused") + private static long TIMEOUT_TIME = 300000; // 5 min private final int[] dataStart = new int[1024]; private final int[] dataActualLength = new int[1024]; private final int[] dataLength = new int[1024]; private final ArrayList inuse = new ArrayList(); - private int segmentSize; - private int segmentMask; private final int rx; private final int rz; private final int defaultSegmentSize; private final File parent; + private RandomAccessFile file; + private int segmentSize; + private int segmentMask; @SuppressWarnings("unused") private long lastAccessTime = System.currentTimeMillis(); - @SuppressWarnings("unused") - private static long TIMEOUT_TIME = 300000; // 5 min public McMMOSimpleRegionFile(File f, int rx, int rz) { this(f, rx, rz, 10); @@ -91,8 +91,7 @@ public class McMMOSimpleRegionFile { } extendFile(); - } - catch (IOException fnfe) { + } catch (IOException fnfe) { throw new RuntimeException(fnfe); } } @@ -139,8 +138,7 @@ public class McMMOSimpleRegionFile { } extendFile(); - } - catch (IOException fnfe) { + } catch (IOException fnfe) { throw new RuntimeException(fnfe); } } @@ -197,8 +195,7 @@ public class McMMOSimpleRegionFile { } file = null; - } - catch (IOException ioe) { + } catch (IOException ioe) { throw new RuntimeException("Unable to close file", ioe); } } @@ -261,8 +258,7 @@ public class McMMOSimpleRegionFile { if (inuse.get(end)) { end++; start = end; - } - else { + } else { end++; } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/NullChunkManager.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/NullChunkManager.java index a83a98b33..2ea6c9d10 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/NullChunkManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/NullChunkManager.java @@ -10,7 +10,8 @@ import java.io.IOException; public class NullChunkManager implements ChunkManager { @Override - public void closeAll() {} + public void closeAll() { + } @Override public ChunkStore readChunkStore(World world, int x, int z) throws IOException { @@ -18,25 +19,32 @@ public class NullChunkManager implements ChunkManager { } @Override - public void writeChunkStore(World world, int x, int z, ChunkStore data) {} + public void writeChunkStore(World world, int x, int z, ChunkStore data) { + } @Override - public void closeChunkStore(World world, int x, int z) {} + public void closeChunkStore(World world, int x, int z) { + } @Override - public void loadChunklet(int cx, int cy, int cz, World world) {} + public void loadChunklet(int cx, int cy, int cz, World world) { + } @Override - public void unloadChunklet(int cx, int cy, int cz, World world) {} + public void unloadChunklet(int cx, int cy, int cz, World world) { + } @Override - public void loadChunk(int cx, int cz, World world, Entity[] entities) {} + public void loadChunk(int cx, int cz, World world, Entity[] entities) { + } @Override - public void unloadChunk(int cx, int cz, World world) {} + public void unloadChunk(int cx, int cz, World world) { + } @Override - public void saveChunk(int cx, int cz, World world) {} + public void saveChunk(int cx, int cz, World world) { + } @Override public boolean isChunkLoaded(int cx, int cz, World world) { @@ -44,25 +52,32 @@ public class NullChunkManager implements ChunkManager { } @Override - public void chunkLoaded(int cx, int cz, World world) {} + public void chunkLoaded(int cx, int cz, World world) { + } @Override - public void chunkUnloaded(int cx, int cz, World world) {} + public void chunkUnloaded(int cx, int cz, World world) { + } @Override - public void saveWorld(World world) {} + public void saveWorld(World world) { + } @Override - public void unloadWorld(World world) {} + public void unloadWorld(World world) { + } @Override - public void loadWorld(World world) {} + public void loadWorld(World world) { + } @Override - public void saveAll() {} + public void saveAll() { + } @Override - public void unloadAll() {} + public void unloadAll() { + } @Override public boolean isTrue(int x, int y, int z, World world) { @@ -80,23 +95,30 @@ public class NullChunkManager implements ChunkManager { } @Override - public void setTrue(int x, int y, int z, World world) {} + public void setTrue(int x, int y, int z, World world) { + } @Override - public void setTrue(Block block) {} + public void setTrue(Block block) { + } @Override - public void setTrue(BlockState blockState) {} + public void setTrue(BlockState blockState) { + } @Override - public void setFalse(int x, int y, int z, World world) {} + public void setFalse(int x, int y, int z, World world) { + } @Override - public void setFalse(Block block) {} + public void setFalse(Block block) { + } @Override - public void setFalse(BlockState blockState) {} + public void setFalse(BlockState blockState) { + } @Override - public void cleanUp() {} + public void cleanUp() { + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java index 58388c6bf..d0acb78ab 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/chunkmeta/PrimitiveChunkStore.java @@ -10,11 +10,13 @@ import java.util.UUID; public class PrimitiveChunkStore implements ChunkStore { private static final long serialVersionUID = -1L; - transient private boolean dirty = false; - /** X, Z, Y */ - public boolean[][][] store; private static final int CURRENT_VERSION = 7; private static final int MAGIC_NUMBER = 0xEA5EDEBB; + /** + * X, Z, Y + */ + public boolean[][][] store; + transient private boolean dirty = false; private int cx; private int cz; private UUID worldUid; @@ -137,8 +139,9 @@ public class PrimitiveChunkStore implements ChunkStore { for (int y = 0; y < store[0][0].length; y++) { try { store[x][z][y] = temp[x][y][z]; + } catch (Exception e) { + e.printStackTrace(); } - catch (Exception e) { e.printStackTrace(); } } } } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java index 3d9d1e8f1..433172a51 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionMain.java @@ -7,12 +7,12 @@ import org.bukkit.scheduler.BukkitScheduler; import java.io.File; public class BlockStoreConversionMain implements Runnable { - private int taskID, i; - private org.bukkit.World world; BukkitScheduler scheduler; File dataDir; File[] xDirs; BlockStoreConversionXDirectory[] converters; + private int taskID, i; + private org.bukkit.World world; public BlockStoreConversionMain(org.bukkit.World world) { this.taskID = -1; diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionXDirectory.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionXDirectory.java index e262acf49..d20741f5a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionXDirectory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionXDirectory.java @@ -7,12 +7,12 @@ import org.bukkit.scheduler.BukkitScheduler; import java.io.File; public class BlockStoreConversionXDirectory implements Runnable { - private int taskID, i; - private org.bukkit.World world; BukkitScheduler scheduler; File dataDir; File[] zDirs; BlockStoreConversionZDirectory[] converters; + private int taskID, i; + private org.bukkit.World world; public BlockStoreConversionXDirectory() { this.taskID = -1; diff --git a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionZDirectory.java b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionZDirectory.java index 029f33430..af843c23d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionZDirectory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/blockmeta/conversion/BlockStoreConversionZDirectory.java @@ -72,8 +72,7 @@ public class BlockStoreConversionZDirectory implements Runnable { try { this.cx = Integer.parseInt(this.cxs); this.cz = Integer.parseInt(this.czs); - } - catch (Exception e) { + } catch (Exception e) { this.dataDir.delete(); stop(); return; @@ -87,8 +86,7 @@ public class BlockStoreConversionZDirectory implements Runnable { if (this.tempChunklet instanceof PrimitiveChunkletStore) { this.primitiveChunklet = (PrimitiveChunkletStore) this.tempChunklet; - } - else if (this.tempChunklet instanceof PrimitiveExChunkletStore) { + } else if (this.tempChunklet instanceof PrimitiveExChunkletStore) { this.primitiveExChunklet = (PrimitiveExChunkletStore) this.tempChunklet; } @@ -115,8 +113,9 @@ public class BlockStoreConversionZDirectory implements Runnable { } this.newManager.setTrue(this.cxPos, this.y2, this.czPos, this.world); + } catch (Exception e) { + e.printStackTrace(); } - catch (Exception e) { e.printStackTrace(); } } } } @@ -136,8 +135,7 @@ public class BlockStoreConversionZDirectory implements Runnable { if (this.primitiveExChunklet != null) { this.oldArray = this.primitiveExChunklet.store[x][z]; - } - else { + } else { return; } @@ -145,8 +143,7 @@ public class BlockStoreConversionZDirectory implements Runnable { if (this.oldArray.length < 64) { return; - } - else if (this.newArray.length < ((this.y * 64) + 64)) { + } else if (this.newArray.length < ((this.y * 64) + 64)) { return; } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java b/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java index d8ccae273..69ac60e22 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManager.java @@ -43,13 +43,13 @@ public interface DatabaseManager { public boolean saveUser(PlayerProfile profile); /** - * Retrieve leaderboard info. - * - * @param skill The skill to retrieve info on - * @param pageNumber Which page in the leaderboards to retrieve - * @param statsPerPage The number of stats per page - * @return the requested leaderboard information - */ + * Retrieve leaderboard info. + * + * @param skill The skill to retrieve info on + * @param pageNumber Which page in the leaderboards to retrieve + * @param statsPerPage The number of stats per page + * @return the requested leaderboard information + */ public List readLeaderboard(PrimarySkillType skill, int pageNumber, int statsPerPage); /** @@ -67,20 +67,19 @@ public interface DatabaseManager { * Add a new user to the database. * * @param playerName The name of the player to be added to the database - * @param uuid The uuid of the player to be added to the database + * @param uuid The uuid of the player to be added to the database */ public void newUser(String playerName, UUID uuid); /** * Load a player from the database. * - * @deprecated replaced by {@link #loadPlayerProfile(String playerName, UUID uuid, boolean createNew)} - * * @param playerName The name of the player to load from the database - * @param createNew Whether to create a new record if the player is not - * found + * @param createNew Whether to create a new record if the player is not + * found * @return The player's data, or an unloaded PlayerProfile if not found - * and createNew is false + * and createNew is false + * @deprecated replaced by {@link #loadPlayerProfile(String playerName, UUID uuid, boolean createNew)} */ @Deprecated public PlayerProfile loadPlayerProfile(String playerName, boolean createNew); @@ -97,11 +96,11 @@ public interface DatabaseManager { * Load a player from the database. Attempt to use uuid, fall back on playername * * @param playerName The name of the player to load from the database - * @param uuid The uuid of the player to load from the database - * @param createNew Whether to create a new record if the player is not - * found + * @param uuid The uuid of the player to load from the database + * @param createNew Whether to create a new record if the player is not + * found * @return The player's data, or an unloaded PlayerProfile if not found - * and createNew is false + * and createNew is false */ public PlayerProfile loadPlayerProfile(String playerName, UUID uuid, boolean createNew); diff --git a/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManagerFactory.java b/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManagerFactory.java index d1e4bc497..27d8ebd4b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManagerFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/database/DatabaseManagerFactory.java @@ -11,12 +11,10 @@ public class DatabaseManagerFactory { if (customManager != null) { try { return createDefaultCustomDatabaseManager(); - } - catch (Exception e) { + } catch (Exception e) { mcMMO.p.debug("Could not create custom database manager"); e.printStackTrace(); - } - catch (Throwable e) { + } catch (Throwable e) { mcMMO.p.debug("Failed to create custom database manager"); e.printStackTrace(); } @@ -26,6 +24,10 @@ public class DatabaseManagerFactory { return Config.getInstance().getUseMySQL() ? new SQLDatabaseManager() : new FlatfileDatabaseManager(); } + public static Class getCustomDatabaseManagerClass() { + return customManager; + } + /** * Sets the custom DatabaseManager class for mcMMO to use. This should be * called prior to mcMMO enabling. @@ -38,7 +40,6 @@ public class DatabaseManagerFactory { * versions. * * @param clazz the DatabaseManager class to use - * * @throws IllegalArgumentException if the provided class does not have * an empty constructor */ @@ -46,16 +47,11 @@ public class DatabaseManagerFactory { try { clazz.getConstructor(); customManager = clazz; - } - catch (Throwable e) { + } catch (Throwable e) { throw new IllegalArgumentException("Provided database manager class must have an empty constructor", e); } } - public static Class getCustomDatabaseManagerClass() { - return customManager; - } - public static DatabaseManager createDatabaseManager(DatabaseType type) { switch (type) { case DatabaseType.FLATFILE: @@ -67,8 +63,7 @@ public class DatabaseManagerFactory { case DatabaseType.CUSTOM: try { return createDefaultCustomDatabaseManager(); - } - catch (Throwable e) { + } catch (Throwable e) { e.printStackTrace(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/database/FlatfileDatabaseManager.java b/core/src/main/java/com/gmail/nossr50/core/data/database/FlatfileDatabaseManager.java index 0fa7ad213..6409f7ad9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/database/FlatfileDatabaseManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/database/FlatfileDatabaseManager.java @@ -20,14 +20,52 @@ import java.io.*; import java.util.*; public final class FlatfileDatabaseManager implements DatabaseManager { + private static final Object fileWritingLock = new Object(); + public static int USERNAME = 0; + public static int SKILLS_MINING = 1; + public static int EXP_MINING = 4; + public static int SKILLS_WOODCUTTING = 5; + public static int EXP_WOODCUTTING = 6; + public static int SKILLS_REPAIR = 7; + public static int SKILLS_UNARMED = 8; + public static int SKILLS_HERBALISM = 9; + public static int SKILLS_EXCAVATION = 10; + public static int SKILLS_ARCHERY = 11; + public static int SKILLS_SWORDS = 12; + public static int SKILLS_AXES = 13; + public static int SKILLS_ACROBATICS = 14; + public static int EXP_REPAIR = 15; + public static int EXP_UNARMED = 16; + public static int EXP_HERBALISM = 17; + public static int EXP_EXCAVATION = 18; + public static int EXP_ARCHERY = 19; + public static int EXP_SWORDS = 20; + public static int EXP_AXES = 21; + public static int EXP_ACROBATICS = 22; + public static int SKILLS_TAMING = 24; + public static int EXP_TAMING = 25; + public static int COOLDOWN_BERSERK = 26; + public static int COOLDOWN_GIGA_DRILL_BREAKER = 27; + public static int COOLDOWN_TREE_FELLER = 28; + public static int COOLDOWN_GREEN_TERRA = 29; + public static int COOLDOWN_SERRATED_STRIKES = 30; + public static int COOLDOWN_SKULL_SPLITTER = 31; + public static int COOLDOWN_SUPER_BREAKER = 32; + public static int SKILLS_FISHING = 34; + public static int EXP_FISHING = 35; + public static int COOLDOWN_BLAST_MINING = 36; + public static int LAST_LOGIN = 37; + public static int HEALTHBAR = 38; + public static int SKILLS_ALCHEMY = 39; + public static int EXP_ALCHEMY = 40; + public static int UUID_INDEX = 41; + public static int SCOREBOARD_TIPS = 42; + public static int COOLDOWN_CHIMAERA_WING = 43; private final HashMap> playerStatHash = new HashMap>(); private final List powerLevels = new ArrayList(); - private long lastUpdate = 0; - private final long UPDATE_WAIT_TIME = 600000L; // 10 minutes private final File usersFile; - private static final Object fileWritingLock = new Object(); - + private long lastUpdate = 0; protected FlatfileDatabaseManager() { usersFile = new File(mcMMO.getUsersFilePath()); checkStructure(); @@ -69,8 +107,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager { // If they're still around, rewrite them to the file. if (!powerless) { writer.append(line).append("\r\n"); - } - else { + } else { purgedUsers++; } } @@ -78,24 +115,20 @@ public final class FlatfileDatabaseManager implements DatabaseManager { // Write the new file out = new FileWriter(usersFilePath); out.write(writer.toString()); - } - catch (IOException e) { + } catch (IOException e) { mcMMO.p.getLogger().severe("Exception while reading " + usersFilePath + " (Are you sure you formatted it correctly?)" + e.toString()); - } - finally { + } finally { if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } if (out != null) { try { out.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -129,8 +162,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager { boolean rewrite = false; try { lastPlayed = Long.parseLong(character[37]) * Misc.TIME_CONVERSION_FACTOR; - } - catch (NumberFormatException e) { + } catch (NumberFormatException e) { e.printStackTrace(); } if (lastPlayed == 0) { @@ -141,15 +173,13 @@ public final class FlatfileDatabaseManager implements DatabaseManager { if (currentTime - lastPlayed > PURGE_TIME) { removedPlayers++; - } - else { + } else { if (rewrite) { // Rewrite their data with a valid time character[37] = Long.toString(lastPlayed); String newLine = org.apache.commons.lang.StringUtils.join(character, ":"); writer.append(newLine).append("\r\n"); - } - else { + } else { writer.append(line).append("\r\n"); } } @@ -158,24 +188,20 @@ public final class FlatfileDatabaseManager implements DatabaseManager { // Write the new file out = new FileWriter(usersFilePath); out.write(writer.toString()); - } - catch (IOException e) { + } catch (IOException e) { mcMMO.p.getLogger().severe("Exception while reading " + usersFilePath + " (Are you sure you formatted it correctly?)" + e.toString()); - } - finally { + } finally { if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } if (out != null) { try { out.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -211,24 +237,20 @@ public final class FlatfileDatabaseManager implements DatabaseManager { out = new FileWriter(usersFilePath); // Write out the new file out.write(writer.toString()); - } - catch (Exception e) { + } catch (Exception e) { mcMMO.p.getLogger().severe("Exception while reading " + usersFilePath + " (Are you sure you formatted it correctly?)" + e.toString()); - } - finally { + } finally { if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } if (out != null) { try { out.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -262,8 +284,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager { String[] character = line.split(":"); if (!(uuid != null && character[UUID_INDEX].equalsIgnoreCase(uuid.toString())) && !character[USERNAME].equalsIgnoreCase(playerName)) { writer.append(line).append("\r\n"); - } - else { + } else { // Otherwise write the new player information writeUserToLine(profile, playerName, uuid, writer); wroteUser = true; @@ -273,8 +294,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager { /* * If we couldn't find the user in the DB we need to add him */ - if(!wroteUser) - { + if (!wroteUser) { writeUserToLine(profile, playerName, uuid, writer); } @@ -282,25 +302,21 @@ public final class FlatfileDatabaseManager implements DatabaseManager { out = new FileWriter(usersFilePath); out.write(writer.toString()); return true; - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); return false; - } - finally { + } finally { if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } if (out != null) { try { out.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -435,16 +451,13 @@ public final class FlatfileDatabaseManager implements DatabaseManager { // Add more in the same format as the line above out.newLine(); - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); - } - finally { + } finally { if (out != null) { try { out.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -506,18 +519,15 @@ public final class FlatfileDatabaseManager implements DatabaseManager { newUser(playerName, uuid); return new PlayerProfile(playerName, uuid, true); } - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); - } - finally { + } finally { // I have no idea why it's necessary to inline tryClose() here, but it removes // a resource leak warning, and I'm trusting the compiler on this one. if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -549,23 +559,19 @@ public final class FlatfileDatabaseManager implements DatabaseManager { try { destination.saveUser(loadFromLine(character)); - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); } convertedUsers++; Misc.printProgress(convertedUsers, progressInterval, startMillis); } - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); - } - finally { + } finally { if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -606,25 +612,21 @@ public final class FlatfileDatabaseManager implements DatabaseManager { out = new FileWriter(usersFilePath); // Write out the new file out.write(writer.toString()); - } - catch (Exception e) { + } catch (Exception e) { mcMMO.p.getLogger().severe("Exception while reading " + usersFilePath + " (Are you sure you formatted it correctly?)" + e.toString()); - } - finally { + } finally { mcMMO.p.getLogger().info(i + " entries written while saving UUID for " + userName); if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } if (out != null) { try { out.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -665,25 +667,21 @@ public final class FlatfileDatabaseManager implements DatabaseManager { out = new FileWriter(usersFilePath); // Write out the new file out.write(writer.toString()); - } - catch (Exception e) { + } catch (Exception e) { mcMMO.p.getLogger().severe("Exception while reading " + usersFilePath + " (Are you sure you formatted it correctly?)" + e.toString()); - } - finally { + } finally { mcMMO.p.getLogger().info(i + " entries written while saving UUID batch"); if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } if (out != null) { try { out.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -708,16 +706,13 @@ public final class FlatfileDatabaseManager implements DatabaseManager { String[] character = line.split(":"); users.add(character[USERNAME]); } - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); - } - finally { + } finally { if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -785,16 +780,13 @@ public final class FlatfileDatabaseManager implements DatabaseManager { putStat(powerLevels, playerName, powerLevel); } - } - catch (Exception e) { + } catch (Exception e) { mcMMO.p.getLogger().severe("Exception while reading " + usersFilePath + " during user " + playerName + " (Are you sure you formatted it correctly?) " + e.toString()); - } - finally { + } finally { if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -1005,11 +997,9 @@ public final class FlatfileDatabaseManager implements DatabaseManager { corrupted = true; if (i == 37) { character[i] = String.valueOf(System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR); - } - else if (i == 38) { + } else if (i == 38) { character[i] = Config.getInstance().getMobHealthbarDefault().toString(); - } - else { + } else { character[i] = "0"; } } @@ -1056,24 +1046,20 @@ public final class FlatfileDatabaseManager implements DatabaseManager { // Write the new file out = new FileWriter(usersFilePath); out.write(writer.toString()); - } - catch (IOException e) { + } catch (IOException e) { mcMMO.p.getLogger().severe("Exception while reading " + usersFilePath + " (Are you sure you formatted it correctly?)" + e.toString()); - } - finally { + } finally { if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } if (out != null) { try { out.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } @@ -1095,8 +1081,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager { try { mcMMO.p.debug("Creating mcmmo.users file..."); new File(mcMMO.getUsersFilePath()).createNewFile(); - } - catch (IOException e) { + } catch (IOException e) { e.printStackTrace(); } } @@ -1124,16 +1109,9 @@ public final class FlatfileDatabaseManager implements DatabaseManager { return statValue; } - private class SkillComparator implements Comparator { - @Override - public int compare(PlayerStat o1, PlayerStat o2) { - return (o2.statVal - o1.statVal); - } - } - private PlayerProfile loadFromLine(String[] character) { - Map skills = getSkillMapFromLine(character); // Skill levels - Map skillsXp = new EnumMap(PrimarySkillType.class); // Skill & XP + Map skills = getSkillMapFromLine(character); // Skill levels + Map skillsXp = new EnumMap(PrimarySkillType.class); // Skill & XP Map skillsDATS = new EnumMap(SuperAbilityType.class); // Ability & Cooldown Map uniquePlayerDataMap = new EnumMap(UniqueDataType.class); MobHealthbarType mobHealthbarType; @@ -1170,30 +1148,26 @@ public final class FlatfileDatabaseManager implements DatabaseManager { try { mobHealthbarType = MobHealthbarType.valueOf(character[HEALTHBAR]); - } - catch (Exception e) { + } catch (Exception e) { mobHealthbarType = Config.getInstance().getMobHealthbarDefault(); } UUID uuid; try { uuid = UUID.fromString(character[UUID_INDEX]); - } - catch (Exception e) { + } catch (Exception e) { uuid = null; } try { scoreboardTipsShown = Integer.valueOf(character[SCOREBOARD_TIPS]); - } - catch (Exception e) { + } catch (Exception e) { scoreboardTipsShown = 0; } try { uniquePlayerDataMap.put(UniqueDataType.CHIMAERA_WING_DATS, Integer.valueOf(character[COOLDOWN_CHIMAERA_WING])); - } - catch (Exception e) { + } catch (Exception e) { uniquePlayerDataMap.put(UniqueDataType.CHIMAERA_WING_DATS, 0); } @@ -1225,7 +1199,8 @@ public final class FlatfileDatabaseManager implements DatabaseManager { } @Override - public void onDisable() { } + public void onDisable() { + } private int getSkillIndex(PrimarySkillType skill) { switch (skill) { @@ -1257,50 +1232,9 @@ public final class FlatfileDatabaseManager implements DatabaseManager { return SKILLS_WOODCUTTING; default: throw new RuntimeException("Primary Skills only"); - + } } - - public static int USERNAME = 0; - public static int SKILLS_MINING = 1; - public static int EXP_MINING = 4; - public static int SKILLS_WOODCUTTING = 5; - public static int EXP_WOODCUTTING = 6; - public static int SKILLS_REPAIR = 7; - public static int SKILLS_UNARMED = 8; - public static int SKILLS_HERBALISM = 9; - public static int SKILLS_EXCAVATION = 10; - public static int SKILLS_ARCHERY = 11; - public static int SKILLS_SWORDS = 12; - public static int SKILLS_AXES = 13; - public static int SKILLS_ACROBATICS = 14; - public static int EXP_REPAIR = 15; - public static int EXP_UNARMED = 16; - public static int EXP_HERBALISM = 17; - public static int EXP_EXCAVATION = 18; - public static int EXP_ARCHERY = 19; - public static int EXP_SWORDS = 20; - public static int EXP_AXES = 21; - public static int EXP_ACROBATICS = 22; - public static int SKILLS_TAMING = 24; - public static int EXP_TAMING = 25; - public static int COOLDOWN_BERSERK = 26; - public static int COOLDOWN_GIGA_DRILL_BREAKER = 27; - public static int COOLDOWN_TREE_FELLER = 28; - public static int COOLDOWN_GREEN_TERRA = 29; - public static int COOLDOWN_SERRATED_STRIKES = 30; - public static int COOLDOWN_SKULL_SPLITTER = 31; - public static int COOLDOWN_SUPER_BREAKER = 32; - public static int SKILLS_FISHING = 34; - public static int EXP_FISHING = 35; - public static int COOLDOWN_BLAST_MINING = 36; - public static int LAST_LOGIN = 37; - public static int HEALTHBAR = 38; - public static int SKILLS_ALCHEMY = 39; - public static int EXP_ALCHEMY = 40; - public static int UUID_INDEX = 41; - public static int SCOREBOARD_TIPS = 42; - public static int COOLDOWN_CHIMAERA_WING = 43; public void resetMobHealthSettings() { BufferedReader in = null; @@ -1319,9 +1253,9 @@ public final class FlatfileDatabaseManager implements DatabaseManager { continue; } String[] character = line.split(":"); - + character[HEALTHBAR] = Config.getInstance().getMobHealthbarDefault().toString(); - + line = new StringBuilder(org.apache.commons.lang.StringUtils.join(character, ":")).append(":").toString(); writer.append(line).append("\r\n"); @@ -1330,28 +1264,31 @@ public final class FlatfileDatabaseManager implements DatabaseManager { // Write the new file out = new FileWriter(usersFilePath); out.write(writer.toString()); - } - catch (IOException e) { + } catch (IOException e) { mcMMO.p.getLogger().severe("Exception while reading " + usersFilePath + " (Are you sure you formatted it correctly?)" + e.toString()); - } - finally { + } finally { if (in != null) { try { in.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } if (out != null) { try { out.close(); - } - catch (IOException e) { + } catch (IOException e) { // Ignore } } } } } + + private class SkillComparator implements Comparator { + @Override + public int compare(PlayerStat o1, PlayerStat o2) { + return (o2.statVal - o1.statVal); + } + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/data/database/SQLDatabaseManager.java b/core/src/main/java/com/gmail/nossr50/core/data/database/SQLDatabaseManager.java index d05476b61..48a3a73ad 100644 --- a/core/src/main/java/com/gmail/nossr50/core/data/database/SQLDatabaseManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/data/database/SQLDatabaseManager.java @@ -23,10 +23,8 @@ import java.util.concurrent.locks.ReentrantLock; public final class SQLDatabaseManager implements DatabaseManager { private static final String ALL_QUERY_VERSION = "total"; - private String tablePrefix = Config.getInstance().getMySQLTablePrefix(); - private final Map cachedUserIDs = new HashMap(); - + private String tablePrefix = Config.getInstance().getMySQLTablePrefix(); private DataSource miscPool; private DataSource loadPool; private DataSource savePool; @@ -37,20 +35,19 @@ public final class SQLDatabaseManager implements DatabaseManager { String connectionString = "jdbc:mysql://" + Config.getInstance().getMySQLServerName() + ":" + Config.getInstance().getMySQLServerPort() + "/" + Config.getInstance().getMySQLDatabaseName(); - if(Config.getInstance().getMySQLSSL()) + if (Config.getInstance().getMySQLSSL()) connectionString += - "?verifyServerCertificate=false"+ - "&useSSL=true"+ - "&requireSSL=true"; + "?verifyServerCertificate=false" + + "&useSSL=true" + + "&requireSSL=true"; else - connectionString+= + connectionString += "?useSSL=false"; try { // Force driver to load if not yet loaded Class.forName("com.mysql.jdbc.Driver"); - } - catch (ClassNotFoundException e) { + } catch (ClassNotFoundException e) { e.printStackTrace(); return; //throw e; // aborts onEnable() Riking if you want to do this, fully implement it. @@ -128,11 +125,9 @@ public final class SQLDatabaseManager implements DatabaseManager { statement.executeUpdate("DELETE FROM `" + tablePrefix + "huds` WHERE NOT EXISTS (SELECT * FROM `" + tablePrefix + "skills` `s` WHERE `" + tablePrefix + "huds`.`user_id` = `s`.`user_id`)"); statement.executeUpdate("DELETE FROM `" + tablePrefix + "cooldowns` WHERE NOT EXISTS (SELECT * FROM `" + tablePrefix + "skills` `s` WHERE `" + tablePrefix + "cooldowns`.`user_id` = `s`.`user_id`)"); statement.executeUpdate("DELETE FROM `" + tablePrefix + "users` WHERE NOT EXISTS (SELECT * FROM `" + tablePrefix + "skills` `s` WHERE `" + tablePrefix + "users`.`id` = `s`.`user_id`)"); - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(statement); tryClose(connection); massUpdateLock.unlock(); @@ -159,11 +154,9 @@ public final class SQLDatabaseManager implements DatabaseManager { "JOIN " + tablePrefix + "skills s ON (u.id = s.user_id) " + "JOIN " + tablePrefix + "cooldowns c ON (u.id = c.user_id) " + "WHERE ((UNIX_TIMESTAMP() - lastlogin) > " + PURGE_TIME + ")"); - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(statement); tryClose(connection); massUpdateLock.unlock(); @@ -190,11 +183,9 @@ public final class SQLDatabaseManager implements DatabaseManager { statement.setString(1, playerName); success = statement.executeUpdate() != 0; - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(statement); tryClose(connection); } @@ -320,11 +311,9 @@ public final class SQLDatabaseManager implements DatabaseManager { mcMMO.p.getLogger().severe("Failed to update hud settings for " + profile.getPlayerName()); return false; } - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(statement); tryClose(connection); } @@ -356,11 +345,9 @@ public final class SQLDatabaseManager implements DatabaseManager { stats.add(new PlayerStat(column.get(1), Integer.valueOf(column.get(0)))); } - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(resultSet); tryClose(statement); tryClose(connection); @@ -452,11 +439,9 @@ public final class SQLDatabaseManager implements DatabaseManager { resultSet.close(); statement.close(); - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(resultSet); tryClose(statement); tryClose(connection); @@ -471,11 +456,9 @@ public final class SQLDatabaseManager implements DatabaseManager { try { connection = getConnection(PoolIdentifier.MISC); newUser(connection, playerName, uuid); - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(connection); } } @@ -507,11 +490,9 @@ public final class SQLDatabaseManager implements DatabaseManager { writeMissingRows(connection, resultSet.getInt(1)); return resultSet.getInt(1); - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(resultSet); tryClose(statement); } @@ -599,17 +580,14 @@ public final class SQLDatabaseManager implements DatabaseManager { } return profile; - } - catch (SQLException e) { + } catch (SQLException e) { printErrors(e); } } resultSet.close(); - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(resultSet); tryClose(statement); tryClose(connection); @@ -655,19 +633,16 @@ public final class SQLDatabaseManager implements DatabaseManager { resultSet.next(); destination.saveUser(loadFromResult(playerName, resultSet)); resultSet.close(); - } - catch (SQLException e) { + } catch (SQLException e) { printErrors(e); // Ignore } convertedUsers++; Misc.printProgress(convertedUsers, progressInterval, startMillis); } - } - catch (SQLException e) { + } catch (SQLException e) { printErrors(e); - } - finally { + } finally { tryClose(resultSet); tryClose(statement); tryClose(connection); @@ -688,12 +663,10 @@ public final class SQLDatabaseManager implements DatabaseManager { statement.setString(2, userName); statement.execute(); return true; - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); return false; - } - finally { + } finally { tryClose(statement); tryClose(connection); } @@ -728,12 +701,10 @@ public final class SQLDatabaseManager implements DatabaseManager { } return true; - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); return false; - } - finally { + } finally { tryClose(statement); tryClose(connection); } @@ -753,11 +724,9 @@ public final class SQLDatabaseManager implements DatabaseManager { while (resultSet.next()) { users.add(resultSet.getString("user")); } - } - catch (SQLException e) { + } catch (SQLException e) { printErrors(e); - } - finally { + } finally { tryClose(resultSet); tryClose(statement); tryClose(connection); @@ -787,13 +756,13 @@ public final class SQLDatabaseManager implements DatabaseManager { if (!resultSet.next()) { createStatement = connection.createStatement(); createStatement.executeUpdate("CREATE TABLE IF NOT EXISTS `" + tablePrefix + "users` (" - + "`id` int(10) unsigned NOT NULL AUTO_INCREMENT," - + "`user` varchar(40) NOT NULL," - + "`uuid` varchar(36) NULL DEFAULT NULL," - + "`lastlogin` int(32) unsigned NOT NULL," - + "PRIMARY KEY (`id`)," - + "INDEX(`user`(20) ASC)," - + "UNIQUE KEY `uuid` (`uuid`)) DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;"); + + "`id` int(10) unsigned NOT NULL AUTO_INCREMENT," + + "`user` varchar(40) NOT NULL," + + "`uuid` varchar(36) NULL DEFAULT NULL," + + "`lastlogin` int(32) unsigned NOT NULL," + + "PRIMARY KEY (`id`)," + + "INDEX(`user`(20) ASC)," + + "UNIQUE KEY `uuid` (`uuid`)) DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;"); tryClose(createStatement); } tryClose(resultSet); @@ -845,20 +814,20 @@ public final class SQLDatabaseManager implements DatabaseManager { createStatement = connection.createStatement(); createStatement.executeUpdate("CREATE TABLE IF NOT EXISTS `" + tablePrefix + "skills` (" + "`user_id` int(10) unsigned NOT NULL," - + "`taming` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`mining` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`woodcutting` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`repair` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`unarmed` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`herbalism` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`excavation` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`archery` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`swords` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`axes` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`acrobatics` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`fishing` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`alchemy` int(10) unsigned NOT NULL DEFAULT "+startingLevel+"," - + "`total` int(10) unsigned NOT NULL DEFAULT "+totalLevel+"," + + "`taming` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`mining` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`woodcutting` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`repair` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`unarmed` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`herbalism` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`excavation` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`archery` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`swords` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`axes` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`acrobatics` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`fishing` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`alchemy` int(10) unsigned NOT NULL DEFAULT " + startingLevel + "," + + "`total` int(10) unsigned NOT NULL DEFAULT " + totalLevel + "," + "PRIMARY KEY (`user_id`)) " + "DEFAULT CHARSET=latin1;"); tryClose(createStatement); @@ -912,11 +881,9 @@ public final class SQLDatabaseManager implements DatabaseManager { createStatement.executeUpdate("DELETE FROM `" + tablePrefix + "huds` WHERE NOT EXISTS (SELECT * FROM `" + tablePrefix + "users` `u` WHERE `" + tablePrefix + "huds`.`user_id` = `u`.`id`)"); createStatement.executeUpdate("DELETE FROM `" + tablePrefix + "cooldowns` WHERE NOT EXISTS (SELECT * FROM `" + tablePrefix + "users` `u` WHERE `" + tablePrefix + "cooldowns`.`user_id` = `u`.`id`)"); createStatement.executeUpdate("DELETE FROM `" + tablePrefix + "skills` WHERE NOT EXISTS (SELECT * FROM `" + tablePrefix + "users` `u` WHERE `" + tablePrefix + "skills`.`user_id` = `u`.`id`)"); - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(resultSet); tryClose(statement); tryClose(createStatement); @@ -1014,11 +981,9 @@ public final class SQLDatabaseManager implements DatabaseManager { } mcMMO.getUpgradeManager().setUpgradeCompleted(upgrade); - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(statement); } } @@ -1048,11 +1013,9 @@ public final class SQLDatabaseManager implements DatabaseManager { statement.setInt(3, 0); statement.execute(); statement.close(); - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(statement); } } @@ -1117,22 +1080,19 @@ public final class SQLDatabaseManager implements DatabaseManager { try { mobHealthbarType = MobHealthbarType.valueOf(result.getString(OFFSET_OTHER + 1)); - } - catch (Exception e) { + } catch (Exception e) { mobHealthbarType = Config.getInstance().getMobHealthbarDefault(); } try { scoreboardTipsShown = result.getInt(OFFSET_OTHER + 2); - } - catch (Exception e) { + } catch (Exception e) { scoreboardTipsShown = 0; } try { uuid = UUID.fromString(result.getString(OFFSET_OTHER + 3)); - } - catch (Exception e) { + } catch (Exception e) { uuid = null; } @@ -1163,7 +1123,7 @@ public final class SQLDatabaseManager implements DatabaseManager { } resultSet.close(); mcMMO.p.getLogger().info("Updating mcMMO MySQL tables to drop name uniqueness..."); - statement.execute("ALTER TABLE `" + tablePrefix + "users` " + statement.execute("ALTER TABLE `" + tablePrefix + "users` " + "DROP INDEX `user`," + "ADD INDEX `user` (`user`(20) ASC)"); } catch (SQLException ex) { @@ -1176,8 +1136,7 @@ public final class SQLDatabaseManager implements DatabaseManager { private void checkUpgradeAddAlchemy(final Statement statement) throws SQLException { try { statement.executeQuery("SELECT `alchemy` FROM `" + tablePrefix + "skills` LIMIT 1"); - } - catch (SQLException ex) { + } catch (SQLException ex) { mcMMO.p.getLogger().info("Updating mcMMO MySQL tables for Alchemy..."); statement.executeUpdate("ALTER TABLE `" + tablePrefix + "skills` ADD `alchemy` int(10) NOT NULL DEFAULT '0'"); statement.executeUpdate("ALTER TABLE `" + tablePrefix + "experience` ADD `alchemy` int(10) NOT NULL DEFAULT '0'"); @@ -1187,8 +1146,7 @@ public final class SQLDatabaseManager implements DatabaseManager { private void checkUpgradeAddBlastMiningCooldown(final Statement statement) throws SQLException { try { statement.executeQuery("SELECT `blast_mining` FROM `" + tablePrefix + "cooldowns` LIMIT 1"); - } - catch (SQLException ex) { + } catch (SQLException ex) { mcMMO.p.getLogger().info("Updating mcMMO MySQL tables for Blast Mining..."); statement.executeUpdate("ALTER TABLE `" + tablePrefix + "cooldowns` ADD `blast_mining` int(32) NOT NULL DEFAULT '0'"); } @@ -1197,8 +1155,7 @@ public final class SQLDatabaseManager implements DatabaseManager { private void checkUpgradeAddUniqueChimaeraWing(final Statement statement) throws SQLException { try { statement.executeQuery("SELECT `chimaera_wing` FROM `" + tablePrefix + "cooldowns` LIMIT 1"); - } - catch (SQLException ex) { + } catch (SQLException ex) { mcMMO.p.getLogger().info("Updating mcMMO MySQL tables for Chimaera Wing..."); statement.executeUpdate("ALTER TABLE `" + tablePrefix + "cooldowns` ADD `chimaera_wing` int(32) NOT NULL DEFAULT '0'"); } @@ -1207,8 +1164,7 @@ public final class SQLDatabaseManager implements DatabaseManager { private void checkUpgradeAddFishing(final Statement statement) throws SQLException { try { statement.executeQuery("SELECT `fishing` FROM `" + tablePrefix + "skills` LIMIT 1"); - } - catch (SQLException ex) { + } catch (SQLException ex) { mcMMO.p.getLogger().info("Updating mcMMO MySQL tables for Fishing..."); statement.executeUpdate("ALTER TABLE `" + tablePrefix + "skills` ADD `fishing` int(10) NOT NULL DEFAULT '0'"); statement.executeUpdate("ALTER TABLE `" + tablePrefix + "experience` ADD `fishing` int(10) NOT NULL DEFAULT '0'"); @@ -1218,8 +1174,7 @@ public final class SQLDatabaseManager implements DatabaseManager { private void checkUpgradeAddMobHealthbars(final Statement statement) throws SQLException { try { statement.executeQuery("SELECT `mobhealthbar` FROM `" + tablePrefix + "huds` LIMIT 1"); - } - catch (SQLException ex) { + } catch (SQLException ex) { mcMMO.p.getLogger().info("Updating mcMMO MySQL tables for mob healthbars..."); statement.executeUpdate("ALTER TABLE `" + tablePrefix + "huds` ADD `mobhealthbar` varchar(50) NOT NULL DEFAULT '" + Config.getInstance().getMobHealthbarDefault() + "'"); } @@ -1228,8 +1183,7 @@ public final class SQLDatabaseManager implements DatabaseManager { private void checkUpgradeAddScoreboardTips(final Statement statement) throws SQLException { try { statement.executeQuery("SELECT `scoreboardtips` FROM `" + tablePrefix + "huds` LIMIT 1"); - } - catch (SQLException ex) { + } catch (SQLException ex) { mcMMO.p.getLogger().info("Updating mcMMO MySQL tables for scoreboard tips..."); statement.executeUpdate("ALTER TABLE `" + tablePrefix + "huds` ADD `scoreboardtips` int(10) NOT NULL DEFAULT '0' ;"); } @@ -1250,17 +1204,14 @@ public final class SQLDatabaseManager implements DatabaseManager { try { statement.executeUpdate("ALTER TABLE `" + tablePrefix + "skills` ADD INDEX `idx_" + skill_name + "` (`" + skill_name + "`) USING BTREE"); - } - catch (SQLException ex) { + } catch (SQLException ex) { // Ignore } } } - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(resultSet); } } @@ -1286,17 +1237,202 @@ public final class SQLDatabaseManager implements DatabaseManager { statement.executeUpdate("ALTER TABLE `" + tablePrefix + "users` ADD `uuid` varchar(36) NULL DEFAULT NULL"); statement.executeUpdate("ALTER TABLE `" + tablePrefix + "users` ADD UNIQUE INDEX `uuid` (`uuid`) USING BTREE"); } - } - catch (SQLException ex) { + } catch (SQLException ex) { printErrors(ex); - } - finally { + } finally { tryClose(resultSet); } new GetUUIDUpdatesRequired().runTaskLaterAsynchronously(mcMMO.p, 100); // wait until after first purge } + private void checkUpgradeDropPartyNames(final Statement statement) { + ResultSet resultSet = null; + + try { + resultSet = statement.executeQuery("SELECT * FROM `" + tablePrefix + "users` LIMIT 1"); + + ResultSetMetaData rsmeta = resultSet.getMetaData(); + boolean column_exists = false; + + for (int i = 1; i <= rsmeta.getColumnCount(); i++) { + if (rsmeta.getColumnName(i).equalsIgnoreCase("party")) { + column_exists = true; + break; + } + } + + if (column_exists) { + mcMMO.p.getLogger().info("Removing party name from users table..."); + statement.executeUpdate("ALTER TABLE `" + tablePrefix + "users` DROP COLUMN `party`"); + } + } catch (SQLException ex) { + printErrors(ex); + } finally { + tryClose(resultSet); + } + } + + private void checkUpgradeSkillTotal(final Connection connection) throws SQLException { + ResultSet resultSet = null; + Statement statement = null; + + try { + connection.setAutoCommit(false); + statement = connection.createStatement(); + resultSet = statement.executeQuery("SELECT * FROM `" + tablePrefix + "skills` LIMIT 1"); + + ResultSetMetaData rsmeta = resultSet.getMetaData(); + boolean column_exists = false; + + for (int i = 1; i <= rsmeta.getColumnCount(); i++) { + if (rsmeta.getColumnName(i).equalsIgnoreCase("total")) { + column_exists = true; + break; + } + } + + if (!column_exists) { + mcMMO.p.getLogger().info("Adding skill total column to skills table..."); + statement.executeUpdate("ALTER TABLE `" + tablePrefix + "skills` ADD COLUMN `total` int NOT NULL DEFAULT '0'"); + statement.executeUpdate("UPDATE `" + tablePrefix + "skills` SET `total` = (taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy)"); + statement.executeUpdate("ALTER TABLE `" + tablePrefix + "skills` ADD INDEX `idx_total` (`total`) USING BTREE"); + connection.commit(); + } + } catch (SQLException ex) { + printErrors(ex); + } finally { + connection.setAutoCommit(true); + tryClose(resultSet); + tryClose(statement); + } + } + + private void checkUpgradeDropSpout(final Statement statement) { + ResultSet resultSet = null; + + try { + resultSet = statement.executeQuery("SELECT * FROM `" + tablePrefix + "huds` LIMIT 1"); + + ResultSetMetaData rsmeta = resultSet.getMetaData(); + boolean column_exists = false; + + for (int i = 1; i <= rsmeta.getColumnCount(); i++) { + if (rsmeta.getColumnName(i).equalsIgnoreCase("hudtype")) { + column_exists = true; + break; + } + } + + if (column_exists) { + mcMMO.p.getLogger().info("Removing Spout HUD type from huds table..."); + statement.executeUpdate("ALTER TABLE `" + tablePrefix + "huds` DROP COLUMN `hudtype`"); + } + } catch (SQLException ex) { + printErrors(ex); + } finally { + tryClose(resultSet); + } + } + + private int getUserID(final Connection connection, final String playerName, final UUID uuid) { + if (uuid == null) + return getUserIDByName(connection, playerName); + + if (cachedUserIDs.containsKey(uuid)) + return cachedUserIDs.get(uuid); + + ResultSet resultSet = null; + PreparedStatement statement = null; + + try { + statement = connection.prepareStatement("SELECT id, user FROM " + tablePrefix + "users WHERE uuid = ? OR (uuid IS NULL AND user = ?)"); + statement.setString(1, uuid.toString()); + statement.setString(2, playerName); + resultSet = statement.executeQuery(); + + if (resultSet.next()) { + int id = resultSet.getInt("id"); + + cachedUserIDs.put(uuid, id); + + return id; + } + } catch (SQLException ex) { + printErrors(ex); + } finally { + tryClose(resultSet); + tryClose(statement); + } + + return -1; + } + + private int getUserIDByName(final Connection connection, final String playerName) { + ResultSet resultSet = null; + PreparedStatement statement = null; + + try { + statement = connection.prepareStatement("SELECT id, user FROM " + tablePrefix + "users WHERE user = ?"); + statement.setString(1, playerName); + resultSet = statement.executeQuery(); + + if (resultSet.next()) { + int id = resultSet.getInt("id"); + + return id; + } + } catch (SQLException ex) { + printErrors(ex); + } finally { + tryClose(resultSet); + tryClose(statement); + } + + return -1; + } + + private void tryClose(AutoCloseable closeable) { + if (closeable != null) { + try { + closeable.close(); + } catch (Exception e) { + // Ignore + } + } + } + + @Override + public void onDisable() { + mcMMO.p.debug("Releasing connection pool resource..."); + miscPool.close(); + loadPool.close(); + savePool.close(); + } + + public void resetMobHealthSettings() { + PreparedStatement statement = null; + Connection connection = null; + + try { + connection = getConnection(PoolIdentifier.MISC); + statement = connection.prepareStatement("UPDATE " + tablePrefix + "huds SET mobhealthbar = ?"); + statement.setString(1, Config.getInstance().getMobHealthbarDefault().toString()); + statement.executeUpdate(); + } catch (SQLException ex) { + printErrors(ex); + } finally { + tryClose(statement); + tryClose(connection); + } + } + + public enum PoolIdentifier { + MISC, + LOAD, + SAVE + } + private class GetUUIDUpdatesRequired extends BukkitRunnable { public void run() { massUpdateLock.lock(); @@ -1329,204 +1465,4 @@ public final class SQLDatabaseManager implements DatabaseManager { } } } - - private void checkUpgradeDropPartyNames(final Statement statement) { - ResultSet resultSet = null; - - try { - resultSet = statement.executeQuery("SELECT * FROM `" + tablePrefix + "users` LIMIT 1"); - - ResultSetMetaData rsmeta = resultSet.getMetaData(); - boolean column_exists = false; - - for (int i = 1; i <= rsmeta.getColumnCount(); i++) { - if (rsmeta.getColumnName(i).equalsIgnoreCase("party")) { - column_exists = true; - break; - } - } - - if (column_exists) { - mcMMO.p.getLogger().info("Removing party name from users table..."); - statement.executeUpdate("ALTER TABLE `" + tablePrefix + "users` DROP COLUMN `party`"); - } - } - catch (SQLException ex) { - printErrors(ex); - } - finally { - tryClose(resultSet); - } - } - - private void checkUpgradeSkillTotal(final Connection connection) throws SQLException { - ResultSet resultSet = null; - Statement statement = null; - - try { - connection.setAutoCommit(false); - statement = connection.createStatement(); - resultSet = statement.executeQuery("SELECT * FROM `" + tablePrefix + "skills` LIMIT 1"); - - ResultSetMetaData rsmeta = resultSet.getMetaData(); - boolean column_exists = false; - - for (int i = 1; i <= rsmeta.getColumnCount(); i++) { - if (rsmeta.getColumnName(i).equalsIgnoreCase("total")) { - column_exists = true; - break; - } - } - - if (!column_exists) { - mcMMO.p.getLogger().info("Adding skill total column to skills table..."); - statement.executeUpdate("ALTER TABLE `" + tablePrefix + "skills` ADD COLUMN `total` int NOT NULL DEFAULT '0'"); - statement.executeUpdate("UPDATE `" + tablePrefix + "skills` SET `total` = (taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing+alchemy)"); - statement.executeUpdate("ALTER TABLE `" + tablePrefix + "skills` ADD INDEX `idx_total` (`total`) USING BTREE"); - connection.commit(); - } - } - catch (SQLException ex) { - printErrors(ex); - } - finally { - connection.setAutoCommit(true); - tryClose(resultSet); - tryClose(statement); - } - } - - private void checkUpgradeDropSpout(final Statement statement) { - ResultSet resultSet = null; - - try { - resultSet = statement.executeQuery("SELECT * FROM `" + tablePrefix + "huds` LIMIT 1"); - - ResultSetMetaData rsmeta = resultSet.getMetaData(); - boolean column_exists = false; - - for (int i = 1; i <= rsmeta.getColumnCount(); i++) { - if (rsmeta.getColumnName(i).equalsIgnoreCase("hudtype")) { - column_exists = true; - break; - } - } - - if (column_exists) { - mcMMO.p.getLogger().info("Removing Spout HUD type from huds table..."); - statement.executeUpdate("ALTER TABLE `" + tablePrefix + "huds` DROP COLUMN `hudtype`"); - } - } - catch (SQLException ex) { - printErrors(ex); - } - finally { - tryClose(resultSet); - } - } - - private int getUserID(final Connection connection, final String playerName, final UUID uuid) { - if (uuid == null) - return getUserIDByName(connection, playerName); - - if (cachedUserIDs.containsKey(uuid)) - return cachedUserIDs.get(uuid); - - ResultSet resultSet = null; - PreparedStatement statement = null; - - try { - statement = connection.prepareStatement("SELECT id, user FROM " + tablePrefix + "users WHERE uuid = ? OR (uuid IS NULL AND user = ?)"); - statement.setString(1, uuid.toString()); - statement.setString(2, playerName); - resultSet = statement.executeQuery(); - - if (resultSet.next()) { - int id = resultSet.getInt("id"); - - cachedUserIDs.put(uuid, id); - - return id; - } - } - catch (SQLException ex) { - printErrors(ex); - } - finally { - tryClose(resultSet); - tryClose(statement); - } - - return -1; - } - - private int getUserIDByName(final Connection connection, final String playerName) { - ResultSet resultSet = null; - PreparedStatement statement = null; - - try { - statement = connection.prepareStatement("SELECT id, user FROM " + tablePrefix + "users WHERE user = ?"); - statement.setString(1, playerName); - resultSet = statement.executeQuery(); - - if (resultSet.next()) { - int id = resultSet.getInt("id"); - - return id; - } - } - catch (SQLException ex) { - printErrors(ex); - } - finally { - tryClose(resultSet); - tryClose(statement); - } - - return -1; - } - - private void tryClose(AutoCloseable closeable) { - if (closeable != null) { - try { - closeable.close(); - } - catch (Exception e) { - // Ignore - } - } - } - - @Override - public void onDisable() { - mcMMO.p.debug("Releasing connection pool resource..."); - miscPool.close(); - loadPool.close(); - savePool.close(); - } - - public enum PoolIdentifier { - MISC, - LOAD, - SAVE - } - - public void resetMobHealthSettings() { - PreparedStatement statement = null; - Connection connection = null; - - try { - connection = getConnection(PoolIdentifier.MISC); - statement = connection.prepareStatement("UPDATE " + tablePrefix + "huds SET mobhealthbar = ?"); - statement.setString(1, Config.getInstance().getMobHealthbarDefault().toString()); - statement.executeUpdate(); - } - catch (SQLException ex) { - printErrors(ex); - } - finally { - tryClose(statement); - tryClose(connection); - } - } } diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java index 36aa98d47..8f3efa7ff 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/LimitedSizeList.java @@ -3,12 +3,11 @@ package com.gmail.nossr50.core.datatypes; import com.gmail.nossr50.core.mcmmo.Location; public class LimitedSizeList { - public Location[] limitedSizeOrderedList; private final int size; + public Location[] limitedSizeOrderedList; - public LimitedSizeList(int size) - { + public LimitedSizeList(int size) { this.size = size; limitedSizeOrderedList = new Location[size]; } @@ -16,16 +15,15 @@ public class LimitedSizeList { /** * Adds objects to our limited size ordered list * New objects are added to the front + * * @param newItem */ - public void add(Location newItem) - { + public void add(Location newItem) { Location[] newList = new Location[size]; - for(int i = 0; i < size-1; i++) - { - if(i != 0) - newList[i] = limitedSizeOrderedList[i-1]; + for (int i = 0; i < size - 1; i++) { + if (i != 0) + newList[i] = limitedSizeOrderedList[i - 1]; else newList[i] = newItem; } @@ -35,17 +33,16 @@ public class LimitedSizeList { /** * Returns true if the object is anywhere in our list + * * @param targetLoc the object to check for * @return true if the object is in our list */ - public boolean contains(Location targetLoc) - { - for(Location iter : limitedSizeOrderedList) - { - if(iter == null) + public boolean contains(Location targetLoc) { + for (Location iter : limitedSizeOrderedList) { + if (iter == null) continue; - if(iter.getX() == targetLoc.getX() + if (iter.getX() == targetLoc.getX() && iter.getY() == targetLoc.getY() && iter.getZ() == targetLoc.getZ()) return true; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/chat/ChatMode.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/chat/ChatMode.java index 039742acc..4a6c3c267 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/chat/ChatMode.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/chat/ChatMode.java @@ -10,7 +10,7 @@ public enum ChatMode { private String disabledMessage; private ChatMode(String enabledMessage, String disabledMessage) { - this.enabledMessage = enabledMessage; + this.enabledMessage = enabledMessage; this.disabledMessage = disabledMessage; } diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/database/DatabaseType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/database/DatabaseType.java index 95ca8a16a..691ae2728 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/database/DatabaseType.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/database/DatabaseType.java @@ -14,8 +14,7 @@ public enum DatabaseType { if (typeName.equalsIgnoreCase("file")) { return FLATFILE; - } - else if (typeName.equalsIgnoreCase("mysql")) { + } else if (typeName.equalsIgnoreCase("mysql")) { return SQL; } diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/FormulaType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/FormulaType.java index 27bf84bca..6f6fda9e2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/FormulaType.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/FormulaType.java @@ -8,8 +8,7 @@ public enum FormulaType { public static FormulaType getFormulaType(String string) { try { return valueOf(string); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { return UNKNOWN; } } diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java index 1cb41005f..8bbb7c55d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/experience/SkillXpGain.java @@ -17,6 +17,10 @@ public class SkillXpGain implements Delayed { this.type = type; } + private static long getDuration() { + return TimeUnit.MINUTES.toMillis(ExperienceConfig.getInstance().getDiminishedReturnsTimeInterval()); + } + public PrimarySkillType getSkill() { return type; } @@ -25,15 +29,10 @@ public class SkillXpGain implements Delayed { return xp; } - private static long getDuration() { - return TimeUnit.MINUTES.toMillis(ExperienceConfig.getInstance().getDiminishedReturnsTimeInterval()); - } - public int compareTo(SkillXpGain other) { if (this.expiryTime < other.expiryTime) { return -1; - } - else if (this.expiryTime > other.expiryTime) { + } else if (this.expiryTime > other.expiryTime) { return 1; } return 0; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/interactions/NotificationType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/interactions/NotificationType.java index 648d49060..435a4c031 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/interactions/NotificationType.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/interactions/NotificationType.java @@ -24,8 +24,7 @@ public enum NotificationType { final String niceName; - NotificationType(String niceName) - { + NotificationType(String niceName) { this.niceName = niceName; } diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOUrl.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOUrl.java index 4b64d42ff..aabeded19 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOUrl.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOUrl.java @@ -1,17 +1,15 @@ package com.gmail.nossr50.core.datatypes.json; public class McMMOUrl { - public static final String urlWebsite = "https://www.mcmmo.org"; - public static final String urlDiscord = "https://discord.gg/bJ7pFS9"; - public static final String urlPatreon = "https://www.patreon.com/com.gmail.nossr50"; - public static final String urlWiki = "https://www.mcmmo.org/wiki/"; - public static final String urlSpigot = "http://spigot.mcmmo.org"; + public static final String urlWebsite = "https://www.mcmmo.org"; + public static final String urlDiscord = "https://discord.gg/bJ7pFS9"; + public static final String urlPatreon = "https://www.patreon.com/com.gmail.nossr50"; + public static final String urlWiki = "https://www.mcmmo.org/wiki/"; + public static final String urlSpigot = "http://spigot.mcmmo.org"; public static final String urlTranslate = "https://www.mcmmo.org/translate/"; - public static String getUrl(McMMOWebLinks webLinks) - { - switch(webLinks) - { + public static String getUrl(McMMOWebLinks webLinks) { + switch (webLinks) { case WIKI: return urlWiki; case PATREON: diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOWebLinks.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOWebLinks.java index 86ee8ffec..749fc920c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOWebLinks.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/json/McMMOWebLinks.java @@ -11,28 +11,24 @@ public enum McMMOWebLinks { HELP_TRANSLATE, WIKI; - public String getUrl() - { + public String getUrl() { return McMMOUrl.getUrl(this); } - public String getNiceTitle() - { + public String getNiceTitle() { return StringUtils.getCapitalized(toString()); } - public String getLocaleDescription() - { - switch (this) - { + public String getLocaleDescription() { + switch (this) { case WEBSITE: - return LocaleLoader.getString( "JSON.URL.Website"); + return LocaleLoader.getString("JSON.URL.Website"); case DISCORD: - return LocaleLoader.getString( "JSON.URL.Discord"); + return LocaleLoader.getString("JSON.URL.Discord"); case PATREON: - return LocaleLoader.getString( "JSON.URL.Patreon"); + return LocaleLoader.getString("JSON.URL.Patreon"); case HELP_TRANSLATE: - return LocaleLoader.getString( "JSON.URL.Translation"); + return LocaleLoader.getString("JSON.URL.Translation"); case SPIGOT: return LocaleLoader.getString("JSON.URL.Spigot"); case WIKI: diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/meta/OldName.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/meta/OldName.java index cf827eae4..df89f3eeb 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/meta/OldName.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/meta/OldName.java @@ -8,8 +8,7 @@ import org.bukkit.metadata.FixedMetadataValue; */ public class OldName extends FixedMetadataValue { - public OldName(String oldName, mcMMO plugin) - { + public OldName(String oldName, mcMMO plugin) { super(plugin, oldName); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ItemShareType.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ItemShareType.java index e7dca7a1b..54f1995c3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ItemShareType.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ItemShareType.java @@ -15,17 +15,13 @@ public enum ItemShareType { public static ItemShareType getShareType(ItemStack itemStack) { if (ItemUtils.isMobDrop(itemStack)) { return LOOT; - } - else if (ItemUtils.isMiningDrop(itemStack)) { + } else if (ItemUtils.isMiningDrop(itemStack)) { return MINING; - } - else if (ItemUtils.isHerbalismDrop(itemStack)) { + } else if (ItemUtils.isHerbalismDrop(itemStack)) { return HERBALISM; - } - else if (ItemUtils.isWoodcuttingDrop(itemStack)) { + } else if (ItemUtils.isWoodcuttingDrop(itemStack)) { return WOODCUTTING; - } - else if (ItemUtils.isMiscDrop(itemStack)) { + } else if (ItemUtils.isMiscDrop(itemStack)) { return MISC; } diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java index a449f0f30..fee25e3e2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/Party.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.datatypes.party; -import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; @@ -31,14 +31,14 @@ public class Party { private int level; private float xp; - private ShareMode xpShareMode = ShareMode.NONE; + private ShareMode xpShareMode = ShareMode.NONE; private ShareMode itemShareMode = ShareMode.NONE; - private boolean shareLootDrops = true; - private boolean shareMiningDrops = true; - private boolean shareHerbalismDrops = true; + private boolean shareLootDrops = true; + private boolean shareMiningDrops = true; + private boolean shareHerbalismDrops = true; private boolean shareWoodcuttingDrops = true; - private boolean shareMiscDrops = true; + private boolean shareMiscDrops = true; public Party(String name) { this.name = name; @@ -75,13 +75,11 @@ public class Party { return onlineMembers; } - public List getVisibleMembers(Player player) - { + public List getVisibleMembers(Player player) { ArrayList visibleMembers = new ArrayList<>(); - for(Player p : onlineMembers) - { - if(player.canSee(p)) + for (Player p : onlineMembers) { + if (player.canSee(p)) visibleMembers.add(p); } @@ -113,22 +111,42 @@ public class Party { return name; } + public void setName(String name) { + this.name = name; + } + public PartyLeader getLeader() { return leader; } + public void setLeader(PartyLeader leader) { + this.leader = leader; + } + public String getPassword() { return password; } + public void setPassword(String password) { + this.password = password; + } + public boolean isLocked() { return locked; } + public void setLocked(boolean locked) { + this.locked = locked; + } + public Party getAlly() { return ally; } + public void setAlly(Party ally) { + this.ally = ally; + } + public List getItemShareCategories() { List shareCategories = new ArrayList(); @@ -141,26 +159,6 @@ public class Party { return shareCategories; } - public void setName(String name) { - this.name = name; - } - - public void setLeader(PartyLeader leader) { - this.leader = leader; - } - - public void setPassword(String password) { - this.password = password; - } - - public void setLocked(boolean locked) { - this.locked = locked; - } - - public void setAlly(Party ally) { - this.ally = ally; - } - public int getLevel() { return level; } @@ -251,22 +249,22 @@ public class Party { return Config.getInstance().getPartyLevelCap() < getLevel() + 1; } - public void setXpShareMode(ShareMode xpShareMode) { - this.xpShareMode = xpShareMode; - } - public ShareMode getXpShareMode() { return xpShareMode; } - public void setItemShareMode(ShareMode itemShareMode) { - this.itemShareMode = itemShareMode; + public void setXpShareMode(ShareMode xpShareMode) { + this.xpShareMode = xpShareMode; } public ShareMode getItemShareMode() { return itemShareMode; } + public void setItemShareMode(ShareMode itemShareMode) { + this.itemShareMode = itemShareMode; + } + public boolean sharingDrops(ItemShareType shareType) { switch (shareType) { case HERBALISM: @@ -336,11 +334,9 @@ public class Party { if (otherPlayer == null) { memberName = memberName.substring(0, 1) + ChatColor.GRAY + ChatColor.ITALIC + "" + memberName.substring(1); } - } - else if (otherPlayer != null) { + } else if (otherPlayer != null) { memberList.append(ChatColor.WHITE); - } - else { + } else { memberList.append(ChatColor.GRAY); } diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java index cb568d60e..ba9ec1bd9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/PartyTeleportRecord.java @@ -5,9 +5,9 @@ import com.gmail.nossr50.util.Misc; import org.bukkit.entity.Player; public class PartyTeleportRecord { - private Player requestor; + private Player requestor; private boolean enabled, confirmRequired; - private int timeout, lastUse; + private int timeout, lastUse; public PartyTeleportRecord() { requestor = null; diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ShareMode.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ShareMode.java index b1649b167..bda169d6c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ShareMode.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/party/ShareMode.java @@ -10,12 +10,10 @@ public enum ShareMode { public static ShareMode getShareMode(String string) { try { return valueOf(string); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { if (string.equalsIgnoreCase("even")) { return EQUAL; - } - else if (CommandUtils.shouldDisableToggle(string)) { + } else if (CommandUtils.shouldDisableToggle(string)) { return NONE; } diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java index 6212d8fc1..d4312e6a2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/McMMOPlayer.java @@ -1,18 +1,19 @@ package com.gmail.nossr50.core.datatypes.player; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.config.skills.WorldBlacklist; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.datatypes.mods.CustomTool; +import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.party.PartyTeleportRecord; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.datatypes.chat.ChatMode; -import com.gmail.nossr50.core.datatypes.mods.CustomTool; -import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.skills.ToolType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; @@ -43,7 +44,6 @@ import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.experience.ExperienceBarManager; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.util.skills.ParticleEffectUtils; import com.gmail.nossr50.util.skills.PerksUtils; @@ -65,41 +65,32 @@ import java.util.Set; import java.util.UUID; public class McMMOPlayer { - private Player player; - private PlayerProfile profile; - private final Map skillManagers = new HashMap(); + private final Map abilityMode = new HashMap(); + private final Map abilityInformed = new HashMap(); + private final Map toolMode = new HashMap(); + private final FixedMetadataValue playerMetadata; + private Player player; + private PlayerProfile profile; private ExperienceBarManager experienceBarManager; - - private Party party; - private Party invite; - private Party allianceInvite; - private int itemShareModifier; - + private Party party; + private Party invite; + private Party allianceInvite; + private int itemShareModifier; private PartyTeleportRecord ptpRecord; - private boolean partyChatMode; private boolean adminChatMode; private boolean displaySkillNotifications = true; - private boolean abilityUse = true; private boolean godMode; private boolean chatSpy = false; //Off by default - - private final Map abilityMode = new HashMap(); - private final Map abilityInformed = new HashMap(); - - private final Map toolMode = new HashMap(); - private int recentlyHurt; private int respawnATS; private int teleportATS; private long databaseATS; //private int chimeraWingLastUse; private Location teleportCommence; - private boolean isUsingUnarmed; - private final FixedMetadataValue playerMetadata; public McMMOPlayer(Player player, PlayerProfile profile) { String playerName = player.getName(); @@ -122,8 +113,7 @@ public class McMMOPlayer { for (PrimarySkillType primarySkillType : PrimarySkillType.values()) { skillManagers.put(primarySkillType, primarySkillType.getManagerClass().getConstructor(McMMOPlayer.class).newInstance(this)); } - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); mcMMO.p.getPluginLoader().disablePlugin(mcMMO.p); } @@ -145,37 +135,33 @@ public class McMMOPlayer { experienceBarManager.hideExperienceBar(primarySkillType); }*/ - public void processPostXpEvent(XPGainReason xpGainReason, PrimarySkillType primarySkillType, Plugin plugin, XPGainSource xpGainSource) - { + public void processPostXpEvent(XPGainReason xpGainReason, PrimarySkillType primarySkillType, Plugin plugin, XPGainSource xpGainSource) { //Updates from Party sources - if(xpGainSource == XPGainSource.PARTY_MEMBERS && !ExperienceConfig.getInstance().isPartyExperienceBarsEnabled()) + if (xpGainSource == XPGainSource.PARTY_MEMBERS && !ExperienceConfig.getInstance().isPartyExperienceBarsEnabled()) return; //Updates from passive sources (Alchemy, Smelting, etc...) - if(xpGainSource == XPGainSource.PASSIVE && !ExperienceConfig.getInstance().isPassiveGainsExperienceBarsEnabled()) + if (xpGainSource == XPGainSource.PASSIVE && !ExperienceConfig.getInstance().isPassiveGainsExperienceBarsEnabled()) return; updateXPBar(primarySkillType, plugin); } - public void processUnlockNotifications(mcMMO plugin, PrimarySkillType primarySkillType, int skillLevel) - { + public void processUnlockNotifications(mcMMO plugin, PrimarySkillType primarySkillType, int skillLevel) { RankUtils.executeSkillUnlockNotifications(plugin, this, primarySkillType, skillLevel); } - public void updateXPBar(PrimarySkillType primarySkillType, Plugin plugin) - { + public void updateXPBar(PrimarySkillType primarySkillType, Plugin plugin) { //Skill Unlock Notifications - if(primarySkillType.isChildSkill()) + if (primarySkillType.isChildSkill()) return; //XP BAR UPDATES experienceBarManager.updateExperienceBar(primarySkillType, plugin); } - public double getProgressInCurrentSkillLevel(PrimarySkillType primarySkillType) - { + public double getProgressInCurrentSkillLevel(PrimarySkillType primarySkillType) { double currentXP = profile.getSkillXpLevel(primarySkillType); double maxXP = profile.getXpToLevel(primarySkillType); @@ -269,7 +255,7 @@ public class McMMOPlayer { /** * Set the mode of an ability. * - * @param ability The ability to check + * @param ability The ability to check * @param isActive True if the ability is active, false otherwise */ public void setAbilityMode(SuperAbilityType ability, boolean isActive) { @@ -289,7 +275,7 @@ public class McMMOPlayer { /** * Set the informed state of an ability. * - * @param ability The ability to check + * @param ability The ability to check * @param isInformed True if the ability is informed, false otherwise */ public void setAbilityInformed(SuperAbilityType ability, boolean isInformed) { @@ -330,7 +316,7 @@ public class McMMOPlayer { /** * Set the current prep mode of a tool. * - * @param tool Tool to set the mode for + * @param tool Tool to set the mode for * @param isPrepared true if the tool should be prepped, false otherwise */ public void setToolPreparationMode(ToolType tool, boolean isPrepared) { @@ -421,9 +407,13 @@ public class McMMOPlayer { * Party Chat Spy */ - public boolean isPartyChatSpying() { return chatSpy; } + public boolean isPartyChatSpying() { + return chatSpy; + } - public void togglePartyChatSpying() { chatSpy = !chatSpy;} + public void togglePartyChatSpying() { + chatSpy = !chatSpy; + } /* * Skill notifications @@ -458,7 +448,7 @@ public class McMMOPlayer { * Begins an experience gain. The amount will be affected by skill modifiers, global rate, perks, and may be shared with the party * * @param skill Skill being used - * @param xp Experience amount to process + * @param xp Experience amount to process */ public void beginXpGain(PrimarySkillType skill, float xp, XPGainReason xpGainReason, XPGainSource xpGainSource) { Validate.isTrue(xp >= 0.0, "XP gained should be greater than or equal to zero."); @@ -492,7 +482,7 @@ public class McMMOPlayer { * Begins an experience gain. The amount will be affected by skill modifiers, global rate and perks * * @param skill Skill being used - * @param xp Experience amount to process + * @param xp Experience amount to process */ public void beginUnsharedXpGain(PrimarySkillType skill, float xp, XPGainReason xpGainReason, XPGainSource xpGainSource) { applyXpGain(skill, modifyXpGain(skill, xp), xpGainReason, xpGainSource); @@ -510,7 +500,7 @@ public class McMMOPlayer { * Applies an experience gain * * @param primarySkillType Skill being used - * @param xp Experience amount to add + * @param xp Experience amount to add */ public void applyXpGain(PrimarySkillType primarySkillType, float xp, XPGainReason xpGainReason, XPGainSource xpGainSource) { if (!primarySkillType.getPermissions(player)) { @@ -603,26 +593,26 @@ public class McMMOPlayer { } } - public void setPartyInvite(Party invite) { - this.invite = invite; - } - public Party getPartyInvite() { return invite; } + public void setPartyInvite(Party invite) { + this.invite = invite; + } + public boolean hasPartyInvite() { return (invite != null); } - public void setParty(Party party) { - this.party = party; - } - public Party getParty() { return party; } + public void setParty(Party party) { + this.party = party; + } + public boolean inParty() { return (party != null); } @@ -639,14 +629,14 @@ public class McMMOPlayer { return ptpRecord; } - public void setPartyAllianceInvite(Party allianceInvite) { - this.allianceInvite = allianceInvite; - } - public Party getPartyAllianceInvite() { return allianceInvite; } + public void setPartyAllianceInvite(Party allianceInvite) { + this.allianceInvite = allianceInvite; + } + public boolean hasPartyAllianceInvite() { return (allianceInvite != null); } @@ -746,7 +736,7 @@ public class McMMOPlayer { * Modifies an experience gain using skill modifiers, global rate and perks * * @param primarySkillType Skill being used - * @param xp Experience amount to process + * @param xp Experience amount to process * @return Modified experience */ private float modifyXpGain(PrimarySkillType primarySkillType, float xp) { @@ -769,7 +759,7 @@ public class McMMOPlayer { public void checkGodMode() { if (godMode && !Permissions.mcgod(player) - || godMode && WorldBlacklist.isWorldBlacklisted(player.getWorld())) { + || godMode && WorldBlacklist.isWorldBlacklisted(player.getWorld())) { toggleGodMode(); player.sendMessage(LocaleLoader.getString("Commands.GodMode.Forbidden")); } @@ -798,8 +788,7 @@ public class McMMOPlayer { //TODO: This is hacky and temporary solution until skills are move to the new system //Potential problems with this include skills with two super abilities (ie mining) - if(!skill.isSuperAbilityUnlocked(getPlayer())) - { + if (!skill.isSuperAbilityUnlocked(getPlayer())) { int diff = RankUtils.getSuperAbilityUnlockRequirement(skill.getAbility()) - getSkillLevel(skill); //Inform the player they are not yet skilled enough @@ -833,8 +822,7 @@ public class McMMOPlayer { int ticks; //Ability cap of 0 or below means no cap - if(abilityLengthCap > 0) - { + if (abilityLengthCap > 0) { ticks = PerksUtils.handleActivationPerks(player, 2 + (Math.min(abilityLengthCap, getSkillLevel(skill)) / abilityLengthVar), ability.getMaxLength()); } else { ticks = PerksUtils.handleActivationPerks(player, 2 + (getSkillLevel(skill) / abilityLengthVar), ability.getMaxLength()); @@ -918,7 +906,6 @@ public class McMMOPlayer { * Calculate the time remaining until the ability's cooldown expires. * * @param ability SuperAbilityType whose cooldown to check - * * @return the number of seconds remaining before the cooldown expires */ public int calculateTimeRemaining(SuperAbilityType ability) { @@ -999,7 +986,7 @@ public class McMMOPlayer { UserManager.remove(thisPlayer); - if(Config.getInstance().getScoreboardsEnabled()) + if (Config.getInstance().getScoreboardsEnabled()) ScoreboardManager.teardownPlayer(thisPlayer); if (inParty()) { diff --git a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java index 8dd1013a5..0240f8c77 100644 --- a/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java +++ b/core/src/main/java/com/gmail/nossr50/core/datatypes/player/PlayerProfile.java @@ -1,17 +1,17 @@ package com.gmail.nossr50.core.datatypes.player; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.datatypes.experience.SkillXpGain; +import com.gmail.nossr50.core.skills.MobHealthbarType; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.skills.MobHealthbarType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.player.PlayerProfileSaveTask; import com.gmail.nossr50.skills.child.FamilyTree; -import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableMap; import java.util.HashMap; @@ -22,20 +22,17 @@ import java.util.concurrent.DelayQueue; public class PlayerProfile { private final String playerName; + /* Skill Data */ + private final Map skills = new HashMap(); // Skill & Level + private final Map skillsXp = new HashMap(); // Skill & XP + private final Map abilityDATS = new HashMap(); // Ability & Cooldown + private final Map uniquePlayerData = new HashMap<>(); //Misc data that doesn't fit into other categories (chimaera wing, etc..) private UUID uuid; private boolean loaded; private volatile boolean changed; - /* HUDs */ private MobHealthbarType mobHealthbarType; private int scoreboardTipsShown; - - /* Skill Data */ - private final Map skills = new HashMap(); // Skill & Level - private final Map skillsXp = new HashMap(); // Skill & XP - private final Map abilityDATS = new HashMap(); // Ability & Cooldown - private final Map uniquePlayerData = new HashMap<>(); //Misc data that doesn't fit into other categories (chimaera wing, etc..) - // Store previous XP gains for deminished returns private DelayQueue gainedSkillsXp = new DelayQueue(); private HashMap rollingSkillsXp = new HashMap(); @@ -158,7 +155,9 @@ public class PlayerProfile { * Cooldowns */ - public int getChimaerWingDATS() { return uniquePlayerData.get(UniqueDataType.CHIMAERA_WING_DATS);} + public int getChimaerWingDATS() { + return uniquePlayerData.get(UniqueDataType.CHIMAERA_WING_DATS); + } protected void setChimaeraWingDATS(int DATS) { changed = true; @@ -170,7 +169,9 @@ public class PlayerProfile { uniquePlayerData.put(uniqueDataType, newData); } - public long getUniqueData(UniqueDataType uniqueDataType) { return uniquePlayerData.get(uniqueDataType); } + public long getUniqueData(UniqueDataType uniqueDataType) { + return uniquePlayerData.get(uniqueDataType); + } /** * Get the current deactivation timestamp of an ability. @@ -186,7 +187,7 @@ public class PlayerProfile { * Set the current deactivation timestamp of an ability. * * @param ability The {@link SuperAbilityType} to set the DATS for - * @param DATS the DATS of the ability + * @param DATS the DATS of the ability */ protected void setAbilityDATS(SuperAbilityType ability, long DATS) { changed = true; @@ -246,7 +247,7 @@ public class PlayerProfile { * Remove Xp from a skill. * * @param skill Type of skill to modify - * @param xp Amount of xp to remove + * @param xp Amount of xp to remove */ public void removeXp(PrimarySkillType skill, int xp) { if (skill.isChildSkill()) { @@ -282,7 +283,7 @@ public class PlayerProfile { changed = true; //Don't allow levels to be negative - if(level < 0) + if (level < 0) level = 0; skills.put(skill, level); @@ -292,7 +293,7 @@ public class PlayerProfile { /** * Add levels to a skill. * - * @param skill Type of skill to add levels to + * @param skill Type of skill to add levels to * @param levels Number of levels to add */ public void addLevels(PrimarySkillType skill, int levels) { @@ -303,7 +304,7 @@ public class PlayerProfile { * Add Experience to a skill. * * @param skill Type of skill to add experience to - * @param xp Number of experience to add + * @param xp Number of experience to add */ public void addXp(PrimarySkillType skill, float xp) { changed = true; @@ -315,8 +316,7 @@ public class PlayerProfile { for (PrimarySkillType parentSkill : parentSkills) { skillsXp.put(parentSkill, skillsXp.get(parentSkill) + dividedXP); } - } - else { + } else { skillsXp.put(skill, skillsXp.get(skill) + xp); } } @@ -342,7 +342,7 @@ public class PlayerProfile { * This is used for diminished XP returns * * @param primarySkillType Skill being used - * @param xp Experience amount to add + * @param xp Experience amount to add */ public void registerXpGain(PrimarySkillType primarySkillType, float xp) { gainedSkillsXp.add(new SkillXpGain(primarySkillType, xp)); diff --git a/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java b/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java index f5a9e46a7..ce1629b5a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java +++ b/core/src/main/java/com/gmail/nossr50/core/locale/LocaleLoader.java @@ -14,7 +14,10 @@ public final class LocaleLoader { private static ResourceBundle bundle = null; private static ResourceBundle enBundle = null; - private LocaleLoader() {}; + private LocaleLoader() { + } + + ; public static String getString(String key) { return getString(key, (Object[]) null); @@ -23,7 +26,7 @@ public final class LocaleLoader { /** * Gets the appropriate string from the Locale files. * - * @param key The key to look up the string with + * @param key The key to look up the string with * @param messageArguments Any arguments to be added to the string * @return The properly formatted locale string */ @@ -34,12 +37,10 @@ public final class LocaleLoader { try { return getString(key, bundle, messageArguments); - } - catch (MissingResourceException ex) { + } catch (MissingResourceException ex) { try { return getString(key, enBundle, messageArguments); - } - catch (MissingResourceException ex2) { + } catch (MissingResourceException ex2) { if (!key.contains("Guides")) { mcMMO.p.getLogger().warning("Could not find locale string: " + key); } @@ -80,8 +81,7 @@ public final class LocaleLoader { if (myLocale.length == 1) { locale = new Locale(myLocale[0]); - } - else if (myLocale.length >= 2) { + } else if (myLocale.length >= 2) { locale = new Locale(myLocale[0], myLocale[1]); } diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/AbstractWorld.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/AbstractWorld.java index e16eb44b7..2c587ba5f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/AbstractWorld.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/AbstractWorld.java @@ -10,8 +10,7 @@ public abstract class AbstractWorld implements World { private final String worldName; - public AbstractWorld(String worldName) - { + public AbstractWorld(String worldName) { this.worldName = worldName; } @@ -27,6 +26,7 @@ public abstract class AbstractWorld implements World { /** * Compares this object to another to see if they are equal + * * @param o the other object * @return true if they are equal */ @@ -40,6 +40,7 @@ public abstract class AbstractWorld implements World { /** * The hash code for the object, used for comparisons + * * @return hash code for this object */ @Override diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Location.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Location.java index 52c6ae403..31377eac9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Location.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Location.java @@ -8,24 +8,28 @@ public interface Location { /** * Returns the position of this location on the x-axis + * * @return x-axis position */ double getX(); /** * Returns the position of this location on the y-axis + * * @return y-axis position */ double getY(); /** * Returns the position of this location on the z-axis + * * @return z-axis position */ double getZ(); /** * The world for this Location + * * @return the world of this location */ World getWorld(); diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java index 87981f308..a69a5ca45 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Nameable.java @@ -3,12 +3,14 @@ package com.gmail.nossr50.core.mcmmo; public interface Nameable extends Named { /** * Change the name for this entity + * * @param newName the new name of this entity */ void setName(String newName); /** * Returns the original name for this entity before any renaming + * * @return the original name of this entity */ String getOriginalName(); diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Named.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Named.java index 63c20a99d..0104a89c1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Named.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Named.java @@ -7,6 +7,7 @@ package com.gmail.nossr50.core.mcmmo; public interface Named { /** * Returns the name of this entity + * * @return this entity */ String getName(); diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Property.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Property.java index ccb92d9aa..1261ad085 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/Property.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/Property.java @@ -5,31 +5,34 @@ import java.util.Collection; /** * Properties are Comparable key value pairs for a blocks state * In MC this exists in three forms, Integer, Booleans, and Enums - * + *

* This class partially mirrors MC Internals - * */ public interface Property> { /** * The name of the Property + * * @return name of this property */ String getName(); /** * A collection of allowed values for this property + * * @return the allowed values for this property */ Collection getAllowedValues(); /** * The class of the value for this particular property + * * @return the value's class */ Class getValueClass(); /** * The name for a specific value + * * @param value the value to match * @return the name of this value */ diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/World.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/World.java index 04c4569c4..a14760be2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/World.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/World.java @@ -3,6 +3,7 @@ package com.gmail.nossr50.core.mcmmo; public interface World { /** * Gets the name of this World + * * @return the name of this world */ String getName(); diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Block.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Block.java index 588905bdc..9dcfdd847 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Block.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/Block.java @@ -4,6 +4,7 @@ import com.gmail.nossr50.core.mcmmo.Property; /** * Represents a container of properties and values for a Block + * * @see Property * @see BlockState */ @@ -12,27 +13,26 @@ public class Block { private final String unlocalizedName; //The name before it is localized (english) private BlockState blockState; - public Block(String unlocalizedName, BlockState blockState) - { + public Block(String unlocalizedName, BlockState blockState) { this.unlocalizedName = unlocalizedName; - this.blockState = blockState; + this.blockState = blockState; } /** * Gets the name of this block in English + * * @return name of this block in English */ - public String getUnlocalizedName() - { + public String getUnlocalizedName() { return unlocalizedName; } /** * Gets the state of this block + * * @return the state of this block */ - public BlockState getBlockState() - { + public BlockState getBlockState() { return blockState; } } diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/BlockState.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/BlockState.java index 444485f04..574137060 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/BlockState.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/block/BlockState.java @@ -11,7 +11,7 @@ import java.util.Collection; */ public interface BlockState { //This is the immutable map of all properties for this block state - ImmutableMap, Comparable> getImmutablePropertyMap(); + ImmutableMap, Comparable> getImmutablePropertyMap(); //This will return the keyset for properties on this block state Collection> getPropertyKeyset(); @@ -20,24 +20,27 @@ public interface BlockState { /** * Get the value for the given property key + * * @param property the property key - * @param the type of property + * @param the type of property * @return the value, can be null */ > T getPropertyValue(Property property); /** * This will attempt to find a matching property for this block state + * * @param property the property we want to match - * @param value the value we are trying to match - * @param the type of the property - * @param the type of the value + * @param value the value we are trying to match + * @param the type of the property + * @param the type of the value * @return the matching property on this block state, can be null */ , V extends T> BlockState findProperty(Property property, V value); /** * This returns the block that this state belongs to + * * @return the parent Block */ Block getBlock(); diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Entity.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Entity.java index 401adce52..f6c6d9ed7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Entity.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Entity.java @@ -12,12 +12,14 @@ import java.util.UUID; public interface Entity extends Location, Named { /** * The UUID for this entity + * * @return this entity's UUID */ UUID getUUID(); /** * The Location for this entity + * * @return this entity's location */ Location getLocation(); diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Living.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Living.java index 05ff0153c..23be2deb7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Living.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Living.java @@ -6,12 +6,14 @@ package com.gmail.nossr50.core.mcmmo.entity; public interface Living { /** * Whether or not this entity is still alive + * * @return true if the entity is alive */ Boolean isAlive(); /** * Change the health of an entity + * * @param newHealth the new health value for the entity */ void setHealth(int newHealth); @@ -19,6 +21,7 @@ public interface Living { /** * Damage an entity * This damage will be reduced by any defensive modifiers such as armor + * * @param damage the damage to deal to this entity */ void damage(int damage); @@ -26,6 +29,7 @@ public interface Living { /** * Damage an entity and attribute it to a source * This damage will be reduced by any defensive modifiers such as armor + * * @param source the source responsible for the damage * @param damage the damage to deal to this entity */ diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java index 328f5dd69..cd7b23493 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/entity/Player.java @@ -10,12 +10,14 @@ public interface Player extends Living, Nameable { /** * Players are not always online + * * @return true if the player is online */ Boolean isOnline(); /** * Gets the McMMOPlayer for this Player + * * @return the associated McMMOPlayer, can be null */ McMMOPlayer getMcMMOPlayer(); diff --git a/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/Cancellable.java b/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/Cancellable.java index 6237f4447..22e71324c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/Cancellable.java +++ b/core/src/main/java/com/gmail/nossr50/core/mcmmo/event/Cancellable.java @@ -7,12 +7,14 @@ public interface Cancellable { /** * Whether or not the event is cancelled + * * @return true if cancelled */ Boolean isCancelled(); /** * Sets an events cancellation to b + * * @param b */ void setCancelled(boolean b); diff --git a/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java b/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java index c7073a128..45bcbba10 100644 --- a/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/party/PartyManager.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.core.party; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.chat.ChatMode; import com.gmail.nossr50.core.datatypes.database.UpgradeType; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; @@ -10,16 +11,15 @@ import com.gmail.nossr50.core.datatypes.party.PartyLeader; import com.gmail.nossr50.core.datatypes.party.ShareMode; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.events.party.McMMOPartyAllianceChangeEvent; -import com.gmail.nossr50.events.party.McMMOPartyChangeEvent; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.core.util.Permissions; import com.gmail.nossr50.core.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.sounds.SoundManager; import com.gmail.nossr50.core.util.sounds.SoundType; +import com.gmail.nossr50.events.party.McMMOPartyAllianceChangeEvent; +import com.gmail.nossr50.events.party.McMMOPartyChangeEvent; +import com.gmail.nossr50.mcMMO; import org.bukkit.OfflinePlayer; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.Player; @@ -36,12 +36,13 @@ public final class PartyManager { private static List parties = new ArrayList(); private static File partyFile = new File(partiesFilePath); - private PartyManager() {} + private PartyManager() { + } /** * Check if a party with a given name already exists. * - * @param player The player to notify + * @param player The player to notify * @param partyName The name of the party to check * @return true if a party with that name exists, false otherwise */ @@ -56,19 +57,19 @@ public final class PartyManager { /** * Checks if the player can join a party, parties can have a size limit, although there is a permission to bypass this - * @param player player who is attempting to join the party + * + * @param player player who is attempting to join the party * @param targetParty the target party * @return true if party is full and cannot be joined */ - public static boolean isPartyFull(Player player, Party targetParty) - { + public static boolean isPartyFull(Player player, Party targetParty) { return !Permissions.partySizeBypass(player) && Config.getInstance().getPartyMaxSize() >= 1 && targetParty.getOnlineMembers().size() >= Config.getInstance().getPartyMaxSize(); } /** * Attempt to change parties or join a new party. * - * @param mcMMOPlayer The player changing or joining parties + * @param mcMMOPlayer The player changing or joining parties * @param newPartyName The name of the party being joined * @return true if the party was joined successfully, false otherwise */ @@ -83,8 +84,8 @@ public final class PartyManager { } removeFromParty(mcMMOPlayer); - } - else return handlePartyChangeEvent(player, null, newPartyName, McMMOPartyChangeEvent.EventReason.JOINED_PARTY); + } else + return handlePartyChangeEvent(player, null, newPartyName, McMMOPartyChangeEvent.EventReason.JOINED_PARTY); return true; } @@ -92,7 +93,7 @@ public final class PartyManager { /** * Check if two online players are in the same party. * - * @param firstPlayer The first player + * @param firstPlayer The first player * @param secondPlayer The second player * @return true if they are in the same party, false otherwise */ @@ -280,7 +281,7 @@ public final class PartyManager { * Remove a player from a party. * * @param player The player to remove - * @param party The party + * @param party The party */ public static void removeFromParty(OfflinePlayer player, Party party) { LinkedHashMap members = party.getMembers(); @@ -294,8 +295,7 @@ public final class PartyManager { if (members.isEmpty()) { parties.remove(party); - } - else { + } else { // If the leaving player was the party leader, appoint a new leader from the party members if (party.getLeader().getUniqueId().equals(player.getUniqueId())) { setPartyLeader(members.keySet().iterator().next(), party); @@ -337,8 +337,8 @@ public final class PartyManager { * Create a new party * * @param mcMMOPlayer The player to add to the party - * @param partyName The party to add the player to - * @param password The password for this party, null if there was no password + * @param partyName The party to add the player to + * @param password The password for this party, null if there was no password */ public static void createParty(McMMOPlayer mcMMOPlayer, String partyName, String password) { Player player = mcMMOPlayer.getPlayer(); @@ -358,8 +358,8 @@ public final class PartyManager { /** * Check if a player can join a party * - * @param player The player trying to join a party - * @param party The party + * @param player The player trying to join a party + * @param party The party * @param password The password provided by the player * @return true if the player can join the party */ @@ -403,8 +403,7 @@ public final class PartyManager { /* * Don't let players join a full party */ - if(Config.getInstance().getPartyMaxSize() > 0 && invite.getMembers().size() >= Config.getInstance().getPartyMaxSize()) - { + if (Config.getInstance().getPartyMaxSize() > 0 && invite.getMembers().size() >= Config.getInstance().getPartyMaxSize()) { NotificationManager.sendPlayerInformation(mcMMOPlayer.getPlayer(), NotificationType.PARTY_MESSAGE, "Commands.Party.PartyFull.InviteAccept", invite.getName(), String.valueOf(Config.getInstance().getPartyMaxSize())); return; } @@ -452,7 +451,7 @@ public final class PartyManager { } } - public static boolean disbandAlliance(Player player, Party firstParty, Party secondParty){ + public static boolean disbandAlliance(Player player, Party firstParty, Party secondParty) { if (!handlePartyChangeAllianceEvent(player, firstParty.getName(), secondParty.getName(), McMMOPartyAllianceChangeEvent.EventReason.DISBAND_ALLIANCE)) { return false; } @@ -478,7 +477,7 @@ public final class PartyManager { * Add a player to a party * * @param mcMMOPlayer The player to add to the party - * @param party The party + * @param party The party */ public static void addToParty(McMMOPlayer mcMMOPlayer, Party party) { Player player = mcMMOPlayer.getPlayer(); @@ -505,7 +504,7 @@ public final class PartyManager { /** * Set the leader of a party. * - * @param uuid The uuid of the player to set as leader + * @param uuid The uuid of the player to set as leader * @param party The party */ public static void setPartyLeader(UUID uuid, Party party) { @@ -517,11 +516,9 @@ public final class PartyManager { if (memberUniqueId.equals(player.getUniqueId())) { member.sendMessage(LocaleLoader.getString("Party.Owner.Player")); - } - else if (memberUniqueId.equals(leaderUniqueId)) { + } else if (memberUniqueId.equals(leaderUniqueId)) { member.sendMessage(LocaleLoader.getString("Party.Owner.NotLeader")); - } - else { + } else { member.sendMessage(LocaleLoader.getString("Party.Owner.New", player.getName())); } } @@ -641,8 +638,7 @@ public final class PartyManager { try { partiesFile.save(partyFile); - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); } } @@ -717,10 +713,10 @@ public final class PartyManager { /** * Handle party change event. * - * @param player The player changing parties + * @param player The player changing parties * @param oldPartyName The name of the old party * @param newPartyName The name of the new party - * @param reason The reason for changing parties + * @param reason The reason for changing parties * @return true if the change event was successful, false otherwise */ public static boolean handlePartyChangeEvent(Player player, String oldPartyName, String newPartyName, McMMOPartyChangeEvent.EventReason reason) { @@ -733,10 +729,10 @@ public final class PartyManager { /** * Handle party alliance change event. * - * @param player The player changing party alliances + * @param player The player changing party alliances * @param oldAllyName The name of the old ally * @param newAllyName The name of the new ally - * @param reason The reason for changing allies + * @param reason The reason for changing allies * @return true if the change event was successful, false otherwise */ public static boolean handlePartyChangeAllianceEvent(Player player, String oldAllyName, String newAllyName, McMMOPartyAllianceChangeEvent.EventReason reason) { @@ -760,9 +756,9 @@ public final class PartyManager { /** * Notify party members when the party levels up. * - * @param party The concerned party + * @param party The concerned party * @param levelsGained The amount of levels gained - * @param level The current party level + * @param level The current party level */ public static void informPartyMembersLevelUp(Party party, int levelsGained, int level) { boolean levelUpSoundsEnabled = Config.getInstance().getLevelUpSoundsEnabled(); @@ -778,7 +774,7 @@ public final class PartyManager { /** * Notify party members when a player joins. * - * @param party The concerned party + * @param party The concerned party * @param playerName The name of the player that joined */ private static void informPartyMembersJoin(Party party, String playerName) { @@ -790,7 +786,7 @@ public final class PartyManager { /** * Notify party members when a party member quits. * - * @param party The concerned party + * @param party The concerned party * @param playerName The name of the player that left */ private static void informPartyMembersQuit(Party party, String playerName) { diff --git a/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java b/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java index 01d20a276..251629827 100644 --- a/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java +++ b/core/src/main/java/com/gmail/nossr50/core/party/ShareHandler.java @@ -1,7 +1,8 @@ package com.gmail.nossr50.core.party; -import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.party.ItemWeightConfig; +import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.party.ItemShareType; @@ -10,7 +11,6 @@ import com.gmail.nossr50.core.datatypes.party.ShareMode; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Misc; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -18,13 +18,14 @@ import org.bukkit.inventory.ItemStack; import java.util.List; public final class ShareHandler { - private ShareHandler() {} + private ShareHandler() { + } /** * Distribute Xp amongst party members. * - * @param xp Xp without party sharing - * @param mcMMOPlayer Player initiating the Xp gain + * @param xp Xp without party sharing + * @param mcMMOPlayer Player initiating the Xp gain * @param primarySkillType Skill being used * @return True is the xp has been shared */ @@ -57,7 +58,7 @@ public final class ShareHandler { /** * Distribute Items amongst party members. * - * @param drop Item that will get shared + * @param drop Item that will get shared * @param mcMMOPlayer Player who picked up the item * @return True if the item has been shared */ @@ -146,11 +147,9 @@ public final class ShareHandler { public static XPGainReason getSharedXpGainReason(XPGainReason xpGainReason) { if (xpGainReason == XPGainReason.PVE) { return XPGainReason.SHARED_PVE; - } - else if (xpGainReason == XPGainReason.PVP) { + } else if (xpGainReason == XPGainReason.PVP) { return XPGainReason.SHARED_PVP; - } - else { + } else { return xpGainReason; } } diff --git a/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java b/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java index 3822fc6e0..9d7bd360b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java +++ b/core/src/main/java/com/gmail/nossr50/core/platform/Platform.java @@ -8,30 +8,35 @@ public interface Platform { /** * Gets the name of the Platform + * * @return name of this platform */ String getPlatformName(); /** * Gets the version of this platform + * * @return the current version of this platform */ String getPlatformVersion(); /** * Gets the target version of Minecraft for this platform + * * @return this platform's target minecraft version */ String getTargetMinecraftVersion(); /** * Whether or not this platform has been loaded + * * @return true if the platform is loaded */ Boolean isPlatformLoaded(); /** * Gets the PlatformSoftwareType for this platform + * * @return this PlatformSoftwareType */ PlatformSoftwareType getPlatformSoftwareType(); diff --git a/core/src/main/java/com/gmail/nossr50/core/platform/TargetMinecraftVersion.java b/core/src/main/java/com/gmail/nossr50/core/platform/TargetMinecraftVersion.java index 0452128dd..2a06d4da1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/platform/TargetMinecraftVersion.java +++ b/core/src/main/java/com/gmail/nossr50/core/platform/TargetMinecraftVersion.java @@ -2,10 +2,11 @@ package com.gmail.nossr50.core.platform; /** * Constants for targeted versions of MC + * * @see Platform#getTargetMinecraftVersion() */ public class TargetMinecraftVersion { - public static final String MC_VERSION_1_8_8 = "1_8_8"; - public static final String MC_VERSION_1_12_2 = "1_12_2"; - public static final String MC_VERSION_1_13_2 = "1_13_2"; + public static final String MC_VERSION_1_8_8 = "1_8_8"; + public static final String MC_VERSION_1_12_2 = "1_12_2"; + public static final String MC_VERSION_1_13_2 = "1_13_2"; } diff --git a/core/src/main/java/com/gmail/nossr50/core/platform/drivers/PlatformDriver.java b/core/src/main/java/com/gmail/nossr50/core/platform/drivers/PlatformDriver.java index 571b097d3..f90d3415f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/platform/drivers/PlatformDriver.java +++ b/core/src/main/java/com/gmail/nossr50/core/platform/drivers/PlatformDriver.java @@ -8,12 +8,14 @@ import com.gmail.nossr50.core.platform.Platform; public interface PlatformDriver { /** * Return the platform for this Driver + * * @return this platform */ Platform getPlatform(); /** * Gets the target MC Version for this driver + * * @return the target MC Version for this driver */ String getTargetMinecraftVersion(); diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/PistonTrackerTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/PistonTrackerTask.java index f9e4615d1..b137ebd96 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/PistonTrackerTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/PistonTrackerTask.java @@ -36,8 +36,7 @@ public class PistonTrackerTask extends BukkitRunnable { if (nextBlock.hasMetadata(mcMMO.blockMetadataKey)) { mcMMO.getPlaceStore().setTrue(nextBlock); nextBlock.removeMetadata(mcMMO.blockMetadataKey, mcMMO.p); - } - else if (mcMMO.getPlaceStore().isTrue(nextBlock)) { + } else if (mcMMO.getPlaceStore().isTrue(nextBlock)) { // Block doesn't have metadatakey but isTrue - set it to false mcMMO.getPlaceStore().setFalse(nextBlock); } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/SaveTimerTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/SaveTimerTask.java index 59bdc4357..8620f2520 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/SaveTimerTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/SaveTimerTask.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.core.runnables; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.runnables.player.PlayerProfileSaveTask; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.party.PartyManager; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.scheduler.BukkitRunnable; public class SaveTimerTask extends BukkitRunnable { diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java index d7dddac84..b24466463 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/backups/CleanBackupsTask.java @@ -51,13 +51,11 @@ public class CleanBackupsTask extends BukkitRunnable { if (isPast24Hours(date) && Config.getInstance().getKeepLast24Hours()) { // Keep all files from the last 24 hours continue; - } - else if (isLastWeek(date) && !savedDays.contains(dayOfWeek) && Config.getInstance().getKeepDailyLastWeek()) { + } else if (isLastWeek(date) && !savedDays.contains(dayOfWeek) && Config.getInstance().getKeepDailyLastWeek()) { // Keep daily backups of the past week savedDays.add(dayOfWeek); continue; - } - else { + } else { List savedWeeks = savedYearsWeeks.get(year); if (savedWeeks == null) { savedWeeks = new ArrayList(); @@ -92,7 +90,6 @@ public class CleanBackupsTask extends BukkitRunnable { * Check if date is within last 24 hours * * @param date date to check - * * @return true is date is within last 24 hours, false if otherwise */ private boolean isPast24Hours(Date date) { @@ -104,7 +101,6 @@ public class CleanBackupsTask extends BukkitRunnable { * Check if date is within the last week * * @param date date to check - * * @return true is date is within the last week, false if otherwise */ private boolean isLastWeek(Date date) { @@ -118,8 +114,7 @@ public class CleanBackupsTask extends BukkitRunnable { try { date = dateFormat.parse(fileName); - } - catch (ParseException e) { + } catch (ParseException e) { return null; } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java index f474c8f35..e0095ac37 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/McrankCommandDisplayTask.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.core.runnables.commands; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import org.bukkit.command.CommandSender; @@ -63,8 +63,7 @@ public class McrankCommandDisplayTask extends BukkitRunnable { public void displayBoard() { if (sender.getName().equalsIgnoreCase(playerName)) { ScoreboardManager.showPlayerRankScoreboard((Player) sender, skills); - } - else { + } else { ScoreboardManager.showPlayerRankScoreboardOthers((Player) sender, playerName, skills); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java index b0d95823d..7c3c287df 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/commands/MctopCommandDisplayTask.java @@ -2,8 +2,8 @@ package com.gmail.nossr50.core.runnables.commands; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.database.PlayerStat; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import org.bukkit.ChatColor; @@ -45,25 +45,22 @@ public class MctopCommandDisplayTask extends BukkitRunnable { if (sender instanceof Player) { ((Player) sender).removeMetadata(mcMMO.databaseCommandKey, mcMMO.p); } - if(sender instanceof Player) + if (sender instanceof Player) sender.sendMessage(LocaleLoader.getString("Commands.mctop.Tip")); } private void displayChat() { if (skill == null) { - if(sender instanceof Player) { + if (sender instanceof Player) { sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Leaderboard")); - } - else { + } else { sender.sendMessage(ChatColor.stripColor(LocaleLoader.getString("Commands.PowerLevel.Leaderboard"))); } - } - else { - if(sender instanceof Player) { + } else { + if (sender instanceof Player) { sender.sendMessage(LocaleLoader.getString("Commands.Skill.Leaderboard", skill.getName())); - } - else { + } else { sender.sendMessage(ChatColor.stripColor(LocaleLoader.getString("Commands.Skill.Leaderboard", skill.getName()))); } } @@ -74,13 +71,12 @@ public class MctopCommandDisplayTask extends BukkitRunnable { // Format: // 01. Playername - skill value // 12. Playername - skill value - if(sender instanceof Player) { + if (sender instanceof Player) { sender.sendMessage(String.format("%2d. %s%s - %s%s", place, ChatColor.GREEN, stat.name, ChatColor.WHITE, stat.statVal)); - } - else { + } else { sender.sendMessage(String.format("%2d. %s - %s", place, stat.name, stat.statVal)); } - + place++; } } @@ -88,8 +84,7 @@ public class MctopCommandDisplayTask extends BukkitRunnable { private void displayBoard() { if (skill == null) { ScoreboardManager.showTopPowerScoreboard((Player) sender, page, userStats); - } - else { + } else { ScoreboardManager.showTopScoreboard((Player) sender, skill, page, userStats); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/database/FormulaConversionTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/database/FormulaConversionTask.java index 87e11786f..0cc08b401 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/database/FormulaConversionTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/database/FormulaConversionTask.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.core.runnables.database; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.data.database.DatabaseManager; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.command.CommandSender; import org.bukkit.scheduler.BukkitRunnable; @@ -42,8 +42,7 @@ public class FormulaConversionTask extends BukkitRunnable { editValues(profile); // Since this is a temporary profile, we save it here. profile.scheduleAsyncSave(); - } - else { + } else { profile = mcMMOPlayer.getProfile(); editValues(profile); } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/database/UUIDUpdateAsyncTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UUIDUpdateAsyncTask.java index f13abc478..daee47db9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/database/UUIDUpdateAsyncTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UUIDUpdateAsyncTask.java @@ -15,12 +15,11 @@ import java.util.UUID; import java.util.logging.Level; public class UUIDUpdateAsyncTask extends BukkitRunnable { - private mcMMO plugin; private static final int MAX_LOOKUP = Math.max(HiddenConfig.getInstance().getUUIDConvertAmount(), 100); private static final int RATE_LIMIT = HiddenConfig.getInstance().getMojangRateLimit(); private static final long LIMIT_PERIOD = HiddenConfig.getInstance().getMojangLimitPeriod(); private static final int BATCH_SIZE = MAX_LOOKUP * 3; - + private mcMMO plugin; private List userNames; private int size; private int checkedUsers; @@ -57,16 +56,14 @@ public class UUIDUpdateAsyncTask extends BukkitRunnable { if (size > MAX_LOOKUP) { userNamesSection = userNames.subList(size - MAX_LOOKUP, size); size -= MAX_LOOKUP; - } - else { + } else { userNamesSection = userNames.subList(0, size); size = 0; } try { fetchedUUIDs.putAll(new UUIDFetcher(userNamesSection).call()); - } - catch (Exception e) { + } catch (Exception e) { // Handle 429 if (e.getMessage().contains("429")) { size += userNamesSection.size(); diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java index abecece74..01bf1d877 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/database/UserPurgeTask.java @@ -8,6 +8,7 @@ import java.util.concurrent.locks.ReentrantLock; public class UserPurgeTask extends BukkitRunnable { private ReentrantLock lock = new ReentrantLock(); + @Override public void run() { lock.lock(); diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/player/ClearRegisteredXPGainTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/player/ClearRegisteredXPGainTask.java index 3bd53222e..4e775e865 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/player/ClearRegisteredXPGainTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/player/ClearRegisteredXPGainTask.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.runnables.player; -import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import org.bukkit.scheduler.BukkitRunnable; public class ClearRegisteredXPGainTask extends BukkitRunnable { diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java index 733790134..e9a77e0be 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/player/PlayerProfileLoadingTask.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.core.runnables.player; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.runnables.commands.McScoreboardKeepTask; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import org.bukkit.Server; import org.bukkit.entity.Player; diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewCheckTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewCheckTask.java index bcb0c712b..34fe29488 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewCheckTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewCheckTask.java @@ -31,8 +31,7 @@ public class AlchemyBrewCheckTask extends BukkitRunnable { if (oldInventory[Alchemy.INGREDIENT_SLOT] == null || newInventory[Alchemy.INGREDIENT_SLOT] == null || !oldInventory[Alchemy.INGREDIENT_SLOT].isSimilar(newInventory[Alchemy.INGREDIENT_SLOT]) || !validBrew) { Alchemy.brewingStandMap.get(location).cancelBrew(); } - } - else if (validBrew) { + } else if (validBrew) { Alchemy.brewingStandMap.put(location, new AlchemyBrewTask(brewingStand, player)); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewTask.java index 6b42e0f35..a378f4b7d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/AlchemyBrewTask.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.core.runnables.skills; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.skills.primary.alchemy.Alchemy; +import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyPotionBrewer; import com.gmail.nossr50.events.skills.alchemy.McMMOPlayerBrewEvent; import com.gmail.nossr50.events.skills.alchemy.McMMOPlayerCatalysisEvent; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.skills.primary.alchemy.Alchemy; -import com.gmail.nossr50.core.skills.primary.alchemy.AlchemyPotionBrewer; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.BlockState; @@ -19,7 +19,7 @@ import org.bukkit.scheduler.BukkitRunnable; public class AlchemyBrewTask extends BukkitRunnable { private static double DEFAULT_BREW_SPEED = 1.0; - private static int DEFAULT_BREW_TICKS = 400; + private static int DEFAULT_BREW_TICKS = 400; private BlockState brewingStand; private Location location; @@ -84,8 +84,7 @@ public class AlchemyBrewTask extends BukkitRunnable { if (brewTimer < Math.max(brewSpeed, 2)) { this.cancel(); finish(); - } - else { + } else { ((BrewingStand) brewingStand).setBrewingTime((int) brewTimer); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedContainer.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedContainer.java index ac4567afb..671d918c8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedContainer.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedContainer.java @@ -8,11 +8,10 @@ public class BleedContainer { public LivingEntity target; public LivingEntity damageSource; - public BleedContainer(LivingEntity target, int bleedTicks, int bleedRank, LivingEntity damageSource) - { - this.target = target; - this.bleedTicks = bleedTicks; - this.bleedRank = bleedRank; - this.damageSource = damageSource; + public BleedContainer(LivingEntity target, int bleedTicks, int bleedRank, LivingEntity damageSource) { + this.target = target; + this.bleedTicks = bleedTicks; + this.bleedRank = bleedRank; + this.damageSource = damageSource; } } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedTimerTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedTimerTask.java index 83a8c2b48..ebd0286d4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedTimerTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/BleedTimerTask.java @@ -21,6 +21,46 @@ import java.util.Map.Entry; public class BleedTimerTask extends BukkitRunnable { private static Map bleedList = new HashMap(); + public static BleedContainer copyContainer(BleedContainer container) { + LivingEntity target = container.target; + LivingEntity source = container.damageSource; + int bleedTicks = container.bleedTicks; + int bleedRank = container.bleedRank; + + BleedContainer newContainer = new BleedContainer(target, bleedTicks, bleedRank, source); + return newContainer; + } + + /** + * Instantly Bleed out a LivingEntity + * + * @param entity LivingEntity to bleed out + */ + public static void bleedOut(LivingEntity entity) { + /* + * Don't remove anything from the list outside of run() + */ + + if (bleedList.containsKey(entity)) { + CombatUtils.dealNoInvulnerabilityTickDamage(entity, bleedList.get(entity).bleedTicks * 2, bleedList.get(entity).damageSource); + } + } + + /** + * Add a LivingEntity to the bleedList if it is not in it. + * + * @param entity LivingEntity to add + * @param ticks Number of bleeding ticks + */ + public static void add(LivingEntity entity, LivingEntity attacker, int ticks, int bleedRank) { + BleedContainer newBleedContainer = new BleedContainer(entity, ticks, bleedRank, attacker); + bleedList.put(entity, newBleedContainer); + } + + public static boolean isBleeding(LivingEntity entity) { + return bleedList.containsKey(entity); + } + @Override public void run() { Iterator> bleedIterator = bleedList.entrySet().iterator(); @@ -75,45 +115,4 @@ public class BleedTimerTask extends BukkitRunnable { containerEntry.setValue(loweredBleedContainer); } } - - public static BleedContainer copyContainer(BleedContainer container) - { - LivingEntity target = container.target; - LivingEntity source = container.damageSource; - int bleedTicks = container.bleedTicks; - int bleedRank = container.bleedRank; - - BleedContainer newContainer = new BleedContainer(target, bleedTicks, bleedRank, source); - return newContainer; - } - - /** - * Instantly Bleed out a LivingEntity - * - * @param entity LivingEntity to bleed out - */ - public static void bleedOut(LivingEntity entity) { - /* - * Don't remove anything from the list outside of run() - */ - - if (bleedList.containsKey(entity)) { - CombatUtils.dealNoInvulnerabilityTickDamage(entity, bleedList.get(entity).bleedTicks * 2, bleedList.get(entity).damageSource); - } - } - - /** - * Add a LivingEntity to the bleedList if it is not in it. - * - * @param entity LivingEntity to add - * @param ticks Number of bleeding ticks - */ - public static void add(LivingEntity entity, LivingEntity attacker, int ticks, int bleedRank) { - BleedContainer newBleedContainer = new BleedContainer(entity, ticks, bleedRank, attacker); - bleedList.put(entity, newBleedContainer); - } - - public static boolean isBleeding(LivingEntity entity) { - return bleedList.containsKey(entity); - } } diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ExperienceBarHideTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ExperienceBarHideTask.java index 383f3c725..d6ca141e2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ExperienceBarHideTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/ExperienceBarHideTask.java @@ -10,8 +10,7 @@ public class ExperienceBarHideTask extends BukkitRunnable { public final PrimarySkillType primarySkillType; public final ExperienceBarManager experienceBarManagerRef; - public ExperienceBarHideTask(ExperienceBarManager experienceBarManagerRef, McMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType) - { + public ExperienceBarHideTask(ExperienceBarManager experienceBarManagerRef, McMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType) { this.experienceBarManagerRef = experienceBarManagerRef; this.mcMMOPlayer = mcMMOPlayer; this.primarySkillType = primarySkillType; @@ -30,7 +29,7 @@ public class ExperienceBarHideTask extends BukkitRunnable { */ @Override public void run() { - if(experienceBarManagerRef == null || mcMMOPlayer == null) + if (experienceBarManagerRef == null || mcMMOPlayer == null) return; experienceBarManagerRef.hideExperienceBar(primarySkillType); diff --git a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/SkillUnlockNotificationTask.java b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/SkillUnlockNotificationTask.java index 509eec752..e597ce833 100644 --- a/core/src/main/java/com/gmail/nossr50/core/runnables/skills/SkillUnlockNotificationTask.java +++ b/core/src/main/java/com/gmail/nossr50/core/runnables/skills/SkillUnlockNotificationTask.java @@ -10,18 +10,20 @@ public class SkillUnlockNotificationTask extends BukkitRunnable { private McMMOPlayer mcMMOPlayer; private SubSkillType subSkillType; private int rank; + /** * Notify a player about a newly unlocked subskill - * @param mcMMOPlayer target player + * + * @param mcMMOPlayer target player * @param subSkillType the subskill that they just unlocked - * @param rank the rank of the subskill + * @param rank the rank of the subskill */ - public SkillUnlockNotificationTask(McMMOPlayer mcMMOPlayer, SubSkillType subSkillType, int rank) - { + public SkillUnlockNotificationTask(McMMOPlayer mcMMOPlayer, SubSkillType subSkillType, int rank) { this.mcMMOPlayer = mcMMOPlayer; this.subSkillType = subSkillType; this.rank = rank; } + /** * When an object implementing interface Runnable is used * to create a thread, starting the thread causes the object's diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/ModConfigType.java b/core/src/main/java/com/gmail/nossr50/core/skills/ModConfigType.java index 267b4be6f..5eef0bbc0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/ModConfigType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/ModConfigType.java @@ -9,11 +9,9 @@ public enum ModConfigType { public static ModConfigType getModConfigType(String materialName) { if (materialName.contains("HELM") || (materialName.contains("CHEST") && !materialName.contains("CHESTNUT")) || materialName.contains("LEGS") || materialName.contains("LEGGINGS") || materialName.contains("BOOT")) { return ARMOR; - } - else if (materialName.contains("PICKAXE") || materialName.contains("AXE") || (materialName.contains("BOW") && !materialName.contains("BOWL")) || materialName.contains("HOE") || materialName.contains("SHOVEL") || materialName.contains("SWORD")) { + } else if (materialName.contains("PICKAXE") || materialName.contains("AXE") || (materialName.contains("BOW") && !materialName.contains("BOWL")) || materialName.contains("HOE") || materialName.contains("SHOVEL") || materialName.contains("SWORD")) { return TOOLS; - } - else if (materialName.contains("LOG") || materialName.contains("LEAVES") || materialName.contains("FLOWER") || materialName.contains("PLANT") || materialName.contains("CROP") || materialName.contains("ORE") || materialName.contains("DIRT") || materialName.contains("SAND") || materialName.contains("GRASS")) { + } else if (materialName.contains("LOG") || materialName.contains("LEAVES") || materialName.contains("FLOWER") || materialName.contains("PLANT") || materialName.contains("CROP") || materialName.contains("ORE") || materialName.contains("DIRT") || materialName.contains("SAND") || materialName.contains("GRASS")) { return BLOCKS; } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/PotionStage.java b/core/src/main/java/com/gmail/nossr50/core/skills/PotionStage.java index acb3b31cd..33d21ea62 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/PotionStage.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/PotionStage.java @@ -21,10 +21,6 @@ public enum PotionStage { this.numerical = numerical; } - public int toNumerical() { - return numerical; - } - private static PotionStage getPotionStageNumerical(int numerical) { for (PotionStage potionStage : values()) { if (numerical >= potionStage.toNumerical()) { @@ -60,12 +56,12 @@ public enum PotionStage { } // Check if potion has a glowstone dust amplifier - // Else check if the potion has a custom effect with an amplifier added by mcMMO + // Else check if the potion has a custom effect with an amplifier added by mcMMO if (data.isUpgraded()) { stage++; - } else if(!effects.isEmpty()) { - for (PotionEffect effect : effects){ - if(effect.getAmplifier() > 0){ + } else if (!effects.isEmpty()) { + for (PotionEffect effect : effects) { + if (effect.getAmplifier() > 0) { stage++; break; } @@ -84,4 +80,8 @@ public enum PotionStage { return PotionStage.getPotionStageNumerical(stage); } + + public int toNumerical() { + return numerical; + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java b/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java index 91c2dfe26..f9d399059 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/PrimarySkillType.java @@ -1,10 +1,9 @@ package com.gmail.nossr50.core.skills; -import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.skills.acrobatics.AcrobaticsManager; import com.gmail.nossr50.skills.alchemy.AlchemyManager; import com.gmail.nossr50.skills.archery.ArcheryManager; @@ -51,18 +50,10 @@ public enum PrimarySkillType { UNARMED(UnarmedManager.class, Color.BLACK, SuperAbilityType.BERSERK, ToolType.FISTS, ImmutableList.of(SubSkillType.UNARMED_BERSERK, SubSkillType.UNARMED_BLOCK_CRACKER, SubSkillType.UNARMED_ARROW_DEFLECT, SubSkillType.UNARMED_DISARM, SubSkillType.UNARMED_IRON_ARM_STYLE, SubSkillType.UNARMED_IRON_GRIP)), WOODCUTTING(WoodcuttingManager.class, Color.OLIVE, SuperAbilityType.TREE_FELLER, ToolType.AXE, ImmutableList.of(SubSkillType.WOODCUTTING_LEAF_BLOWER, SubSkillType.WOODCUTTING_TREE_FELLER, SubSkillType.WOODCUTTING_HARVEST_LUMBER)); - private Class managerClass; - private Color runescapeColor; - private SuperAbilityType ability; - private ToolType tool; - private List subSkillTypes; - public static final List SKILL_NAMES; public static final List SUBSKILL_NAMES; - public static final List CHILD_SKILLS; public static final List NON_CHILD_SKILLS; - public static final List COMBAT_SKILLS = ImmutableList.of(ARCHERY, AXES, SWORDS, TAMING, UNARMED); public static final List GATHERING_SKILLS = ImmutableList.of(EXCAVATION, FISHING, HERBALISM, MINING, WOODCUTTING); public static final List MISC_SKILLS = ImmutableList.of(ACROBATICS, ALCHEMY, REPAIR, SALVAGE, SMELTING); @@ -76,13 +67,11 @@ public enum PrimarySkillType { for (PrimarySkillType skill : values()) { if (skill.isChildSkill()) { childSkills.add(skill); - } - else { + } else { nonChildSkills.add(skill); } - for(SubSkillType subSkillType : skill.subSkillTypes) - { + for (SubSkillType subSkillType : skill.subSkillTypes) { subSkillNames.add(subSkillType.getNiceNameNoSpaces(subSkillType)); } names.add(skill.getName()); @@ -96,6 +85,12 @@ public enum PrimarySkillType { NON_CHILD_SKILLS = ImmutableList.copyOf(nonChildSkills); } + private Class managerClass; + private Color runescapeColor; + private SuperAbilityType ability; + private ToolType tool; + private List subSkillTypes; + private PrimarySkillType(Class managerClass, Color runescapeColor, List subSkillTypes) { this(managerClass, runescapeColor, null, null, subSkillTypes); } @@ -108,6 +103,47 @@ public enum PrimarySkillType { this.subSkillTypes = subSkillTypes; } + public static PrimarySkillType getSkill(String skillName) { + if (!Config.getInstance().getLocale().equalsIgnoreCase("en_US")) { + for (PrimarySkillType type : values()) { + if (skillName.equalsIgnoreCase(LocaleLoader.getString(StringUtils.getCapitalized(type.name()) + ".SkillName"))) { + return type; + } + } + } + + for (PrimarySkillType type : values()) { + if (type.name().equalsIgnoreCase(skillName)) { + return type; + } + } + + if (!skillName.equalsIgnoreCase("all")) { + mcMMO.p.getLogger().warning("Invalid mcMMO skill (" + skillName + ")"); //TODO: Localize + } + + return null; + } + + public static PrimarySkillType bySecondaryAbility(SubSkillType subSkillType) { + for (PrimarySkillType type : values()) { + if (type.getSkillAbilities().contains(subSkillType)) { + return type; + } + } + return null; + } + + public static PrimarySkillType byAbility(SuperAbilityType ability) { + for (PrimarySkillType type : values()) { + if (type.getAbility() == ability) { + return type; + } + } + + return null; + } + public Class getManagerClass() { return managerClass; } @@ -125,7 +161,9 @@ public enum PrimarySkillType { return Config.getInstance().getLevelCap(this); } - public boolean isSuperAbilityUnlocked(Player player) { return RankUtils.getRank(player, getAbility().getSubSkillTypeDefinition()) >= 1; } + public boolean isSuperAbilityUnlocked(Player player) { + return RankUtils.getRank(player, getAbility().getSubSkillTypeDefinition()) >= 1; + } public boolean getPVPEnabled() { return Config.getInstance().getPVPEnabled(this); @@ -167,28 +205,6 @@ public enum PrimarySkillType { return ExperienceConfig.getInstance().getFormulaSkillModifier(this); } - public static PrimarySkillType getSkill(String skillName) { - if (!Config.getInstance().getLocale().equalsIgnoreCase("en_US")) { - for (PrimarySkillType type : values()) { - if (skillName.equalsIgnoreCase(LocaleLoader.getString(StringUtils.getCapitalized(type.name()) + ".SkillName"))) { - return type; - } - } - } - - for (PrimarySkillType type : values()) { - if (type.name().equalsIgnoreCase(skillName)) { - return type; - } - } - - if (!skillName.equalsIgnoreCase("all")) { - mcMMO.p.getLogger().warning("Invalid mcMMO skill (" + skillName + ")"); //TODO: Localize - } - - return null; - } - // TODO: This is a little "hacky", we probably need to add something to distinguish child skills in the enum, or to use another enum for them public boolean isChildSkill() { switch (this) { @@ -201,25 +217,6 @@ public enum PrimarySkillType { } } - public static PrimarySkillType bySecondaryAbility(SubSkillType subSkillType) { - for (PrimarySkillType type : values()) { - if (type.getSkillAbilities().contains(subSkillType)) { - return type; - } - } - return null; - } - - public static PrimarySkillType byAbility(SuperAbilityType ability) { - for (PrimarySkillType type : values()) { - if (type.getAbility() == ability) { - return type; - } - } - - return null; - } - public String getName() { return Config.getInstance().getLocale().equalsIgnoreCase("en_US") ? StringUtils.getCapitalized(this.toString()) : StringUtils.getCapitalized(LocaleLoader.getString(StringUtils.getCapitalized(this.toString()) + ".SkillName")); } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/SkillManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/SkillManager.java index c15dd3f90..3866baa0b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/SkillManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/SkillManager.java @@ -26,7 +26,8 @@ public abstract class SkillManager { /** * Applies XP to a player, provides SELF as an XpGainSource source - * @param xp amount of XP to apply + * + * @param xp amount of XP to apply * @param xpGainReason the reason for the XP gain * @deprecated use applyXpGain(float, XPGainReason, XPGainSource) */ @@ -37,7 +38,8 @@ public abstract class SkillManager { /** * Applies XP to a player - * @param xp amount of XP to apply + * + * @param xp amount of XP to apply * @param xpGainReason the reason for the XP gain * @param xpGainSource the source of the XP */ diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillFlags.java b/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillFlags.java index 96be040da..453d288e7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillFlags.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillFlags.java @@ -6,14 +6,14 @@ public class SubSkillFlags { * These are so I can flag properties for subskills * Flags are in the power of 2 because binary is a base-2 system */ - public static final int ACTIVE = 1; //Active subskills are ones that aren't passive - public static final int SUPERABILITY = 2; // Super abilities are redundantly active - public static final int RNG = 4; //If the subskill makes use of RNG - public static final int PVP = 8; //If the subskill has properties that change in PVP conditions - public static final int TIMED = 16; //If the subskill has a duration or time component - public static final int TARGET_COLLECTION = 32; //If the subskill has multiple target types - public static final int REWARD_COLLECTION = 64; //If the subskill has multiple reward types - public static final int CHARGES = 128; - public static final int LIMITED = 256; + public static final int ACTIVE = 1; //Active subskills are ones that aren't passive + public static final int SUPERABILITY = 2; // Super abilities are redundantly active + public static final int RNG = 4; //If the subskill makes use of RNG + public static final int PVP = 8; //If the subskill has properties that change in PVP conditions + public static final int TIMED = 16; //If the subskill has a duration or time component + public static final int TARGET_COLLECTION = 32; //If the subskill has multiple target types + public static final int REWARD_COLLECTION = 64; //If the subskill has multiple reward types + public static final int CHARGES = 128; + public static final int LIMITED = 256; //public static final int RANDOM_ACTIVATION = 128; //If the subskill has random activation } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillType.java b/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillType.java index 5d7120e4c..e4c5b5da2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/SubSkillType.java @@ -94,11 +94,11 @@ public enum SubSkillType { UNARMED_IRON_GRIP(1), /* Woodcutting */ -/* WOODCUTTING_BARK_SURGEON(3),*/ + /* WOODCUTTING_BARK_SURGEON(3),*/ WOODCUTTING_HARVEST_LUMBER(1), WOODCUTTING_LEAF_BLOWER(1), -/* WOODCUTTING_NATURES_BOUNTY(3), - WOODCUTTING_SPLINTER(3),*/ + /* WOODCUTTING_NATURES_BOUNTY(3), + WOODCUTTING_SPLINTER(3),*/ WOODCUTTING_TREE_FELLER(1); private final int numRanks; @@ -106,32 +106,34 @@ public enum SubSkillType { /** * If our SubSkillType has more than 1 rank define it + * * @param numRanks The number of ranks our SubSkillType has */ - SubSkillType(int numRanks) - { + SubSkillType(int numRanks) { this.numRanks = numRanks; } - SubSkillType() - { + SubSkillType() { this.numRanks = 0; } - public int getNumRanks() - { + public int getNumRanks() { return numRanks; } /** * !!! This relies on the immutable lists in PrimarySkillType being populated !!! * If we add skills, those immutable lists need to be updated + * * @return */ - public PrimarySkillType getParentSkill() { return PrimarySkillType.bySecondaryAbility(this); } + public PrimarySkillType getParentSkill() { + return PrimarySkillType.bySecondaryAbility(this); + } /** * Returns the root address for this skill in the advanced.yml file + * * @return the root address for this skill in advanced.yml */ public String getAdvConfigAddress() { @@ -140,6 +142,7 @@ public enum SubSkillType { /** * Returns the root address for this skill in the rankskills.yml file + * * @return the root address for this skill in rankskills.yml */ public String getRankConfigAddress() { @@ -148,16 +151,17 @@ public enum SubSkillType { /** * Get the string representation of the permission node for this subskill + * * @return the permission node for this subskill */ - public String getPermissionNodeAddress() - { + public String getPermissionNodeAddress() { //TODO: This could be optimized return "mcmmo.ability." + getParentSkill().toString().toLowerCase() + "." + getConfigName(toString()).toLowerCase(); } /** * Returns the name of the skill as it is used in advanced.yml and other config files + * * @return the yaml identifier for this skill */ private String getConfigName(String subSkillName) { @@ -181,12 +185,10 @@ public enum SubSkillType { * Split the string up so we can capitalize each part */ String subskillNameWithoutPrefix = subSkillName.substring(subStringIndex); - if(subskillNameWithoutPrefix.contains("_")) - { + if (subskillNameWithoutPrefix.contains("_")) { String splitStrings[] = subskillNameWithoutPrefix.split("_"); - for(String string : splitStrings) - { + for (String string : splitStrings) { endResult += StringUtils.getCapitalized(string); } } else { @@ -207,14 +209,12 @@ public enum SubSkillType { * Split the string up so we can capitalize each part */ String subskillNameWithoutPrefix = subSkillName.substring(subStringIndex); - if(subskillNameWithoutPrefix.contains("_")) - { + if (subskillNameWithoutPrefix.contains("_")) { String splitStrings[] = subskillNameWithoutPrefix.split("_"); - for(int i = 0; i < splitStrings.length; i++) - { - if(i+1 >= splitStrings.length) - endResult+=StringUtils.getCapitalized(splitStrings[i]); + for (int i = 0; i < splitStrings.length; i++) { + if (i + 1 >= splitStrings.length) + endResult += StringUtils.getCapitalized(splitStrings[i]); else { endResult += StringUtils.getCapitalized(splitStrings[i]); endResult += "_"; @@ -229,25 +229,26 @@ public enum SubSkillType { /** * Returns the name of the parent skill from the Locale file + * * @return The parent skill as defined in the locale */ - public String getParentNiceNameLocale() - { - return LocaleLoader.getString(StringUtils.getCapitalized(getParentSkill().toString())+".SkillName"); + public String getParentNiceNameLocale() { + return LocaleLoader.getString(StringUtils.getCapitalized(getParentSkill().toString()) + ".SkillName"); } /** * Gets the "nice" name of the subskill without spaces + * * @param subSkillType target subskill * @return the "nice" name without spaces */ - public String getNiceNameNoSpaces(SubSkillType subSkillType) - { + public String getNiceNameNoSpaces(SubSkillType subSkillType) { return getConfigName(subSkillType.toString()); } /** * This finds the substring index for our SubSkillType's name after its parent name prefix + * * @param subSkillName The name to process * @return The value of the substring index after our parent's prefix */ @@ -266,35 +267,40 @@ public enum SubSkillType { return subStringIndex; } - public String getLocaleKeyRoot() - { - return StringUtils.getCapitalized(getParentSkill().toString())+".SubSkill."+getConfigName(toString()); + public String getLocaleKeyRoot() { + return StringUtils.getCapitalized(getParentSkill().toString()) + ".SubSkill." + getConfigName(toString()); } - public String getLocaleName() - { + public String getLocaleName() { return getFromLocaleSubAddress(".Name"); } - public String getLocaleDescription() - { + public String getLocaleDescription() { return getFromLocaleSubAddress(".Description"); } - public String getLocaleStatDescription() { return getFromLocaleSubAddress(".Stat"); } - public String getLocaleKeyStatDescription() { return getLocaleKeyFromSubAddress(".Stat"); } + public String getLocaleStatDescription() { + return getFromLocaleSubAddress(".Stat"); + } - public String getLocaleStatExtraDescription() { return getFromLocaleSubAddress(".Stat.Extra"); } - public String getLocaleKeyStatExtraDescription() { return getLocaleKeyFromSubAddress(".Stat.Extra"); } + public String getLocaleKeyStatDescription() { + return getLocaleKeyFromSubAddress(".Stat"); + } - public String getLocaleStat(String... vars) - { + public String getLocaleStatExtraDescription() { + return getFromLocaleSubAddress(".Stat.Extra"); + } + + public String getLocaleKeyStatExtraDescription() { + return getLocaleKeyFromSubAddress(".Stat.Extra"); + } + + public String getLocaleStat(String... vars) { String statMsg = LocaleLoader.getString("Ability.Generic.Template", (Object[]) vars); return statMsg; } - public String getCustomLocaleStat(String... vars) - { + public String getCustomLocaleStat(String... vars) { String statMsg = LocaleLoader.getString("Ability.Generic.Template.Custom", (Object[]) vars); return statMsg; } @@ -303,8 +309,7 @@ public enum SubSkillType { return LocaleLoader.getString(getLocaleKeyRoot() + s); } - private String getLocaleKeyFromSubAddress(String s) - { + private String getLocaleKeyFromSubAddress(String s) { return getLocaleKeyRoot() + s; } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java b/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java index ee36532dd..2d3a8ca89 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/SuperAbilityType.java @@ -74,14 +74,14 @@ public enum SuperAbilityType { * This is a bit of a band-aid fix until the new skill system is in place */ static { - BERSERK.subSkillTypeDefinition = SubSkillType.UNARMED_BERSERK; - SUPER_BREAKER.subSkillTypeDefinition = SubSkillType.MINING_SUPER_BREAKER; - GIGA_DRILL_BREAKER.subSkillTypeDefinition = SubSkillType.EXCAVATION_GIGA_DRILL_BREAKER; - GREEN_TERRA.subSkillTypeDefinition = SubSkillType.HERBALISM_GREEN_TERRA; - SKULL_SPLITTER.subSkillTypeDefinition = SubSkillType.AXES_SKULL_SPLITTER; - TREE_FELLER.subSkillTypeDefinition = SubSkillType.WOODCUTTING_TREE_FELLER; - SERRATED_STRIKES.subSkillTypeDefinition = SubSkillType.SWORDS_SERRATED_STRIKES; - BLAST_MINING.subSkillTypeDefinition = SubSkillType.MINING_BLAST_MINING; + BERSERK.subSkillTypeDefinition = SubSkillType.UNARMED_BERSERK; + SUPER_BREAKER.subSkillTypeDefinition = SubSkillType.MINING_SUPER_BREAKER; + GIGA_DRILL_BREAKER.subSkillTypeDefinition = SubSkillType.EXCAVATION_GIGA_DRILL_BREAKER; + GREEN_TERRA.subSkillTypeDefinition = SubSkillType.HERBALISM_GREEN_TERRA; + SKULL_SPLITTER.subSkillTypeDefinition = SubSkillType.AXES_SKULL_SPLITTER; + TREE_FELLER.subSkillTypeDefinition = SubSkillType.WOODCUTTING_TREE_FELLER; + SERRATED_STRIKES.subSkillTypeDefinition = SubSkillType.SWORDS_SERRATED_STRIKES; + BLAST_MINING.subSkillTypeDefinition = SubSkillType.MINING_BLAST_MINING; } private String abilityOn; @@ -219,6 +219,7 @@ public enum SuperAbilityType { /** * Grabs the associated SubSkillType definition for this SuperAbilityType + * * @return the matching SubSkillType definition for this SuperAbilityType */ public SubSkillType getSubSkillTypeDefinition() { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/ChildConfig.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/ChildConfig.java index 5a3df0a37..5af3c9449 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/ChildConfig.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/ChildConfig.java @@ -30,8 +30,7 @@ public class ChildConfig extends AutoUpdateConfigLoader { PrimarySkillType parentSkill = PrimarySkillType.valueOf(name.toUpperCase()); FamilyTree.enforceNotChildSkill(parentSkill); parentSkills.add(parentSkill); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { plugin.getLogger().warning(name + " is not a valid skill type, or is a child skill!"); useDefaults = true; break; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java index a288d12d7..9a58635f0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/Salvage.java @@ -12,7 +12,7 @@ public class Salvage { public static int advancedSalvageUnlockLevel = RankUtils.getRankUnlockLevel(SubSkillType.SALVAGE_ADVANCED_SALVAGE, 1);*/ - public static boolean arcaneSalvageDowngrades = AdvancedConfig.getInstance().getArcaneSalvageEnchantDowngradeEnabled(); + public static boolean arcaneSalvageDowngrades = AdvancedConfig.getInstance().getArcaneSalvageEnchantDowngradeEnabled(); public static boolean arcaneSalvageEnchantLoss = AdvancedConfig.getInstance().getArcaneSalvageEnchantLossEnabled(); protected static int calculateSalvageableAmount(short currentDurability, short maxDurability, int baseAmount) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java index c01ba6dc3..92aa8867d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/SalvageManager.java @@ -4,12 +4,12 @@ import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SkillManager; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.child.salvage.salvageables.Salvageable; +import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; @@ -33,7 +33,7 @@ import java.util.Map.Entry; public class SalvageManager extends SkillManager { private boolean placedAnvil; - private int lastClick; + private int lastClick; public SalvageManager(McMMOPlayer mcMMOPlayer) { super(mcMMOPlayer, PrimarySkillType.SALVAGE); @@ -207,34 +207,29 @@ public class SalvageManager extends SkillManager { if (!Salvage.arcaneSalvageEnchantLoss || RandomChanceUtil.checkRandomChanceExecutionSuccess(new RandomChanceSkillStatic(getExtractFullEnchantChance(), getPlayer(), SubSkillType.SALVAGE_ARCANE_SALVAGE))) { enchantMeta.addStoredEnchant(enchant.getKey(), enchant.getValue(), true); - } - else if (enchant.getValue() > 1 + } else if (enchant.getValue() > 1 && Salvage.arcaneSalvageDowngrades && RandomChanceUtil.checkRandomChanceExecutionSuccess(new RandomChanceSkillStatic(getExtractPartialEnchantChance(), getPlayer(), SubSkillType.SALVAGE_ARCANE_SALVAGE))) { enchantMeta.addStoredEnchant(enchant.getKey(), enchant.getValue() - 1, true); downgraded = true; - } - else { + } else { arcaneFailure = true; downgraded = true; } } - if(!arcaneFailure) - { + if (!arcaneFailure) { Map newEnchants = enchantMeta.getStoredEnchants(); if (downgraded || newEnchants.size() < enchants.size()) { NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Salvage.Skills.ArcanePartial"); - } - else { + } else { NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Salvage.Skills.ArcanePartial"); } book.setItemMeta(enchantMeta); } else { - if(enchantMeta.getStoredEnchants().size() > 0) - { + if (enchantMeta.getStoredEnchants().size() > 0) { NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Salvage.Skills.ArcaneFailed"); } return null; @@ -245,8 +240,8 @@ public class SalvageManager extends SkillManager { /** * Check if the player has tried to use an Anvil before. - * @param actualize * + * @param actualize * @return true if the player has confirmed using an Anvil */ public boolean checkConfirmation(boolean actualize) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/Salvageable.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/Salvageable.java index baf60b406..d15e4be72 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/Salvageable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/Salvageable.java @@ -42,7 +42,7 @@ public interface Salvageable { /** * Gets the maximum quantity of salvage materials ignoring all other salvage bonuses - * + *

* This is typically set to the number of items needed to create that item, for example 5 for helmets or 2 for swords * * @return the maximum number of items @@ -58,7 +58,7 @@ public interface Salvageable { /** * Gets the base salvage durability on which to calculate bonuses. - * + *

* This is actually the maximum durability divided by the minimum quantity * * @return the base salvage durability diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableManager.java index 9d50c68c4..5f962bc19 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/salvage/salvageables/SalvageableManager.java @@ -24,7 +24,6 @@ public interface SalvageableManager { * Checks if an item is salvageable * * @param type Material to check if salvageable - * * @return true if salvageable, false if not */ public boolean isSalvageable(Material type); @@ -33,7 +32,6 @@ public interface SalvageableManager { * Checks if an item is salvageable * * @param itemStack Item to check if salvageable - * * @return true if salvageable, false if not */ public boolean isSalvageable(ItemStack itemStack); @@ -42,7 +40,6 @@ public interface SalvageableManager { * Gets the salvageable with this type * * @param type Material of the salvageable to look for - * * @return the salvageable, can be null */ public Salvageable getSalvageable(Material type); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/Smelting.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/Smelting.java index 6ded74855..03cf4409b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/Smelting.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/Smelting.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.child.smelting; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.mcMMO; @@ -11,17 +11,15 @@ import org.bukkit.inventory.ItemStack; public class Smelting { - public static int getRank(Player player) - { + public static int burnModifierMaxLevel = AdvancedConfig.getInstance().getBurnModifierMaxLevel(); + public static double burnTimeMultiplier = AdvancedConfig.getInstance().getBurnTimeMultiplier(); + public static int fluxMiningUnlockLevel = RankUtils.getUnlockLevel(SubSkillType.SMELTING_FLUX_MINING); + public static double fluxMiningChance = AdvancedConfig.getInstance().getFluxMiningChance(); + + public static int getRank(Player player) { return RankUtils.getRank(player, SubSkillType.SMELTING_UNDERSTANDING_THE_ART); } - public static int burnModifierMaxLevel = AdvancedConfig.getInstance().getBurnModifierMaxLevel(); - public static double burnTimeMultiplier = AdvancedConfig.getInstance().getBurnTimeMultiplier(); - - public static int fluxMiningUnlockLevel = RankUtils.getUnlockLevel(SubSkillType.SMELTING_FLUX_MINING); - public static double fluxMiningChance = AdvancedConfig.getInstance().getFluxMiningChance(); - protected static int getResourceXp(ItemStack smelting) { return mcMMO.getModManager().isCustomOre(smelting.getType()) ? mcMMO.getModManager().getBlock(smelting.getType()).getSmeltingXpGain() : ExperienceConfig.getInstance().getXp(PrimarySkillType.SMELTING, smelting.getType()); } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java index 20626be12..dd4873061 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/child/smelting/SmeltingManager.java @@ -5,8 +5,8 @@ import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SkillManager; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.primary.mining.Mining; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.BlockUtils; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/ChildSkill.java b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/ChildSkill.java index 504542177..e6df253c6 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/ChildSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/ChildSkill.java @@ -5,6 +5,7 @@ import com.gmail.nossr50.core.skills.PrimarySkillType; public interface ChildSkill extends Skill { /** * Get's the other parent for this Skill + * * @return the other parent */ PrimarySkillType getSecondParent(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/CoreSkill.java b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/CoreSkill.java index df85989b0..909c10cb8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/CoreSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/CoreSkill.java @@ -11,6 +11,7 @@ import com.gmail.nossr50.core.skills.SubSkillType; public interface CoreSkill { /** * Gets the associated SubSkillType for this subskill + * * @return the associated SubSkillType ENUM definition */ SubSkillType getSubSkillType(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Localized.java b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Localized.java index a2758d46f..83a4726b2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Localized.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Localized.java @@ -7,12 +7,14 @@ package com.gmail.nossr50.core.skills.interfaces; public interface Localized { /** * The translated name for this locale + * * @return the translated name for this locale */ String getLocaleName(); /** * The translated name for this subskill description + * * @return */ String getLocaleDescription(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Progression.java b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Progression.java index cbdd3e51c..92cd66109 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Progression.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Progression.java @@ -6,6 +6,7 @@ import org.bukkit.event.Event; public interface Progression { /** * The interaction vector for gaining XP + * * @return the interaction vector for gaining XP */ InteractType getXpGainInteractType(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Skill.java b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Skill.java index f89e93c17..c4cd71866 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Skill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Skill.java @@ -5,12 +5,14 @@ import com.gmail.nossr50.core.skills.PrimarySkillType; public interface Skill { /** * The primary skill + * * @return this primary skill */ PrimarySkillType getPrimarySkill(); /** * Returns the key name used for this skill in conjunction with config files + * * @return config file key name */ String getPrimaryKeyName(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Toolable.java b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Toolable.java index 184c7a59d..8997fbce6 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Toolable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/interfaces/Toolable.java @@ -8,12 +8,14 @@ public interface Toolable { /** * Whether or not this Skill requires a tool * Not all skills will require a tool + * * @return true if tool is required */ - boolean requiresTool(); + boolean requiresTool(); /** * The tools associated with this Skill + * * @return the tools */ Collection getTools(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java index 5ade031db..b175620ba 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/Acrobatics.java @@ -1,15 +1,16 @@ package com.gmail.nossr50.core.skills.primary.acrobatics; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.config.experience.ExperienceConfig; public final class Acrobatics { - public static double dodgeDamageModifier = AdvancedConfig.getInstance().getDodgeDamageModifier(); + public static double dodgeDamageModifier = AdvancedConfig.getInstance().getDodgeDamageModifier(); public static int dodgeXpModifier = ExperienceConfig.getInstance().getDodgeXPModifier(); public static boolean dodgeLightningDisabled = Config.getInstance().getDodgeLightningDisabled(); - private Acrobatics() {} + private Acrobatics() { + } protected static double calculateModifiedDodgeDamage(double damage, double damageModifier) { return Math.max(damage / damageModifier, 1.0); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/AcrobaticsManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/AcrobaticsManager.java index a483c29cf..2c7d8df3a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/AcrobaticsManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/acrobatics/AcrobaticsManager.java @@ -4,8 +4,8 @@ import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SkillManager; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; @@ -25,7 +25,7 @@ public class AcrobaticsManager extends SkillManager { } public boolean canDodge(Entity damager) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.ACROBATICS_DODGE)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.ACROBATICS_DODGE)) return false; if (Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.ACROBATICS_DODGE)) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/Alchemy.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/Alchemy.java index 30cd1b396..a700518d0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/Alchemy.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/Alchemy.java @@ -49,14 +49,15 @@ public final class Alchemy { public static final int INGREDIENT_SLOT = 3; - public static int catalysisUnlockLevel = RankUtils.getUnlockLevel(SubSkillType.ALCHEMY_CATALYSIS); - public static int catalysisMaxBonusLevel = AdvancedConfig.getInstance().getCatalysisMaxBonusLevel(); - public static double catalysisMinSpeed = AdvancedConfig.getInstance().getCatalysisMinSpeed(); - public static double catalysisMaxSpeed = AdvancedConfig.getInstance().getCatalysisMaxSpeed(); + public static int catalysisUnlockLevel = RankUtils.getUnlockLevel(SubSkillType.ALCHEMY_CATALYSIS); + public static int catalysisMaxBonusLevel = AdvancedConfig.getInstance().getCatalysisMaxBonusLevel(); + public static double catalysisMinSpeed = AdvancedConfig.getInstance().getCatalysisMinSpeed(); + public static double catalysisMaxSpeed = AdvancedConfig.getInstance().getCatalysisMaxSpeed(); public static Map brewingStandMap = new HashMap(); - private Alchemy() {} + private Alchemy() { + } /** * Finish all active brews. Used upon Disable to prevent vanilla potions from being brewed upon next Enable. diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyManager.java index 10f3d3f07..e7235ad70 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyManager.java @@ -5,10 +5,10 @@ import com.gmail.nossr50.config.skills.alchemy.PotionConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.PotionStage; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SkillManager; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.skills.RankUtils; import org.bukkit.inventory.ItemStack; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotion.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotion.java index 3efde46bd..1030a0c47 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotion.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotion.java @@ -54,7 +54,7 @@ public class AlchemyPotion { meta.addCustomEffect(effect, true); } } - + if (this.getColor() != null) { meta.setColor(this.getColor()); } @@ -106,11 +106,11 @@ public class AlchemyPotion { public Color getColor() { return color; } - + public void setColor(Color color) { this.color = color; } - + public Map getChildren() { return children; } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotionBrewer.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotionBrewer.java index 1daa82c22..89c617a0a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotionBrewer.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/alchemy/AlchemyPotionBrewer.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.core.skills.primary.alchemy; import com.gmail.nossr50.config.skills.alchemy.PotionConfig; -import com.gmail.nossr50.core.skills.SubSkillType; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.skills.PotionStage; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.events.fake.FakeBrewEvent; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.player.PlayerUpdateInventoryTask; import com.gmail.nossr50.runnables.skills.AlchemyBrewCheckTask; import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.Material; import org.bukkit.block.BlockState; import org.bukkit.block.BrewingStand; @@ -59,12 +59,10 @@ public final class AlchemyPotionBrewer { if (isEmpty(ingredient) || !isValidIngredient(player, ingredient)) { return; - } - else if (ingredient.getAmount() <= 1) { + } else if (ingredient.getAmount() <= 1) { inventory.setIngredient(null); return; - } - else { + } else { ingredient.setAmount(ingredient.getAmount() - 1); inventory.setIngredient(ingredient); return; @@ -157,8 +155,7 @@ public final class AlchemyPotionBrewer { if (click.isLeftClick()) { success = transferItems(view, fromSlot); - } - else if (click.isRightClick()) { + } else if (click.isRightClick()) { success = transferOneItem(view, fromSlot); } @@ -178,13 +175,11 @@ public final class AlchemyPotionBrewer { if (!emptyTo && fromAmount >= from.getType().getMaxStackSize()) { return false; - } - else if (emptyTo || from.isSimilar(to)) { + } else if (emptyTo || from.isSimilar(to)) { if (emptyTo) { to = from.clone(); to.setAmount(1); - } - else { + } else { to.setAmount(to.getAmount() + 1); } @@ -207,14 +202,12 @@ public final class AlchemyPotionBrewer { if (isEmpty(from)) { return false; - } - else if (isEmpty(to)) { + } else if (isEmpty(to)) { view.setItem(Alchemy.INGREDIENT_SLOT, from); view.setItem(fromSlot, null); return true; - } - else if (from.isSimilar(to)) { + } else if (from.isSimilar(to)) { int fromAmount = from.getAmount(); int toAmount = to.getAmount(); int maxSize = to.getType().getMaxStackSize(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/Archery.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/Archery.java index 7ec67ed0c..36f0c277c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/Archery.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/Archery.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.primary.archery; -import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.skills.RankUtils; @@ -15,13 +15,11 @@ import java.util.Iterator; import java.util.List; public class Archery { - private static List trackedEntities = new ArrayList(); - - public static double skillShotMaxBonusDamage = AdvancedConfig.getInstance().getSkillShotDamageMax(); + public static final double DISTANCE_XP_MULTIPLIER = ExperienceConfig.getInstance().getArcheryDistanceMultiplier(); + public static double skillShotMaxBonusDamage = AdvancedConfig.getInstance().getSkillShotDamageMax(); public static double dazeBonusDamage = AdvancedConfig.getInstance().getDazeBonusDamage(); - - public static final double DISTANCE_XP_MULTIPLIER = ExperienceConfig.getInstance().getArcheryDistanceMultiplier(); + private static List trackedEntities = new ArrayList(); protected static void incrementTrackerValue(LivingEntity livingEntity) { for (TrackedEntity trackedEntity : trackedEntities) { @@ -51,7 +49,7 @@ public class Archery { * @param livingEntity The entity hit by the arrows */ public static void arrowRetrievalCheck(LivingEntity livingEntity) { - for (Iterator entityIterator = trackedEntities.iterator(); entityIterator.hasNext();) { + for (Iterator entityIterator = trackedEntities.iterator(); entityIterator.hasNext(); ) { TrackedEntity trackedEntity = entityIterator.next(); if (trackedEntity.getID() == livingEntity.getUniqueId()) { @@ -62,8 +60,7 @@ public class Archery { } } - public static double getSkillShotBonusDamage(Player player, double oldDamage) - { + public static double getSkillShotBonusDamage(Player player, double oldDamage) { double damageBonusPercent = getDamageBonusPercent(player); double newDamage = oldDamage + (oldDamage * damageBonusPercent); return Math.min(newDamage, Archery.skillShotMaxBonusDamage); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/ArcheryManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/ArcheryManager.java index 17a998a58..53772546b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/ArcheryManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/archery/ArcheryManager.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.core.skills.primary.archery; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SkillManager; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.SkillActivationType; @@ -26,21 +26,21 @@ public class ArcheryManager extends SkillManager { } public boolean canDaze(LivingEntity target) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.ARCHERY_DAZE)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.ARCHERY_DAZE)) return false; return target instanceof Player && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.ARCHERY_DAZE); } public boolean canSkillShot() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.ARCHERY_SKILL_SHOT)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.ARCHERY_SKILL_SHOT)) return false; return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.ARCHERY_SKILL_SHOT); } public boolean canRetrieveArrows() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.ARCHERY_ARROW_RETRIEVAL)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.ARCHERY_ARROW_RETRIEVAL)) return false; return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.ARCHERY_ARROW_RETRIEVAL); @@ -49,7 +49,7 @@ public class ArcheryManager extends SkillManager { /** * Calculate bonus XP awarded for Archery when hitting a far-away target. * - * @param target The {@link LivingEntity} damaged by the arrow + * @param target The {@link LivingEntity} damaged by the arrow * @param damager The {@link Entity} who shot the arrow */ public double distanceXpBonusMultiplier(LivingEntity target, Entity damager) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/Axes.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/Axes.java index da17bd6b6..bb6b9042c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/Axes.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/Axes.java @@ -11,15 +11,15 @@ import org.bukkit.inventory.ItemStack; public class Axes { public static double axeMasteryRankDamageMultiplier = AdvancedConfig.getInstance().getAxeMasteryRankDamageMultiplier(); - public static double criticalHitPVPModifier = AdvancedConfig.getInstance().getCriticalStrikesPVPModifier(); - public static double criticalHitPVEModifier = AdvancedConfig.getInstance().getCriticalStrikesPVEModifier(); + public static double criticalHitPVPModifier = AdvancedConfig.getInstance().getCriticalStrikesPVPModifier(); + public static double criticalHitPVEModifier = AdvancedConfig.getInstance().getCriticalStrikesPVEModifier(); - public static int impactIncreaseLevel = AdvancedConfig.getInstance().getArmorImpactIncreaseLevel(); - public static double impactChance = AdvancedConfig.getInstance().getImpactChance(); + public static int impactIncreaseLevel = AdvancedConfig.getInstance().getArmorImpactIncreaseLevel(); + public static double impactChance = AdvancedConfig.getInstance().getImpactChance(); public static double impactMaxDurabilityModifier = AdvancedConfig.getInstance().getArmorImpactMaxDurabilityDamage() / 100D; - public static double greaterImpactBonusDamage = AdvancedConfig.getInstance().getGreaterImpactBonusDamage(); - public static double greaterImpactChance = AdvancedConfig.getInstance().getGreaterImpactChance(); + public static double greaterImpactBonusDamage = AdvancedConfig.getInstance().getGreaterImpactBonusDamage(); + public static double greaterImpactChance = AdvancedConfig.getInstance().getGreaterImpactChance(); public static double greaterImpactKnockbackMultiplier = AdvancedConfig.getInstance().getGreaterImpactModifier(); public static double skullSplitterModifier = AdvancedConfig.getInstance().getSkullSplitterModifier(); @@ -36,11 +36,11 @@ public class Axes { /** * For every rank in Axe Mastery we add RankDamageMultiplier to get the total bonus damage from Axe Mastery + * * @param player The target player * @return The axe mastery bonus damage which will be added to their attack */ - public static double getAxeMasteryBonusDamage(Player player) - { + public static double getAxeMasteryBonusDamage(Player player) { return RankUtils.getRank(player, SubSkillType.AXES_AXE_MASTERY) * Axes.axeMasteryRankDamageMultiplier; } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/AxesManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/AxesManager.java index acb40da77..10b168e70 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/AxesManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/axes/AxesManager.java @@ -1,16 +1,12 @@ package com.gmail.nossr50.core.skills.primary.axes; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.skills.ToolType; -import com.gmail.nossr50.core.skills.SkillManager; +import com.gmail.nossr50.core.skills.*; import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceUtil; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; @@ -25,35 +21,35 @@ public class AxesManager extends SkillManager { } public boolean canUseAxeMastery() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_AXE_MASTERY)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_AXE_MASTERY)) return false; return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.AXES_AXE_MASTERY); } public boolean canCriticalHit(LivingEntity target) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_CRITICAL_STRIKES)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_CRITICAL_STRIKES)) return false; return target.isValid() && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.AXES_CRITICAL_STRIKES); } public boolean canImpact(LivingEntity target) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_ARMOR_IMPACT)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_ARMOR_IMPACT)) return false; return target.isValid() && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.AXES_ARMOR_IMPACT) && Axes.hasArmor(target); } public boolean canGreaterImpact(LivingEntity target) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_GREATER_IMPACT)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_GREATER_IMPACT)) return false; return target.isValid() && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.AXES_GREATER_IMPACT) && !Axes.hasArmor(target); } public boolean canUseSkullSplitter(LivingEntity target) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_SKULL_SPLITTER)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.AXES_SKULL_SPLITTER)) return false; return target.isValid() && mcMMOPlayer.getAbilityMode(SuperAbilityType.SKULL_SPLITTER) && Permissions.skullSplitter(getPlayer()); @@ -99,8 +95,7 @@ public class AxesManager extends SkillManager { } damage = (damage * Axes.criticalHitPVPModifier) - damage; - } - else { + } else { damage = (damage * Axes.criticalHitPVEModifier) - damage; } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java index 519723681..d1e715da6 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/excavation/ExcavationManager.java @@ -4,9 +4,9 @@ import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.treasure.ExcavationTreasure; -import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.random.RandomChanceUtil; @@ -50,18 +50,17 @@ public class ExcavationManager extends SkillManager { applyXpGain(xp, XPGainReason.PVE); } - public void printExcavationDebug(Player player, BlockState blockState) - { + public void printExcavationDebug(Player player, BlockState blockState) { if (Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.EXCAVATION_ARCHAEOLOGY)) { List treasures = Excavation.getTreasures(blockState); if (!treasures.isEmpty()) { for (ExcavationTreasure treasure : treasures) { player.sendMessage("|||||||||||||||||||||||||||||||||"); - player.sendMessage("[mcMMO DEBUG] Treasure found: ("+treasure.getDrop().getType().toString()+")"); - player.sendMessage("[mcMMO DEBUG] Drop Chance for Treasure: "+treasure.getDropChance()); - player.sendMessage("[mcMMO DEBUG] Skill Level Required: "+treasure.getDropLevel()); - player.sendMessage("[mcMMO DEBUG] XP for Treasure: "+treasure.getXp()); + player.sendMessage("[mcMMO DEBUG] Treasure found: (" + treasure.getDrop().getType().toString() + ")"); + player.sendMessage("[mcMMO DEBUG] Drop Chance for Treasure: " + treasure.getDropChance()); + player.sendMessage("[mcMMO DEBUG] Skill Level Required: " + treasure.getDropLevel()); + player.sendMessage("[mcMMO DEBUG] XP for Treasure: " + treasure.getXp()); } } else { player.sendMessage("[mcMMO DEBUG] No treasures found for this block."); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/Fishing.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/Fishing.java index 9ffc0c444..928cf60e9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/Fishing.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/Fishing.java @@ -21,18 +21,18 @@ public final class Fishing { public static int fishermansDietRankLevel1 = AdvancedConfig.getInstance().getFishermanDietRankChange(); public static int fishermansDietRankLevel2 = fishermansDietRankLevel1 * 2; - public static int fishermansDietMaxLevel = fishermansDietRankLevel1 * 5; + public static int fishermansDietMaxLevel = fishermansDietRankLevel1 * 5; public static Set masterAnglerBiomes = BiomeAdapter.WATER_BIOMES; - public static Set iceFishingBiomes = BiomeAdapter.ICE_BIOMES; + public static Set iceFishingBiomes = BiomeAdapter.ICE_BIOMES; - private Fishing() {} + private Fishing() { + } /** * Finds the possible drops of an entity * - * @param target - * Targeted entity + * @param target Targeted entity * @return possibleDrops List of ItemStack that can be dropped */ protected static List findPossibleDrops(LivingEntity target) { @@ -45,8 +45,7 @@ public final class Fishing { /** * Randomly chooses a drop among the list * - * @param possibleDrops - * List of ItemStack that can be dropped + * @param possibleDrops List of ItemStack that can be dropped * @return Chosen ItemStack */ protected static ItemStack chooseDrop(List possibleDrops) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java index 8a0dd5e3e..8b7eca90c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/fishing/FishingManager.java @@ -1,19 +1,19 @@ package com.gmail.nossr50.core.skills.primary.fishing; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.treasure.TreasureConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.treasure.EnchantmentTreasure; import com.gmail.nossr50.core.skills.treasure.FishingTreasure; import com.gmail.nossr50.core.skills.treasure.Rarity; import com.gmail.nossr50.core.skills.treasure.ShakeTreasure; -import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.events.skills.fishing.McMMOPlayerFishingTreasureEvent; import com.gmail.nossr50.events.skills.fishing.McMMOPlayerShakeEvent; import com.gmail.nossr50.util.*; @@ -28,7 +28,8 @@ import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.*; +import org.bukkit.entity.Item; +import org.bukkit.entity.LivingEntity; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; @@ -68,7 +69,7 @@ public class FishingManager extends SkillManager { long currentTime = System.currentTimeMillis(); boolean hasFished = (currentTime < fishingTimestamp + (FISHING_COOLDOWN_SECONDS * 10)); - if(hasFished) + if (hasFished) fishingTimestamp = currentTime; boolean sameTarget = (lastFishingBoundingBox != null && lastFishingBoundingBox.overlaps(boundingBox)); @@ -136,7 +137,6 @@ public class FishingManager extends SkillManager { * * @param rankChange The # of levels to change rank for the food * @param eventFoodLevel The initial change in hunger from the event - * * @return the modified change in hunger for the event */ public int handleFishermanDiet(int rankChange, int eventFoodLevel) { @@ -179,8 +179,7 @@ public class FishingManager extends SkillManager { hook.setBiteChance(Math.min(biteChance, 1.0)); } - public boolean isMagicHunterEnabled() - { + public boolean isMagicHunterEnabled() { return RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.FISHING_MAGIC_HUNTER) && RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.FISHING_TREASURE_HUNTER) && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.FISHING_TREASURE_HUNTER); @@ -217,8 +216,7 @@ public class FishingManager extends SkillManager { if (!event.isCancelled()) { treasureDrop = event.getTreasure(); treasureXp = event.getXp(); - } - else { + } else { treasureDrop = null; treasureXp = 0; } @@ -251,7 +249,6 @@ public class FishingManager extends SkillManager { * Handle the vanilla XP boost for Fishing * * @param experience The amount of experience initially awarded by the event - * * @return the modified event damage */ public int handleVanillaXpBoost(int experience) { @@ -308,8 +305,7 @@ public class FishingManager extends SkillManager { if (TreasureConfig.getInstance().getInventoryStealStacks()) { inventory.setItem(slot, null); - } - else { + } else { inventory.setItem(slot, (drop.getAmount() > 1) ? new ItemStack(drop.getType(), drop.getAmount() - 1) : null); drop.setAmount(1); } @@ -362,8 +358,7 @@ public class FishingManager extends SkillManager { if (getPlayer().getInventory().getItemInMainHand().getType() == Material.FISHING_ROD) { luck = getPlayer().getInventory().getItemInMainHand().getEnchantmentLevel(Enchantment.LUCK); - } - else { + } else { // We know something was caught, so if the rod wasn't in the main hand it must be in the offhand luck = getPlayer().getInventory().getItemInOffHand().getEnchantmentLevel(Enchantment.LUCK); } @@ -419,7 +414,6 @@ public class FishingManager extends SkillManager { * Process the Magic Hunter ability * * @param treasureDrop The {@link ItemStack} to enchant - * * @return true if the item has been enchanted */ private Map handleMagicHunter(ItemStack treasureDrop) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/Herbalism.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/Herbalism.java index f055a07f1..3f1f62352 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/Herbalism.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/Herbalism.java @@ -14,8 +14,7 @@ public class Herbalism { /** * Convert blocks affected by the Green Thumb & Green Terra abilities. * - * @param blockState - * The {@link BlockState} to check ability activation for + * @param blockState The {@link BlockState} to check ability activation for * @return true if the ability was successful, false otherwise */ protected static boolean convertGreenTerraBlocks(BlockState blockState) { @@ -28,16 +27,16 @@ public class Herbalism { blockState.setType(Material.MOSSY_STONE_BRICKS); return true; - case Material.DIRT : - case Material.GRASS_PATH : + case Material.DIRT: + case Material.GRASS_PATH: blockState.setType(Material.GRASS_BLOCK); return true; - case Material.COBBLESTONE : + case Material.COBBLESTONE: blockState.setType(Material.MOSSY_COBBLESTONE); return true; - default : + default: return false; } } @@ -64,7 +63,7 @@ public class Herbalism { else dropAmount++; - for (BlockFace blockFace : new BlockFace[] { BlockFace.UP, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST ,BlockFace.WEST}) + for (BlockFace blockFace : new BlockFace[]{BlockFace.UP, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST, BlockFace.WEST}) dropAmount += calculateChorusPlantDropsRecursive(target.getRelative(blockFace, 1), traversed); return dropAmount; @@ -74,8 +73,7 @@ public class Herbalism { * 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 + * @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 */ protected static int calculateMultiBlockPlantDrops(BlockState blockState) { @@ -112,19 +110,18 @@ public class Herbalism { /** * Convert blocks affected by the Green Thumb & Green Terra abilities. * - * @param blockState - * The {@link BlockState} to check ability activation for + * @param blockState The {@link BlockState} to check ability activation for * @return true if the ability was successful, false otherwise */ protected static boolean convertShroomThumb(BlockState blockState) { switch (blockState.getType()) { - case Material.DIRT : + case Material.DIRT: case Material.GRASS_BLOCK: - case Material.GRASS_PATH : + case Material.GRASS_PATH: blockState.setType(Material.MYCELIUM); return true; - default : + default: return false; } } @@ -132,8 +129,7 @@ public class Herbalism { /** * Check if the block has a recently grown crop from Green Thumb * - * @param blockState - * The {@link BlockState} to check green thumb regrown for + * @param blockState The {@link BlockState} to check green thumb regrown for * @return true if the block is recently regrown, false otherwise */ public static boolean isRecentlyRegrown(BlockState blockState) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java index fd84ca1cd..e4e25e018 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/herbalism/HerbalismManager.java @@ -1,18 +1,14 @@ package com.gmail.nossr50.core.skills.primary.herbalism; -import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.config.treasure.TreasureConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.mods.CustomBlock; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.skills.ToolType; +import com.gmail.nossr50.core.skills.*; import com.gmail.nossr50.core.skills.treasure.HylianTreasure; -import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.skills.HerbalismBlockUpdaterTask; import com.gmail.nossr50.util.*; @@ -44,7 +40,7 @@ public class HerbalismManager extends SkillManager { } public boolean canGreenThumbBlock(BlockState blockState) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.HERBALISM_GREEN_THUMB)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.HERBALISM_GREEN_THUMB)) return false; Player player = getPlayer(); @@ -54,7 +50,7 @@ public class HerbalismManager extends SkillManager { } public boolean canUseShroomThumb(BlockState blockState) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.HERBALISM_SHROOM_THUMB)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.HERBALISM_SHROOM_THUMB)) return false; Player player = getPlayer(); @@ -65,7 +61,7 @@ public class HerbalismManager extends SkillManager { } public boolean canUseHylianLuck() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.HERBALISM_HYLIAN_LUCK)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.HERBALISM_HYLIAN_LUCK)) return false; return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.HERBALISM_HYLIAN_LUCK); @@ -149,8 +145,7 @@ public class HerbalismManager extends SkillManager { if (Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_DOUBLE_DROPS) && customBlock.isDoubleDropEnabled()) { drops = blockState.getBlock().getDrops(); } - } - else { + } else { xp = ExperienceConfig.getInstance().getXp(skill, blockState.getBlockData()); if (Config.getInstance().getDoubleDropsEnabled(skill, material) && Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_DOUBLE_DROPS)) { @@ -161,7 +156,7 @@ public class HerbalismManager extends SkillManager { amount = Herbalism.calculateMultiBlockPlantDrops(blockState); xp *= amount; } - + if (Permissions.greenThumbPlant(player, material)) { processGreenThumbPlants(blockState, greenTerra); } @@ -245,7 +240,7 @@ public class HerbalismManager extends SkillManager { public boolean processShroomThumb(BlockState blockState) { Player player = getPlayer(); PlayerInventory playerInventory = player.getInventory(); - + if (!playerInventory.contains(Material.BROWN_MUSHROOM, 1)) { NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Skills.NeedMore", StringUtils.getPrettyItemString(Material.BROWN_MUSHROOM)); return false; @@ -344,8 +339,7 @@ public class HerbalismManager extends SkillManager { if (greenTerra) { crops.setAge(3); - } - else { + } else { crops.setAge(greenThumbStage); } break; @@ -355,21 +349,18 @@ public class HerbalismManager extends SkillManager { if (greenTerra || greenThumbStage > 2) { crops.setAge(2); - } - else if (greenThumbStage == 2) { + } else if (greenThumbStage == 2) { crops.setAge(1); - } - else { + } else { crops.setAge(0); } - break; + break; case Material.COCOA: if (greenTerra || getGreenThumbStage() > 1) { crops.setAge(1); - } - else { + } else { crops.setAge(0); } break; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java index e1be7e7a6..5cd81b7ce 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/BlastMining.java @@ -2,9 +2,9 @@ package com.gmail.nossr50.core.skills.primary.mining; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.skills.RankUtils; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -41,22 +41,19 @@ public class BlastMining { }*/ - public static Material detonator = Config.getInstance().getDetonatorItem(); - public final static int MAXIMUM_REMOTE_DETONATION_DISTANCE = 100; + public static Material detonator = Config.getInstance().getDetonatorItem(); public static double getBlastRadiusModifier(int rank) { return AdvancedConfig.getInstance().getBlastRadiusModifier(rank); } - public static double getBlastDamageDecrease(int rank) { return AdvancedConfig.getInstance().getBlastDamageDecrease(rank); } - public static int getDemolitionExpertUnlockLevel() { /*List tierList = Arrays.asList(Tier.values()); for (Tier tier : tierList) { @@ -67,10 +64,9 @@ public class BlastMining { return tier == Tier.EIGHT ? tier.getLevel() : tierList.get(tierList.indexOf(tier) - 1).getLevel(); }*/ - for(int i = 0; i < SubSkillType.MINING_BLAST_MINING.getNumRanks()-1; i++) - { - if(getBlastDamageDecrease(i+1) > 0) - return RankUtils.getRankUnlockLevel(SubSkillType.MINING_BLAST_MINING, i+1); + for (int i = 0; i < SubSkillType.MINING_BLAST_MINING.getNumRanks() - 1; i++) { + if (getBlastDamageDecrease(i + 1) > 0) + return RankUtils.getRankUnlockLevel(SubSkillType.MINING_BLAST_MINING, i + 1); } return 0; @@ -86,10 +82,9 @@ public class BlastMining { return tier == Tier.EIGHT ? tier.getLevel() : tierList.get(tierList.indexOf(tier) - 1).getLevel(); }*/ - for(int i = 0; i < SubSkillType.MINING_BLAST_MINING.getNumRanks()-1; i++) - { - if(getBlastRadiusModifier(i+1) > 0) - return RankUtils.getRankUnlockLevel(SubSkillType.MINING_BLAST_MINING, i+1); + for (int i = 0; i < SubSkillType.MINING_BLAST_MINING.getNumRanks() - 1; i++) { + if (getBlastRadiusModifier(i + 1) > 0) + return RankUtils.getRankUnlockLevel(SubSkillType.MINING_BLAST_MINING, i + 1); } return 0; @@ -107,7 +102,7 @@ public class BlastMining { return false; } - MiningManager miningManager = UserManager.getPlayer(defender).getMiningManager(); + MiningManager miningManager = UserManager.getPlayer(defender).getMiningManager(); if (!miningManager.canUseDemolitionsExpertise()) { return false; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java index 97dbe946e..130efcca3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/mining/MiningManager.java @@ -6,11 +6,11 @@ import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.skills.AbilityCooldownTask; -import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.util.BlockUtils; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Misc; @@ -36,8 +36,20 @@ public class MiningManager extends SkillManager { super(mcMMOPlayer, PrimarySkillType.MINING); } + public static double getOreBonus(int rank) { + return AdvancedConfig.getInstance().getOreBonus(rank); + } + + public static double getDebrisReduction(int rank) { + return AdvancedConfig.getInstance().getDebrisReduction(rank); + } + + public static int getDropMultiplier(int rank) { + return AdvancedConfig.getInstance().getDropMultiplier(rank); + } + public boolean canUseDemolitionsExpertise() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.MINING_DEMOLITIONS_EXPERTISE)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.MINING_DEMOLITIONS_EXPERTISE)) return false; return getSkillLevel() >= BlastMining.getDemolitionExpertUnlockLevel() && Permissions.demolitionsExpertise(getPlayer()); @@ -55,7 +67,7 @@ public class MiningManager extends SkillManager { } public boolean canUseBiggerBombs() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.MINING_BIGGER_BOMBS)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.MINING_BIGGER_BOMBS)) return false; return getSkillLevel() >= BlastMining.getBiggerBombsUnlockLevel() && Permissions.biggerBombs(getPlayer()); @@ -92,8 +104,7 @@ public class MiningManager extends SkillManager { if (RandomChanceUtil.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.MINING_DOUBLE_DROPS, player)) { if (silkTouch) { Mining.handleSilkTouchDrops(blockState); - } - else { + } else { Mining.handleMiningDrops(blockState); } } @@ -130,7 +141,7 @@ public class MiningManager extends SkillManager { /** * Handler for explosion drops and XP gain. * - * @param yield The % of blocks to drop + * @param yield The % of blocks to drop * @param blockList The list of blocks to drop */ public void blastMiningDropProcessing(float yield, List blockList) { @@ -149,8 +160,7 @@ public class MiningManager extends SkillManager { if (BlockUtils.isOre(blockState)) { ores.add(blockState); - } - else { + } else { debris.add(blockState); } } @@ -214,14 +224,6 @@ public class MiningManager extends SkillManager { return getOreBonus(getBlastMiningTier()); } - public static double getOreBonus(int rank) { - return AdvancedConfig.getInstance().getOreBonus(rank); - } - - public static double getDebrisReduction(int rank) { - return AdvancedConfig.getInstance().getDebrisReduction(rank); - } - /** * Gets the Blast Mining tier * @@ -231,10 +233,6 @@ public class MiningManager extends SkillManager { return getDebrisReduction(getBlastMiningTier()); } - public static int getDropMultiplier(int rank) { - return AdvancedConfig.getInstance().getDropMultiplier(rank); - } - /** * Gets the Blast Mining tier * diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/ArcaneForging.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/ArcaneForging.java index 1a15e6050..6acc378ea 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/ArcaneForging.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/ArcaneForging.java @@ -4,6 +4,6 @@ import com.gmail.nossr50.core.config.skills.AdvancedConfig; public class ArcaneForging { - public static boolean arcaneForgingDowngrades = AdvancedConfig.getInstance().getArcaneForgingDowngradeEnabled(); + public static boolean arcaneForgingDowngrades = AdvancedConfig.getInstance().getArcaneForgingDowngradeEnabled(); public static boolean arcaneForgingEnchantLoss = AdvancedConfig.getInstance().getArcaneForgingEnchantLossEnabled(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java index 145c96a5c..439e2886b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/Repair.java @@ -5,8 +5,8 @@ import com.gmail.nossr50.core.config.skills.Config; import org.bukkit.Material; public class Repair { - public static int repairMasteryMaxBonusLevel = AdvancedConfig.getInstance().getRepairMasteryMaxLevel(); - public static double repairMasteryMaxBonus = AdvancedConfig.getInstance().getRepairMasteryMaxBonus(); + public static int repairMasteryMaxBonusLevel = AdvancedConfig.getInstance().getRepairMasteryMaxLevel(); + public static double repairMasteryMaxBonus = AdvancedConfig.getInstance().getRepairMasteryMaxBonus(); - public static Material anvilMaterial = Config.getInstance().getRepairAnvilMaterial(); + public static Material anvilMaterial = Config.getInstance().getRepairAnvilMaterial(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java index fc186ffba..d8c148224 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/RepairManager.java @@ -1,17 +1,17 @@ package com.gmail.nossr50.core.skills.primary.repair; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SkillManager; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; @@ -35,7 +35,7 @@ import java.util.Map.Entry; public class RepairManager extends SkillManager { private boolean placedAnvil; - private int lastClick; + private int lastClick; public RepairManager(McMMOPlayer mcMMOPlayer) { super(mcMMOPlayer, PrimarySkillType.REPAIR); @@ -255,7 +255,7 @@ public class RepairManager extends SkillManager { /** * Computes repair bonuses. * - * @param durability The durability of the item being repaired + * @param durability The durability of the item being repaired * @param repairAmount The base amount of durability repaired to the item * @return The final amount of durability repaired to the item */ @@ -284,7 +284,7 @@ public class RepairManager extends SkillManager { * @return true if bonus granted, false otherwise */ private boolean checkPlayerProcRepair() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.REPAIR_SUPER_REPAIR)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.REPAIR_SUPER_REPAIR)) return false; if (RandomChanceUtil.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.REPAIR_SUPER_REPAIR, getPlayer())) { @@ -336,8 +336,7 @@ public class RepairManager extends SkillManager { item.addUnsafeEnchantment(enchantment, enchantLevel - 1); downgraded = true; } - } - else { + } else { item.removeEnchantment(enchantment); } } @@ -346,11 +345,9 @@ public class RepairManager extends SkillManager { if (newEnchants.isEmpty()) { NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE_FAILED, "Repair.Arcane.Fail"); - } - else if (downgraded || newEnchants.size() < enchants.size()) { + } else if (downgraded || newEnchants.size() < enchants.size()) { NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE_FAILED, "Repair.Arcane.Downgrade"); - } - else { + } else { NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Repair.Arcane.Perfect"); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/Repairable.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/Repairable.java index d954b161e..ca51d18b8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/Repairable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/Repairable.java @@ -50,7 +50,7 @@ public interface Repairable { /** * Gets the minimum quantity of repair materials ignoring all other repair bonuses - * + *

* This is typically set to the number of items needed to create that item, for example 5 for helmets or 2 for swords * * @return the minimum number of items @@ -66,7 +66,7 @@ public interface Repairable { /** * Gets the base repair durability on which to calculate bonuses. - * + *

* This is actually the maximum durability divided by the minimum quantity * * @return the base repair durability diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableManager.java index eb6e17d53..00a225ff7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/RepairableManager.java @@ -24,7 +24,6 @@ public interface RepairableManager { * Checks if an item is repairable * * @param type Material to check if repairable - * * @return true if repairable, false if not */ public boolean isRepairable(Material type); @@ -33,7 +32,6 @@ public interface RepairableManager { * Checks if an item is repairable * * @param itemStack Item to check if repairable - * * @return true if repairable, false if not */ public boolean isRepairable(ItemStack itemStack); @@ -42,7 +40,6 @@ public interface RepairableManager { * Gets the repairable with this type * * @param type Material of the repairable to look for - * * @return the repairable, can be null */ public Repairable getRepairable(Material type); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairable.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairable.java index c79eac8ec..bfe9efeac 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairable.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/repair/repairables/SimpleRepairable.java @@ -10,10 +10,10 @@ public class SimpleRepairable implements Repairable { private final int minimumQuantity, minimumLevel; private final short maximumDurability, baseRepairDurability; private final byte repairMetadata; - private String repairMaterialPrettyName; private final ItemType repairItemType; private final MaterialType repairMaterialType; private final double xpMultiplier; + private String repairMaterialPrettyName; protected SimpleRepairable(Material type, Material repairMaterial, byte repairMetadata, String repairMaterialPrettyName, int minimumLevel, int minimumQuantity, short maximumDurability, ItemType repairItemType, MaterialType repairMaterialType, double xpMultiplier) { this.itemMaterial = type; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/Swords.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/Swords.java index cb10d1377..11e3f9c7d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/Swords.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/Swords.java @@ -3,11 +3,11 @@ package com.gmail.nossr50.core.skills.primary.swords; import com.gmail.nossr50.core.config.skills.AdvancedConfig; public class Swords { - public static int bleedMaxTicks = AdvancedConfig.getInstance().getRuptureMaxTicks(); - public static int bleedBaseTicks = AdvancedConfig.getInstance().getRuptureBaseTicks(); + public static int bleedMaxTicks = AdvancedConfig.getInstance().getRuptureMaxTicks(); + public static int bleedBaseTicks = AdvancedConfig.getInstance().getRuptureBaseTicks(); - public static double counterAttackModifier = AdvancedConfig.getInstance().getCounterModifier(); + public static double counterAttackModifier = AdvancedConfig.getInstance().getCounterModifier(); - public static double serratedStrikesModifier = AdvancedConfig.getInstance().getSerratedStrikesModifier(); - public static int serratedStrikesBleedTicks = AdvancedConfig.getInstance().getSerratedStrikesTicks(); + public static double serratedStrikesModifier = AdvancedConfig.getInstance().getSerratedStrikesModifier(); + public static int serratedStrikesBleedTicks = AdvancedConfig.getInstance().getSerratedStrikesTicks(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/SwordsManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/SwordsManager.java index 2d6b8ae3e..6953dd462 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/SwordsManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/swords/SwordsManager.java @@ -1,16 +1,12 @@ package com.gmail.nossr50.core.skills.primary.swords; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.skills.ToolType; +import com.gmail.nossr50.core.skills.*; import com.gmail.nossr50.runnables.skills.BleedTimerTask; -import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.skills.CombatUtils; import com.gmail.nossr50.util.skills.RankUtils; @@ -36,14 +32,14 @@ public class SwordsManager extends SkillManager { } public boolean canUseCounterAttack(Entity target) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.SWORDS_COUNTER_ATTACK)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.SWORDS_COUNTER_ATTACK)) return false; return target instanceof LivingEntity && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.SWORDS_COUNTER_ATTACK); } public boolean canUseSerratedStrike() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.SWORDS_SERRATED_STRIKES)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.SWORDS_SERRATED_STRIKES)) return false; return mcMMOPlayer.getAbilityMode(SuperAbilityType.SERRATED_STRIKES); @@ -61,7 +57,7 @@ public class SwordsManager extends SkillManager { Player defender = (Player) target; if (UserManager.getPlayer(defender).useChatNotifications()) { - if(!BleedTimerTask.isBleeding(defender)) + if (!BleedTimerTask.isBleeding(defender)) NotificationManager.sendPlayerInformation(defender, NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Bleeding.Started"); } } @@ -74,11 +70,10 @@ public class SwordsManager extends SkillManager { } } - public int getRuptureBleedTicks() - { + public int getRuptureBleedTicks() { int bleedTicks = 2 * RankUtils.getRank(getPlayer(), SubSkillType.SWORDS_RUPTURE); - if(bleedTicks > Swords.bleedMaxTicks) + if (bleedTicks > Swords.bleedMaxTicks) bleedTicks = Swords.bleedMaxTicks; return bleedTicks; @@ -88,7 +83,7 @@ public class SwordsManager extends SkillManager { * Handle the effects of the Counter Attack ability * * @param attacker The {@link LivingEntity} being affected by the ability - * @param damage The amount of damage initially dealt by the event + * @param damage The amount of damage initially dealt by the event */ public void counterAttackChecks(LivingEntity attacker, double damage) { if (RandomChanceUtil.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.SWORDS_COUNTER_ATTACK, getPlayer())) { @@ -97,7 +92,7 @@ public class SwordsManager extends SkillManager { NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Countered"); if (attacker instanceof Player) { - NotificationManager.sendPlayerInformation((Player)attacker, NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Counter.Hit"); + NotificationManager.sendPlayerInformation((Player) attacker, NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Counter.Hit"); } } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/Taming.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/Taming.java index 45a246752..7426d883f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/Taming.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/Taming.java @@ -2,19 +2,18 @@ package com.gmail.nossr50.core.skills.primary.taming; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import org.bukkit.EntityEffect; -import org.bukkit.entity.*; public class Taming { public static double fastFoodServiceActivationChance = AdvancedConfig.getInstance().getFastFoodChance(); - public static int goreBleedTicks = 2; //Equivalent to rank 1 in Rupture - public static double goreModifier = AdvancedConfig.getInstance().getGoreModifier(); + public static int goreBleedTicks = 2; //Equivalent to rank 1 in Rupture + public static double goreModifier = AdvancedConfig.getInstance().getGoreModifier(); public static double sharpenedClawsBonusDamage = AdvancedConfig.getInstance().getSharpenedClawsBonus(); - public static double shockProofModifier = AdvancedConfig.getInstance().getShockProofModifier(); + public static double shockProofModifier = AdvancedConfig.getInstance().getShockProofModifier(); - public static double thickFurModifier = AdvancedConfig.getInstance().getThickFurModifier(); + public static double thickFurModifier = AdvancedConfig.getInstance().getThickFurModifier(); public static boolean canPreventDamage(Tameable pet, AnimalTamer owner) { return pet.isTamed() && owner instanceof Player && pet instanceof Wolf; diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java index 74c224b0d..75c72bfc5 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/taming/TamingManager.java @@ -1,23 +1,23 @@ package com.gmail.nossr50.core.skills.primary.taming; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.events.fake.FakeEntityTameEvent; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.runnables.skills.BleedTimerTask; -import com.gmail.nossr50.core.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.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceSkillStatic; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.skills.ParticleEffectUtils; @@ -25,7 +25,6 @@ import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.SkillActivationType; import org.bukkit.Location; import org.bukkit.Sound; -import org.bukkit.entity.*; import org.bukkit.inventory.ItemStack; import java.util.ArrayList; @@ -33,11 +32,29 @@ import java.util.HashMap; import java.util.List; public class TamingManager extends SkillManager { + private static HashMap> summonedEntities = new HashMap>(); + public TamingManager(McMMOPlayer mcMMOPlayer) { super(mcMMOPlayer, PrimarySkillType.TAMING); } - private static HashMap> summonedEntities = new HashMap>(); + protected static void addToTracker(LivingEntity livingEntity) { + TrackedTamingEntity trackedEntity = new TrackedTamingEntity(livingEntity); + + if (!summonedEntities.containsKey(livingEntity.getType())) { + summonedEntities.put(livingEntity.getType(), new ArrayList()); + } + + summonedEntities.get(livingEntity.getType()).add(trackedEntity); + } + + protected static List getTrackedEntities(EntityType entityType) { + return summonedEntities.get(entityType); + } + + protected static void removeFromTracker(TrackedTamingEntity trackedEntity) { + summonedEntities.get(trackedEntity.getLivingEntity().getType()).remove(trackedEntity); + } public boolean canUseThickFur() { return RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_THICK_FUR) @@ -70,14 +87,14 @@ public class TamingManager extends SkillManager { } public boolean canUseGore() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_GORE)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_GORE)) return false; return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_GORE); } public boolean canUseBeastLore() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_BEAST_LORE)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_BEAST_LORE)) return false; return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.TAMING_BEAST_LORE); @@ -95,7 +112,7 @@ public class TamingManager extends SkillManager { /** * 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) { @@ -127,7 +144,7 @@ public class TamingManager extends SkillManager { BleedTimerTask.add(target, getPlayer(), Taming.goreBleedTicks, 1); if (target instanceof Player) { - NotificationManager.sendPlayerInformation((Player)target, NotificationType.SUBSKILL_MESSAGE, "Combat.StruckByGore"); + NotificationManager.sendPlayerInformation((Player) target, NotificationType.SUBSKILL_MESSAGE, "Combat.StruckByGore"); } NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Combat.Gore"); @@ -144,7 +161,7 @@ public class TamingManager extends SkillManager { * Summon an ocelot to your side. */ public void summonOcelot() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD)) return; if (!Permissions.callOfTheWild(getPlayer(), EntityType.OCELOT)) { @@ -158,7 +175,7 @@ public class TamingManager extends SkillManager { * Summon a wolf to your side. */ public void summonWolf() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD)) return; if (!Permissions.callOfTheWild(getPlayer(), EntityType.WOLF)) { @@ -172,7 +189,7 @@ public class TamingManager extends SkillManager { * Summon a horse to your side. */ public void summonHorse() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_CALL_OF_THE_WILD)) return; if (!Permissions.callOfTheWild(getPlayer(), EntityType.HORSE)) { @@ -213,10 +230,10 @@ public class TamingManager extends SkillManager { } public void pummel(LivingEntity target, Wolf wolf) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_PUMMEL)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.TAMING_PUMMEL)) return; - if(!RandomChanceUtil.checkRandomChanceExecutionSuccess(new RandomChanceSkillStatic(AdvancedConfig.getInstance().getPummelChance(), getPlayer(), SubSkillType.TAMING_PUMMEL))) + if (!RandomChanceUtil.checkRandomChanceExecutionSuccess(new RandomChanceSkillStatic(AdvancedConfig.getInstance().getPummelChance(), getPlayer(), SubSkillType.TAMING_PUMMEL))) return; ParticleEffectUtils.playGreaterImpactEffect(target); @@ -253,7 +270,7 @@ public class TamingManager extends SkillManager { /** * Handle the Call of the Wild ability. * - * @param type The type of entity to summon. + * @param type The type of entity to summon. * @param summonAmount The amount of material needed to summon the entity */ private void callOfTheWild(EntityType type, int summonAmount) { @@ -379,22 +396,4 @@ public class TamingManager extends SkillManager { return true; } - - protected static void addToTracker(LivingEntity livingEntity) { - TrackedTamingEntity trackedEntity = new TrackedTamingEntity(livingEntity); - - if (!summonedEntities.containsKey(livingEntity.getType())) { - summonedEntities.put(livingEntity.getType(), new ArrayList()); - } - - summonedEntities.get(livingEntity.getType()).add(trackedEntity); - } - - protected static List getTrackedEntities(EntityType entityType) { - return summonedEntities.get(entityType); - } - - protected static void removeFromTracker(TrackedTamingEntity trackedEntity) { - summonedEntities.get(trackedEntity.getLivingEntity().getType()).remove(trackedEntity); - } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java index 448b4f8f8..397b07c82 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/Unarmed.java @@ -21,27 +21,22 @@ public class Unarmed { int amount = itemDrop.getAmount(); boolean grabbedItem = false; - for(int i = 0; i <= storageContents.length-1; i++) - { - if(amount <= 0) + for (int i = 0; i <= storageContents.length - 1; i++) { + if (amount <= 0) break; - if(i == heldItemSlotID) + if (i == heldItemSlotID) continue; //EMPTY SLOT! - if(storageContents[i] == null) - { + if (storageContents[i] == null) { player.getInventory().setItem(i, itemDrop); amount = 0; grabbedItem = true; break; - } - else if(itemDrop.isSimilar(storageContents[i]) && storageContents[i].getAmount() < storageContents[i].getMaxStackSize()) - { + } else if (itemDrop.isSimilar(storageContents[i]) && storageContents[i].getAmount() < storageContents[i].getMaxStackSize()) { //If we can fit this whole itemstack into this item - if(amount + storageContents[i].getAmount() <= storageContents[i].getMaxStackSize()) - { + if (amount + storageContents[i].getAmount() <= storageContents[i].getMaxStackSize()) { ItemStack modifiedAmount = storageContents[i]; modifiedAmount.setAmount(amount + storageContents[i].getAmount()); @@ -63,15 +58,14 @@ public class Unarmed { } } - if(amount <= 0) + if (amount <= 0) event.getItem().remove(); //Cleanup Item else event.getItem().getItemStack().setAmount(amount); event.setCancelled(true); - if(grabbedItem) - { + if (grabbedItem) { SoundManager.sendSound(player, player.getLocation(), SoundType.POP); player.updateInventory(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/UnarmedManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/UnarmedManager.java index b927c49b1..d7ab72994 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/UnarmedManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/unarmed/UnarmedManager.java @@ -1,20 +1,16 @@ package com.gmail.nossr50.core.skills.primary.unarmed; import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.skills.ToolType; -import com.gmail.nossr50.core.skills.SkillManager; +import com.gmail.nossr50.core.skills.*; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.SkillActivationType; @@ -36,7 +32,7 @@ public class UnarmedManager extends SkillManager { } public boolean canUseIronArm() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.UNARMED_IRON_ARM_STYLE)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.UNARMED_IRON_ARM_STYLE)) return false; return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.UNARMED_IRON_ARM_STYLE); @@ -47,14 +43,14 @@ public class UnarmedManager extends SkillManager { } public boolean canDisarm(LivingEntity target) { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.UNARMED_DISARM)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.UNARMED_DISARM)) return false; return target instanceof Player && ((Player) target).getInventory().getItemInMainHand().getType() != Material.AIR && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.UNARMED_DISARM); } public boolean canDeflect() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.UNARMED_ARROW_DEFLECT)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.UNARMED_ARROW_DEFLECT)) return false; Player player = getPlayer(); @@ -63,7 +59,7 @@ public class UnarmedManager extends SkillManager { } public boolean canUseBlockCracker() { - if(!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.UNARMED_BLOCK_CRACKER)) + if (!RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.UNARMED_BLOCK_CRACKER)) return false; return Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.UNARMED_BLOCK_CRACKER); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java index 92c7bcbb5..6cebed974 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/Woodcutting.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.skills.primary.woodcutting; -import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.BlockUtils; @@ -17,22 +17,27 @@ import java.util.List; import java.util.Set; public final class Woodcutting { + /** + * The x/y differences to the blocks in a flat cylinder around the center + * block, which is excluded. + */ + private static final int[][] directions = { + new int[]{-2, -1}, new int[]{-2, 0}, new int[]{-2, 1}, + new int[]{-1, -2}, new int[]{-1, -1}, new int[]{-1, 0}, new int[]{-1, 1}, new int[]{-1, 2}, + new int[]{0, -2}, new int[]{0, -1}, new int[]{0, 1}, new int[]{0, 2}, + new int[]{1, -2}, new int[]{1, -1}, new int[]{1, 0}, new int[]{1, 1}, new int[]{1, 2}, + new int[]{2, -1}, new int[]{2, 0}, new int[]{2, 1}, + }; public static int treeFellerThreshold = Config.getInstance().getTreeFellerThreshold(); - - protected static boolean treeFellerReachedThreshold = false; - protected enum ExperienceGainMethod { - DEFAULT, - TREE_FELLER, + private Woodcutting() { } - private Woodcutting() {} - /** * Retrieves the experience reward from a log * - * @param blockState Log being broken + * @param blockState Log being broken * @param experienceGainMethod How the log is being broken * @return Amount of experience */ @@ -52,30 +57,17 @@ public final class Woodcutting { protected static void checkForDoubleDrop(BlockState blockState) { if (mcMMO.getModManager().isCustomLog(blockState) && mcMMO.getModManager().getBlock(blockState).isDoubleDropEnabled()) { Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops()); - } - else { + } else { if (Config.getInstance().getWoodcuttingDoubleDropsEnabled(blockState.getBlockData())) { Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops()); } } } - /** - * The x/y differences to the blocks in a flat cylinder around the center - * block, which is excluded. - */ - private static final int[][] directions = { - new int[] {-2, -1}, new int[] {-2, 0}, new int[] {-2, 1}, - new int[] {-1, -2}, new int[] {-1, -1}, new int[] {-1, 0}, new int[] {-1, 1}, new int[] {-1, 2}, - new int[] { 0, -2}, new int[] { 0, -1}, new int[] { 0, 1}, new int[] { 0, 2}, - new int[] { 1, -2}, new int[] { 1, -1}, new int[] { 1, 0}, new int[] { 1, 1}, new int[] { 1, 2}, - new int[] { 2, -1}, new int[] { 2, 0}, new int[] { 2, 1}, - }; - /** * Processes Tree Feller in a recursive manner * - * @param blockState Block being checked + * @param blockState Block being checked * @param treeFellerBlocks List of blocks to be removed */ /* @@ -113,8 +105,7 @@ public final class Woodcutting { return; } } - } - else { + } else { // Cover DOWN handleBlock(blockState.getBlock().getRelative(BlockFace.DOWN).getState(), futureCenterBlocks, treeFellerBlocks); // Search in a cube @@ -143,7 +134,7 @@ public final class Woodcutting { * Handles the durability loss * * @param treeFellerBlocks List of blocks to be removed - * @param inHand tool being used + * @param inHand tool being used * @return True if the tool can sustain the durability loss */ protected static boolean handleDurabilityLoss(Set treeFellerBlocks, ItemStack inHand) { @@ -165,12 +156,12 @@ public final class Woodcutting { * list of blocks used for future recursive calls of * 'processTree()' * - * @param blockState Block to be added + * @param blockState Block to be added * @param futureCenterBlocks List of blocks that will be used to call - * 'processTree()' - * @param treeFellerBlocks List of blocks to be removed + * 'processTree()' + * @param treeFellerBlocks List of blocks to be removed * @return true if and only if the given blockState was a Log not already - * in treeFellerBlocks. + * in treeFellerBlocks. */ private static boolean handleBlock(BlockState blockState, List futureCenterBlocks, Set treeFellerBlocks) { if (treeFellerBlocks.contains(blockState) || mcMMO.getPlaceStore().isTrue(blockState)) { @@ -186,11 +177,15 @@ public final class Woodcutting { treeFellerBlocks.add(blockState); futureCenterBlocks.add(blockState); return true; - } - else if (BlockUtils.isLeaves(blockState)) { + } else if (BlockUtils.isLeaves(blockState)) { treeFellerBlocks.add(blockState); return false; } return false; } + + protected enum ExperienceGainMethod { + DEFAULT, + TREE_FELLER, + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/WoodcuttingManager.java b/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/WoodcuttingManager.java index 1dff844f8..fe6359e3d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/WoodcuttingManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/primary/woodcutting/WoodcuttingManager.java @@ -5,11 +5,11 @@ import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.mods.CustomBlock; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SkillManager; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.skills.SkillManager; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.skills.primary.woodcutting.Woodcutting.ExperienceGainMethod; +import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.*; import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.util.random.RandomChanceUtil; @@ -129,8 +129,7 @@ public class WoodcuttingManager extends SkillManager { if (material == Material.BROWN_MUSHROOM_BLOCK || material == Material.RED_MUSHROOM_BLOCK) { xp += Woodcutting.getExperienceFromLog(blockState, ExperienceGainMethod.TREE_FELLER); Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops()); - } - else if (mcMMO.getModManager().isCustomLog(blockState)) { + } else if (mcMMO.getModManager().isCustomLog(blockState)) { if (canGetDoubleDrops()) { Woodcutting.checkForDoubleDrop(blockState); } @@ -139,11 +138,9 @@ public class WoodcuttingManager extends SkillManager { xp = customBlock.getXpGain(); Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops()); - } - else if (mcMMO.getModManager().isCustomLeaf(blockState)) { + } else if (mcMMO.getModManager().isCustomLeaf(blockState)) { Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops()); - } - else { + } else { if (BlockUtils.isLog(blockState)) { if (canGetDoubleDrops()) { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/AbstractSubSkill.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/AbstractSubSkill.java index b18f1d42c..7b9d3ae1d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/AbstractSubSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/AbstractSubSkill.java @@ -1,11 +1,11 @@ package com.gmail.nossr50.core.skills.subskills; import com.gmail.nossr50.core.config.skills.CoreSkillsConfig; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.subskills.interfaces.Interaction; import com.gmail.nossr50.core.skills.subskills.interfaces.Rank; import com.gmail.nossr50.core.skills.subskills.interfaces.SubSkill; import com.gmail.nossr50.core.skills.subskills.interfaces.SubSkillProperties; -import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; import org.bukkit.entity.Player; @@ -17,8 +17,7 @@ public abstract class AbstractSubSkill implements SubSkill, Interaction, Rank, S protected String configKeyPrimary; protected SubSkillType subSkillType; - public AbstractSubSkill(String configKeySubSkill, String configKeyPrimary, SubSkillType subSkillType) - { + public AbstractSubSkill(String configKeySubSkill, String configKeyPrimary, SubSkillType subSkillType) { this.configKeySubSkill = configKeySubSkill; this.configKeyPrimary = configKeyPrimary; this.subSkillType = subSkillType; @@ -31,7 +30,7 @@ public abstract class AbstractSubSkill implements SubSkill, Interaction, Rank, S */ @Override public String getDescription() { - return LocaleLoader.getString(getPrimaryKeyName()+".SubSkill."+getConfigKeyName()+".Description"); + return LocaleLoader.getString(getPrimaryKeyName() + ".SubSkill." + getConfigKeyName() + ".Description"); } /** @@ -39,7 +38,8 @@ public abstract class AbstractSubSkill implements SubSkill, Interaction, Rank, S * * @return true if enabled */ - @Override @Deprecated + @Override + @Deprecated public boolean isEnabled() { //TODO: This might be troublesome... return CoreSkillsConfig.getInstance().isSkillEnabled(this); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/AcrobaticsSubSkill.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/AcrobaticsSubSkill.java index da7428845..569f24f41 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/AcrobaticsSubSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/AcrobaticsSubSkill.java @@ -28,7 +28,7 @@ public abstract class AcrobaticsSubSkill extends AbstractSubSkill { */ @Override public String getNiceName() { - return LocaleLoader.getString(getPrimaryKeyName()+".SubSkill."+getConfigKeyName()+".Name"); + return LocaleLoader.getString(getPrimaryKeyName() + ".SubSkill." + getConfigKeyName() + ".Name"); } /** @@ -48,7 +48,7 @@ public abstract class AcrobaticsSubSkill extends AbstractSubSkill { */ @Override public String getTips() { - return LocaleLoader.getString("JSON."+ StringUtils.getCapitalized(getPrimarySkill().toString())+".SubSkill."+getConfigKeyName()+".Details.Tips"); + return LocaleLoader.getString("JSON." + StringUtils.getCapitalized(getPrimarySkill().toString()) + ".SubSkill." + getConfigKeyName() + ".Details.Tips"); } /** diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java index 51a3fe315..9c58b4e72 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/acrobatics/Roll.java @@ -1,11 +1,12 @@ package com.gmail.nossr50.core.skills.subskills.acrobatics; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.datatypes.LimitedSizeList; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; -import com.gmail.nossr50.core.datatypes.LimitedSizeList; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import com.gmail.nossr50.core.skills.SubSkillType; @@ -14,7 +15,6 @@ import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.util.random.RandomChanceSkill; import com.gmail.nossr50.util.random.RandomChanceUtil; import com.gmail.nossr50.util.skills.PerksUtils; @@ -44,6 +44,10 @@ public class Roll extends AcrobaticsSubSkill { fallLocationMap = new HashMap<>(); } + protected static double calculateModifiedRollDamage(double damage, double damageThreshold) { + return Math.max(damage - damageThreshold, 0.0); + } + /** * Executes the interaction between this subskill and Minecraft * @@ -64,7 +68,7 @@ public class Roll extends AcrobaticsSubSkill { EntityDamageEvent entityDamageEvent = (EntityDamageEvent) event; //Make sure a real player was damaged in this event - if(!EventUtils.isRealPlayerDamaged(entityDamageEvent)) + if (!EventUtils.isRealPlayerDamaged(entityDamageEvent)) return false; switch (entityDamageEvent.getCause()) { @@ -101,7 +105,7 @@ public class Roll extends AcrobaticsSubSkill { */ @Override public String getPermissionNode() { - return ("mcmmo.ability."+getPrimaryKeyName()+"."+getConfigKeyName()).toLowerCase(); + return ("mcmmo.ability." + getPrimaryKeyName() + "." + getConfigKeyName()).toLowerCase(); } /** @@ -119,7 +123,7 @@ public class Roll extends AcrobaticsSubSkill { * Adds detailed stats specific to this skill * * @param componentBuilder target component builder - * @param player target player + * @param player target player */ @Override public void addStats(ComponentBuilder componentBuilder, Player player) { @@ -159,8 +163,7 @@ public class Roll extends AcrobaticsSubSkill { //Advanced //Lucky Notice - if(isLucky) - { + if (isLucky) { componentBuilder.append(LocaleLoader.getString("JSON.JWrapper.Perks.Header")); componentBuilder.append("\n"); componentBuilder.append(LocaleLoader.getString("JSON.JWrapper.Perks.Lucky", "33")); @@ -210,16 +213,15 @@ public class Roll extends AcrobaticsSubSkill { //player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.Text")); //if (!SkillUtils.cooldownExpired((long) mcMMOPlayer.getTeleportATS(), Config.getInstance().getXPAfterTeleportCooldown())) { - if(!isExploiting(player)) + if (!isExploiting(player)) SkillUtils.applyXpGain(mcMMOPlayer, getPrimarySkill(), calculateRollXP(player, damage, true), XPGainReason.PVE); //} addFallLocation(player); return modifiedDamage; - } - else if (!isFatal(player, damage)) { + } else if (!isFatal(player, damage)) { //if (!SkillUtils.cooldownExpired((long) mcMMOPlayer.getTeleportATS(), Config.getInstance().getXPAfterTeleportCooldown())) { - if(!isExploiting(player)) + if (!isExploiting(player)) SkillUtils.applyXpGain(mcMMOPlayer, getPrimarySkill(), calculateRollXP(player, damage, false), XPGainReason.PVE); //} } @@ -245,20 +247,18 @@ public class Roll extends AcrobaticsSubSkill { rcs.setSkillLevel(rcs.getSkillLevel() * 2); //Double the effective odds if (!isFatal(player, modifiedDamage) - && RandomChanceUtil.checkRandomChanceExecutionSuccess(rcs)) - { + && RandomChanceUtil.checkRandomChanceExecutionSuccess(rcs)) { NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Acrobatics.Ability.Proc"); - SoundManager.sendCategorizedSound(player, player.getLocation(), SoundType.ROLL_ACTIVATED, SoundCategory.PLAYERS,0.5F); - if(!isExploiting(player)) + SoundManager.sendCategorizedSound(player, player.getLocation(), SoundType.ROLL_ACTIVATED, SoundCategory.PLAYERS, 0.5F); + if (!isExploiting(player)) SkillUtils.applyXpGain(mcMMOPlayer, getPrimarySkill(), calculateRollXP(player, damage, true), XPGainReason.PVE); addFallLocation(player); return modifiedDamage; - } - else if (!isFatal(player, damage)) { - if(!isExploiting(player)) + } else if (!isFatal(player, damage)) { + if (!isExploiting(player)) SkillUtils.applyXpGain(mcMMOPlayer, getPrimarySkill(), calculateRollXP(player, damage, false), XPGainReason.PVE); - + addFallLocation(player); } @@ -280,12 +280,12 @@ public class Roll extends AcrobaticsSubSkill { return true; } - if(fallLocationMap.get(player) == null) + if (fallLocationMap.get(player) == null) fallLocationMap.put(player, new LimitedSizeList(50)); LimitedSizeList fallLocations = fallLocationMap.get(player); - - if(fallLocations.contains(getBlockLocation(player))) + + if (fallLocations.contains(getBlockLocation(player))) return true; return false; //NOT EXPLOITING @@ -312,10 +312,6 @@ public class Roll extends AcrobaticsSubSkill { return xp; } - protected static double calculateModifiedRollDamage(double damage, double damageThreshold) { - return Math.max(damage - damageThreshold, 0.0); - } - private boolean isFatal(Player player, double damage) { return player.getHealth() - damage <= 0; } @@ -344,7 +340,7 @@ public class Roll extends AcrobaticsSubSkill { //player.sendMessage(getDescription()); //Player stats player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Stats", - LocaleLoader.getString("Acrobatics.SubSkill.Roll.Stats", getStats(player)[0], getStats(player)[1]))); + LocaleLoader.getString("Acrobatics.SubSkill.Roll.Stats", getStats(player)[0], getStats(player)[1]))); //Mechanics player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Mechanics")); @@ -389,13 +385,13 @@ public class Roll extends AcrobaticsSubSkill { rollGraceHalfMaxSkill.setSkillLevel(1); //Level 1 skill //Chance Stat Calculations - rollChanceHalfMax = RandomChanceUtil.getRandomChanceExecutionChance(rollHalfMaxSkill); - graceChanceHalfMax = RandomChanceUtil.getRandomChanceExecutionChance(rollGraceHalfMaxSkill); - damageThreshold = AdvancedConfig.getInstance().getRollDamageThreshold(); + rollChanceHalfMax = RandomChanceUtil.getRandomChanceExecutionChance(rollHalfMaxSkill); + graceChanceHalfMax = RandomChanceUtil.getRandomChanceExecutionChance(rollGraceHalfMaxSkill); + damageThreshold = AdvancedConfig.getInstance().getRollDamageThreshold(); - chancePerLevel = RandomChanceUtil.getRandomChanceExecutionChance(rollOneSkillLevel); + chancePerLevel = RandomChanceUtil.getRandomChanceExecutionChance(rollOneSkillLevel); - double maxLevel = AdvancedConfig.getInstance().getMaxBonusLevel(SubSkillType.ACROBATICS_ROLL); + double maxLevel = AdvancedConfig.getInstance().getMaxBonusLevel(SubSkillType.ACROBATICS_ROLL); return LocaleLoader.getString("Acrobatics.SubSkill.Roll.Mechanics", rollChanceHalfMax, graceChanceHalfMax, maxLevel, chancePerLevel, damageThreshold, damageThreshold * 2); } @@ -407,26 +403,24 @@ public class Roll extends AcrobaticsSubSkill { * @return stat array for target player for this skill */ @Override - public Double[] getStats(Player player) - { + public Double[] getStats(Player player) { double playerChanceRoll, playerChanceGrace; - RandomChanceSkill roll = new RandomChanceSkill(player, getSubSkillType()); - RandomChanceSkill graceful = new RandomChanceSkill(player, getSubSkillType()); + RandomChanceSkill roll = new RandomChanceSkill(player, getSubSkillType()); + RandomChanceSkill graceful = new RandomChanceSkill(player, getSubSkillType()); graceful.setSkillLevel(graceful.getSkillLevel() * 2); //Double odds //Calculate - playerChanceRoll = RandomChanceUtil.getRandomChanceExecutionChance(roll); - playerChanceGrace = RandomChanceUtil.getRandomChanceExecutionChance(graceful); + playerChanceRoll = RandomChanceUtil.getRandomChanceExecutionChance(roll); + playerChanceGrace = RandomChanceUtil.getRandomChanceExecutionChance(graceful); - Double[] stats = { playerChanceRoll, playerChanceGrace }; //DEBUG + Double[] stats = {playerChanceRoll, playerChanceGrace}; //DEBUG return stats; } - public void addFallLocation(Player player) - { - if(fallLocationMap.get(player) == null) + public void addFallLocation(Player player) { + if (fallLocationMap.get(player) == null) fallLocationMap.put(player, new LimitedSizeList(50)); LimitedSizeList fallLocations = fallLocationMap.get(player); @@ -435,8 +429,7 @@ public class Roll extends AcrobaticsSubSkill { fallLocations.add(loc); } - public Location getBlockLocation(Player player) - { + public Location getBlockLocation(Player player) { return player.getLocation().getBlock().getLocation(); } } \ No newline at end of file diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Interaction.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Interaction.java index 397526230..94723591c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Interaction.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Interaction.java @@ -7,13 +7,15 @@ import org.bukkit.event.EventPriority; public interface Interaction { /** * The type of interaction this subskill has with Minecraft + * * @return the interaction type */ InteractType getInteractType(); /** * Executes the interaction between this subskill and Minecraft - * @param event the vector of interaction + * + * @param event the vector of interaction * @param plugin the mcMMO plugin instance * @return true if interaction wasn't cancelled */ @@ -21,6 +23,7 @@ public interface Interaction { /** * The priority for this interaction + * * @return the priority for interaction */ EventPriority getEventPriority(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Rank.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Rank.java index 2ccf2c80e..309c359a0 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Rank.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/Rank.java @@ -3,12 +3,14 @@ package com.gmail.nossr50.core.skills.subskills.interfaces; public interface Rank { /** * Gets the number of ranks for this subskill, 0 for no ranks + * * @return the number of ranks for this subskill, 0 for no ranks */ int getNumRanks(); /** * Not all skills have ranks + * * @return true if the skill has ranks */ boolean hasRanks(); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/SubSkill.java b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/SubSkill.java index 45ce88af6..712012194 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/SubSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/subskills/interfaces/SubSkill.java @@ -7,18 +7,21 @@ import org.bukkit.entity.Player; public interface SubSkill extends Skill { /** * Grabs the permission node for this skill + * * @return permission node address */ String getPermissionNode(); /** * Returns a collection of strings about how a skill works + * * @return */ String getMechanics(); /** * Get an array of various stats for a player + * * @param player target player * @return stat array for target player for this skill */ @@ -26,6 +29,7 @@ public interface SubSkill extends Skill { /** * Checks if a player has permission to use this skill + * * @param player target player * @return true if player has permission */ @@ -34,43 +38,50 @@ public interface SubSkill extends Skill { /** * The name of this subskill * It's a good idea for this to return the localized name + * * @return the subskill name */ String getNiceName(); /** * This is the name that represents our subskill in the config + * * @return the config key name */ String getConfigKeyName(); /** * Returns the simple description of this subskill + * * @return the simple description of this subskill */ String getDescription(); /** * Grabs tips for the subskill + * * @return tips for the subskill */ String getTips(); /** * Adds detailed stats specific to this skill + * * @param componentBuilder target component builder - * @param player owner of this skill + * @param player owner of this skill */ void addStats(ComponentBuilder componentBuilder, Player player); /** * Whether or not this subskill is enabled + * * @return true if enabled */ boolean isEnabled(); /** * Prints detailed info about this subskill to the player + * * @param player the target player */ void printInfo(Player player); diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ExcavationTreasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ExcavationTreasure.java index c69073284..92ba9c7c9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ExcavationTreasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ExcavationTreasure.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.core.skills.treasure; -import com.gmail.nossr50.core.skills.treasure.Treasure; import org.bukkit.inventory.ItemStack; public class ExcavationTreasure extends Treasure { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/FishingTreasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/FishingTreasure.java index 6e9b07ef8..bce93839e 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/FishingTreasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/FishingTreasure.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.core.skills.treasure; -import com.gmail.nossr50.core.skills.treasure.Treasure; import org.bukkit.inventory.ItemStack; public class FishingTreasure extends Treasure { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/HylianTreasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/HylianTreasure.java index 61863a3b6..e5595f58f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/HylianTreasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/HylianTreasure.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.core.skills.treasure; -import com.gmail.nossr50.core.skills.treasure.Treasure; import org.bukkit.inventory.ItemStack; public class HylianTreasure extends Treasure { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Rarity.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Rarity.java index fe4eff482..a6f7dc37f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Rarity.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Rarity.java @@ -11,8 +11,7 @@ public enum Rarity { public static Rarity getRarity(String string) { try { return valueOf(string); - } - catch (IllegalArgumentException ex) { + } catch (IllegalArgumentException ex) { return COMMON; } } diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ShakeTreasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ShakeTreasure.java index 6c9755cd7..41bd533fe 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ShakeTreasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/ShakeTreasure.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.core.skills.treasure; -import com.gmail.nossr50.core.skills.treasure.Treasure; import org.bukkit.inventory.ItemStack; public class ShakeTreasure extends Treasure { diff --git a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java index 127b94540..6bbd50825 100644 --- a/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java +++ b/core/src/main/java/com/gmail/nossr50/core/skills/treasure/Treasure.java @@ -42,7 +42,7 @@ public abstract class Treasure { public int getDropLevel() { //If they are in retro mode all requirements are scaled up by 10 - if(Config.getInstance().getIsRetroMode()) + if (Config.getInstance().getIsRetroMode()) return dropLevel * 10; return dropLevel; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/BlockUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/BlockUtils.java index 5780eeb5b..0db94f6d5 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/BlockUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/BlockUtils.java @@ -2,9 +2,9 @@ package com.gmail.nossr50.core.util; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.skills.primary.repair.Repair; import com.gmail.nossr50.core.skills.child.salvage.Salvage; +import com.gmail.nossr50.core.skills.primary.repair.Repair; +import com.gmail.nossr50.mcMMO; import org.bukkit.Material; import org.bukkit.block.BlockState; import org.bukkit.block.data.Ageable; @@ -14,13 +14,13 @@ import java.util.HashSet; public final class BlockUtils { - private BlockUtils() {} + private BlockUtils() { + } /** * Checks to see if a given block awards XP. * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block awards XP, false otherwise */ public static boolean shouldBeWatched(BlockState blockState) { @@ -30,10 +30,9 @@ public final class BlockUtils { /** * Check if a given block should allow for the activation of abilities * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block should allow ability activation, false - * otherwise + * otherwise */ public static boolean canActivateAbilities(BlockState blockState) { switch (blockState.getType()) { @@ -53,24 +52,24 @@ public final class BlockUtils { case Material.RED_BED: case Material.WHITE_BED: case Material.YELLOW_BED: - case Material.BREWING_STAND : - case Material.BOOKSHELF : + case Material.BREWING_STAND: + case Material.BOOKSHELF: case Material.CAKE: - case Material.CHEST : - case Material.DISPENSER : + case Material.CHEST: + case Material.DISPENSER: case Material.ENCHANTING_TABLE: - case Material.ENDER_CHEST : + case Material.ENDER_CHEST: case Material.OAK_FENCE_GATE: - case Material.ACACIA_FENCE_GATE : - case Material.DARK_OAK_FENCE_GATE : - case Material.SPRUCE_FENCE_GATE : - case Material.BIRCH_FENCE_GATE : - case Material.JUNGLE_FENCE_GATE : - case Material.FURNACE : - case Material.JUKEBOX : - case Material.LEVER : - case Material.NOTE_BLOCK : - case Material.STONE_BUTTON : + case Material.ACACIA_FENCE_GATE: + case Material.DARK_OAK_FENCE_GATE: + case Material.SPRUCE_FENCE_GATE: + case Material.BIRCH_FENCE_GATE: + case Material.JUNGLE_FENCE_GATE: + case Material.FURNACE: + case Material.JUKEBOX: + case Material.LEVER: + case Material.NOTE_BLOCK: + case Material.STONE_BUTTON: case Material.OAK_BUTTON: case Material.BIRCH_BUTTON: case Material.ACACIA_BUTTON: @@ -83,47 +82,47 @@ public final class BlockUtils { case Material.JUNGLE_TRAPDOOR: case Material.OAK_TRAPDOOR: case Material.SPRUCE_TRAPDOOR: - case Material.WALL_SIGN : + case Material.WALL_SIGN: case Material.CRAFTING_TABLE: - case Material.BEACON : - case Material.ANVIL : - case Material.DROPPER : - case Material.HOPPER : - case Material.TRAPPED_CHEST : - case Material.IRON_DOOR : - case Material.IRON_TRAPDOOR : + case Material.BEACON: + case Material.ANVIL: + case Material.DROPPER: + case Material.HOPPER: + case Material.TRAPPED_CHEST: + case Material.IRON_DOOR: + case Material.IRON_TRAPDOOR: case Material.OAK_DOOR: - case Material.ACACIA_DOOR : - case Material.SPRUCE_DOOR : - case Material.BIRCH_DOOR : - case Material.JUNGLE_DOOR : - case Material.DARK_OAK_DOOR : + case Material.ACACIA_DOOR: + case Material.SPRUCE_DOOR: + case Material.BIRCH_DOOR: + case Material.JUNGLE_DOOR: + case Material.DARK_OAK_DOOR: case Material.OAK_FENCE: - case Material.ACACIA_FENCE : - case Material.DARK_OAK_FENCE : - case Material.BIRCH_FENCE : - case Material.JUNGLE_FENCE : - case Material.SPRUCE_FENCE : - case Material.ARMOR_STAND : - case Material.BLACK_SHULKER_BOX : - case Material.BLUE_SHULKER_BOX : - case Material.BROWN_SHULKER_BOX : - case Material.CYAN_SHULKER_BOX : - case Material.GRAY_SHULKER_BOX : - case Material.GREEN_SHULKER_BOX : - case Material.LIGHT_BLUE_SHULKER_BOX : - case Material.LIME_SHULKER_BOX : - case Material.MAGENTA_SHULKER_BOX : - case Material.ORANGE_SHULKER_BOX : - case Material.PINK_SHULKER_BOX : - case Material.PURPLE_SHULKER_BOX : - case Material.RED_SHULKER_BOX : + case Material.ACACIA_FENCE: + case Material.DARK_OAK_FENCE: + case Material.BIRCH_FENCE: + case Material.JUNGLE_FENCE: + case Material.SPRUCE_FENCE: + case Material.ARMOR_STAND: + case Material.BLACK_SHULKER_BOX: + case Material.BLUE_SHULKER_BOX: + case Material.BROWN_SHULKER_BOX: + case Material.CYAN_SHULKER_BOX: + case Material.GRAY_SHULKER_BOX: + case Material.GREEN_SHULKER_BOX: + case Material.LIGHT_BLUE_SHULKER_BOX: + case Material.LIME_SHULKER_BOX: + case Material.MAGENTA_SHULKER_BOX: + case Material.ORANGE_SHULKER_BOX: + case Material.PINK_SHULKER_BOX: + case Material.PURPLE_SHULKER_BOX: + case Material.RED_SHULKER_BOX: case Material.LIGHT_GRAY_SHULKER_BOX: - case Material.WHITE_SHULKER_BOX : - case Material.YELLOW_SHULKER_BOX : + case Material.WHITE_SHULKER_BOX: + case Material.YELLOW_SHULKER_BOX: return false; - default : + default: return !isMcMMOAnvil(blockState) && !mcMMO.getModManager().isCustomAbilityBlock(blockState); } } @@ -132,10 +131,9 @@ public final class BlockUtils { * Check if a given block should allow for the activation of tools * Activating a tool is step 1 of a 2 step process for super ability activation * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block should allow ability activation, false - * otherwise + * otherwise */ public static boolean canActivateTools(BlockState blockState) { switch (blockState.getType()) { @@ -155,24 +153,24 @@ public final class BlockUtils { case Material.RED_BED: case Material.WHITE_BED: case Material.YELLOW_BED: - case Material.BREWING_STAND : - case Material.BOOKSHELF : + case Material.BREWING_STAND: + case Material.BOOKSHELF: case Material.CAKE: - case Material.CHEST : - case Material.DISPENSER : + case Material.CHEST: + case Material.DISPENSER: case Material.ENCHANTING_TABLE: - case Material.ENDER_CHEST : + case Material.ENDER_CHEST: case Material.OAK_FENCE_GATE: - case Material.ACACIA_FENCE_GATE : - case Material.DARK_OAK_FENCE_GATE : - case Material.SPRUCE_FENCE_GATE : - case Material.BIRCH_FENCE_GATE : - case Material.JUNGLE_FENCE_GATE : - case Material.FURNACE : - case Material.JUKEBOX : - case Material.LEVER : - case Material.NOTE_BLOCK : - case Material.STONE_BUTTON : + case Material.ACACIA_FENCE_GATE: + case Material.DARK_OAK_FENCE_GATE: + case Material.SPRUCE_FENCE_GATE: + case Material.BIRCH_FENCE_GATE: + case Material.JUNGLE_FENCE_GATE: + case Material.FURNACE: + case Material.JUKEBOX: + case Material.LEVER: + case Material.NOTE_BLOCK: + case Material.STONE_BUTTON: case Material.OAK_BUTTON: case Material.BIRCH_BUTTON: case Material.ACACIA_BUTTON: @@ -185,44 +183,44 @@ public final class BlockUtils { case Material.JUNGLE_TRAPDOOR: case Material.OAK_TRAPDOOR: case Material.SPRUCE_TRAPDOOR: - case Material.WALL_SIGN : + case Material.WALL_SIGN: case Material.CRAFTING_TABLE: - case Material.BEACON : - case Material.ANVIL : - case Material.DROPPER : - case Material.HOPPER : - case Material.TRAPPED_CHEST : - case Material.IRON_DOOR : - case Material.IRON_TRAPDOOR : + case Material.BEACON: + case Material.ANVIL: + case Material.DROPPER: + case Material.HOPPER: + case Material.TRAPPED_CHEST: + case Material.IRON_DOOR: + case Material.IRON_TRAPDOOR: case Material.OAK_DOOR: - case Material.ACACIA_DOOR : - case Material.SPRUCE_DOOR : - case Material.BIRCH_DOOR : - case Material.JUNGLE_DOOR : - case Material.DARK_OAK_DOOR : + case Material.ACACIA_DOOR: + case Material.SPRUCE_DOOR: + case Material.BIRCH_DOOR: + case Material.JUNGLE_DOOR: + case Material.DARK_OAK_DOOR: case Material.OAK_FENCE: - case Material.ACACIA_FENCE : - case Material.DARK_OAK_FENCE : - case Material.BIRCH_FENCE : - case Material.JUNGLE_FENCE : - case Material.SPRUCE_FENCE : - case Material.ARMOR_STAND : - case Material.BLACK_SHULKER_BOX : - case Material.BLUE_SHULKER_BOX : - case Material.BROWN_SHULKER_BOX : - case Material.CYAN_SHULKER_BOX : - case Material.GRAY_SHULKER_BOX : - case Material.GREEN_SHULKER_BOX : - case Material.LIGHT_BLUE_SHULKER_BOX : - case Material.LIME_SHULKER_BOX : - case Material.MAGENTA_SHULKER_BOX : - case Material.ORANGE_SHULKER_BOX : - case Material.PINK_SHULKER_BOX : - case Material.PURPLE_SHULKER_BOX : - case Material.RED_SHULKER_BOX : + case Material.ACACIA_FENCE: + case Material.DARK_OAK_FENCE: + case Material.BIRCH_FENCE: + case Material.JUNGLE_FENCE: + case Material.SPRUCE_FENCE: + case Material.ARMOR_STAND: + case Material.BLACK_SHULKER_BOX: + case Material.BLUE_SHULKER_BOX: + case Material.BROWN_SHULKER_BOX: + case Material.CYAN_SHULKER_BOX: + case Material.GRAY_SHULKER_BOX: + case Material.GREEN_SHULKER_BOX: + case Material.LIGHT_BLUE_SHULKER_BOX: + case Material.LIME_SHULKER_BOX: + case Material.MAGENTA_SHULKER_BOX: + case Material.ORANGE_SHULKER_BOX: + case Material.PINK_SHULKER_BOX: + case Material.PURPLE_SHULKER_BOX: + case Material.RED_SHULKER_BOX: case Material.LIGHT_GRAY_SHULKER_BOX: - case Material.WHITE_SHULKER_BOX : - case Material.YELLOW_SHULKER_BOX : + case Material.WHITE_SHULKER_BOX: + case Material.YELLOW_SHULKER_BOX: case Material.STRIPPED_ACACIA_LOG: case Material.STRIPPED_ACACIA_WOOD: case Material.STRIPPED_BIRCH_LOG: @@ -249,7 +247,7 @@ public final class BlockUtils { case Material.SPRUCE_WOOD: return false; - default : + default: return !isMcMMOAnvil(blockState) && !mcMMO.getModManager().isCustomAbilityBlock(blockState); } } @@ -257,8 +255,7 @@ public final class BlockUtils { /** * Check if a given block is an ore * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block is an ore, false otherwise */ public static boolean isOre(BlockState blockState) { @@ -268,15 +265,14 @@ public final class BlockUtils { /** * Determine if a given block can be made mossy * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block can be made mossy, false otherwise */ public static boolean canMakeMossy(BlockState blockState) { switch (blockState.getType()) { - case Material.COBBLESTONE : - case Material.DIRT : - case Material.GRASS_PATH : + case Material.COBBLESTONE: + case Material.DIRT: + case Material.GRASS_PATH: return true; case Material.STONE_BRICKS: @@ -285,7 +281,7 @@ public final class BlockUtils { case Material.COBBLESTONE_WALL: return true; - default : + default: return false; } } @@ -293,8 +289,7 @@ public final class BlockUtils { /** * Determine if a given block should be affected by Green Terra * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block should affected by Green Terra, false otherwise */ public static boolean affectedByGreenTerra(BlockState blockState) { @@ -308,10 +303,9 @@ public final class BlockUtils { /** * Determine if a given block should be affected by Super Breaker * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block should affected by Super Breaker, false - * otherwise + * otherwise */ public static Boolean affectedBySuperBreaker(BlockState blockState) { if (ExperienceConfig.getInstance().doesBlockGiveSkillXP(PrimarySkillType.MINING, blockState.getBlockData())) @@ -323,10 +317,9 @@ public final class BlockUtils { /** * Determine if a given block should be affected by Giga Drill Breaker * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block should affected by Giga Drill Breaker, false - * otherwise + * otherwise */ public static boolean affectedByGigaDrillBreaker(BlockState blockState) { if (ExperienceConfig.getInstance().doesBlockGiveSkillXP(PrimarySkillType.EXCAVATION, blockState.getBlockData())) @@ -337,8 +330,7 @@ public final class BlockUtils { /** * Check if a given block is a log * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block is a log, false otherwise */ public static boolean isLog(BlockState blockState) { @@ -350,8 +342,7 @@ public final class BlockUtils { /** * Check if a given block is a leaf * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block is a leaf, false otherwise */ public static boolean isLeaves(BlockState blockState) { @@ -364,7 +355,7 @@ public final class BlockUtils { case Material.SPRUCE_LEAVES: return true; - default : + default: return mcMMO.getModManager().isCustomLeaf(blockState); } } @@ -372,17 +363,16 @@ public final class BlockUtils { /** * Determine if a given block should be affected by Flux Mining * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block should affected by Flux Mining, false otherwise */ public static boolean affectedByFluxMining(BlockState blockState) { switch (blockState.getType()) { - case Material.IRON_ORE : - case Material.GOLD_ORE : + case Material.IRON_ORE: + case Material.GOLD_ORE: return true; - default : + default: return false; } } @@ -390,20 +380,19 @@ public final class BlockUtils { /** * Determine if a given block can activate Herbalism abilities * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block can be activate Herbalism abilities, false - * otherwise + * otherwise */ public static boolean canActivateHerbalism(BlockState blockState) { switch (blockState.getType()) { - case Material.DIRT : - case Material.GRASS : - case Material.GRASS_PATH : + case Material.DIRT: + case Material.GRASS: + case Material.GRASS_PATH: case Material.FARMLAND: return false; - default : + default: return true; } } @@ -411,17 +400,16 @@ public final class BlockUtils { /** * Determine if a given block should be affected by Block Cracker * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block should affected by Block Cracker, false - * otherwise + * otherwise */ public static boolean affectedByBlockCracker(BlockState blockState) { switch (blockState.getType()) { case Material.STONE_BRICKS: return true; - default : + default: return false; } } @@ -429,18 +417,17 @@ public final class BlockUtils { /** * Determine if a given block can be made into Mycelium * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block can be made into Mycelium, false otherwise */ public static boolean canMakeShroomy(BlockState blockState) { switch (blockState.getType()) { - case Material.DIRT : - case Material.GRASS : - case Material.GRASS_PATH : + case Material.DIRT: + case Material.GRASS: + case Material.GRASS_PATH: return true; - default : + default: return false; } } @@ -448,8 +435,7 @@ public final class BlockUtils { /** * Determine if a given block is an mcMMO anvil * - * @param blockState - * The {@link BlockState} of the block to check + * @param blockState The {@link BlockState} of the block to check * @return true if the block is an mcMMO anvil, false otherwise */ public static boolean isMcMMOAnvil(BlockState blockState) { @@ -485,8 +471,7 @@ public final class BlockUtils { BlockData data = blockState.getBlockData(); if (data.getMaterial() == Material.CACTUS || data.getMaterial() == Material.SUGAR_CANE) return true; - if (data instanceof Ageable) - { + if (data instanceof Ageable) { Ageable ageable = (Ageable) data; return ageable.getAge() == ageable.getMaximumAge(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java b/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java index 63e1832a1..6cb7fdeaa 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/ChimaeraWing.java @@ -1,17 +1,17 @@ package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.runnables.items.ChimaeraWingWarmup; import com.gmail.nossr50.core.util.player.NotificationManager; import com.gmail.nossr50.core.util.skills.CombatUtils; import com.gmail.nossr50.core.util.skills.SkillUtils; import com.gmail.nossr50.core.util.sounds.SoundManager; import com.gmail.nossr50.core.util.sounds.SoundType; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.runnables.items.ChimaeraWingWarmup; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; @@ -29,7 +29,8 @@ public final class ChimaeraWing { private static McMMOPlayer mcMMOPlayer; private static Location location; - private ChimaeraWing() {} + private ChimaeraWing() { + } /** * Check for item usage. @@ -61,7 +62,7 @@ public final class ChimaeraWing { int amount = inHand.getAmount(); if (amount < Config.getInstance().getChimaeraUseCost()) { - NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Item.ChimaeraWing.NotEnough",String.valueOf(Config.getInstance().getChimaeraUseCost() - amount), "Item.ChimaeraWing.Name"); + NotificationManager.sendPlayerInformation(player, NotificationType.REQUIREMENTS_NOT_MET, "Item.ChimaeraWing.NotEnough", String.valueOf(Config.getInstance().getChimaeraUseCost() - amount), "Item.ChimaeraWing.Name"); return; } @@ -110,8 +111,7 @@ public final class ChimaeraWing { if (warmup > 0) { NotificationManager.sendPlayerInformation(player, NotificationType.ITEM_MESSAGE, "Teleport.Commencing", String.valueOf(warmup)); new ChimaeraWingWarmup(mcMMOPlayer).runTaskLater(mcMMO.p, 20 * warmup); - } - else { + } else { chimaeraExecuteTeleport(); } } @@ -121,13 +121,11 @@ public final class ChimaeraWing { if (Config.getInstance().getChimaeraUseBedSpawn() && player.getBedSpawnLocation() != null) { player.teleport(player.getBedSpawnLocation()); - } - else { + } else { Location spawnLocation = player.getWorld().getSpawnLocation(); if (spawnLocation.getBlock().getType() == Material.AIR) { player.teleport(spawnLocation); - } - else { + } else { player.teleport(player.getWorld().getHighestBlockAt(spawnLocation).getLocation()); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/EnchantmentUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/EnchantmentUtils.java index 33d3e0a7b..1a65377d7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/EnchantmentUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/EnchantmentUtils.java @@ -40,7 +40,6 @@ public class EnchantmentUtils { * Method to get an {@link Enchantment} using it's Vanilla Minecraft name or Bukkit enum name * * @param enchantmentName Vanilla or Bukkit name of enchantment - * * @return Enchantment or null if no enchantment was found */ public static Enchantment getByName(String enchantmentName) { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/EventUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/EventUtils.java index 3b8c6f143..84b3a6837 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/EventUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/EventUtils.java @@ -1,19 +1,21 @@ package com.gmail.nossr50.core.util; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.party.Party; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; +import com.gmail.nossr50.core.util.skills.CombatUtils; import com.gmail.nossr50.events.experience.McMMOPlayerLevelChangeEvent; import com.gmail.nossr50.events.experience.McMMOPlayerLevelDownEvent; import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent; import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent; -import com.gmail.nossr50.events.fake.*; import com.gmail.nossr50.events.hardcore.McMMOPlayerPreDeathPenaltyEvent; import com.gmail.nossr50.events.hardcore.McMMOPlayerStatLossEvent; import com.gmail.nossr50.events.hardcore.McMMOPlayerVampirismEvent; @@ -28,10 +30,7 @@ import com.gmail.nossr50.events.skills.repair.McMMOPlayerRepairCheckEvent; import com.gmail.nossr50.events.skills.salvage.McMMOPlayerSalvageCheckEvent; import com.gmail.nossr50.events.skills.secondaryabilities.SubSkillEvent; import com.gmail.nossr50.events.skills.unarmed.McMMOPlayerDisarmEvent; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.data.UserManager; -import com.gmail.nossr50.core.util.skills.CombatUtils; import org.bukkit.block.Block; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Entity; @@ -54,6 +53,7 @@ public class EventUtils { /* * Quality of Life methods */ + /** * Checks to see if damage is from natural sources * This cannot be used to determine if damage is from vanilla MC, it just checks to see if the damage is from a complex behaviour in mcMMO such as bleed. @@ -70,19 +70,19 @@ public class EventUtils { /** * This little method is just to make the code more readable + * * @param entity target entity * @return the associated McMMOPlayer for this entity */ - public static McMMOPlayer getMcMMOPlayer(Entity entity) - { - return UserManager.getPlayer((Player)entity); + public static McMMOPlayer getMcMMOPlayer(Entity entity) { + return UserManager.getPlayer((Player) entity); } /** * Checks to see if a Player was damaged in this EntityDamageEvent - * + *

* This method checks for the following things and if they are all true it returns true - * + *

* 1) The player is real and not an NPC * 2) The player is not in god mode * 3) The damage dealt is above 0 @@ -91,8 +91,7 @@ public class EventUtils { * @param entityDamageEvent * @return */ - public static boolean isRealPlayerDamaged(EntityDamageEvent entityDamageEvent) - { + public static boolean isRealPlayerDamaged(EntityDamageEvent entityDamageEvent) { //Make sure the damage is above 0 double damage = entityDamageEvent.getFinalDamage(); @@ -103,7 +102,7 @@ public class EventUtils { Entity entity = entityDamageEvent.getEntity(); //Check to make sure the entity is not an NPC - if(Misc.isNPCEntity(entity)) + if (Misc.isNPCEntity(entity)) return false; if (!entity.isValid() || !(entity instanceof LivingEntity)) { @@ -150,7 +149,8 @@ public class EventUtils { /** * Calls a new SubSkillEvent for this SubSkill and then returns it - * @param player target player + * + * @param player target player * @param subSkillType target subskill * @return the event after it has been fired */ @@ -164,7 +164,8 @@ public class EventUtils { /** * Calls a new SubSkillEvent for this SubSkill and then returns it - * @param player target player + * + * @param player target player * @param abstractSubSkill target subskill * @return the event after it has been fired */ @@ -201,8 +202,8 @@ public class EventUtils { /** * Simulate a block break event. * - * @param block The block to break - * @param player The player breaking the block + * @param block The block to break + * @param player The player breaking the block * @param shouldArmSwing true if an armswing event should be fired, false otherwise * @return true if the event wasn't cancelled, false otherwise */ diff --git a/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java b/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java index 7ac15590a..a44aba75a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/HardcoreManager.java @@ -1,17 +1,18 @@ package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; import java.util.HashMap; public final class HardcoreManager { - private HardcoreManager() {} + private HardcoreManager() { + } public static void invokeStatPenalty(Player player) { double statLossPercentage = Config.getInstance().getHardcoreDeathStatPenaltyPercentage(); @@ -100,8 +101,7 @@ public final class HardcoreManager { if (totalLevelsStolen > 0) { NotificationManager.sendPlayerInformation(killer, NotificationType.HARDCORE_MODE, "Hardcore.Vampirism.Killer.Success", String.valueOf(totalLevelsStolen), victim.getName()); NotificationManager.sendPlayerInformation(victim, NotificationType.HARDCORE_MODE, "Hardcore.Vampirism.Victim.Success", killer.getName(), String.valueOf(totalLevelsStolen)); - } - else { + } else { NotificationManager.sendPlayerInformation(killer, NotificationType.HARDCORE_MODE, "Hardcore.Vampirism.Killer.Failure", victim.getName()); NotificationManager.sendPlayerInformation(victim, NotificationType.HARDCORE_MODE, "Hardcore.Vampirism.Victim.Failure", killer.getName()); } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/HolidayManager.java b/core/src/main/java/com/gmail/nossr50/core/util/HolidayManager.java index cec47e1a9..3eb4c341c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/HolidayManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/HolidayManager.java @@ -1,17 +1,16 @@ package com.gmail.nossr50.core.util; import com.gmail.nossr50.commands.skills.AprilCommand; -import com.gmail.nossr50.core.datatypes.interactions.NotificationType; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.util.player.NotificationManager; import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.datatypes.interactions.NotificationType; +import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.util.player.NotificationManager; import com.gmail.nossr50.core.util.skills.ParticleEffectUtils; import com.gmail.nossr50.core.util.sounds.SoundManager; import com.gmail.nossr50.core.util.sounds.SoundType; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; -import org.bukkit.*; import org.bukkit.FireworkEffect.Type; import org.bukkit.command.CommandSender; import org.bukkit.command.PluginCommand; @@ -26,76 +25,11 @@ import java.util.*; import java.util.regex.Pattern; public final class HolidayManager { - private ArrayList hasCelebrated; - private int currentYear; private static final int START_YEAR = 2011; - private static final List ALL_COLORS; private static final List ALL_CHAT_COLORS; private static final List CHAT_FORMATS; - public enum FakeSkillType { - MACHO, - JUMPING, - THROWING, - WRECKING, - CRAFTING, - WALKING, - SWIMMING, - FALLING, - CLIMBING, - FLYING, - DIVING, - PIGGY, - UNKNOWN; - - public static FakeSkillType getByName(String skillName) { - for (FakeSkillType type : values()) { - if (type.name().equalsIgnoreCase(skillName)) { - return type; - } - } - return null; - } - - public static FakeSkillType getByStatistic(Statistic statistic) { - switch (statistic) { - case Statistic.DAMAGE_TAKEN: - return FakeSkillType.MACHO; - case Statistic.JUMP: - return FakeSkillType.JUMPING; - case Statistic.DROP: - return FakeSkillType.THROWING; - case Statistic.MINE_BLOCK: - case Statistic.BREAK_ITEM: - return FakeSkillType.WRECKING; - case Statistic.CRAFT_ITEM: - return FakeSkillType.CRAFTING; - case Statistic.WALK_ONE_CM: - return FakeSkillType.WALKING; - case Statistic.SWIM_ONE_CM: - return FakeSkillType.SWIMMING; - case Statistic.FALL_ONE_CM: - return FakeSkillType.FALLING; - case Statistic.CLIMB_ONE_CM: - return FakeSkillType.CLIMBING; - case Statistic.FLY_ONE_CM: - return FakeSkillType.FLYING; - case Statistic.WALK_UNDER_WATER_ONE_CM: - return FakeSkillType.DIVING; - case Statistic.PIG_ONE_CM: - return FakeSkillType.PIGGY; - default: - return FakeSkillType.UNKNOWN; - } - } - } - - public final Set movementStatistics = EnumSet.of( - Statistic.WALK_ONE_CM, Statistic.SWIM_ONE_CM, Statistic.FALL_ONE_CM, - Statistic.CLIMB_ONE_CM, Statistic.FLY_ONE_CM, Statistic.WALK_UNDER_WATER_ONE_CM, - Statistic.PIG_ONE_CM); - static { List colors = new ArrayList(); List chatColors = new ArrayList(); @@ -104,8 +38,7 @@ public final class HolidayManager { for (ChatColor color : ChatColor.values()) { if (color.isColor()) { chatColors.add(color); - } - else { + } else { chatFormats.add(color); } } @@ -123,6 +56,13 @@ public final class HolidayManager { CHAT_FORMATS = ImmutableList.copyOf(chatFormats); } + public final Set movementStatistics = EnumSet.of( + Statistic.WALK_ONE_CM, Statistic.SWIM_ONE_CM, Statistic.FALL_ONE_CM, + Statistic.CLIMB_ONE_CM, Statistic.FLY_ONE_CM, Statistic.WALK_UNDER_WATER_ONE_CM, + Statistic.PIG_ONE_CM); + private ArrayList hasCelebrated; + private int currentYear; + // This gets called onEnable public HolidayManager() { currentYear = Calendar.getInstance().get(Calendar.YEAR); @@ -132,8 +72,7 @@ public final class HolidayManager { if (!anniversaryFile.exists()) { try { anniversaryFile.createNewFile(); - } - catch (IOException ex) { + } catch (IOException ex) { mcMMO.p.getLogger().severe(ex.toString()); } } @@ -151,14 +90,29 @@ public final class HolidayManager { } reader.close(); - } - catch (Exception ex) { + } catch (Exception ex) { mcMMO.p.getLogger().severe(ex.toString()); } cleanupFiles(); } + private static List colorChoose() { + return ALL_COLORS.subList(0, Math.max(Misc.getRandom().nextInt(ALL_COLORS.size() + 1), 1)); + } + + private static String chatColorChoose() { + StringBuilder ret = new StringBuilder(ALL_CHAT_COLORS.get(Misc.getRandom().nextInt(ALL_CHAT_COLORS.size())).toString()); + + for (ChatColor chatFormat : CHAT_FORMATS) { + if (Misc.getRandom().nextInt(CHAT_FORMATS.size()) == 0) { + ret.append(chatFormat); + } + } + + return ret.toString(); + } + private void cleanupFiles() { File FlatFileDir = new File(mcMMO.getFlatFileDirectory()); File legacy = new File(FlatFileDir, "anniversary.yml"); @@ -203,8 +157,7 @@ public final class HolidayManager { writer.newLine(); } writer.close(); - } - catch (Exception ex) { + } catch (Exception ex) { mcMMO.p.getLogger().severe(ex.toString()); } } @@ -235,34 +188,33 @@ public final class HolidayManager { } }, delay); } - } - else { - /* - * Credit: http://www.geocities.com/spunk1111/ - * (good luck finding that in 3 years heh) - * .''. . *''* :_\/_: . - * :_\/_: _\(/_ .:.*_\/_* : /\ : .'.:.'. - * .''.: /\ : /)\ ':'* /\ * : '..'. -=:o:=- - * :_\/_:'.:::. ' *''* * '.\'/.'_\(/_ '.':'.' - * : /\ : ::::: *_\/_* -= o =- /)\ ' - * '..' ':::' * /\ * .'/.\'. ' * - * * *..* : * - * * * * - * * * * - */ + } else { + /* + * Credit: http://www.geocities.com/spunk1111/ + * (good luck finding that in 3 years heh) + * .''. . *''* :_\/_: . + * :_\/_: _\(/_ .:.*_\/_* : /\ : .'.:.'. + * .''.: /\ : /)\ ':'* /\ * : '..'. -=:o:=- + * :_\/_:'.:::. ' *''* * '.\'/.'_\(/_ '.':'.' + * : /\ : ::::: *_\/_* -= o =- /)\ ' + * '..' ':::' * /\ * .'/.\'. ' * + * * *..* : * + * * * * + * * * * + */ - /* - * Color map - * AAAA D GGGG JJJJJJ K - * AAAAAA DDDDD EEEGGGGGG JJJJJJ KKKKKKK - * BBBBAAAAAA DDD EEEGGGGGG I JJJJJ KKKKKKK - * BBBBBBACCCCC D FFFF G IIIIIIIHHHHH KKKKKKK - * BBBBBB CCCCC FFFFFF IIIIIII HHH K - * BBBB CCCCC FFFFFF IIIIIII H k - * b FFFF I k - * b i k - * b i k - */ + /* + * Color map + * AAAA D GGGG JJJJJJ K + * AAAAAA DDDDD EEEGGGGGG JJJJJJ KKKKKKK + * BBBBAAAAAA DDD EEEGGGGGG I JJJJJ KKKKKKK + * BBBBBBACCCCC D FFFF G IIIIIIIHHHHH KKKKKKK + * BBBBBB CCCCC FFFFFF IIIIIII HHH K + * BBBB CCCCC FFFFFF IIIIIII H k + * b FFFF I k + * b i k + * b i k + */ Object[] colorParams = new Object[]{chatColorChoose(), chatColorChoose(), chatColorChoose(), chatColorChoose(), chatColorChoose(), chatColorChoose(), chatColorChoose(), chatColorChoose(), chatColorChoose(), chatColorChoose(), chatColorChoose()}; sender.sendMessage(String.format(" %1$s.''. %4$s. %7$s*''* %10$s:_\\/_: %11$s.", colorParams)); sender.sendMessage(String.format(" %1$s:_\\/_: %4$s_\\(/_ %5$s.:.%7$s*_\\/_* %10$s: /\\ : %11$s.'.:.'.", colorParams)); @@ -296,22 +248,6 @@ public final class HolidayManager { fireworks.setFireworkMeta(fireworkmeta); } - private static List colorChoose() { - return ALL_COLORS.subList(0, Math.max(Misc.getRandom().nextInt(ALL_COLORS.size() + 1), 1)); - } - - private static String chatColorChoose() { - StringBuilder ret = new StringBuilder(ALL_CHAT_COLORS.get(Misc.getRandom().nextInt(ALL_CHAT_COLORS.size())).toString()); - - for (ChatColor chatFormat : CHAT_FORMATS) { - if (Misc.getRandom().nextInt(CHAT_FORMATS.size()) == 0) { - ret.append(chatFormat); - } - } - - return ret.toString(); - } - public boolean isAprilFirst() { GregorianCalendar aprilFirst = new GregorianCalendar(currentYear, Calendar.APRIL, 1); GregorianCalendar aprilSecond = new GregorianCalendar(currentYear, Calendar.APRIL, 2); @@ -370,4 +306,61 @@ public final class HolidayManager { PluginCommand command = mcMMO.p.getCommand("mcfools"); command.setExecutor(new AprilCommand()); } + + public enum FakeSkillType { + MACHO, + JUMPING, + THROWING, + WRECKING, + CRAFTING, + WALKING, + SWIMMING, + FALLING, + CLIMBING, + FLYING, + DIVING, + PIGGY, + UNKNOWN; + + public static FakeSkillType getByName(String skillName) { + for (FakeSkillType type : values()) { + if (type.name().equalsIgnoreCase(skillName)) { + return type; + } + } + return null; + } + + public static FakeSkillType getByStatistic(Statistic statistic) { + switch (statistic) { + case Statistic.DAMAGE_TAKEN: + return FakeSkillType.MACHO; + case Statistic.JUMP: + return FakeSkillType.JUMPING; + case Statistic.DROP: + return FakeSkillType.THROWING; + case Statistic.MINE_BLOCK: + case Statistic.BREAK_ITEM: + return FakeSkillType.WRECKING; + case Statistic.CRAFT_ITEM: + return FakeSkillType.CRAFTING; + case Statistic.WALK_ONE_CM: + return FakeSkillType.WALKING; + case Statistic.SWIM_ONE_CM: + return FakeSkillType.SWIMMING; + case Statistic.FALL_ONE_CM: + return FakeSkillType.FALLING; + case Statistic.CLIMB_ONE_CM: + return FakeSkillType.CLIMBING; + case Statistic.FLY_ONE_CM: + return FakeSkillType.FLYING; + case Statistic.WALK_UNDER_WATER_ONE_CM: + return FakeSkillType.DIVING; + case Statistic.PIG_ONE_CM: + return FakeSkillType.PIGGY; + default: + return FakeSkillType.UNKNOWN; + } + } + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java index 709bfa87e..85b2d1ff1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/ItemUtils.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.util; -import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.party.ItemWeightConfig; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import org.bukkit.ChatColor; @@ -12,7 +12,8 @@ import org.bukkit.inventory.Recipe; import org.bukkit.inventory.meta.ItemMeta; public final class ItemUtils { - private ItemUtils() {} + private ItemUtils() { + } /** * Checks if the item is a bow. diff --git a/core/src/main/java/com/gmail/nossr50/core/util/MaterialUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/MaterialUtils.java index 698936c1c..65b79d9b7 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/MaterialUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/MaterialUtils.java @@ -4,7 +4,8 @@ import com.gmail.nossr50.mcMMO; import org.bukkit.Material; public final class MaterialUtils { - private MaterialUtils() {} + private MaterialUtils() { + } protected static boolean isOre(Material data) { switch (data) { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/Misc.java b/core/src/main/java/com/gmail/nossr50/core/util/Misc.java index 48ace8dab..9257e44f4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/Misc.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/Misc.java @@ -1,9 +1,9 @@ package com.gmail.nossr50.core.util; +import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask; import com.gmail.nossr50.events.items.McMMOItemSpawnEvent; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.runnables.player.PlayerProfileLoadingTask; -import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableSet; import org.bukkit.Location; import org.bukkit.Material; @@ -19,13 +19,11 @@ import java.util.Random; import java.util.Set; public final class Misc { - private static Random random = new Random(); - public static final int TIME_CONVERSION_FACTOR = 1000; public static final int TICK_CONVERSION_FACTOR = 20; - public static final int PLAYER_RESPAWN_COOLDOWN_SECONDS = 5; public static final double SKILL_MESSAGE_MAX_SENDING_DISTANCE = 10.0; + public static final Set modNames = ImmutableSet.of("LOTR", "BUILDCRAFT", "ENDERIO", "ENHANCEDBIOMES", "IC2", "METALLURGY", "FORESTRY", "GALACTICRAFT", "RAILCRAFT", "TWILIGHTFOREST", "THAUMCRAFT", "GRAVESTONEMOD", "GROWTHCRAFT", "ARCTICMOBS", "DEMONMOBS", "INFERNOMOBS", "SWAMPMOBS", "MARICULTURE", "MINESTRAPPOLATION"); // Sound Pitches & Volumes from CB /* public static final float ANVIL_USE_PITCH = 0.3F; // Not in CB directly, I went off the place sound values @@ -37,10 +35,12 @@ public final class Misc { public static final float GHAST_VOLUME = 1.0F * Config.getInstance().getMasterVolume(); public static final float LEVELUP_PITCH = 0.5F; // Reduced to differentiate between vanilla level-up public static final float LEVELUP_VOLUME = 0.75F * Config.getInstance().getMasterVolume(); // Use max volume always*/ + private static Random random = new Random(); - public static final Set modNames = ImmutableSet.of("LOTR", "BUILDCRAFT", "ENDERIO", "ENHANCEDBIOMES", "IC2", "METALLURGY", "FORESTRY", "GALACTICRAFT", "RAILCRAFT", "TWILIGHTFOREST", "THAUMCRAFT", "GRAVESTONEMOD", "GROWTHCRAFT", "ARCTICMOBS", "DEMONMOBS", "INFERNOMOBS", "SWAMPMOBS", "MARICULTURE", "MINESTRAPPOLATION"); + private Misc() { + } - private Misc() {}; + ; public static boolean isNPCEntity(Entity entity) { return (entity == null || entity.hasMetadata("NPC") || entity instanceof NPC || entity.getClass().getName().equalsIgnoreCase("cofh.entity.PlayerFake")); @@ -49,8 +49,8 @@ public final class Misc { /** * Determine if two locations are near each other. * - * @param first The first location - * @param second The second location + * @param first The first location + * @param second The second location * @param maxDistance The max distance apart * @return true if the distance between {@code first} and {@code second} is less than {@code maxDistance}, false otherwise */ @@ -60,7 +60,7 @@ public final class Misc { /** * Get the center of the given block. - * + * * @param blockState The {@link BlockState} of the block * @return A {@link Location} lying at the center of the block */ @@ -78,7 +78,7 @@ public final class Misc { * Drop items at a given location. * * @param location The location to drop the items at - * @param is The items to drop + * @param is The items to drop * @param quantity The amount of items to drop */ public static void dropItems(Location location, ItemStack is, int quantity) { @@ -90,7 +90,7 @@ public final class Misc { /** * Drop an item at a given location. * - * @param location The location to drop the item at + * @param location The location to drop the item at * @param itemStack The item to drop * @return Dropped Item entity or null if invalid or cancelled */ diff --git a/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java index 55826c168..2b69e64d5 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/MobHealthbarUtils.java @@ -2,10 +2,10 @@ package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.skills.MobHealthbarType; import com.gmail.nossr50.core.datatypes.meta.OldName; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.runnables.MobHealthDisplayUpdaterTask; +import com.gmail.nossr50.core.skills.MobHealthbarType; +import com.gmail.nossr50.mcMMO; import org.bukkit.ChatColor; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; @@ -14,13 +14,14 @@ import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.metadata.FixedMetadataValue; public final class MobHealthbarUtils { - private MobHealthbarUtils() {} + private MobHealthbarUtils() { + } /** * Fix issues with death messages caused by the mob healthbars. * * @param deathMessage The original death message - * @param player The player who died + * @param player The player who died * @return the fixed death message */ public static String fixDeathMessage(String deathMessage, Player player) { @@ -32,7 +33,8 @@ public final class MobHealthbarUtils { /** * Handle the creation of mob healthbars. - * @param target the targetted entity + * + * @param target the targetted entity * @param damage damage done by the attack triggering this */ public static void handleMobHealthbars(LivingEntity target, double damage, mcMMO plugin) { @@ -50,13 +52,12 @@ public final class MobHealthbarUtils { /* * Store the name in metadata */ - if(target.getMetadata("mcMMO_oldName").size() <= 0 && originalName != null) + if (target.getMetadata("mcMMO_oldName").size() <= 0 && originalName != null) target.setMetadata("mcMMO_oldName", new OldName(originalName, plugin)); if (oldName == null) { oldName = ""; - } - else if (oldName.equalsIgnoreCase(AdvancedConfig.getInstance().getKrakenName())) { + } else if (oldName.equalsIgnoreCase(AdvancedConfig.getInstance().getKrakenName())) { return; } @@ -74,8 +75,7 @@ public final class MobHealthbarUtils { if (updateName) { target.setMetadata(mcMMO.customNameKey, new FixedMetadataValue(mcMMO.p, oldName)); target.setMetadata(mcMMO.customVisibleKey, new FixedMetadataValue(mcMMO.p, oldNameVisible)); - } - else if (!target.hasMetadata(mcMMO.customNameKey)) { + } else if (!target.hasMetadata(mcMMO.customNameKey)) { target.setMetadata(mcMMO.customNameKey, new FixedMetadataValue(mcMMO.p, "")); target.setMetadata(mcMMO.customVisibleKey, new FixedMetadataValue(mcMMO.p, false)); } @@ -105,20 +105,15 @@ public final class MobHealthbarUtils { if (healthPercentage >= 85) { color = ChatColor.DARK_GREEN; - } - else if (healthPercentage >= 70) { + } else if (healthPercentage >= 70) { color = ChatColor.GREEN; - } - else if (healthPercentage >= 55) { + } else if (healthPercentage >= 55) { color = ChatColor.GOLD; - } - else if (healthPercentage >= 40) { + } else if (healthPercentage >= 40) { color = ChatColor.YELLOW; - } - else if (healthPercentage >= 25) { + } else if (healthPercentage >= 25) { color = ChatColor.RED; - } - else if (healthPercentage >= 0) { + } else if (healthPercentage >= 0) { color = ChatColor.DARK_RED; } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java b/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java index 0585613b4..7db1d74cf 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/ModManager.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.core.util; -import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.mods.CustomArmorConfig; import com.gmail.nossr50.config.mods.CustomBlockConfig; import com.gmail.nossr50.config.mods.CustomEntityConfig; import com.gmail.nossr50.config.mods.CustomToolConfig; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.mods.CustomBlock; import com.gmail.nossr50.core.datatypes.mods.CustomEntity; import com.gmail.nossr50.core.datatypes.mods.CustomTool; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.skills.primary.repair.repairables.Repairable; +import com.gmail.nossr50.mcMMO; import org.bukkit.Material; import org.bukkit.block.BlockState; import org.bukkit.configuration.file.YamlConfiguration; @@ -25,32 +25,32 @@ public class ModManager { private List repairables = new ArrayList(); // Armor Mods - private List customBoots = new ArrayList(); + private List customBoots = new ArrayList(); private List customChestplates = new ArrayList(); - private List customHelmets = new ArrayList(); - private List customLeggings = new ArrayList(); + private List customHelmets = new ArrayList(); + private List customLeggings = new ArrayList(); // Block Mods - private List customExcavationBlocks = new ArrayList(); - private List customHerbalismBlocks = new ArrayList(); - private List customMiningBlocks = new ArrayList(); - private List customOres = new ArrayList(); - private List customLogs = new ArrayList(); - private List customLeaves = new ArrayList(); - private List customAbilityBlocks = new ArrayList(); + private List customExcavationBlocks = new ArrayList(); + private List customHerbalismBlocks = new ArrayList(); + private List customMiningBlocks = new ArrayList(); + private List customOres = new ArrayList(); + private List customLogs = new ArrayList(); + private List customLeaves = new ArrayList(); + private List customAbilityBlocks = new ArrayList(); private HashMap customBlockMap = new HashMap<>(); // Entity Mods private HashMap customEntityClassMap = new HashMap(); - private HashMap customEntityTypeMap = new HashMap(); + private HashMap customEntityTypeMap = new HashMap(); // Tool Mods - private List customAxes = new ArrayList(); - private List customBows = new ArrayList(); - private List customHoes = new ArrayList(); + private List customAxes = new ArrayList(); + private List customBows = new ArrayList(); + private List customHoes = new ArrayList(); private List customPickaxes = new ArrayList(); - private List customShovels = new ArrayList(); - private List customSwords = new ArrayList(); + private List customShovels = new ArrayList(); + private List customSwords = new ArrayList(); private HashMap customToolMap = new HashMap(); public void registerCustomArmor(CustomArmorConfig config) { @@ -199,8 +199,7 @@ public class ModManager { try { return customEntityClassMap.containsKey(((Class) entity.getClass().getDeclaredField("entityClass").get(entity)).getName()); - } - catch (Exception e) { + } catch (Exception e) { if (e instanceof NoSuchFieldException || e instanceof IllegalArgumentException || e instanceof IllegalAccessException) { return customEntityClassMap.containsKey(entity.getClass().getName()); } @@ -216,12 +215,10 @@ public class ModManager { if (customEntity == null) { try { customEntity = customEntityClassMap.get(((Class) entity.getClass().getDeclaredField("entityClass").get(entity)).getName()); - } - catch (Exception e) { + } catch (Exception e) { if (e instanceof NoSuchFieldException || e instanceof IllegalArgumentException || e instanceof IllegalAccessException) { customEntity = customEntityClassMap.get(entity.getClass().getName()); - } - else { + } else { e.printStackTrace(); } } @@ -257,12 +254,10 @@ public class ModManager { try { className = ((Class) entity.getClass().getDeclaredField("entityClass").get(entity)).getName(); - } - catch (Exception e) { + } catch (Exception e) { if (e instanceof NoSuchFieldException || e instanceof IllegalArgumentException || e instanceof IllegalAccessException) { className = entity.getClass().getName(); - } - else { + } else { e.printStackTrace(); } } @@ -274,8 +269,7 @@ public class ModManager { try { entitiesFile.save(entityFile); mcMMO.p.debug(entity.getType().toString() + " was added to the custom entities file!"); - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/Motd.java b/core/src/main/java/com/gmail/nossr50/core/util/Motd.java index b675c539f..f625b54a3 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/Motd.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/Motd.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.core.util; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.skills.PerksUtils; import com.gmail.nossr50.mcMMO; import org.bukkit.entity.Player; @@ -14,7 +14,8 @@ public final class Motd { public static final String PERK_PREFIX = LocaleLoader.getString("MOTD.PerksPrefix") + " "; private static final PluginDescriptionFile pluginDescription = mcMMO.p.getDescription(); - private Motd() {} + private Motd() { + } public static void displayAll(Player player) { displayVersion(player, pluginDescription.getVersion()); diff --git a/core/src/main/java/com/gmail/nossr50/core/util/Permissions.java b/core/src/main/java/com/gmail/nossr50/core/util/Permissions.java index aaea517dc..addbe21df 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/Permissions.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/Permissions.java @@ -17,200 +17,490 @@ import org.bukkit.permissions.PermissionDefault; import org.bukkit.plugin.PluginManager; public final class Permissions { - private Permissions() {} + private Permissions() { + } /* * GENERAL */ - public static boolean motd(Permissible permissible) { return permissible.hasPermission("mcmmo.motd"); } - public static boolean mobHealthDisplay(Permissible permissible) { return permissible.hasPermission("mcmmo.mobhealthdisplay"); } - public static boolean updateNotifications(Permissible permissible) {return permissible.hasPermission("mcmmo.tools.updatecheck"); } - public static boolean chimaeraWing(Permissible permissible) { return permissible.hasPermission("mcmmo.item.chimaerawing"); } - public static boolean showversion(Permissible permissible) { return permissible.hasPermission("mcmmo.showversion"); } + public static boolean motd(Permissible permissible) { + return permissible.hasPermission("mcmmo.motd"); + } + + public static boolean mobHealthDisplay(Permissible permissible) { + return permissible.hasPermission("mcmmo.mobhealthdisplay"); + } + + public static boolean updateNotifications(Permissible permissible) { + return permissible.hasPermission("mcmmo.tools.updatecheck"); + } + + public static boolean chimaeraWing(Permissible permissible) { + return permissible.hasPermission("mcmmo.item.chimaerawing"); + } + + public static boolean showversion(Permissible permissible) { + return permissible.hasPermission("mcmmo.showversion"); + } /* BYPASS */ - public static boolean hardcoreBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.hardcoremode"); } - public static boolean arcaneBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.arcanebypass"); } - public static boolean krakenBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.kraken"); } - public static boolean trapsBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.fishingtraps"); } + public static boolean hardcoreBypass(Permissible permissible) { + return permissible.hasPermission("mcmmo.bypass.hardcoremode"); + } + + public static boolean arcaneBypass(Permissible permissible) { + return permissible.hasPermission("mcmmo.bypass.arcanebypass"); + } + + public static boolean krakenBypass(Permissible permissible) { + return permissible.hasPermission("mcmmo.bypass.kraken"); + } + + public static boolean trapsBypass(Permissible permissible) { + return permissible.hasPermission("mcmmo.bypass.fishingtraps"); + } /* CHAT */ - public static boolean partyChat(Permissible permissible) { return permissible.hasPermission("mcmmo.chat.partychat"); } - public static boolean adminChat(Permissible permissible) { return permissible.hasPermission("mcmmo.chat.adminchat"); } + public static boolean partyChat(Permissible permissible) { + return permissible.hasPermission("mcmmo.chat.partychat"); + } + + public static boolean adminChat(Permissible permissible) { + return permissible.hasPermission("mcmmo.chat.adminchat"); + } /* * COMMANDS */ - public static boolean mmoinfo(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmoinfo"); } - public static boolean addlevels(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.addlevels"); } - public static boolean addlevelsOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.addlevels.others"); } + public static boolean mmoinfo(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mmoinfo"); + } - public static boolean addxp(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.addxp"); } - public static boolean addxpOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.addxp.others"); } + public static boolean addlevels(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.addlevels"); + } - public static boolean hardcoreModify(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.hardcore.modify"); } - public static boolean hardcoreToggle(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.hardcore.toggle"); } + public static boolean addlevelsOthers(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.addlevels.others"); + } - public static boolean inspect(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect")); } - public static boolean inspectFar(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect.far")); } - public static boolean inspectHidden(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect.hidden")); } - public static boolean inspectOffline(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect.offline")); } + public static boolean addxp(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.addxp"); + } - public static boolean kraken(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.kraken"); } - public static boolean krakenOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.kraken.others"); } + public static boolean addxpOthers(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.addxp.others"); + } - public static boolean mcability(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcability")); } - public static boolean mcabilityOthers(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcability.others")); } + public static boolean hardcoreModify(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.hardcore.modify"); + } - public static boolean adminChatSpy(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcchatspy");} - public static boolean adminChatSpyOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcchatspy.others");} + public static boolean hardcoreToggle(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.hardcore.toggle"); + } - public static boolean mcgod(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcgod"); } - public static boolean mcgodOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcgod.others"); } + public static boolean inspect(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.inspect")); + } - public static boolean mcmmoDescription(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcmmo.description"); } - public static boolean mcmmoHelp(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcmmo.help"); } + public static boolean inspectFar(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.inspect.far")); + } - public static boolean mcrank(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrank")); } - public static boolean mcrankOthers(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrank.others")); } - public static boolean mcrankFar(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrank.others.far")); } - public static boolean mcrankOffline(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrank.others.offline")); } + public static boolean inspectHidden(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.inspect.hidden")); + } - public static boolean mcrefresh(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrefresh")); } - public static boolean mcrefreshOthers(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.mcrefresh.others")); } + public static boolean inspectOffline(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.inspect.offline")); + } - public static boolean mctop(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.mctop." + skill.toString().toLowerCase()); } + public static boolean kraken(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.kraken"); + } - public static boolean mmoedit(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmoedit"); } - public static boolean mmoeditOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmoedit.others"); } + public static boolean krakenOthers(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.kraken.others"); + } - public static boolean skillreset(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.skillreset"); } - public static boolean skillreset(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.skillreset." + skill.toString().toLowerCase()); } - public static boolean skillresetOthers(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.skillreset.others"); } - public static boolean skillresetOthers(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.skillreset.others." + skill.toString().toLowerCase()); } + public static boolean mcability(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.mcability")); + } - public static boolean xplock(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.commands.xplock." + skill.toString().toLowerCase()); } + public static boolean mcabilityOthers(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.mcability.others")); + } - public static boolean xprateSet(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.xprate.set"); } - public static boolean xprateReset(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.xprate.reset"); } + public static boolean adminChatSpy(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mcchatspy"); + } - public static boolean vampirismModify(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.vampirism.modify"); } - public static boolean vampirismToggle(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.vampirism.toggle"); } + public static boolean adminChatSpyOthers(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mcchatspy.others"); + } - public static boolean mcpurge(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcpurge"); } - public static boolean mcremove(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mcremove"); } - public static boolean mmoupdate(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.mmoupdate"); } + public static boolean mcgod(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mcgod"); + } + + public static boolean mcgodOthers(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mcgod.others"); + } + + public static boolean mcmmoDescription(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mcmmo.description"); + } + + public static boolean mcmmoHelp(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mcmmo.help"); + } + + public static boolean mcrank(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.mcrank")); + } + + public static boolean mcrankOthers(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.mcrank.others")); + } + + public static boolean mcrankFar(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.mcrank.others.far")); + } + + public static boolean mcrankOffline(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.mcrank.others.offline")); + } + + public static boolean mcrefresh(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.mcrefresh")); + } + + public static boolean mcrefreshOthers(Permissible permissible) { + return (permissible.hasPermission("mcmmo.commands.mcrefresh.others")); + } + + public static boolean mctop(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.commands.mctop." + skill.toString().toLowerCase()); + } + + public static boolean mmoedit(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mmoedit"); + } + + public static boolean mmoeditOthers(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mmoedit.others"); + } + + public static boolean skillreset(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.skillreset"); + } + + public static boolean skillreset(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.commands.skillreset." + skill.toString().toLowerCase()); + } + + public static boolean skillresetOthers(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.skillreset.others"); + } + + public static boolean skillresetOthers(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.commands.skillreset.others." + skill.toString().toLowerCase()); + } + + public static boolean xplock(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.commands.xplock." + skill.toString().toLowerCase()); + } + + public static boolean xprateSet(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.xprate.set"); + } + + public static boolean xprateReset(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.xprate.reset"); + } + + public static boolean vampirismModify(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.vampirism.modify"); + } + + public static boolean vampirismToggle(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.vampirism.toggle"); + } + + public static boolean mcpurge(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mcpurge"); + } + + public static boolean mcremove(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mcremove"); + } + + public static boolean mmoupdate(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.mmoupdate"); + } /* * PERKS */ - public static boolean lucky(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.lucky." + skill.toString().toLowerCase()); } + public static 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) { return permissible.hasPermission("mcmmo.perks.xp.quadruple." + skill.toString().toLowerCase()); } - public static boolean tripleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.triple." + skill.toString().toLowerCase()); } - public static boolean doubleAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.150percentboost." + skill.toString().toLowerCase()); } - public static boolean doubleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.double." + skill.toString().toLowerCase()); } - public static boolean oneAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.50percentboost." + skill.toString().toLowerCase()); } - public static boolean oneAndOneTenthXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.10percentboost." + skill.toString().toLowerCase()); } - public static boolean customXpBoost(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.customboost." + skill.toString().toLowerCase()); } + public static boolean quadrupleXp(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.quadruple." + skill.toString().toLowerCase()); + } + + public static boolean tripleXp(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.triple." + skill.toString().toLowerCase()); + } + + public static boolean doubleAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.150percentboost." + skill.toString().toLowerCase()); + } + + public static boolean doubleXp(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.double." + skill.toString().toLowerCase()); + } + + public static boolean oneAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.50percentboost." + skill.toString().toLowerCase()); + } + + public static boolean oneAndOneTenthXp(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.10percentboost." + skill.toString().toLowerCase()); + } + + public static boolean customXpBoost(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.customboost." + skill.toString().toLowerCase()); + } /* ACTIVATION PERKS */ - public static boolean twelveSecondActivationBoost(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.activationtime.twelveseconds"); } - public static boolean eightSecondActivationBoost(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.activationtime.eightseconds"); } - public static boolean fourSecondActivationBoost(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.activationtime.fourseconds"); } + public static boolean twelveSecondActivationBoost(Permissible permissible) { + return permissible.hasPermission("mcmmo.perks.activationtime.twelveseconds"); + } + + public static boolean eightSecondActivationBoost(Permissible permissible) { + return permissible.hasPermission("mcmmo.perks.activationtime.eightseconds"); + } + + public static boolean fourSecondActivationBoost(Permissible permissible) { + return permissible.hasPermission("mcmmo.perks.activationtime.fourseconds"); + } /* COOLDOWN PERKS */ - public static boolean halvedCooldowns(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.cooldowns.halved"); } - public static boolean thirdedCooldowns(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.cooldowns.thirded"); } - public static boolean quarteredCooldowns(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.cooldowns.quartered"); } + public static boolean halvedCooldowns(Permissible permissible) { + return permissible.hasPermission("mcmmo.perks.cooldowns.halved"); + } + + public static boolean thirdedCooldowns(Permissible permissible) { + return permissible.hasPermission("mcmmo.perks.cooldowns.thirded"); + } + + public static boolean quarteredCooldowns(Permissible permissible) { + return permissible.hasPermission("mcmmo.perks.cooldowns.quartered"); + } /* * SKILLS */ - public static boolean skillEnabled(Permissible permissible, PrimarySkillType skill) {return permissible.hasPermission("mcmmo.skills." + skill.toString().toLowerCase()); } - public static 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 static boolean isSubSkillEnabled(Permissible permissible, AbstractSubSkill abstractSubSkill) { return permissible.hasPermission(abstractSubSkill.getPermissionNode()); } - public static boolean bonusDamage(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase() + ".bonusdamage"); } + public static boolean skillEnabled(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.skills." + skill.toString().toLowerCase()); + } + + public static 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 static boolean isSubSkillEnabled(Permissible permissible, AbstractSubSkill abstractSubSkill) { + return permissible.hasPermission(abstractSubSkill.getPermissionNode()); + } + + public static boolean bonusDamage(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase() + ".bonusdamage"); + } /* ACROBATICS */ - public static boolean dodge(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.acrobatics.dodge"); } - public static boolean gracefulRoll(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.acrobatics.gracefulroll"); } - public static boolean roll(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.acrobatics.roll"); } + public static boolean dodge(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.acrobatics.dodge"); + } + + public static boolean gracefulRoll(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.acrobatics.gracefulroll"); + } + + public static boolean roll(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.acrobatics.roll"); + } /* ALCHEMY */ - public static boolean catalysis(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.alchemy.catalysis"); } - public static boolean concoctions(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.alchemy.concoctions"); } + public static boolean catalysis(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.alchemy.catalysis"); + } + + public static boolean concoctions(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.alchemy.concoctions"); + } /* ARCHERY */ - public static boolean arrowRetrieval(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.archery.trackarrows"); } - public static boolean daze(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.archery.daze"); } + public static boolean arrowRetrieval(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.archery.trackarrows"); + } + + public static boolean daze(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.archery.daze"); + } /* AXES */ - public static boolean skullSplitter(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.axes.skullsplitter"); } + public static boolean skullSplitter(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.axes.skullsplitter"); + } /* EXCAVATION */ - public static boolean gigaDrillBreaker(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.excavation.gigadrillbreaker"); } + public static boolean gigaDrillBreaker(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.excavation.gigadrillbreaker"); + } /* HERBALISM */ - public static boolean greenTerra(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.herbalism.greenterra"); } - public static 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) { return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.plants." + material.toString().replace("_", "").toLowerCase()); } + public static boolean greenTerra(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.herbalism.greenterra"); + } + + public static 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) { + return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.plants." + material.toString().replace("_", "").toLowerCase()); + } /* MINING */ - public static boolean biggerBombs(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.blastmining.biggerbombs"); } - public static boolean demolitionsExpertise(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.blastmining.demolitionsexpertise"); } - public static boolean remoteDetonation(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.blastmining.detonate"); } - public static boolean superBreaker(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.mining.superbreaker"); } + public static boolean biggerBombs(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.mining.blastmining.biggerbombs"); + } + + public static boolean demolitionsExpertise(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.mining.blastmining.demolitionsexpertise"); + } + + public static boolean remoteDetonation(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.mining.blastmining.detonate"); + } + + public static boolean superBreaker(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.mining.superbreaker"); + } /* REPAIR */ - public static boolean repairItemType(Permissible permissible, ItemType repairItemType) { return permissible.hasPermission("mcmmo.ability.repair." + repairItemType.toString().toLowerCase() + "repair"); } - public static boolean repairMaterialType(Permissible permissible, MaterialType repairMaterialType) { return permissible.hasPermission("mcmmo.ability.repair." + repairMaterialType.toString().toLowerCase() + "repair"); } + public static boolean repairItemType(Permissible permissible, ItemType repairItemType) { + return permissible.hasPermission("mcmmo.ability.repair." + repairItemType.toString().toLowerCase() + "repair"); + } + + public static boolean repairMaterialType(Permissible permissible, MaterialType repairMaterialType) { + return permissible.hasPermission("mcmmo.ability.repair." + repairMaterialType.toString().toLowerCase() + "repair"); + } /* SALVAGE */ - public static boolean advancedSalvage(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.salvage.advancedsalvage"); } - public static boolean arcaneSalvage(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.salvage.arcanesalvage"); } + public static boolean advancedSalvage(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.salvage.advancedsalvage"); + } - public static boolean salvageItemType(Permissible permissible, ItemType salvageItemType) { return permissible.hasPermission("mcmmo.ability.salvage." + salvageItemType.toString().toLowerCase() + "salvage"); } - public static boolean salvageMaterialType(Permissible permissible, MaterialType salvageMaterialType) { return permissible.hasPermission("mcmmo.ability.salvage." + salvageMaterialType.toString().toLowerCase() + "salvage"); } + public static boolean arcaneSalvage(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.salvage.arcanesalvage"); + } + + public static boolean salvageItemType(Permissible permissible, ItemType salvageItemType) { + return permissible.hasPermission("mcmmo.ability.salvage." + salvageItemType.toString().toLowerCase() + "salvage"); + } + + public static boolean salvageMaterialType(Permissible permissible, MaterialType salvageMaterialType) { + return permissible.hasPermission("mcmmo.ability.salvage." + salvageMaterialType.toString().toLowerCase() + "salvage"); + } /* SMELTING */ - public static boolean fluxMining(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.smelting.fluxmining"); } - public static boolean fuelEfficiency(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.smelting.fuelefficiency"); } + public static boolean fluxMining(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.smelting.fluxmining"); + } + + public static boolean fuelEfficiency(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.smelting.fuelefficiency"); + } /* SWORDS */ - public static boolean serratedStrikes(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.swords.serratedstrikes"); } + public static boolean serratedStrikes(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.swords.serratedstrikes"); + } /* TAMING */ - public static 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"); } + public static 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) { return permissible.hasPermission("mcmmo.ability.unarmed.berserk"); } + public static boolean berserk(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.unarmed.berserk"); + } /* WOODCUTTING */ - public static boolean treeFeller(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.woodcutting.treefeller"); } + public static boolean treeFeller(Permissible permissible) { + return permissible.hasPermission("mcmmo.ability.woodcutting.treefeller"); + } /* * PARTY */ - public static boolean partySizeBypass(Permissible permissible) { return permissible.hasPermission("mcmmo.bypass.partylimit" ); } - public static boolean party(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.party"); } - public static boolean partySubcommand(Permissible permissible, PartySubcommandType subcommand) { return permissible.hasPermission("mcmmo.commands.party." + subcommand.toString().toLowerCase()); } - public static boolean friendlyFire(Permissible permissible) { return permissible.hasPermission("mcmmo.party.friendlyfire"); } + public static boolean partySizeBypass(Permissible permissible) { + return permissible.hasPermission("mcmmo.bypass.partylimit"); + } + + public static boolean party(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.party"); + } + + public static boolean partySubcommand(Permissible permissible, PartySubcommandType subcommand) { + return permissible.hasPermission("mcmmo.commands.party." + subcommand.toString().toLowerCase()); + } + + public static boolean friendlyFire(Permissible permissible) { + return permissible.hasPermission("mcmmo.party.friendlyfire"); + } /* TELEPORT */ - public static boolean partyTeleportSend(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.send"); } - public static boolean partyTeleportAccept(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.accept"); } - public static boolean partyTeleportAcceptAll(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.acceptall"); } - public static boolean partyTeleportToggle(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.toggle"); } + public static boolean partyTeleportSend(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.ptp.send"); + } - public static boolean partyTeleportAllWorlds(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.ptp.world.all"); } - public static boolean partyTeleportWorld(Permissible permissible, World world) { return permissible.hasPermission("mcmmo.commands.ptp.world." + world.getName()); } + public static boolean partyTeleportAccept(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.ptp.accept"); + } + + public static boolean partyTeleportAcceptAll(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.ptp.acceptall"); + } + + public static boolean partyTeleportToggle(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.ptp.toggle"); + } + + public static boolean partyTeleportAllWorlds(Permissible permissible) { + return permissible.hasPermission("mcmmo.commands.ptp.world.all"); + } + + public static boolean partyTeleportWorld(Permissible permissible, World world) { + return permissible.hasPermission("mcmmo.commands.ptp.world." + world.getName()); + } public static void generateWorldTeleportPermissions() { Server server = mcMMO.p.getServer(); diff --git a/core/src/main/java/com/gmail/nossr50/core/util/StringUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/StringUtils.java index f744ffb37..e4234f181 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/StringUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/StringUtils.java @@ -12,8 +12,7 @@ public class StringUtils { /** * Gets a capitalized version of the target string. * - * @param target - * String to capitalize + * @param target String to capitalize * @return the capitalized string */ public static String getCapitalized(String target) { @@ -31,7 +30,7 @@ public class StringUtils { public static String getPrettyAbilityString(SuperAbilityType ability) { return createPrettyString(ability.toString()); } - + public static String getWildcardConfigBlockDataString(BlockData data) { return getWildcardConfigMaterialString(data.getMaterial()); } @@ -41,7 +40,7 @@ public class StringUtils { } public static String getFriendlyConfigBlockDataString(BlockData data) { - switch(data.getMaterial()){ + switch (data.getMaterial()) { case Material.CHORUS_FLOWER: case Material.COCOA: case Material.WHEAT: @@ -98,8 +97,7 @@ public class StringUtils { /** * Determine if a string represents an Integer * - * @param string - * String to check + * @param string String to check * @return true if the string is an Integer, false otherwise */ public static boolean isInt(String string) { @@ -114,8 +112,7 @@ public class StringUtils { /** * Determine if a string represents a Double * - * @param string - * String to check + * @param string String to check * @return true if the string is a Double, false otherwise */ public static boolean isDouble(String string) { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java b/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java index c27f78ee0..5c504dc8b 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/TextComponentFactory.java @@ -5,15 +5,14 @@ import com.gmail.nossr50.core.config.skills.RankConfig; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.json.McMMOUrl; import com.gmail.nossr50.core.datatypes.json.McMMOWebLinks; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.core.util.skills.RankUtils; import com.gmail.nossr50.listeners.InteractionManager; -import com.gmail.nossr50.core.locale.LocaleLoader; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.ChatMessageType; -import net.md_5.bungee.api.chat.*; import org.bukkit.entity.Player; import java.util.ArrayList; @@ -26,38 +25,34 @@ public class TextComponentFactory { /** * Makes a text component using strings from a locale and supports passing an undefined number of variables to the LocaleLoader - * @param localeKey target locale string address + * + * @param localeKey target locale string address * @param notificationType type of notification - * @param values vars to be passed to the locale loader + * @param values vars to be passed to the locale loader * @return */ - public static TextComponent getNotificationMultipleValues(String localeKey, NotificationType notificationType, String... values) - { + public static TextComponent getNotificationMultipleValues(String localeKey, NotificationType notificationType, String... values) { String preColoredString = LocaleLoader.getString(localeKey, (Object[]) values); TextComponent msg = new TextComponent(preColoredString); return new TextComponent(msg); } - public static TextComponent getNotificationTextComponentFromLocale(String localeKey, NotificationType notificationType) - { + public static TextComponent getNotificationTextComponentFromLocale(String localeKey, NotificationType notificationType) { return getNotificationTextComponent(LocaleLoader.getString(localeKey)); } - public static TextComponent getNotificationLevelUpTextComponent(PrimarySkillType skill, int levelsGained, int currentLevel) - { - TextComponent textComponent = new TextComponent(LocaleLoader.getString("Overhaul.Levelup", LocaleLoader.getString("Overhaul.Name."+StringUtils.getCapitalized(skill.toString())), levelsGained, currentLevel)); + public static TextComponent getNotificationLevelUpTextComponent(PrimarySkillType skill, int levelsGained, int currentLevel) { + TextComponent textComponent = new TextComponent(LocaleLoader.getString("Overhaul.Levelup", LocaleLoader.getString("Overhaul.Name." + StringUtils.getCapitalized(skill.toString())), levelsGained, currentLevel)); return textComponent; } - private static TextComponent getNotificationTextComponent(String text) - { + private static TextComponent getNotificationTextComponent(String text) { //textComponent.setColor(getNotificationColor(notificationType)); return new TextComponent(text); } - public static void sendPlayerSubSkillWikiLink(Player player, String subskillformatted) - { - if(!Config.getInstance().getUrlLinksEnabled()) + public static void sendPlayerSubSkillWikiLink(Player player, String subskillformatted) { + if (!Config.getInstance().getUrlLinksEnabled()) return; Player.Spigot spigotPlayer = player.spigot(); @@ -65,7 +60,7 @@ public class TextComponentFactory { TextComponent wikiLinkComponent = new TextComponent(LocaleLoader.getString("Overhaul.mcMMO.MmoInfo.Wiki")); wikiLinkComponent.setUnderlined(true); - String wikiUrl = "https://mcmmo.org/wiki/"+subskillformatted; + String wikiUrl = "https://mcmmo.org/wiki/" + subskillformatted; wikiLinkComponent.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, wikiUrl)); @@ -81,7 +76,7 @@ public class TextComponentFactory { TextComponent prefix = new TextComponent(LocaleLoader.getString("Overhaul.mcMMO.Url.Wrap.Prefix") + " "); /*prefix.setColor(ChatColor.DARK_AQUA);*/ - TextComponent suffix = new TextComponent(" "+LocaleLoader.getString("Overhaul.mcMMO.Url.Wrap.Suffix")); + TextComponent suffix = new TextComponent(" " + LocaleLoader.getString("Overhaul.mcMMO.Url.Wrap.Suffix")); /*suffix.setColor(ChatColor.DARK_AQUA);*/ TextComponent emptySpace = new TextComponent(" "); @@ -103,8 +98,7 @@ public class TextComponentFactory { spigotPlayer.sendMessage(baseComponents); } - public static void sendPlayerSubSkillList(Player player, List textComponents) - { + public static void sendPlayerSubSkillList(Player player, List textComponents) { TextComponent emptySpace = new TextComponent(" "); ArrayList bulkMessage = new ArrayList<>(); @@ -112,8 +106,7 @@ public class TextComponentFactory { for (TextComponent textComponent : textComponents) { //Don't send more than 3 subskills per line to avoid MOST wordwrap problems - if(newLineCount > 2) - { + if (newLineCount > 2) { TextComponent[] bulkArray = new TextComponent[bulkMessage.size()]; bulkArray = bulkMessage.toArray(bulkArray); @@ -127,10 +120,10 @@ public class TextComponentFactory { TextComponent stylizedText = new TextComponent(LocaleLoader.getString("JSON.Hover.AtSymbolSkills")); addChild(stylizedText, originalTxt); - if(textComponent.getHoverEvent() != null) + if (textComponent.getHoverEvent() != null) stylizedText.setHoverEvent(textComponent.getHoverEvent()); - if(textComponent.getClickEvent() != null) + if (textComponent.getClickEvent() != null) stylizedText.setClickEvent(textComponent.getClickEvent()); bulkMessage.add(stylizedText); @@ -148,12 +141,10 @@ public class TextComponentFactory { player.spigot().sendMessage(bulkArray); } - private static TextComponent getWebLinkTextComponent(McMMOWebLinks webLinks) - { + private static TextComponent getWebLinkTextComponent(McMMOWebLinks webLinks) { TextComponent webTextComponent; - switch(webLinks) - { + switch (webLinks) { case WEBSITE: webTextComponent = new TextComponent(LocaleLoader.getString("JSON.Hover.AtSymbolURL")); addChild(webTextComponent, "Web"); @@ -200,12 +191,10 @@ public class TextComponentFactory { webTextComponent.addExtra(childComponent); } - private static BaseComponent[] getUrlHoverEvent(McMMOWebLinks webLinks) - { + private static BaseComponent[] getUrlHoverEvent(McMMOWebLinks webLinks) { ComponentBuilder componentBuilder = new ComponentBuilder(webLinks.getNiceTitle()); - switch(webLinks) - { + switch (webLinks) { case WEBSITE: addUrlHeaderHover(webLinks, componentBuilder); componentBuilder.append("\n\n").italic(false); @@ -254,13 +243,11 @@ public class TextComponentFactory { componentBuilder.append(webLinks.getUrl()).color(ChatColor.GRAY).italic(true); } - private static ClickEvent getUrlClickEvent(String url) - { + private static ClickEvent getUrlClickEvent(String url) { return new ClickEvent(ClickEvent.Action.OPEN_URL, url); } - private static TextComponent getSubSkillTextComponent(Player player, SubSkillType subSkillType) - { + private static TextComponent getSubSkillTextComponent(Player player, SubSkillType subSkillType) { //Get skill name String skillName = subSkillType.getLocaleName(); @@ -281,8 +268,7 @@ public class TextComponentFactory { textComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, baseComponent)); } - private static TextComponent getSubSkillTextComponent(Player player, AbstractSubSkill abstractSubSkill) - { + private static TextComponent getSubSkillTextComponent(Player player, AbstractSubSkill abstractSubSkill) { //String key = abstractSubSkill.getConfigKeyName(); String skillName = abstractSubSkill.getNiceName(); @@ -321,47 +307,44 @@ public class TextComponentFactory { return textComponent; } - private static BaseComponent[] getSubSkillHoverComponent(Player player, AbstractSubSkill abstractSubSkill) - { + private static BaseComponent[] getSubSkillHoverComponent(Player player, AbstractSubSkill abstractSubSkill) { return getSubSkillHoverEventJSON(abstractSubSkill, player); } - private static BaseComponent[] getSubSkillHoverComponent(Player player, SubSkillType subSkillType) - { + private static BaseComponent[] getSubSkillHoverComponent(Player player, SubSkillType subSkillType) { return getSubSkillHoverEventJSON(subSkillType, player); } /** * Used for the skill in the new skill system (Deriving from AbstractSubSkill) + * * @param abstractSubSkill this subskill - * @param player the player who owns this subskill + * @param player the player who owns this subskill * @return the hover basecomponent object for this subskill */ - private static BaseComponent[] getSubSkillHoverEventJSON(AbstractSubSkill abstractSubSkill, Player player) - { + private static BaseComponent[] getSubSkillHoverEventJSON(AbstractSubSkill abstractSubSkill, Player player) { String skillName = abstractSubSkill.getNiceName(); /* * Hover Event BaseComponent color table */ - ChatColor ccSubSkillHeader = ChatColor.GOLD; - ChatColor ccRank = ChatColor.BLUE; - ChatColor ccCurRank = ChatColor.GREEN; - ChatColor ccPossessive = ChatColor.WHITE; - ChatColor ccNumRanks = ccCurRank; + ChatColor ccSubSkillHeader = ChatColor.GOLD; + ChatColor ccRank = ChatColor.BLUE; + ChatColor ccCurRank = ChatColor.GREEN; + ChatColor ccPossessive = ChatColor.WHITE; + ChatColor ccNumRanks = ccCurRank; //ChatColor ccDescriptionHeader = ChatColor.DARK_PURPLE; //ChatColor ccDescription = ChatColor.WHITE; - ChatColor ccLocked = ChatColor.DARK_GRAY; - ChatColor ccLevelRequirement = ChatColor.BLUE; - ChatColor ccLevelRequired = ChatColor.RED; + ChatColor ccLocked = ChatColor.DARK_GRAY; + ChatColor ccLevelRequirement = ChatColor.BLUE; + ChatColor ccLevelRequired = ChatColor.RED; SubSkillType subSkillType = abstractSubSkill.getSubSkillType(); //SubSkillType Name ComponentBuilder componentBuilder = setupSkillComponentNameStyle(player, skillName, subSkillType, RankUtils.hasUnlockedSubskill(player, abstractSubSkill)); - if(!RankUtils.hasUnlockedSubskill(player, abstractSubSkill)) - { + if (!RankUtils.hasUnlockedSubskill(player, abstractSubSkill)) { //Skill is not unlocked yet addLocked(abstractSubSkill, ccLocked, ccLevelRequirement, ccLevelRequired, componentBuilder); } else { @@ -371,9 +354,8 @@ public class TextComponentFactory { int curRank = RankUtils.getRank(player, abstractSubSkill); int nextRank = 0; - if(curRank < abstractSubSkill.getNumRanks() && abstractSubSkill.getNumRanks() > 0) - { - nextRank = RankUtils.getRankUnlockLevel(abstractSubSkill, curRank+1); + if (curRank < abstractSubSkill.getNumRanks() && abstractSubSkill.getNumRanks() > 0) { + nextRank = RankUtils.getRankUnlockLevel(abstractSubSkill, curRank + 1); } addRanked(ccRank, ccCurRank, ccPossessive, ccNumRanks, componentBuilder, abstractSubSkill.getNumRanks(), RankUtils.getRank(player, abstractSubSkill), nextRank); @@ -418,7 +400,7 @@ public class TextComponentFactory { .bold(false).italic(false).strikethrough(false).underlined(false); //Next Rank: x - if(nextRank > rank) + if (nextRank > rank) componentBuilder.append(LocaleLoader.getString("JSON.Hover.NextRank", String.valueOf(nextRank))).append("\n") .bold(false).italic(false).strikethrough(false).underlined(false); @@ -446,43 +428,39 @@ public class TextComponentFactory { } @Deprecated - private static BaseComponent[] getSubSkillHoverEventJSON(SubSkillType subSkillType, Player player) - { + private static BaseComponent[] getSubSkillHoverEventJSON(SubSkillType subSkillType, Player player) { String skillName = subSkillType.getLocaleName(); /* * Hover Event BaseComponent color table */ - ChatColor ccSubSkillHeader = ChatColor.GOLD; - ChatColor ccRank = ChatColor.BLUE; - ChatColor ccCurRank = ChatColor.GREEN; - ChatColor ccPossessive = ChatColor.WHITE; - ChatColor ccNumRanks = ccCurRank; - ChatColor ccDescriptionHeader = ChatColor.DARK_PURPLE; - ChatColor ccDescription = ChatColor.DARK_GRAY; - ChatColor ccLocked = ChatColor.DARK_GRAY; - ChatColor ccLevelRequirement = ChatColor.BLUE; - ChatColor ccLevelRequired = ChatColor.RED; + ChatColor ccSubSkillHeader = ChatColor.GOLD; + ChatColor ccRank = ChatColor.BLUE; + ChatColor ccCurRank = ChatColor.GREEN; + ChatColor ccPossessive = ChatColor.WHITE; + ChatColor ccNumRanks = ccCurRank; + ChatColor ccDescriptionHeader = ChatColor.DARK_PURPLE; + ChatColor ccDescription = ChatColor.DARK_GRAY; + ChatColor ccLocked = ChatColor.DARK_GRAY; + ChatColor ccLevelRequirement = ChatColor.BLUE; + ChatColor ccLevelRequired = ChatColor.RED; //SubSkillType Name ComponentBuilder componentBuilder = setupSkillComponentNameStyle(player, skillName, subSkillType, RankUtils.hasUnlockedSubskill(player, subSkillType)); - if(!RankUtils.hasUnlockedSubskill(player, subSkillType)) - { + if (!RankUtils.hasUnlockedSubskill(player, subSkillType)) { //Skill is not unlocked yet addLocked(subSkillType, ccLocked, ccLevelRequirement, ccLevelRequired, componentBuilder); } else { //addSubSkillTypeToHoverEventJSON(subSkillType, componentBuilder); //RANK - if(subSkillType.getNumRanks() > 0) - { + if (subSkillType.getNumRanks() > 0) { int curRank = RankUtils.getRank(player, subSkillType); int nextRank = 0; - if(curRank < subSkillType.getNumRanks() && subSkillType.getNumRanks() > 0) - { - nextRank = RankUtils.getRankUnlockLevel(subSkillType, curRank+1); + if (curRank < subSkillType.getNumRanks() && subSkillType.getNumRanks() > 0) { + nextRank = RankUtils.getRankUnlockLevel(subSkillType, curRank + 1); } addRanked(ccRank, ccCurRank, ccPossessive, ccNumRanks, componentBuilder, subSkillType.getNumRanks(), RankUtils.getRank(player, subSkillType), nextRank); @@ -500,14 +478,11 @@ public class TextComponentFactory { return componentBuilder.create(); } - private static void addSubSkillTypeToHoverEventJSON(AbstractSubSkill abstractSubSkill, ComponentBuilder componentBuilder) - { - if(abstractSubSkill.isSuperAbility()) - { + private static void addSubSkillTypeToHoverEventJSON(AbstractSubSkill abstractSubSkill, ComponentBuilder componentBuilder) { + if (abstractSubSkill.isSuperAbility()) { componentBuilder.append(LocaleLoader.getString("JSON.Type.SuperAbility")).color(ChatColor.LIGHT_PURPLE); componentBuilder.bold(true); - } else if(abstractSubSkill.isActiveUse()) - { + } else if (abstractSubSkill.isActiveUse()) { componentBuilder.append(LocaleLoader.getString("JSON.Type.Active")).color(ChatColor.DARK_RED); componentBuilder.bold(true); } else { @@ -519,35 +494,29 @@ public class TextComponentFactory { } public static void getSubSkillTextComponents(Player player, List textComponents, PrimarySkillType parentSkill) { - for(SubSkillType subSkillType : SubSkillType.values()) - { - if(subSkillType.getParentSkill() == parentSkill) - { - if(Permissions.isSubSkillEnabled(player, subSkillType)) - { - if(!InteractionManager.hasSubSkill(subSkillType)) + for (SubSkillType subSkillType : SubSkillType.values()) { + if (subSkillType.getParentSkill() == parentSkill) { + if (Permissions.isSubSkillEnabled(player, subSkillType)) { + if (!InteractionManager.hasSubSkill(subSkillType)) textComponents.add(TextComponentFactory.getSubSkillTextComponent(player, subSkillType)); } } } /* NEW SKILL SYSTEM */ - for(AbstractSubSkill abstractSubSkill : InteractionManager.getSubSkillList()) - { - if(abstractSubSkill.getPrimarySkill() == parentSkill) - { - if(Permissions.isSubSkillEnabled(player, abstractSubSkill)) + for (AbstractSubSkill abstractSubSkill : InteractionManager.getSubSkillList()) { + if (abstractSubSkill.getPrimarySkill() == parentSkill) { + if (Permissions.isSubSkillEnabled(player, abstractSubSkill)) textComponents.add(TextComponentFactory.getSubSkillTextComponent(player, abstractSubSkill)); } } } - public static TextComponent getSubSkillUnlockedNotificationComponents(Player player, SubSkillType subSkillType) - { + public static TextComponent getSubSkillUnlockedNotificationComponents(Player player, SubSkillType subSkillType) { TextComponent unlockMessage = new TextComponent(""); unlockMessage.setText(LocaleLoader.getString("JSON.SkillUnlockMessage", subSkillType.getLocaleName(), RankUtils.getRank(player, subSkillType))); unlockMessage.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, getSubSkillHoverComponent(player, subSkillType))); - unlockMessage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/"+subSkillType.getParentSkill().toString().toLowerCase())); + unlockMessage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + subSkillType.getParentSkill().toString().toLowerCase())); return unlockMessage; } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/adapter/BiomeAdapter.java b/core/src/main/java/com/gmail/nossr50/core/util/adapter/BiomeAdapter.java index 6070e7e42..f36fb1a69 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/adapter/BiomeAdapter.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/adapter/BiomeAdapter.java @@ -7,7 +7,7 @@ import java.util.*; public class BiomeAdapter { public static final Set WATER_BIOMES; public static final Set ICE_BIOMES; - + static { List allBiomes = Arrays.asList(Biome.values()); List waterBiomes = new ArrayList(); @@ -26,6 +26,7 @@ public class BiomeAdapter { private static boolean isWater(String name) { return name.contains("RIVER") || name.contains("OCEAN"); } + private static boolean isCold(String name) { return (name.contains("COLD") || name.contains("ICE") || name.contains("FROZEN") || name.contains("TAIGA")) && !(name.contains("WARM")); } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java index dc5401584..53cf6cb45 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandRegistrationManager.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.core.util.commands; -import com.gmail.nossr50.commands.*; import com.gmail.nossr50.commands.chat.AdminChatCommand; import com.gmail.nossr50.commands.chat.McChatSpy; import com.gmail.nossr50.commands.chat.PartyChatCommand; @@ -15,23 +14,24 @@ import com.gmail.nossr50.commands.hardcore.HardcoreCommand; import com.gmail.nossr50.commands.hardcore.VampirismCommand; import com.gmail.nossr50.commands.party.PartyCommand; import com.gmail.nossr50.commands.party.teleport.PtpCommand; -import com.gmail.nossr50.commands.player.*; -import com.gmail.nossr50.commands.skills.*; import com.gmail.nossr50.core.config.skills.Config; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.StringUtils; +import com.gmail.nossr50.mcMMO; import org.bukkit.command.PluginCommand; import java.util.ArrayList; import java.util.List; public final class CommandRegistrationManager { - private CommandRegistrationManager() {}; - private static String permissionsMessage = LocaleLoader.getString("mcMMO.NoPermission"); + ; + + private CommandRegistrationManager() { + } + private static void registerSkillCommands() { for (PrimarySkillType skill : PrimarySkillType.values()) { String commandName = skill.toString().toLowerCase(); @@ -326,9 +326,9 @@ public final class CommandRegistrationManager { PluginCommand command = mcMMO.p.getCommand("party"); command.setDescription(LocaleLoader.getString("Commands.Description.party")); command.setPermission("mcmmo.commands.party;mcmmo.commands.party.accept;mcmmo.commands.party.create;mcmmo.commands.party.disband;" + - "mcmmo.commands.party.xpshare;mcmmo.commands.party.invite;mcmmo.commands.party.itemshare;mcmmo.commands.party.join;" + - "mcmmo.commands.party.kick;mcmmo.commands.party.lock;mcmmo.commands.party.owner;mcmmo.commands.party.password;" + - "mcmmo.commands.party.quit;mcmmo.commands.party.rename;mcmmo.commands.party.unlock"); + "mcmmo.commands.party.xpshare;mcmmo.commands.party.invite;mcmmo.commands.party.itemshare;mcmmo.commands.party.join;" + + "mcmmo.commands.party.kick;mcmmo.commands.party.lock;mcmmo.commands.party.owner;mcmmo.commands.party.password;" + + "mcmmo.commands.party.quit;mcmmo.commands.party.rename;mcmmo.commands.party.unlock"); command.setPermissionMessage(permissionsMessage); command.setExecutor(new PartyCommand()); } @@ -371,7 +371,7 @@ public final class CommandRegistrationManager { command.setUsage(LocaleLoader.getString("Commands.Usage.0", "mcnotify")); command.setExecutor(new McnotifyCommand()); } - + private static void registerMHDCommand() { PluginCommand command = mcMMO.p.getCommand("mhd"); command.setDescription("Resets all mob health bar settings for all players to the default"); //TODO: Localize diff --git a/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java index 7b923a893..e80487891 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/commands/CommandUtils.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.core.util.commands; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.Misc; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.util.StringUtils; -import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.util.skills.SkillUtils; +import com.gmail.nossr50.mcMMO; import com.google.common.collect.ImmutableList; import org.bukkit.OfflinePlayer; import org.bukkit.command.CommandSender; @@ -22,7 +22,8 @@ public final class CommandUtils { public static final List TRUE_FALSE_OPTIONS = ImmutableList.of("on", "off", "true", "false", "enabled", "disabled"); public static final List RESET_OPTIONS = ImmutableList.of("clear", "reset"); - private CommandUtils() {} + private CommandUtils() { + } public static boolean isChildSkill(CommandSender sender, PrimarySkillType skill) { if (skill == null || !skill.isChildSkill()) { @@ -80,10 +81,9 @@ public final class CommandUtils { /** * Checks if there is a valid mcMMOPlayer object. * - * @param sender CommandSender who used the command - * @param playerName name of the target player + * @param sender CommandSender who used the command + * @param playerName name of the target player * @param mcMMOPlayer mcMMOPlayer object of the target player - * * @return true if the player is online and a valid mcMMOPlayer object was found */ public static boolean checkPlayerExistence(CommandSender sender, String playerName, McMMOPlayer mcMMOPlayer) { @@ -258,7 +258,6 @@ public final class CommandUtils { * Get a matched player name if one was found in the database. * * @param partialName Name to match - * * @return Matched name or {@code partialName} if no match was found */ public static String getMatchedPlayerName(String partialName) { @@ -268,8 +267,7 @@ public final class CommandUtils { if (matches.size() == 1) { partialName = matches.get(0); } - } - else { + } else { Player player = mcMMO.p.getServer().getPlayer(partialName); if (player != null) { @@ -282,7 +280,7 @@ public final class CommandUtils { /** * Attempts to match any player names with the given name, and returns a list of all possibly matches. - * + *

* This list is not sorted in any particular order. * If an exact match is found, the returned list will only contain a single result. * @@ -294,10 +292,10 @@ public final class CommandUtils { for (OfflinePlayer offlinePlayer : mcMMO.p.getServer().getOfflinePlayers()) { String playerName = offlinePlayer.getName(); - + if (playerName == null) { //Do null checking here to detect corrupted data before sending it throuogh .equals - System.err.println("[McMMO] Player data file with UIID " + offlinePlayer.getUniqueId() + " is missing a player name. This may be a legacy file from before bukkit.lastKnownName. This should be okay to ignore."); - continue; //Don't let an error here interrupt the loop + System.err.println("[McMMO] Player data file with UIID " + offlinePlayer.getUniqueId() + " is missing a player name. This may be a legacy file from before bukkit.lastKnownName. This should be okay to ignore."); + continue; //Don't let an error here interrupt the loop } if (partialName.equalsIgnoreCase(playerName)) { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarManager.java b/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarManager.java index 86744195d..85cf33a46 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarManager.java @@ -2,8 +2,8 @@ package com.gmail.nossr50.core.util.experience; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.runnables.skills.ExperienceBarHideTask; +import com.gmail.nossr50.core.skills.PrimarySkillType; import org.bukkit.plugin.Plugin; import java.util.HashMap; @@ -13,13 +13,11 @@ import java.util.HashMap; * Each ExperienceBarManager only manages a single player */ public class ExperienceBarManager { - private McMMOPlayer mcMMOPlayer; - HashMap experienceBars; HashMap experienceBarHideTaskHashMap; + private McMMOPlayer mcMMOPlayer; - public ExperienceBarManager(McMMOPlayer mcMMOPlayer) - { + public ExperienceBarManager(McMMOPlayer mcMMOPlayer) { //Init map experienceBars = new HashMap<>(); experienceBarHideTaskHashMap = new HashMap<>(); @@ -27,13 +25,12 @@ public class ExperienceBarManager { this.mcMMOPlayer = mcMMOPlayer; } - public void updateExperienceBar(PrimarySkillType primarySkillType, Plugin plugin) - { - if(!ExperienceConfig.getInstance().isExperienceBarsEnabled() || !ExperienceConfig.getInstance().isExperienceBarEnabled(primarySkillType)) + public void updateExperienceBar(PrimarySkillType primarySkillType, Plugin plugin) { + if (!ExperienceConfig.getInstance().isExperienceBarsEnabled() || !ExperienceConfig.getInstance().isExperienceBarEnabled(primarySkillType)) return; //Init Bar - if(experienceBars.get(primarySkillType) == null) + if (experienceBars.get(primarySkillType) == null) experienceBars.put(primarySkillType, new ExperienceBarWrapper(primarySkillType, mcMMOPlayer)); //Get Bar @@ -46,8 +43,7 @@ public class ExperienceBarManager { experienceBarWrapper.showExperienceBar(); //Setup Hide Bar Task - if(experienceBarHideTaskHashMap.get(primarySkillType) != null) - { + if (experienceBarHideTaskHashMap.get(primarySkillType) != null) { experienceBarHideTaskHashMap.get(primarySkillType).cancel(); scheduleHideTask(primarySkillType, plugin); } else { @@ -57,17 +53,15 @@ public class ExperienceBarManager { private void scheduleHideTask(PrimarySkillType primarySkillType, Plugin plugin) { ExperienceBarHideTask experienceBarHideTask = new ExperienceBarHideTask(this, mcMMOPlayer, primarySkillType); - experienceBarHideTask.runTaskLater(plugin, 20*2); + experienceBarHideTask.runTaskLater(plugin, 20 * 2); experienceBarHideTaskHashMap.put(primarySkillType, experienceBarHideTask); } - public void hideExperienceBar(PrimarySkillType primarySkillType) - { + public void hideExperienceBar(PrimarySkillType primarySkillType) { experienceBars.get(primarySkillType).hideExperienceBar(); } - public void clearTask(PrimarySkillType primarySkillType) - { + public void clearTask(PrimarySkillType primarySkillType) { experienceBarHideTaskHashMap.remove(primarySkillType); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarWrapper.java b/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarWrapper.java index 24ae7d5d0..f3acec350 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarWrapper.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/experience/ExperienceBarWrapper.java @@ -2,8 +2,8 @@ package com.gmail.nossr50.core.util.experience; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.locale.LocaleLoader; +import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.util.StringUtils; import org.bukkit.Server; import org.bukkit.boss.BarColor; @@ -18,20 +18,18 @@ import java.util.List; */ public class ExperienceBarWrapper { - private final PrimarySkillType primarySkillType; //Primary Skill - private BossBar bossBar; - private final Server server; protected final McMMOPlayer mcMMOPlayer; - private int lastLevelUpdated; - + private final PrimarySkillType primarySkillType; //Primary Skill + private final Server server; /* * This is stored to help optimize updating the title */ protected String niceSkillName; protected String title; + private BossBar bossBar; + private int lastLevelUpdated; - public ExperienceBarWrapper(PrimarySkillType primarySkillType, McMMOPlayer mcMMOPlayer) - { + public ExperienceBarWrapper(PrimarySkillType primarySkillType, McMMOPlayer mcMMOPlayer) { this.mcMMOPlayer = mcMMOPlayer; this.server = mcMMOPlayer.getPlayer().getServer(); //Might not be good for bungee to do this this.primarySkillType = primarySkillType; @@ -45,8 +43,7 @@ public class ExperienceBarWrapper { initBar(); } - private void initBar() - { + private void initBar() { title = getTitleTemplate(); createBossBar(); } @@ -58,19 +55,31 @@ public class ExperienceBarWrapper { private String getTitleTemplate() { //If they are using extra details - if(ExperienceConfig.getInstance().getAddExtraDetails()) - return LocaleLoader.getString("XPBar.Complex.Template", LocaleLoader.getString("XPBar."+niceSkillName, getLevel()), getCurrentXP(), getMaxXP(), getPowerLevel(), getPercentageOfLevel()); + if (ExperienceConfig.getInstance().getAddExtraDetails()) + return LocaleLoader.getString("XPBar.Complex.Template", LocaleLoader.getString("XPBar." + niceSkillName, getLevel()), getCurrentXP(), getMaxXP(), getPowerLevel(), getPercentageOfLevel()); - return LocaleLoader.getString("XPBar."+niceSkillName, getLevel(), getCurrentXP(), getMaxXP(), getPowerLevel(), getPercentageOfLevel()); + return LocaleLoader.getString("XPBar." + niceSkillName, getLevel(), getCurrentXP(), getMaxXP(), getPowerLevel(), getPercentageOfLevel()); } private int getLevel() { return mcMMOPlayer.getSkillLevel(primarySkillType); } - private int getCurrentXP() { return mcMMOPlayer.getSkillXpLevel(primarySkillType); } - private int getMaxXP() { return mcMMOPlayer.getXpToLevel(primarySkillType); } - private int getPowerLevel() { return mcMMOPlayer.getPowerLevel(); } - private int getPercentageOfLevel() { return (int) (mcMMOPlayer.getProgressInCurrentSkillLevel(primarySkillType) * 100); } + + private int getCurrentXP() { + return mcMMOPlayer.getSkillXpLevel(primarySkillType); + } + + private int getMaxXP() { + return mcMMOPlayer.getXpToLevel(primarySkillType); + } + + private int getPowerLevel() { + return mcMMOPlayer.getPowerLevel(); + } + + private int getPercentageOfLevel() { + return (int) (mcMMOPlayer.getProgressInCurrentSkillLevel(primarySkillType) * 100); + } public String getTitle() { return bossBar.getTitle(); @@ -96,28 +105,27 @@ public class ExperienceBarWrapper { bossBar.setStyle(barStyle); } + public double getProgress() { + return bossBar.getProgress(); + } + public void setProgress(double v) { //Clamp Values - if(v < 0) + if (v < 0) bossBar.setProgress(0.0D); - else if(v > 1) + else if (v > 1) bossBar.setProgress(1.0D); else bossBar.setProgress(v); //Every time progress updates we need to check for a title update - if(getLevel() != lastLevelUpdated || ExperienceConfig.getInstance().getDoExperienceBarsAlwaysUpdateTitle()) - { + if (getLevel() != lastLevelUpdated || ExperienceConfig.getInstance().getDoExperienceBarsAlwaysUpdateTitle()) { updateTitle(); lastLevelUpdated = getLevel(); } } - public double getProgress() { - return bossBar.getProgress(); - } - public List getPlayers() { return bossBar.getPlayers(); } @@ -126,13 +134,11 @@ public class ExperienceBarWrapper { return bossBar.isVisible(); } - public void hideExperienceBar() - { + public void hideExperienceBar() { bossBar.setVisible(false); } - public void showExperienceBar() - { + public void showExperienceBar() { bossBar.setVisible(true); } @@ -141,8 +147,7 @@ public class ExperienceBarWrapper { return bossBar }*/ - private void createBossBar() - { + private void createBossBar() { bossBar = mcMMOPlayer.getPlayer().getServer().createBossBar(title, ExperienceConfig.getInstance().getExperienceBarColor(primarySkillType), ExperienceConfig.getInstance().getExperienceBarStyle(primarySkillType)); bossBar.addPlayer(mcMMOPlayer.getPlayer()); } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java b/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java index 7e9f0c099..93ddec6d2 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/experience/FormulaManager.java @@ -1,7 +1,7 @@ package com.gmail.nossr50.core.util.experience; -import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.datatypes.experience.FormulaType; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; @@ -52,7 +52,7 @@ public class FormulaManager { * the amount of levels and experience, using the previously * used formula type. * - * @param skillLevel Amount of levels + * @param skillLevel Amount of levels * @param skillXPLevel Amount of experience * @return The total amount of experience */ @@ -73,8 +73,8 @@ public class FormulaManager { * the new formula type. * * @param primarySkillType skill where new levels and experience are calculated for - * @param experience total amount of experience - * @param formulaType The new {@link FormulaType} + * @param experience total amount of experience + * @param formulaType The new {@link FormulaType} * @return the amount of levels and experience */ public int[] calculateNewLevel(PrimarySkillType primarySkillType, int experience, FormulaType formulaType) { @@ -94,7 +94,7 @@ public class FormulaManager { experience -= experienceToNextLevel; } - return new int[]{ newLevel, remainder }; + return new int[]{newLevel, remainder}; } /** @@ -102,7 +102,7 @@ public class FormulaManager { * if cache doesn't contain the given value it is calculated and added * to the cached data. * - * @param level level to check + * @param level level to check * @param formulaType The {@link FormulaType} used * @return amount of experience needed to reach next level */ @@ -126,7 +126,7 @@ public class FormulaManager { switch (formulaType) { case LINEAR: if (!experienceNeededLinear.containsKey(level)) { - experience = (int) Math.floor( xpNeededMultiplier * (base + level * multiplier)); + experience = (int) Math.floor(xpNeededMultiplier * (base + level * multiplier)); experienceNeededLinear.put(level, experience); } @@ -134,7 +134,7 @@ public class FormulaManager { case EXPONENTIAL: if (!experienceNeededExponential.containsKey(level)) { - experience = (int) Math.floor( xpNeededMultiplier * (multiplier * Math.pow(level, exponent) + base)); + experience = (int) Math.floor(xpNeededMultiplier * (multiplier * Math.pow(level, exponent) + base)); experienceNeededExponential.put(level, experience); } @@ -167,8 +167,7 @@ public class FormulaManager { try { formulasFile.save(formulaFile); - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/player/NotificationManager.java b/core/src/main/java/com/gmail/nossr50/core/util/player/NotificationManager.java index 539e42805..21ba5142c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/player/NotificationManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/player/NotificationManager.java @@ -6,10 +6,10 @@ import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.util.Misc; +import com.gmail.nossr50.core.util.TextComponentFactory; import com.gmail.nossr50.core.util.sounds.SoundManager; import com.gmail.nossr50.core.util.sounds.SoundType; import com.gmail.nossr50.events.skills.McMMOPlayerNotificationEvent; -import com.gmail.nossr50.core.util.TextComponentFactory; import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.Bukkit; @@ -22,12 +22,12 @@ public class NotificationManager { /** * Sends players notifications from mcMMO * This does this by sending out an event so other plugins can cancel it - * @param player target player + * + * @param player target player * @param notificationType notifications defined type - * @param key the locale key for the notifications defined message + * @param key the locale key for the notifications defined message */ - public static void sendPlayerInformation(Player player, NotificationType notificationType, String key) - { + public static void sendPlayerInformation(Player player, NotificationType notificationType, String key) { ChatMessageType destination = AdvancedConfig.getInstance().doesNotificationUseActionBar(notificationType) ? ChatMessageType.ACTION_BAR : ChatMessageType.SYSTEM; TextComponent message = TextComponentFactory.getNotificationTextComponentFromLocale(key, notificationType); @@ -40,13 +40,13 @@ public class NotificationManager { * Sends players notifications from mcMMO * This does this by sending out an event so other plugins can cancel it * This event in particular is provided with a source player, and players near the source player are sent the information - * @param source the source player for this event + * + * @param source the source player for this event * @param notificationType type of notification - * @param key Locale Key for the string to use with this event - * @param values values to be injected into the locale string + * @param key Locale Key for the string to use with this event + * @param values values to be injected into the locale string */ - public static void sendNearbyPlayersInformation(Player source, NotificationType notificationType, String key, String... values) - { + public static void sendNearbyPlayersInformation(Player source, NotificationType notificationType, String key, String... values) { Location location = source.getLocation(); for (Player otherPlayer : source.getWorld().getPlayers()) { if (otherPlayer != source && Misc.isNear(location, otherPlayer.getLocation(), Misc.SKILL_MESSAGE_MAX_SENDING_DISTANCE)) { @@ -55,8 +55,7 @@ public class NotificationManager { } } - public static void sendPlayerInformation(Player player, NotificationType notificationType, String key, String... values) - { + public static void sendPlayerInformation(Player player, NotificationType notificationType, String key, String... values) { ChatMessageType destination = AdvancedConfig.getInstance().doesNotificationUseActionBar(notificationType) ? ChatMessageType.ACTION_BAR : ChatMessageType.SYSTEM; @@ -71,12 +70,10 @@ public class NotificationManager { return; //If the message is being sent to the action bar we need to check if the copy if a copy is sent to the chat system - if(customEvent.getChatMessageType() == ChatMessageType.ACTION_BAR) - { + if (customEvent.getChatMessageType() == ChatMessageType.ACTION_BAR) { player.spigot().sendMessage(customEvent.getChatMessageType(), customEvent.getNotificationTextComponent()); - if(customEvent.isMessageAlsoBeingSentToChat()) - { + if (customEvent.isMessageAlsoBeingSentToChat()) { //Send copy to chat system player.spigot().sendMessage(ChatMessageType.SYSTEM, customEvent.getNotificationTextComponent()); } @@ -97,12 +94,12 @@ public class NotificationManager { /** * Handles sending level up notifications to a mcMMOPlayer + * * @param mcMMOPlayer target mcMMOPlayer - * @param skillName skill that leveled up - * @param newLevel new level of that skill + * @param skillName skill that leveled up + * @param newLevel new level of that skill */ - public static void sendPlayerLevelUpNotification(McMMOPlayer mcMMOPlayer, PrimarySkillType skillName, int levelsGained, int newLevel) - { + public static void sendPlayerLevelUpNotification(McMMOPlayer mcMMOPlayer, PrimarySkillType skillName, int levelsGained, int newLevel) { ChatMessageType destination = AdvancedConfig.getInstance().doesNotificationUseActionBar(NotificationType.LEVEL_UP_MESSAGE) ? ChatMessageType.ACTION_BAR : ChatMessageType.SYSTEM; TextComponent levelUpTextComponent = TextComponentFactory.getNotificationLevelUpTextComponent(skillName, levelsGained, newLevel); @@ -111,16 +108,13 @@ public class NotificationManager { sendNotification(mcMMOPlayer.getPlayer(), customEvent); } - public static void broadcastTitle(Server server, String title, String subtitle, int i1, int i2, int i3) - { - for(Player player : server.getOnlinePlayers()) - { + public static void broadcastTitle(Server server, String title, String subtitle, int i1, int i2, int i3) { + for (Player player : server.getOnlinePlayers()) { player.sendTitle(title, subtitle, i1, i2, i3); } } - public static void sendPlayerUnlockNotification(McMMOPlayer mcMMOPlayer, SubSkillType subSkillType) - { + public static void sendPlayerUnlockNotification(McMMOPlayer mcMMOPlayer, SubSkillType subSkillType) { //CHAT MESSAGE mcMMOPlayer.getPlayer().spigot().sendMessage(TextComponentFactory.getSubSkillUnlockedNotificationComponents(mcMMOPlayer.getPlayer(), subSkillType)); diff --git a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceExecution.java b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceExecution.java index 2726bf02b..1aefc0055 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceExecution.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceExecution.java @@ -3,6 +3,7 @@ package com.gmail.nossr50.core.util.random; public interface RandomChanceExecution { /** * Gets the XPos used in the formula for success + * * @return value of x for our success probability graph */ double getXPos(); @@ -10,6 +11,7 @@ public interface RandomChanceExecution { /** * The maximum odds for this RandomChanceExecution * For example, if this value is 10, then 10% odds would be the maximum and would be achieved only when xPos equaled the LinearCurvePeak + * * @return maximum probability odds from 0.00 (no chance of ever happened) to 100.0 (probability can be guaranteed) */ double getProbabilityCap(); diff --git a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkill.java b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkill.java index fee48dc52..b317b0d0c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkill.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkill.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.core.util.random; import com.gmail.nossr50.core.config.skills.AdvancedConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.util.Permissions; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; public class RandomChanceSkill implements RandomChanceExecution { @@ -15,26 +15,24 @@ public class RandomChanceSkill implements RandomChanceExecution { protected final boolean isLucky; private int skillLevel; - public RandomChanceSkill(Player player, SubSkillType subSkillType) - { + public RandomChanceSkill(Player player, SubSkillType subSkillType) { this.primarySkillType = subSkillType.getParentSkill(); this.subSkillType = subSkillType; this.probabilityCap = RandomChanceUtil.LINEAR_CURVE_VAR; - if(player != null) + if (player != null) this.skillLevel = UserManager.getPlayer(player).getSkillLevel(primarySkillType); else this.skillLevel = 0; - if(player != null) + if (player != null) isLucky = Permissions.lucky(player, primarySkillType); else isLucky = false; } - public RandomChanceSkill(Player player, SubSkillType subSkillType, boolean hasCap) - { - if(hasCap) + public RandomChanceSkill(Player player, SubSkillType subSkillType, boolean hasCap) { + if (hasCap) this.probabilityCap = AdvancedConfig.getInstance().getMaximumProbability(subSkillType); else this.probabilityCap = RandomChanceUtil.LINEAR_CURVE_VAR; @@ -42,12 +40,12 @@ public class RandomChanceSkill implements RandomChanceExecution { this.primarySkillType = subSkillType.getParentSkill(); this.subSkillType = subSkillType; - if(player != null) + if (player != null) this.skillLevel = UserManager.getPlayer(player).getSkillLevel(primarySkillType); else this.skillLevel = 0; - if(player != null) + if (player != null) isLucky = Permissions.lucky(player, primarySkillType); else isLucky = false; @@ -55,6 +53,7 @@ public class RandomChanceSkill implements RandomChanceExecution { /** * The subskill corresponding to this RandomChanceSkill + * * @return this subskill */ public SubSkillType getSubSkill() { @@ -63,15 +62,16 @@ public class RandomChanceSkill implements RandomChanceExecution { /** * Gets the skill level of the player who owns this RandomChanceSkill + * * @return the current skill level relating to this RandomChanceSkill */ - public int getSkillLevel() - { + public int getSkillLevel() { return skillLevel; } /** * Modify the skill level used for this skill's RNG calculations + * * @param newSkillLevel new skill level */ public void setSkillLevel(int newSkillLevel) { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkillStatic.java b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkillStatic.java index 97da973ac..8618cc0d1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkillStatic.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceSkillStatic.java @@ -6,8 +6,7 @@ import org.bukkit.entity.Player; public class RandomChanceSkillStatic extends RandomChanceSkill { private final double xPos; - public RandomChanceSkillStatic(double xPos, Player player, SubSkillType subSkillType) - { + public RandomChanceSkillStatic(double xPos, Player player, SubSkillType subSkillType) { super(player, subSkillType); this.xPos = xPos; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceStatic.java b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceStatic.java index 86ff0e059..92af8e823 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceStatic.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceStatic.java @@ -5,8 +5,7 @@ public class RandomChanceStatic implements RandomChanceExecution { private final double probabilityCap; private final boolean isLucky; - public RandomChanceStatic(double xPos, boolean isLucky) - { + public RandomChanceStatic(double xPos, boolean isLucky) { this.xPos = xPos; this.probabilityCap = xPos; this.isLucky = isLucky; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceUtil.java b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceUtil.java index d01b9ff39..bb34e91f8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceUtil.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/random/RandomChanceUtil.java @@ -14,8 +14,7 @@ import org.bukkit.entity.Player; import java.text.DecimalFormat; import java.util.Random; -public class RandomChanceUtil -{ +public class RandomChanceUtil { public static final DecimalFormat percent = new DecimalFormat("##0.00%"); //public static final DecimalFormat decimal = new DecimalFormat("##0.00"); public static final double LINEAR_CURVE_VAR = 100.0D; @@ -26,14 +25,12 @@ public class RandomChanceUtil * non-RNG skills just fire the cancellable event and succeed if they go uncancelled * * @param skillActivationType this value represents what kind of activation procedures this sub-skill uses - * @param subSkillType The identifier for this specific sub-skill - * @param player The owner of this sub-skill + * @param subSkillType The identifier for this specific sub-skill + * @param player The owner of this sub-skill * @return returns true if all conditions are met and they event is not cancelled */ - public static boolean isActivationSuccessful(SkillActivationType skillActivationType, SubSkillType subSkillType, Player player) - { - switch(skillActivationType) - { + public static boolean isActivationSuccessful(SkillActivationType skillActivationType, SubSkillType subSkillType, Player player) { + switch (skillActivationType) { case RANDOM_LINEAR_100_SCALE_WITH_CAP: return checkRandomChanceExecutionSuccess(player, subSkillType, true); case RANDOM_STATIC_CHANCE: @@ -46,10 +43,8 @@ public class RandomChanceUtil } } - public static double getActivationChance(SkillActivationType skillActivationType, SubSkillType subSkillType, Player player) - { - switch(skillActivationType) - { + public static double getActivationChance(SkillActivationType skillActivationType, SubSkillType subSkillType, Player player) { + switch (skillActivationType) { case RANDOM_LINEAR_100_SCALE_WITH_CAP: return getRandomChanceExecutionSuccess(player, subSkillType, true); case RANDOM_STATIC_CHANCE: @@ -61,10 +56,10 @@ public class RandomChanceUtil /** * Checks whether or not the random chance succeeds + * * @return true if the random chance succeeds */ - public static boolean checkRandomChanceExecutionSuccess(Player player, PrimarySkillType primarySkillType, double chance) - { + public static boolean checkRandomChanceExecutionSuccess(Player player, PrimarySkillType primarySkillType, double chance) { //Check the odds chance *= 100; @@ -88,19 +83,18 @@ public class RandomChanceUtil /** * Used for stuff like Excavation, Fishing, etc... + * * @param randomChance * @return */ - public static boolean checkRandomChanceExecutionSuccess(RandomChanceSkillStatic randomChance) - { + public static boolean checkRandomChanceExecutionSuccess(RandomChanceSkillStatic randomChance) { double chanceOfSuccess = calculateChanceOfSuccess(randomChance); //Check the odds return rollDice(chanceOfSuccess, 100); } - public static boolean checkRandomChanceExecutionSuccess(RandomChanceSkill randomChance) - { + public static boolean checkRandomChanceExecutionSuccess(RandomChanceSkill randomChance) { double chanceOfSuccess = calculateChanceOfSuccess(randomChance); Random random = new Random(); @@ -118,6 +112,7 @@ public class RandomChanceUtil /** * Gets the Static Chance for something to activate + * * @param randomChance * @return */ @@ -176,27 +171,23 @@ public class RandomChanceUtil * * @return the chance of success from 0-100 (100 = guaranteed) */ - private static int getChanceOfSuccess(double skillLevel, double maxProbability, double maxLevel) - { + private static int getChanceOfSuccess(double skillLevel, double maxProbability, double maxLevel) { //return (int) (x / (y / LINEAR_CURVE_VAR)); - return (int) (maxProbability * (skillLevel/maxLevel)); + return (int) (maxProbability * (skillLevel / maxLevel)); // max probability * (weight/maxlevel) = chance of success } - private static int getChanceOfSuccess(double x, double y) - { + private static int getChanceOfSuccess(double x, double y) { return (int) (x / (y / LINEAR_CURVE_VAR)); // max probability * (weight/maxlevel) = chance of success } - public static double getRandomChanceExecutionSuccess(Player player, SubSkillType subSkillType, boolean hasCap) - { + public static double getRandomChanceExecutionSuccess(Player player, SubSkillType subSkillType, boolean hasCap) { RandomChanceSkill rcs = new RandomChanceSkill(player, subSkillType, hasCap); return calculateChanceOfSuccess(rcs); } - public static double getRandomStaticChanceExecutionSuccess(Player player, SubSkillType subSkillType) - { + public static double getRandomStaticChanceExecutionSuccess(Player player, SubSkillType subSkillType) { try { return getRandomChanceExecutionChance(new RandomChanceSkillStatic(getStaticRandomChance(subSkillType), player, subSkillType)); } catch (InvalidStaticChance invalidStaticChance) { @@ -207,18 +198,15 @@ public class RandomChanceUtil return 0.1337; //Puts on shades } - public static boolean checkRandomChanceExecutionSuccess(Player player, SubSkillType subSkillType, boolean hasCap) - { + public static boolean checkRandomChanceExecutionSuccess(Player player, SubSkillType subSkillType, boolean hasCap) { return checkRandomChanceExecutionSuccess(new RandomChanceSkill(player, subSkillType, hasCap)); } - public static boolean checkRandomChanceExecutionSuccess(Player player, SubSkillType subSkillType) - { + public static boolean checkRandomChanceExecutionSuccess(Player player, SubSkillType subSkillType) { return checkRandomChanceExecutionSuccess(new RandomChanceSkill(player, subSkillType)); } - public static boolean checkRandomStaticChanceExecutionSuccess(Player player, SubSkillType subSkillType) - { + public static boolean checkRandomStaticChanceExecutionSuccess(Player player, SubSkillType subSkillType) { try { return checkRandomChanceExecutionSuccess(new RandomChanceSkillStatic(getStaticRandomChance(subSkillType), player, subSkillType)); } catch (InvalidStaticChance invalidStaticChance) { @@ -231,14 +219,13 @@ public class RandomChanceUtil /** * Grabs static activation rolls for Secondary Abilities + * * @param subSkillType The secondary ability to grab properties of - * @throws InvalidStaticChance if the skill has no defined static chance this exception will be thrown and you should know you're a naughty boy * @return The static activation roll involved in the RNG calculation + * @throws InvalidStaticChance if the skill has no defined static chance this exception will be thrown and you should know you're a naughty boy */ - public static double getStaticRandomChance(SubSkillType subSkillType) throws InvalidStaticChance - { - switch(subSkillType) - { + public static double getStaticRandomChance(SubSkillType subSkillType) throws InvalidStaticChance { + switch (subSkillType) { case AXES_ARMOR_IMPACT: return AdvancedConfig.getInstance().getImpactChance(); case AXES_GREATER_IMPACT: @@ -250,8 +237,7 @@ public class RandomChanceUtil } } - public static boolean sendSkillEvent(Player player, SubSkillType subSkillType, double activationChance) - { + public static boolean sendSkillEvent(Player player, SubSkillType subSkillType, double activationChance) { SubSkillRandomCheckEvent event = new SubSkillRandomCheckEvent(player, subSkillType, activationChance); return !event.isCancelled(); } @@ -262,8 +248,7 @@ public class RandomChanceUtil return (event.getChance() * activationChance) > (Misc.getRandom().nextDouble() * activationChance) && !event.isCancelled(); }*/ - public static boolean isActivationSuccessful(SkillActivationType skillActivationType, AbstractSubSkill abstractSubSkill, Player player) - { + public static boolean isActivationSuccessful(SkillActivationType skillActivationType, AbstractSubSkill abstractSubSkill, Player player) { return isActivationSuccessful(skillActivationType, abstractSubSkill.getSubSkillType(), player); } @@ -311,17 +296,15 @@ public class RandomChanceUtil return displayValues; } - public static double addLuck(Player player, PrimarySkillType primarySkillType, double chance) - { - if(Permissions.lucky(player, primarySkillType)) + public static double addLuck(Player player, PrimarySkillType primarySkillType, double chance) { + if (Permissions.lucky(player, primarySkillType)) return chance * 1.333D; else return chance; } - public static double addLuck(boolean isLucky, double chance) - { - if(isLucky) + public static double addLuck(boolean isLucky, double chance) { + if (isLucky) return chance * 1.333D; else return chance; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java index 54770160f..089b0631d 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardManager.java @@ -1,15 +1,15 @@ package com.gmail.nossr50.core.util.scoreboards; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.database.PlayerStat; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.core.data.UserManager; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; @@ -44,9 +44,10 @@ public class ScoreboardManager { static final String LABEL_ABILITY_COOLDOWN = LocaleLoader.getString("Scoreboard.Misc.Cooldown"); static final String LABEL_OVERALL = LocaleLoader.getString("Scoreboard.Misc.Overall"); - static final Map skillLabels; + static final Map skillLabels; static final Map abilityLabelsColored; static final Map abilityLabelsSkill; + private static List dirtyPowerLevels = new ArrayList(); /* * Initializes the static properties of this class @@ -129,17 +130,6 @@ public class ScoreboardManager { abilityLabelsSkill = abilityLabelSkillBuilder.build(); } - private static List dirtyPowerLevels = new ArrayList(); - - public enum SidebarType { - NONE, - SKILL_BOARD, - STATS_BOARD, - COOLDOWNS_BOARD, - RANK_BOARD, - TOP_BOARD; - } - private static String formatAbility(String abilityName) { return formatAbility(ChatColor.AQUA, abilityName); } @@ -147,8 +137,7 @@ public class ScoreboardManager { private static String formatAbility(ChatColor color, String abilityName) { if (Config.getInstance().getShowAbilityNames()) { return getShortenedName(color + abilityName); - } - else { + } else { return color + LocaleLoader.getString("Scoreboard.Misc.Ability"); } } @@ -165,14 +154,14 @@ public class ScoreboardManager { return name; } - // **** Listener call-ins **** // - // Called by PlayerJoinEvent listener public static void setupPlayer(Player player) { PLAYER_SCOREBOARDS.put(player.getName(), ScoreboardWrapper.create(player)); dirtyPowerLevels.add(player.getName()); } + // **** Listener call-ins **** // + // Called by PlayerQuitEvent listener public static void teardownPlayer(Player player) { ScoreboardWrapper wrapper = PLAYER_SCOREBOARDS.remove(player.getName()); @@ -247,8 +236,6 @@ public class ScoreboardManager { } } - // **** Setup methods **** // - public static void enablePlayerSkillScoreboard(Player player, PrimarySkillType skill) { ScoreboardWrapper wrapper = PLAYER_SCOREBOARDS.get(player.getName()); @@ -258,6 +245,8 @@ public class ScoreboardManager { changeScoreboard(wrapper, Config.getInstance().getSkillScoreboardTime()); } + // **** Setup methods **** // + public static void enablePlayerSkillLevelUpScoreboard(Player player, PrimarySkillType skill) { ScoreboardWrapper wrapper = PLAYER_SCOREBOARDS.get(player.getName()); @@ -339,8 +328,6 @@ public class ScoreboardManager { changeScoreboard(wrapper, Config.getInstance().getTopScoreboardTime()); } - // **** Helper methods **** // - /** * @return false if power levels are disabled */ @@ -372,6 +359,8 @@ public class ScoreboardManager { return true; } + // **** Helper methods **** // + /** * Gets or creates the power level objective on the main targetBoard. *

@@ -406,8 +395,7 @@ public class ScoreboardManager { private static void changeScoreboard(ScoreboardWrapper wrapper, int displayTime) { if (displayTime == -1) { wrapper.showBoardWithNoRevert(); - } - else { + } else { wrapper.showBoardAndScheduleRevert(displayTime * Misc.TICK_CONVERSION_FACTOR); } } @@ -427,4 +415,13 @@ public class ScoreboardManager { public static void setRevertTimer(String playerName, int seconds) { PLAYER_SCOREBOARDS.get(playerName).showBoardAndScheduleRevert(seconds * Misc.TICK_CONVERSION_FACTOR); } + + public enum SidebarType { + NONE, + SKILL_BOARD, + STATS_BOARD, + COOLDOWNS_BOARD, + RANK_BOARD, + TOP_BOARD; + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java index 34c5ae3c6..bf4b633d8 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/scoreboards/ScoreboardWrapper.java @@ -1,18 +1,17 @@ package com.gmail.nossr50.core.util.scoreboards; import com.gmail.nossr50.core.config.skills.Config; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.database.PlayerStat; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; import com.gmail.nossr50.core.datatypes.player.PlayerProfile; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.util.Misc; -import com.gmail.nossr50.events.scoreboard.*; -import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.skills.child.FamilyTree; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager.SidebarType; +import com.gmail.nossr50.mcMMO; import org.apache.commons.lang.Validate; import org.bukkit.ChatColor; import org.bukkit.entity.Player; @@ -31,20 +30,21 @@ public class ScoreboardWrapper { public final String playerName; public final Player player; private final Scoreboard scoreboard; + public String targetPlayer = null; + public PrimarySkillType targetSkill = null; + public int leaderboardPage = -1; + public BukkitTask updateTask = null; + public BukkitTask revertTask = null; + public BukkitTask cooldownTask = null; private boolean tippedKeep = false; private boolean tippedClear = false; - // Internal usage variables (should exist) private SidebarType sidebarType; private Objective sidebarObjective; private Objective powerObjective; - // Parameter variables (May be null / invalid) private Scoreboard oldBoard = null; - public String targetPlayer = null; - public PrimarySkillType targetSkill = null; private PlayerProfile targetProfile = null; - public int leaderboardPage = -1; private ScoreboardWrapper(Player player, Scoreboard scoreboard) { this.player = player; @@ -72,42 +72,6 @@ public class ScoreboardWrapper { return new ScoreboardWrapper(event.getTargetPlayer(), event.getTargetBoard()); } - public BukkitTask updateTask = null; - - private class ScoreboardQuickUpdate extends BukkitRunnable { - @Override - public void run() { - updateSidebar(); - updateTask = null; - } - } - - public BukkitTask revertTask = null; - - private class ScoreboardChangeTask extends BukkitRunnable { - @Override - public void run() { - tryRevertBoard(); - revertTask = null; - } - } - - public BukkitTask cooldownTask = null; - - private class ScoreboardCooldownTask extends BukkitRunnable { - @Override - public void run() { - // Stop updating if it's no longer something displaying cooldowns - if (isBoardShown() && (isSkillScoreboard() || isCooldownScoreboard())) { - doSidebarUpdateSoon(); - } - else { - stopCooldownUpdating(); - } - } - } - - public void doSidebarUpdateSoon() { if (updateTask == null) { // To avoid spamming the scheduler, store the instance and run 2 ticks later @@ -127,8 +91,7 @@ public class ScoreboardWrapper { if (cooldownTask != null) { try { cooldownTask.cancel(); - } - catch (Throwable ignored) { + } catch (Throwable ignored) { } cooldownTask = null; @@ -165,8 +128,7 @@ public class ScoreboardWrapper { // (Shouldn't happen) Use failsafe value - we're already displaying our board, but we don't have the one we should revert to this.oldBoard = mcMMO.p.getServer().getScoreboardManager().getMainScoreboard(); } - } - else { + } else { this.oldBoard = oldBoard; } } @@ -214,8 +176,7 @@ public class ScoreboardWrapper { if (!tippedKeep) { tippedKeep = true; player.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Tip.Keep")); - } - else if (!tippedClear) { + } else if (!tippedClear) { tippedClear = true; player.sendMessage(LocaleLoader.getString("Commands.Scoreboard.Tip.Clear")); profile.increaseTipsShown(); @@ -240,8 +201,7 @@ public class ScoreboardWrapper { //Modify the player based on the event event.getTargetPlayer().setScoreboard(event.getTargetBoard()); oldBoard = null; - } - else { + } else { mcMMO.p.debug("Not reverting targetBoard for " + playerName + " - targetBoard was changed by another plugin (Consider disabling the mcMMO scoreboards if you don't want them!)"); } } @@ -275,8 +235,6 @@ public class ScoreboardWrapper { revertTask = null; } - // Board Type Changing 'API' methods - public void setTypeNone() { this.sidebarType = SidebarType.NONE; @@ -310,6 +268,8 @@ public class ScoreboardWrapper { loadObjective(ScoreboardManager.HEADER_STATS); } + // Board Type Changing 'API' methods + public void setTypeInspectStats(PlayerProfile profile) { this.sidebarType = SidebarType.STATS_BOARD; targetPlayer = profile.getPlayerName(); @@ -384,13 +344,13 @@ public class ScoreboardWrapper { protected void loadObjective(String displayName) { //Unregister objective McMMOScoreboardObjectiveEvent unregisterEvent = callObjectiveEvent(ScoreboardObjectiveEventReason.UNREGISTER_THIS_OBJECTIVE); - if(!unregisterEvent.isCancelled()) { + if (!unregisterEvent.isCancelled()) { sidebarObjective.unregister(); } //Register objective McMMOScoreboardObjectiveEvent registerEvent = callObjectiveEvent(ScoreboardObjectiveEventReason.REGISTER_NEW_OBJECTIVE); - if(!registerEvent.isCancelled()) + if (!registerEvent.isCancelled()) sidebarObjective = registerEvent.getTargetBoard().registerNewObjective(ScoreboardManager.SIDEBAR_OBJECTIVE, "dummy"); if (displayName.length() > 32) { @@ -416,8 +376,7 @@ public class ScoreboardWrapper { private void updateSidebar() { try { updateTask.cancel(); - } - catch (Throwable ignored) { + } catch (Throwable ignored) { } // catch NullPointerException and IllegalStateException and any Error; don't care updateTask = null; @@ -447,8 +406,7 @@ public class ScoreboardWrapper { sidebarObjective.getScore(ScoreboardManager.LABEL_CURRENT_XP).setScore(currentXP); sidebarObjective.getScore(ScoreboardManager.LABEL_REMAINING_XP).setScore(mcMMOPlayer.getXpToLevel(targetSkill) - currentXP); - } - else { + } else { for (PrimarySkillType parentSkill : FamilyTree.getParents(targetSkill)) { sidebarObjective.getScore(ScoreboardManager.skillLabels.get(parentSkill)).setScore(mcMMOPlayer.getSkillLevel(parentSkill)); } @@ -470,8 +428,7 @@ public class ScoreboardWrapper { cooldownBM.setScore(secondsBM); stopUpdating = (secondsSB == 0 && secondsBM == 0); - } - else { + } else { SuperAbilityType ability = targetSkill.getAbility(); Score cooldown = sidebarObjective.getScore(ScoreboardManager.abilityLabelsSkill.get(ability)); int seconds = Math.max(mcMMOPlayer.calculateTimeRemaining(ability), 0); @@ -483,8 +440,7 @@ public class ScoreboardWrapper { if (stopUpdating) { stopCooldownUpdating(); - } - else { + } else { startCooldownUpdating(); } } @@ -505,8 +461,7 @@ public class ScoreboardWrapper { if (anyCooldownsActive) { startCooldownUpdating(); - } - else { + } else { stopCooldownUpdating(); } break; @@ -517,11 +472,9 @@ public class ScoreboardWrapper { if (targetProfile != null) { newProfile = targetProfile; // offline - } - else if (targetPlayer == null) { + } else if (targetPlayer == null) { newProfile = mcMMOPlayer.getProfile(); // self - } - else { + } else { newProfile = UserManager.getPlayer(targetPlayer).getProfile(); // online } @@ -545,10 +498,10 @@ public class ScoreboardWrapper { case RANK_BOARD: case TOP_BOARD: - /* - * @see #acceptRankData(Map rank) - * @see #acceptLeaderboardData(List stats) - */ + /* + * @see #acceptRankData(Map rank) + * @see #acceptLeaderboardData(List stats) + */ break; default: @@ -594,4 +547,32 @@ public class ScoreboardWrapper { public void updatePowerLevel(Player player, int newPowerLevel) { powerObjective.getScore(player.getName()).setScore(newPowerLevel); } + + private class ScoreboardQuickUpdate extends BukkitRunnable { + @Override + public void run() { + updateSidebar(); + updateTask = null; + } + } + + private class ScoreboardChangeTask extends BukkitRunnable { + @Override + public void run() { + tryRevertBoard(); + revertTask = null; + } + } + + private class ScoreboardCooldownTask extends BukkitRunnable { + @Override + public void run() { + // Stop updating if it's no longer something displaying cooldowns + if (isBoardShown() && (isSkillScoreboard() || isCooldownScoreboard())) { + doSidebarUpdateSoon(); + } else { + stopCooldownUpdating(); + } + } + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/CombatUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/CombatUtils.java index 0a9422b68..2aa3ed355 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/CombatUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/CombatUtils.java @@ -1,18 +1,14 @@ package com.gmail.nossr50.core.util.skills; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; -import com.gmail.nossr50.core.skills.PrimarySkillType; -import com.gmail.nossr50.core.skills.SubSkillType; -import com.gmail.nossr50.core.util.*; -import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent; -import com.gmail.nossr50.events.fake.FakeEntityDamageEvent; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.party.PartyManager; import com.gmail.nossr50.core.runnables.skills.AwardCombatXpTask; import com.gmail.nossr50.core.runnables.skills.BleedTimerTask; +import com.gmail.nossr50.core.skills.PrimarySkillType; +import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.primary.acrobatics.AcrobaticsManager; import com.gmail.nossr50.core.skills.primary.archery.ArcheryManager; import com.gmail.nossr50.core.skills.primary.axes.AxesManager; @@ -20,13 +16,17 @@ import com.gmail.nossr50.core.skills.primary.swords.SwordsManager; import com.gmail.nossr50.core.skills.primary.taming.TamingManager; import com.gmail.nossr50.core.skills.primary.unarmed.Unarmed; import com.gmail.nossr50.core.skills.primary.unarmed.UnarmedManager; -import com.gmail.nossr50.util.*; +import com.gmail.nossr50.core.util.*; import com.gmail.nossr50.core.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent; +import com.gmail.nossr50.events.fake.FakeEntityDamageEvent; +import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.party.PartyManager; +import com.gmail.nossr50.util.*; import com.google.common.collect.ImmutableMap; import org.bukkit.GameMode; import org.bukkit.Material; -import org.bukkit.entity.*; +import org.bukkit.entity.LivingEntity; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; @@ -39,13 +39,14 @@ import java.util.HashMap; import java.util.Map; public final class CombatUtils { - private CombatUtils() {} + private CombatUtils() { + } private static void processSwordCombat(LivingEntity target, Player player, EntityDamageByEntityEvent event) { if (event.getCause() == DamageCause.THORNS) { return; } - + McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); SwordsManager swordsManager = mcMMOPlayer.getSwordsManager(); double initialDamage = event.getDamage(); @@ -56,8 +57,7 @@ public final class CombatUtils { mcMMOPlayer.checkAbilityActivation(PrimarySkillType.SWORDS); } - if(target.getHealth() - event.getFinalDamage() >= 1) - { + if (target.getHealth() - event.getFinalDamage() >= 1) { if (swordsManager.canUseRupture()) { swordsManager.ruptureCheck(target); } @@ -74,7 +74,7 @@ public final class CombatUtils { if (event.getCause() == DamageCause.THORNS) { return; } - + double initialDamage = event.getDamage(); double finalDamage = initialDamage; Map modifiers = getModifiers(event); @@ -96,8 +96,7 @@ public final class CombatUtils { if (axesManager.canImpact(target)) { axesManager.impactCheck(target); - } - else if (axesManager.canGreaterImpact(target)) { + } else if (axesManager.canGreaterImpact(target)) { finalDamage += axesManager.greaterImpact(target); } @@ -113,7 +112,7 @@ public final class CombatUtils { if (event.getCause() == DamageCause.THORNS) { return; } - + double initialDamage = event.getDamage(); double finalDamage = initialDamage; @@ -125,8 +124,7 @@ public final class CombatUtils { } //Only execute bonuses if the player is not spamming - if(unarmedManager.isPunchingCooldownOver()) - { + if (unarmedManager.isPunchingCooldownOver()) { if (unarmedManager.canUseIronArm()) { finalDamage += unarmedManager.ironArm(); } @@ -250,8 +248,7 @@ public final class CombatUtils { if (PrimarySkillType.SWORDS.getPermissions(player)) { processSwordCombat(target, player, event); } - } - else if (ItemUtils.isAxe(heldItem)) { + } else if (ItemUtils.isAxe(heldItem)) { if (!PrimarySkillType.AXES.shouldProcess(target)) { return; } @@ -259,8 +256,7 @@ public final class CombatUtils { if (PrimarySkillType.AXES.getPermissions(player)) { processAxeCombat(target, player, event); } - } - else if (ItemUtils.isUnarmed(heldItem)) { + } else if (ItemUtils.isUnarmed(heldItem)) { if (!PrimarySkillType.UNARMED.shouldProcess(target)) { return; } @@ -269,9 +265,7 @@ public final class CombatUtils { processUnarmedCombat(target, player, event); } } - } - - else if (entityType == EntityType.WOLF) { + } else if (entityType == EntityType.WOLF) { Wolf wolf = (Wolf) damager; AnimalTamer tamer = wolf.getOwner(); @@ -282,8 +276,7 @@ public final class CombatUtils { processTamingCombat(target, master, wolf, event); } } - } - else if (entityType == EntityType.ARROW) { + } else if (entityType == EntityType.ARROW) { Arrow arrow = (Arrow) damager; ProjectileSource projectileSource = arrow.getShooter(); @@ -346,8 +339,8 @@ public final class CombatUtils { /** * Attempt to damage target for value dmg with reason ENTITY_ATTACK with damager attacker * - * @param target LivingEntity which to attempt to damage - * @param damage Amount of damage to attempt to do + * @param target LivingEntity which to attempt to damage + * @param damage Amount of damage to attempt to do * @param attacker Player to pass to event as damager */ @Deprecated @@ -358,8 +351,8 @@ public final class CombatUtils { /** * Attempt to damage target for value dmg with reason ENTITY_ATTACK with damager attacker * - * @param target LivingEntity which to attempt to damage - * @param damage Amount of damage to attempt to do + * @param target LivingEntity which to attempt to damage + * @param damage Amount of damage to attempt to do * @param attacker Player to pass to event as damager */ public static void dealDamage(LivingEntity target, double damage, Map modifiers, LivingEntity attacker) { @@ -374,8 +367,8 @@ public final class CombatUtils { /** * Attempt to damage target for value dmg with reason ENTITY_ATTACK with damager attacker * - * @param target LivingEntity which to attempt to damage - * @param damage Amount of damage to attempt to do + * @param target LivingEntity which to attempt to damage + * @param damage Amount of damage to attempt to do * @param attacker Player to pass to event as damager */ @Deprecated @@ -402,9 +395,9 @@ public final class CombatUtils { * Apply Area-of-Effect ability actions. * * @param attacker The attacking player - * @param target The defending entity - * @param damage The initial damage amount - * @param type The type of skill being used + * @param target The defending entity + * @param damage The initial damage amount + * @param type The type of skill being used */ public static void applyAbilityAoE(Player attacker, LivingEntity target, double damage, Map modifiers, PrimarySkillType type) { int numberOfTargets = getTier(attacker.getInventory().getItemInMainHand()); // The higher the weapon tier, the more targets you hit @@ -425,7 +418,7 @@ public final class CombatUtils { switch (type) { case SWORDS: if (entity instanceof Player) { - NotificationManager.sendPlayerInformation((Player)entity, NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.SS.Struck"); + NotificationManager.sendPlayerInformation((Player) entity, NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.SS.Struck"); } BleedTimerTask.add(livingEntity, attacker, UserManager.getPlayer(attacker).getSwordsManager().getRuptureBleedTicks(), RankUtils.getRank(attacker, SubSkillType.SWORDS_RUPTURE)); @@ -433,7 +426,7 @@ public final class CombatUtils { case AXES: if (entity instanceof Player) { - NotificationManager.sendPlayerInformation((Player)entity, NotificationType.SUBSKILL_MESSAGE, "Axes.Combat.SS.Struck"); + NotificationManager.sendPlayerInformation((Player) entity, NotificationType.SUBSKILL_MESSAGE, "Axes.Combat.SS.Struck"); } break; @@ -454,8 +447,8 @@ public final class CombatUtils { /** * Start the task that gives combat XP. * - * @param mcMMOPlayer The attacking player - * @param target The defending entity + * @param mcMMOPlayer The attacking player + * @param target The defending entity * @param primarySkillType The skill being used */ private static void startGainXp(McMMOPlayer mcMMOPlayer, LivingEntity target, PrimarySkillType primarySkillType, double multiplier) { @@ -473,37 +466,27 @@ public final class CombatUtils { if (defender.isOnline() && SkillUtils.cooldownExpired(mcMMOPlayer.getRespawnATS(), Misc.PLAYER_RESPAWN_COOLDOWN_SECONDS)) { baseXP = 20 * ExperienceConfig.getInstance().getPlayerVersusPlayerXP(); } - } - else { + } else { if (mcMMO.getModManager().isCustomEntity(target)) { baseXP = mcMMO.getModManager().getEntity(target).getXpMultiplier(); - } - else if (target instanceof Animals) { + } else if (target instanceof Animals) { EntityType type = target.getType(); baseXP = ExperienceConfig.getInstance().getAnimalsXP(type); - } - else if (target instanceof Monster) - { + } else if (target instanceof Monster) { EntityType type = target.getType(); baseXP = ExperienceConfig.getInstance().getCombatXP(type); - } - else { + } else { EntityType type = target.getType(); if (ExperienceConfig.getInstance().hasCombatXP(type)) { - if (type == EntityType.IRON_GOLEM) - { + if (type == EntityType.IRON_GOLEM) { if (!((IronGolem) target).isPlayerCreated()) { baseXP = ExperienceConfig.getInstance().getCombatXP(type); } - } - else - { + } else { baseXP = ExperienceConfig.getInstance().getCombatXP(type); } - } - else - { + } else { baseXP = 1.0; mcMMO.getModManager().addCustomEntity(target); } @@ -552,7 +535,7 @@ public final class CombatUtils { if (!player.canSee(defender)) { return false; } - + // Spectators should not be affected if (defender.getGameMode() == GameMode.SPECTATOR) { return false; @@ -562,8 +545,7 @@ public final class CombatUtils { if (callFakeDamageEvent(player, entity, 1.0) == 0) { return false; } - } - else if (entity instanceof Tameable) { + } else if (entity instanceof Tameable) { if (isFriendlyPet(player, (Tameable) entity)) { // 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 @@ -580,7 +562,7 @@ public final class CombatUtils { /** * Checks to see if an entity is currently invincible. * - * @param entity The {@link LivingEntity} to check + * @param entity The {@link LivingEntity} to check * @param eventDamage The damage from the event the entity is involved in * @return true if the entity is invincible, false otherwise */ @@ -596,7 +578,7 @@ public final class CombatUtils { * Checks to see if an entity is currently friendly toward a given player. * * @param attacker The player to check. - * @param pet The entity to check. + * @param pet The entity to check. * @return true if the entity is friendly, false otherwise */ public static boolean isFriendlyPet(Player attacker, Tameable pet) { @@ -706,20 +688,15 @@ public final class CombatUtils { if (ItemUtils.isWoodTool(inHand)) { tier = 1; - } - else if (ItemUtils.isStoneTool(inHand)) { + } else if (ItemUtils.isStoneTool(inHand)) { tier = 2; - } - else if (ItemUtils.isIronTool(inHand)) { + } else if (ItemUtils.isIronTool(inHand)) { tier = 3; - } - else if (ItemUtils.isGoldTool(inHand)) { + } else if (ItemUtils.isGoldTool(inHand)) { tier = 1; - } - else if (ItemUtils.isDiamondTool(inHand)) { + } else if (ItemUtils.isDiamondTool(inHand)) { tier = 4; - } - else if (mcMMO.getModManager().isCustomTool(inHand)) { + } else if (mcMMO.getModManager().isCustomTool(inHand)) { tier = mcMMO.getModManager().getTool(inHand).getTier(); } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java index 22257ee20..0a26e40a9 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/ParticleEffectUtils.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.core.util.skills; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.mcMMO; -import org.bukkit.*; import org.bukkit.FireworkEffect.Type; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; @@ -15,7 +14,10 @@ import org.bukkit.metadata.FixedMetadataValue; public final class ParticleEffectUtils { - private ParticleEffectUtils() {}; + private ParticleEffectUtils() { + } + + ; public static void playBleedEffect(LivingEntity livingEntity) { if (!Config.getInstance().getBleedEffectEnabled()) { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/PerksUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/PerksUtils.java index b3000d9f9..9c8f068b1 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/PerksUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/PerksUtils.java @@ -9,16 +9,17 @@ public final class PerksUtils { private static final int LUCKY_SKILL_ACTIVATION_CHANCE = 75; private static final int NORMAL_SKILL_ACTIVATION_CHANCE = 100; - private PerksUtils() {}; + private PerksUtils() { + } + + ; public static int handleCooldownPerks(Player player, int cooldown) { if (Permissions.halvedCooldowns(player)) { cooldown *= 0.5; - } - else if (Permissions.thirdedCooldowns(player)) { + } else if (Permissions.thirdedCooldowns(player)) { cooldown *= (2.0 / 3.0); - } - else if (Permissions.quarteredCooldowns(player)) { + } else if (Permissions.quarteredCooldowns(player)) { cooldown *= 0.75; } @@ -32,11 +33,9 @@ public final class PerksUtils { if (Permissions.twelveSecondActivationBoost(player)) { ticks += 12; - } - else if (Permissions.eightSecondActivationBoost(player)) { + } else if (Permissions.eightSecondActivationBoost(player)) { ticks += 8; - } - else if (Permissions.fourSecondActivationBoost(player)) { + } else if (Permissions.fourSecondActivationBoost(player)) { ticks += 4; } @@ -46,23 +45,17 @@ public final class PerksUtils { public static float handleXpPerks(Player player, float xp, PrimarySkillType skill) { if (Permissions.customXpBoost(player, skill)) { xp *= ExperienceConfig.getInstance().getCustomXpPerkBoost(); - } - else if (Permissions.quadrupleXp(player, skill)) { + } else if (Permissions.quadrupleXp(player, skill)) { xp *= 4; - } - else if (Permissions.tripleXp(player, skill)) { + } else if (Permissions.tripleXp(player, skill)) { xp *= 3; - } - else if (Permissions.doubleAndOneHalfXp(player, skill)) { + } else if (Permissions.doubleAndOneHalfXp(player, skill)) { xp *= 2.5; - } - else if (Permissions.doubleXp(player, skill)) { + } else if (Permissions.doubleXp(player, skill)) { xp *= 2; - } - else if (Permissions.oneAndOneHalfXp(player, skill)) { + } else if (Permissions.oneAndOneHalfXp(player, skill)) { xp *= 1.5; - } - else if (Permissions.oneAndOneTenthXp(player, skill)) { + } else if (Permissions.oneAndOneTenthXp(player, skill)) { xp *= 1.1; } @@ -73,7 +66,7 @@ public final class PerksUtils { * Calculate activation chance for a skill. * * @param player Player to check the activation chance for - * @param skill PrimarySkillType to check the activation chance of + * @param skill PrimarySkillType to check the activation chance of * @return the activation chance with "lucky perk" accounted for */ public static int handleLuckyPerks(Player player, PrimarySkillType skill) { diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/RankUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/RankUtils.java index c82f05ee4..ae5535f11 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/RankUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/RankUtils.java @@ -1,14 +1,14 @@ package com.gmail.nossr50.core.util.skills; import com.gmail.nossr50.core.config.skills.RankConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.runnables.skills.SkillUnlockNotificationTask; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.listeners.InteractionManager; -import com.gmail.nossr50.core.runnables.skills.SkillUnlockNotificationTask; -import com.gmail.nossr50.core.data.UserManager; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; @@ -18,29 +18,25 @@ public class RankUtils { private static HashMap> subSkillRanks; /** - * - * @param plugin plugin instance ref - * @param mcMMOPlayer target player + * @param plugin plugin instance ref + * @param mcMMOPlayer target player * @param primarySkillType - * @param newLevel the new level of this skill + * @param newLevel the new level of this skill */ - public static void executeSkillUnlockNotifications(Plugin plugin, McMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType, int newLevel) - { + public static void executeSkillUnlockNotifications(Plugin plugin, McMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType, int newLevel) { int count = 0; - for(SubSkillType subSkillType : primarySkillType.getSkillAbilities()) - { + for (SubSkillType subSkillType : primarySkillType.getSkillAbilities()) { int playerRankInSkill = getRank(mcMMOPlayer.getPlayer(), subSkillType); HashMap innerMap = subSkillRanks.get(subSkillType.toString()); //If the skill doesn't have registered ranks gtfo - if(innerMap == null || innerMap.get(playerRankInSkill) == null) + if (innerMap == null || innerMap.get(playerRankInSkill) == null) return; //The players level is the exact level requirement for this skill - if(newLevel == innerMap.get(playerRankInSkill)) - { + if (newLevel == innerMap.get(playerRankInSkill)) { SkillUnlockNotificationTask skillUnlockNotificationTask = new SkillUnlockNotificationTask(mcMMOPlayer, subSkillType, newLevel); skillUnlockNotificationTask.runTaskLater(plugin, ((count * 4) + 1) * 20); @@ -51,26 +47,22 @@ public class RankUtils { } /* NEW SYSTEM */ - private static void addRanks(AbstractSubSkill abstractSubSkill) - { + private static void addRanks(AbstractSubSkill abstractSubSkill) { //Fill out the rank array - for(int i = 0; i < abstractSubSkill.getNumRanks(); i++) - { + for (int i = 0; i < abstractSubSkill.getNumRanks(); i++) { //This adds the highest ranks first - addRank(abstractSubSkill, abstractSubSkill.getNumRanks()-i); + addRank(abstractSubSkill, abstractSubSkill.getNumRanks() - i); //TODO: Remove debug code /*System.out.println("DEBUG: Adding rank "+(numRanks-i)+" to "+subSkillType.toString());*/ } } - private static void addRanks(SubSkillType subSkillType) - { + private static void addRanks(SubSkillType subSkillType) { //Fill out the rank array - for(int i = 0; i < subSkillType.getNumRanks(); i++) - { + for (int i = 0; i < subSkillType.getNumRanks(); i++) { //This adds the highest ranks first - addRank(subSkillType, subSkillType.getNumRanks()-i); + addRank(subSkillType, subSkillType.getNumRanks() - i); //TODO: Remove debug code /*System.out.println("DEBUG: Adding rank "+(numRanks-i)+" to "+subSkillType.toString());*/ @@ -80,27 +72,24 @@ public class RankUtils { /** * Populates the ranks for every skill we know about */ - public static void populateRanks() - { - for(SubSkillType subSkillType : SubSkillType.values()) - { + public static void populateRanks() { + for (SubSkillType subSkillType : SubSkillType.values()) { addRanks(subSkillType); } - for(AbstractSubSkill abstractSubSkill : InteractionManager.getSubSkillList()) - { + for (AbstractSubSkill abstractSubSkill : InteractionManager.getSubSkillList()) { addRanks(abstractSubSkill); } } /** * Returns whether or not the player has unlocked the first rank in target subskill - * @param player the player + * + * @param player the player * @param subSkillType the target subskill * @return true if the player has at least one rank in the skill */ - public static boolean hasUnlockedSubskill(Player player, SubSkillType subSkillType) - { + public static boolean hasUnlockedSubskill(Player player, SubSkillType subSkillType) { int curRank = getRank(player, subSkillType); //-1 means the skill has no unlockable levels and is therefor unlocked @@ -109,12 +98,12 @@ public class RankUtils { /** * Returns whether or not the player has unlocked the first rank in target subskill - * @param player the player + * + * @param player the player * @param abstractSubSkill the target subskill * @return true if the player has at least one rank in the skill */ - public static boolean hasUnlockedSubskill(Player player, AbstractSubSkill abstractSubSkill) - { + public static boolean hasUnlockedSubskill(Player player, AbstractSubSkill abstractSubSkill) { int curRank = getRank(player, abstractSubSkill); //-1 means the skill has no unlockable levels and is therefor unlocked @@ -123,46 +112,46 @@ public class RankUtils { /** * Returns whether or not the player has reached the specified rank in target subskill - * @param rank the target rank - * @param player the player + * + * @param rank the target rank + * @param player the player * @param subSkillType the target subskill * @return true if the player is at least that rank in this subskill */ - public static boolean hasReachedRank(int rank, Player player, SubSkillType subSkillType) - { + public static boolean hasReachedRank(int rank, Player player, SubSkillType subSkillType) { return getRank(player, subSkillType) >= rank; } /** * Returns whether or not the player has reached the specified rank in target subskill - * @param rank the target rank - * @param player the player + * + * @param rank the target rank + * @param player the player * @param abstractSubSkill the target subskill * @return true if the player is at least that rank in this subskill */ - public static boolean hasReachedRank(int rank, Player player, AbstractSubSkill abstractSubSkill) - { + public static boolean hasReachedRank(int rank, Player player, AbstractSubSkill abstractSubSkill) { return getRank(player, abstractSubSkill) >= rank; } /** * Gets the current rank of the subskill for the player - * @param player The player in question + * + * @param player The player in question * @param subSkillType Target subskill * @return The rank the player currently has achieved in this skill. -1 for skills without ranks. */ - public static int getRank(Player player, SubSkillType subSkillType) - { + public static int getRank(Player player, SubSkillType subSkillType) { String skillName = subSkillType.toString(); int numRanks = subSkillType.getNumRanks(); - if(subSkillRanks == null) + if (subSkillRanks == null) subSkillRanks = new HashMap<>(); - if(numRanks == 0) + if (numRanks == 0) return -1; //-1 Means the skill doesn't have ranks - if(subSkillRanks.get(skillName) == null && numRanks > 0) + if (subSkillRanks.get(skillName) == null && numRanks > 0) addRanks(subSkillType); //Get our rank map @@ -171,18 +160,17 @@ public class RankUtils { //Skill level of parent skill int currentSkillLevel = UserManager.getPlayer(player).getSkillLevel(subSkillType.getParentSkill()); - for(int i = 0; i < numRanks; i++) - { + for (int i = 0; i < numRanks; i++) { //Compare against the highest to lowest rank in that order - int rank = numRanks-i; + int rank = numRanks - i; int unlockLevel = getRankUnlockLevel(subSkillType, rank); //If we check all ranks and still cannot unlock the skill, we return rank 0 - if(rank == 0) + if (rank == 0) return 0; //True if our skill level can unlock the current rank - if(currentSkillLevel >= unlockLevel) + if (currentSkillLevel >= unlockLevel) return rank; } @@ -191,22 +179,22 @@ public class RankUtils { /** * Gets the current rank of the subskill for the player - * @param player The player in question + * + * @param player The player in question * @param abstractSubSkill Target subskill * @return The rank the player currently has achieved in this skill. -1 for skills without ranks. */ - public static int getRank(Player player, AbstractSubSkill abstractSubSkill) - { + public static int getRank(Player player, AbstractSubSkill abstractSubSkill) { String skillName = abstractSubSkill.getConfigKeyName(); int numRanks = abstractSubSkill.getNumRanks(); - if(subSkillRanks == null) + if (subSkillRanks == null) subSkillRanks = new HashMap<>(); - if(numRanks == 0) + if (numRanks == 0) return -1; //-1 Means the skill doesn't have ranks - if(subSkillRanks.get(skillName) == null && numRanks > 0) + if (subSkillRanks.get(skillName) == null && numRanks > 0) addRanks(abstractSubSkill); //Get our rank map @@ -215,18 +203,17 @@ public class RankUtils { //Skill level of parent skill int currentSkillLevel = UserManager.getPlayer(player).getSkillLevel(abstractSubSkill.getPrimarySkill()); - for(int i = 0; i < numRanks; i++) - { + for (int i = 0; i < numRanks; i++) { //Compare against the highest to lowest rank in that order - int rank = numRanks-i; + int rank = numRanks - i; int unlockLevel = getRankUnlockLevel(abstractSubSkill, rank); //If we check all ranks and still cannot unlock the skill, we return rank 0 - if(rank == 0) + if (rank == 0) return 0; //True if our skill level can unlock the current rank - if(currentSkillLevel >= unlockLevel) + if (currentSkillLevel >= unlockLevel) return rank; } @@ -235,11 +222,11 @@ public class RankUtils { /** * Adds ranks to our map + * * @param abstractSubSkill The subskill to add ranks for - * @param rank The rank to add + * @param rank The rank to add */ - private static void addRank(AbstractSubSkill abstractSubSkill, int rank) - { + private static void addRank(AbstractSubSkill abstractSubSkill, int rank) { initMaps(abstractSubSkill.getConfigKeyName()); HashMap rankMap = subSkillRanks.get(abstractSubSkill.getConfigKeyName()); @@ -248,8 +235,7 @@ public class RankUtils { } @Deprecated - private static void addRank(SubSkillType subSkillType, int rank) - { + private static void addRank(SubSkillType subSkillType, int rank) { initMaps(subSkillType.toString()); HashMap rankMap = subSkillRanks.get(subSkillType.toString()); @@ -284,68 +270,65 @@ public class RankUtils { /** * Gets the unlock level for a specific rank in a subskill + * * @param subSkillType The target subskill - * @param rank The target rank + * @param rank The target rank * @return The level at which this rank unlocks */ @Deprecated - public static int getRankUnlockLevel(SubSkillType subSkillType, int rank) - { + public static int getRankUnlockLevel(SubSkillType subSkillType, int rank) { return RankConfig.getInstance().getSubSkillUnlockLevel(subSkillType, rank); } - public static int getRankUnlockLevel(AbstractSubSkill abstractSubSkill, int rank) - { + public static int getRankUnlockLevel(AbstractSubSkill abstractSubSkill, int rank) { return RankConfig.getInstance().getSubSkillUnlockLevel(abstractSubSkill, rank); } /** * Get the level at which a skill is unlocked for a player (this is the first rank of a skill) + * * @param subSkillType target subskill * @return The unlock requirements for rank 1 in this skill */ - public static int getUnlockLevel(SubSkillType subSkillType) - { + public static int getUnlockLevel(SubSkillType subSkillType) { return RankConfig.getInstance().getSubSkillUnlockLevel(subSkillType, 1); } /** * Get the level at which a skill is unlocked for a player (this is the first rank of a skill) + * * @param abstractSubSkill target subskill * @return The unlock requirements for rank 1 in this skill */ - public static int getUnlockLevel(AbstractSubSkill abstractSubSkill) - { + public static int getUnlockLevel(AbstractSubSkill abstractSubSkill) { return RankConfig.getInstance().getSubSkillUnlockLevel(abstractSubSkill, 1); } /** * Get the highest rank of a subskill + * * @param subSkillType target subskill * @return the last rank of a subskill */ - public static int getHighestRank(SubSkillType subSkillType) - { + public static int getHighestRank(SubSkillType subSkillType) { return subSkillType.getNumRanks(); } - public static String getHighestRankStr(SubSkillType subSkillType) - { + public static String getHighestRankStr(SubSkillType subSkillType) { return String.valueOf(subSkillType.getNumRanks()); } /** * Get the highest rank of a subskill + * * @param abstractSubSkill target subskill * @return the last rank of a subskill */ - public static int getHighestRank(AbstractSubSkill abstractSubSkill) - { + public static int getHighestRank(AbstractSubSkill abstractSubSkill) { return abstractSubSkill.getNumRanks(); } - public static int getSuperAbilityUnlockRequirement(SuperAbilityType superAbilityType) - { + public static int getSuperAbilityUnlockRequirement(SuperAbilityType superAbilityType) { return getRankUnlockLevel(superAbilityType.getSubSkillTypeDefinition(), 1); } } \ No newline at end of file diff --git a/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java b/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java index bb28f14c0..28892a5f4 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/skills/SkillUtils.java @@ -3,20 +3,20 @@ package com.gmail.nossr50.core.util.skills; import com.gmail.nossr50.core.config.skills.AdvancedConfig; import com.gmail.nossr50.core.config.skills.Config; import com.gmail.nossr50.core.config.skills.HiddenConfig; +import com.gmail.nossr50.core.data.UserManager; import com.gmail.nossr50.core.datatypes.experience.XPGainReason; import com.gmail.nossr50.core.datatypes.experience.XPGainSource; import com.gmail.nossr50.core.datatypes.interactions.NotificationType; import com.gmail.nossr50.core.datatypes.player.McMMOPlayer; +import com.gmail.nossr50.core.locale.LocaleLoader; import com.gmail.nossr50.core.skills.PrimarySkillType; import com.gmail.nossr50.core.skills.SubSkillType; import com.gmail.nossr50.core.skills.SuperAbilityType; -import com.gmail.nossr50.core.locale.LocaleLoader; -import com.gmail.nossr50.core.util.Misc; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.core.util.ItemUtils; +import com.gmail.nossr50.core.util.Misc; import com.gmail.nossr50.core.util.StringUtils; import com.gmail.nossr50.core.util.player.NotificationManager; -import com.gmail.nossr50.core.data.UserManager; +import com.gmail.nossr50.mcMMO; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; @@ -53,9 +53,8 @@ public class SkillUtils { int length; - if(abilityLengthCap > 0) - { - length = (int) Math.min(abilityLengthCap, 2 + (skillValue / abilityLengthVar)); + if (abilityLengthCap > 0) { + length = (int) Math.min(abilityLengthCap, 2 + (skillValue / abilityLengthVar)); } else { length = 2 + (int) (skillValue / abilityLengthVar); } @@ -66,7 +65,7 @@ public class SkillUtils { length = Math.min(length, maxLength); } - return new String[] { String.valueOf(length), String.valueOf(enduranceLength) }; + return new String[]{String.valueOf(length), String.valueOf(enduranceLength)}; } /* @@ -79,7 +78,7 @@ public class SkillUtils { int currentFoodLevel = player.getFoodLevel(); int foodChange = eventFoodLevel - currentFoodLevel; - foodChange+=curRank; + foodChange += curRank; return currentFoodLevel + foodChange; } @@ -88,9 +87,8 @@ public class SkillUtils { * Calculate the time remaining until the cooldown expires. * * @param deactivatedTimeStamp Time of deactivation - * @param cooldown The length of the cooldown - * @param player The Player to check for cooldown perks - * + * @param cooldown The length of the cooldown + * @param player The Player to check for cooldown perks * @return the number of seconds remaining before the cooldown expires */ public static int calculateTimeLeft(long deactivatedTimeStamp, int cooldown, Player player) { @@ -102,8 +100,7 @@ public class SkillUtils { * This does NOT account for cooldown perks! * * @param deactivatedTimeStamp Time of deactivation in seconds - * @param cooldown The length of the cooldown in seconds - * + * @param cooldown The length of the cooldown in seconds * @return true if the cooldown is expired */ public static boolean cooldownExpired(long deactivatedTimeStamp, int cooldown) { @@ -151,8 +148,7 @@ public class SkillUtils { itemMeta.setLore(itemLore); heldItem.setItemMeta(itemMeta); - } - else { + } else { int duration = 0; int amplifier = 0; @@ -174,9 +170,8 @@ public class SkillUtils { int ticks; - if(abilityLengthCap > 0) - { - ticks = PerksUtils.handleActivationPerks(player, Math.min(abilityLengthCap, 2 + (mcMMOPlayer.getSkillLevel(skill) / abilityLengthVar)), + if (abilityLengthCap > 0) { + ticks = PerksUtils.handleActivationPerks(player, Math.min(abilityLengthCap, 2 + (mcMMOPlayer.getSkillLevel(skill) / abilityLengthVar)), skill.getAbility().getMaxLength()) * Misc.TICK_CONVERSION_FACTOR; } else { ticks = PerksUtils.handleActivationPerks(player, 2 + ((mcMMOPlayer.getSkillLevel(skill)) / abilityLengthVar), @@ -213,8 +208,7 @@ public class SkillUtils { if (efficiencyLevel <= AdvancedConfig.getInstance().getEnchantBuff()) { itemMeta.removeEnchant(Enchantment.DIG_SPEED); - } - else { + } else { itemMeta.addEnchant(Enchantment.DIG_SPEED, efficiencyLevel - AdvancedConfig.getInstance().getEnchantBuff(), true); } @@ -231,9 +225,9 @@ public class SkillUtils { /** * Modify the durability of an ItemStack. * - * @param itemStack The ItemStack which durability should be modified + * @param itemStack The ItemStack which durability should be modified * @param durabilityModifier the amount to modify the durability by - * @param maxDamageModifier the amount to adjust the max damage by + * @param maxDamageModifier the amount to adjust the max damage by */ public static void handleDurabilityChange(ItemStack itemStack, int durabilityModifier, double maxDamageModifier) { if (itemStack.hasItemMeta() && itemStack.getItemMeta().isUnbreakable()) { @@ -260,26 +254,19 @@ public class SkillUtils { protected static Material getRepairAndSalvageItem(ItemStack inHand) { if (ItemUtils.isDiamondTool(inHand) || ItemUtils.isDiamondArmor(inHand)) { return Material.DIAMOND; - } - else if (ItemUtils.isGoldTool(inHand) || ItemUtils.isGoldArmor(inHand)) { + } else if (ItemUtils.isGoldTool(inHand) || ItemUtils.isGoldArmor(inHand)) { return Material.GOLD_INGOT; - } - else if (ItemUtils.isIronTool(inHand) || ItemUtils.isIronArmor(inHand)) { + } else if (ItemUtils.isIronTool(inHand) || ItemUtils.isIronArmor(inHand)) { return Material.IRON_INGOT; - } - else if (ItemUtils.isStoneTool(inHand)) { + } else if (ItemUtils.isStoneTool(inHand)) { return Material.COBBLESTONE; - } - else if (ItemUtils.isWoodTool(inHand)) { + } else if (ItemUtils.isWoodTool(inHand)) { return Material.OAK_WOOD; - } - else if (ItemUtils.isLeatherArmor(inHand)) { + } else if (ItemUtils.isLeatherArmor(inHand)) { return Material.LEATHER; - } - else if (ItemUtils.isStringTool(inHand)) { + } else if (ItemUtils.isStringTool(inHand)) { return Material.STRING; - } - else { + } else { return null; } } @@ -308,8 +295,7 @@ public class SkillUtils { quantity += ingredient.getAmount(); } } - } - else if (recipe instanceof ShapedRecipe) { + } else if (recipe instanceof ShapedRecipe) { for (ItemStack ingredient : ((ShapedRecipe) recipe).getIngredientMap().values()) { if (ingredient != null && (repairMaterial == null || ingredient.getType() == repairMaterial) && (repairMetadata == -1 || ingredient.getType().equals(repairMaterial))) { quantity += ingredient.getAmount(); diff --git a/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundManager.java b/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundManager.java index e361d1dff..14984334c 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundManager.java @@ -11,47 +11,43 @@ import org.bukkit.entity.Player; public class SoundManager { /** * Sends a sound to the player + * * @param soundType the type of sound */ - public static void sendSound(Player player, Location location, SoundType soundType) - { - if(SoundConfig.getInstance().getIsEnabled(soundType)) + public static void sendSound(Player player, Location location, SoundType soundType) { + if (SoundConfig.getInstance().getIsEnabled(soundType)) player.playSound(location, getSound(soundType), SoundCategory.MASTER, getVolume(soundType), getPitch(soundType)); } - public static void sendCategorizedSound(Player player, Location location, SoundType soundType, SoundCategory soundCategory) - { - if(SoundConfig.getInstance().getIsEnabled(soundType)) + public static void sendCategorizedSound(Player player, Location location, SoundType soundType, SoundCategory soundCategory) { + if (SoundConfig.getInstance().getIsEnabled(soundType)) player.playSound(location, getSound(soundType), soundCategory, getVolume(soundType), getPitch(soundType)); } - public static void sendCategorizedSound(Player player, Location location, SoundType soundType, SoundCategory soundCategory, float pitchModifier) - { + public static void sendCategorizedSound(Player player, Location location, SoundType soundType, SoundCategory soundCategory, float pitchModifier) { float totalPitch = Math.min(2.0F, (getPitch(soundType) + pitchModifier)); - if(SoundConfig.getInstance().getIsEnabled(soundType)) + if (SoundConfig.getInstance().getIsEnabled(soundType)) player.playSound(location, getSound(soundType), soundCategory, getVolume(soundType), totalPitch); } - public static void worldSendSound(World world, Location location, SoundType soundType) - { - if(SoundConfig.getInstance().getIsEnabled(soundType)) + public static void worldSendSound(World world, Location location, SoundType soundType) { + if (SoundConfig.getInstance().getIsEnabled(soundType)) world.playSound(location, getSound(soundType), getVolume(soundType), getPitch(soundType)); } /** * All volume is multiplied by the master volume to get its final value + * * @param soundType target soundtype * @return the volume for this soundtype */ - private static float getVolume(SoundType soundType) - { + private static float getVolume(SoundType soundType) { return SoundConfig.getInstance().getVolume(soundType) * SoundConfig.getInstance().getMasterVolume(); } - private static float getPitch(SoundType soundType) - { - if(soundType == SoundType.FIZZ) + private static float getPitch(SoundType soundType) { + if (soundType == SoundType.FIZZ) return getFizzPitch(); else if (soundType == SoundType.POP) return getPopPitch(); @@ -59,10 +55,8 @@ public class SoundManager { return SoundConfig.getInstance().getPitch(soundType); } - private static Sound getSound(SoundType soundType) - { - switch(soundType) - { + private static Sound getSound(SoundType soundType) { + switch (soundType) { case ANVIL: return Sound.BLOCK_ANVIL_PLACE; case ITEM_BREAK: diff --git a/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundType.java b/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundType.java index ddffdcd08..99ee7ef07 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundType.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/sounds/SoundType.java @@ -16,9 +16,8 @@ public enum SoundType { BLEED, TIRED; - public boolean usesCustomPitch() - { - switch(this){ + public boolean usesCustomPitch() { + switch (this) { case POP: case FIZZ: return true; diff --git a/core/src/main/java/com/gmail/nossr50/core/util/upgrade/UpgradeManager.java b/core/src/main/java/com/gmail/nossr50/core/util/upgrade/UpgradeManager.java index 52af72fa0..2a4a0e70a 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/upgrade/UpgradeManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/upgrade/UpgradeManager.java @@ -22,7 +22,6 @@ public class UpgradeManager extends ConfigLoader { * Check if the given {@link UpgradeType} is necessary. * * @param type Upgrade type to check - * * @return true if plugin data needs to have the given upgrade */ public boolean shouldUpgrade(final UpgradeType type) { @@ -46,8 +45,7 @@ public class UpgradeManager extends ConfigLoader { try { config.save(getFile()); - } - catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); } } diff --git a/core/src/main/java/com/gmail/nossr50/core/util/uuid/UUIDFetcher.java b/core/src/main/java/com/gmail/nossr50/core/util/uuid/UUIDFetcher.java index 0da94b63a..5fa9e7452 100644 --- a/core/src/main/java/com/gmail/nossr50/core/util/uuid/UUIDFetcher.java +++ b/core/src/main/java/com/gmail/nossr50/core/util/uuid/UUIDFetcher.java @@ -30,28 +30,6 @@ public class UUIDFetcher implements Callable> { this(names, true); } - public Map call() throws Exception { - Map uuidMap = new HashMap(); - int requests = (int) Math.ceil(names.size() / PROFILES_PER_REQUEST); - for (int i = 0; i < requests; i++) { - HttpURLConnection connection = createConnection(); - String body = JSONArray.toJSONString(names.subList(i * PROFILES_PER_REQUEST, Math.min((i + 1) * PROFILES_PER_REQUEST, names.size()))); - writeBody(connection, body); - JSONArray array = (JSONArray) jsonParser.parse(new InputStreamReader(connection.getInputStream())); - for (Object profile : array) { - JSONObject jsonProfile = (JSONObject) profile; - String id = (String) jsonProfile.get("id"); - String name = (String) jsonProfile.get("name"); - UUID uuid = UUIDFetcher.getUUID(id); - uuidMap.put(name, uuid); - } - if (rateLimiting && i != requests - 1) { - Thread.sleep(RATE_LIMIT); - } - } - return uuidMap; - } - private static void writeBody(HttpURLConnection connection, String body) throws Exception { OutputStream stream = connection.getOutputStream(); stream.write(body.getBytes()); @@ -94,4 +72,26 @@ public class UUIDFetcher implements Callable> { public static UUID getUUIDOf(String name) throws Exception { return new UUIDFetcher(Arrays.asList(name)).call().get(name); } + + public Map call() throws Exception { + Map uuidMap = new HashMap(); + int requests = (int) Math.ceil(names.size() / PROFILES_PER_REQUEST); + for (int i = 0; i < requests; i++) { + HttpURLConnection connection = createConnection(); + String body = JSONArray.toJSONString(names.subList(i * PROFILES_PER_REQUEST, Math.min((i + 1) * PROFILES_PER_REQUEST, names.size()))); + writeBody(connection, body); + JSONArray array = (JSONArray) jsonParser.parse(new InputStreamReader(connection.getInputStream())); + for (Object profile : array) { + JSONObject jsonProfile = (JSONObject) profile; + String id = (String) jsonProfile.get("id"); + String name = (String) jsonProfile.get("name"); + UUID uuid = UUIDFetcher.getUUID(id); + uuidMap.put(name, uuid); + } + if (rateLimiting && i != requests - 1) { + Thread.sleep(RATE_LIMIT); + } + } + return uuidMap; + } } diff --git a/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardManager.java b/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardManager.java index 9cd12f58d..41d0de8ea 100644 --- a/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardManager.java +++ b/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardManager.java @@ -16,21 +16,19 @@ public class WorldGuardManager { private static WorldGuardManager instance; private WorldGuardPlugin worldGuardPluginRef; + public WorldGuardManager() { + + } + public static WorldGuardManager getInstance() { - if(instance == null) + if (instance == null) instance = new WorldGuardManager(); return instance; } - public WorldGuardManager() - { - - } - - public boolean hasMainFlag(Player player) - { - if(player == null) + public boolean hasMainFlag(Player player) { + if (player == null) return false; BukkitPlayer localPlayer = BukkitAdapter.adapt(player); @@ -46,9 +44,8 @@ public class WorldGuardManager { return query.testState(loc, WorldGuardPlugin.inst().wrapPlayer(player), WorldGuardFlags.MCMMO_ENABLE_WG_FLAG); } - public boolean hasXPFlag(Player player) - { - if(player == null) + public boolean hasXPFlag(Player player) { + if (player == null) return false; BukkitPlayer localPlayer = BukkitAdapter.adapt(player); @@ -75,9 +72,8 @@ public class WorldGuardManager { return worldGuardPluginRef; } - public void registerFlags() - { - if(getWorldGuard() == null) + public void registerFlags() { + if (getWorldGuard() == null) return; FlagRegistry registry = WorldGuard.getInstance().getFlagRegistry(); diff --git a/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardUtils.java b/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardUtils.java index 6b19963a0..6aae57a0f 100644 --- a/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardUtils.java +++ b/core/src/main/java/com/gmail/nossr50/core/worldguard/WorldGuardUtils.java @@ -10,8 +10,7 @@ public class WorldGuardUtils { private static boolean isLoaded = false; private static boolean hasWarned = false; - public static boolean isWorldGuardLoaded() - { + public static boolean isWorldGuardLoaded() { WorldGuardPlugin plugin = getWorldGuard(); try { @@ -30,25 +29,21 @@ public class WorldGuardUtils { return true; } - private static WorldGuardPlugin getWorldGuard() - { - if(isLoaded) + private static WorldGuardPlugin getWorldGuard() { + if (isLoaded) return worldGuardPluginRef; Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin("WorldGuard"); - if(plugin instanceof WorldGuardPlugin) - { - if(plugin.getDescription().getVersion().startsWith("7")) - { + if (plugin instanceof WorldGuardPlugin) { + if (plugin.getDescription().getVersion().startsWith("7")) { worldGuardPluginRef = (WorldGuardPlugin) plugin; - if(worldGuardPluginRef != null) + if (worldGuardPluginRef != null) isLoaded = true; } else { - if(!hasWarned) - { + if (!hasWarned) { mcMMO.p.getLogger().severe("mcMMO only supports WorldGuard version 7! Make sure you have WG 7! This warning will not appear again."); hasWarned = true; } diff --git a/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java b/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java index 5e1e942de..bf4abe5f1 100644 --- a/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java +++ b/core/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java @@ -36,8 +36,7 @@ public class ZipLibrary { if (BACKUP_DIR.mkdir()) { mcMMO.p.debug("Created Backup Directory."); } - } - catch (Exception e) { + } catch (Exception e) { mcMMO.p.getLogger().severe(e.toString()); } @@ -73,8 +72,7 @@ public class ZipLibrary { for (File source : sources) { if (source.isDirectory()) { zipDir(zipOut, "", source); - } - else { + } else { zipFile(zipOut, "", source); } } @@ -104,8 +102,7 @@ public class ZipLibrary { for (File source : files) { if (source.isDirectory()) { zipDir(zos, path, source); - } - else { + } else { zipFile(zos, path, source); } }