diff --git a/src/main/java/fr/communaywen/core/Managers.java b/src/main/java/fr/communaywen/core/Managers.java index c63fad7f..35a8ea0b 100644 --- a/src/main/java/fr/communaywen/core/Managers.java +++ b/src/main/java/fr/communaywen/core/Managers.java @@ -132,7 +132,7 @@ public void init(AywenCraftPlugin plugin) { guidelineManager = new GuidelineManager(plugin); contestCache = new ContestCache(plugin); contestManager = new ContestManager(plugin, contestCache); - this.teamManager = new TeamManager(plugin); + teamManager = new TeamManager(plugin); scoreboardManager = new ScoreboardManager(plugin); dreamdimManager = new DimensionManager(plugin); homeManager = new HomeManager(plugin); diff --git a/src/main/java/fr/communaywen/core/mailboxes/menu/letter/SendingLetter.java b/src/main/java/fr/communaywen/core/mailboxes/menu/letter/SendingLetter.java index b93f011a..eb0e4c95 100644 --- a/src/main/java/fr/communaywen/core/mailboxes/menu/letter/SendingLetter.java +++ b/src/main/java/fr/communaywen/core/mailboxes/menu/letter/SendingLetter.java @@ -24,7 +24,7 @@ public class SendingLetter extends MailboxInv { // private final TeamManager teamManager; // private final List playerFriends; -> Temporaire - int mail_accept; + int mailAccept; public SendingLetter(Player player, OfflinePlayer receiver, AywenCraftPlugin plugin) { super(player); @@ -33,7 +33,7 @@ public SendingLetter(Player player, OfflinePlayer receiver, AywenCraftPlugin plu // this.teamManager = plugin.getManagers().getTeamManager(); // FriendsManager friendsManager = plugin.getManagers().getFriendsManager(); // playerFriends = (List) friendsManager.getFriendsAsync(player.getName()); - this.mail_accept = SettingsCache.settingsMap.get(receiver.getUniqueId().toString()).mail_accept(); + mailAccept = SettingsCache.settingsMap.get(receiver.getUniqueId().toString()).mailAccept(); inventory = Bukkit.createInventory(this, 54, MailboxMenuManager.getInvTitle(INV_NAME)); inventory.setItem(49, getHead(receiver)); inventory.setItem(45, homeBtn()); @@ -45,7 +45,7 @@ public SendingLetter(Player player, OfflinePlayer receiver, AywenCraftPlugin plu @Override public void openInventory() { - player.openInventory(this.inventory); + player.openInventory(inventory); } public ItemStack[] getItems() { @@ -65,8 +65,8 @@ public void sendLetter() { sendFailureMessage(player, "Vous ne pouvez pas envoyer de lettre vide"); return; } - plugin.getLogger().info("Mail Accept" + mail_accept); - switch (mail_accept) { + plugin.getLogger().info("Mail Accept" + mailAccept); + switch (mailAccept) { case 0: sendFailureMessage(player, "Ce joueur n'accepte pas les lettres"); for (ItemStack item : items) player.getWorld().dropItemNaturally(player.getLocation(), item); diff --git a/src/main/java/fr/communaywen/core/settings/PlayerSettings.java b/src/main/java/fr/communaywen/core/settings/PlayerSettings.java index 04aff070..df08153b 100644 --- a/src/main/java/fr/communaywen/core/settings/PlayerSettings.java +++ b/src/main/java/fr/communaywen/core/settings/PlayerSettings.java @@ -1,3 +1,3 @@ package fr.communaywen.core.settings; -public record PlayerSettings(String uuid, int mail_accept, int trade_accept, int tpa_accept) {} \ No newline at end of file +public record PlayerSettings(String uuid, int mailAccept, int tradeAccept, int tpaAccept) {} \ No newline at end of file diff --git a/src/main/java/fr/communaywen/core/settings/SettingsCache.java b/src/main/java/fr/communaywen/core/settings/SettingsCache.java index 100850e8..fb9ea40f 100644 --- a/src/main/java/fr/communaywen/core/settings/SettingsCache.java +++ b/src/main/java/fr/communaywen/core/settings/SettingsCache.java @@ -5,6 +5,6 @@ public class SettingsCache { - public static Map settingsMap = new HashMap<>(); + public static Map settingsMap = new HashMap<>(); // UUID; PlayerSettings } \ No newline at end of file diff --git a/src/main/java/fr/communaywen/core/settings/SettingsManager.java b/src/main/java/fr/communaywen/core/settings/SettingsManager.java index b9435a7c..876e0691 100644 --- a/src/main/java/fr/communaywen/core/settings/SettingsManager.java +++ b/src/main/java/fr/communaywen/core/settings/SettingsManager.java @@ -50,9 +50,9 @@ public void createPlayerSettings(PlayerSettings settings) { String sql = "INSERT INTO settings (player, mail_accept, trade_accept, tpa_accept) VALUES (?, ?, ?, ?)"; PreparedStatement statement = connection.prepareStatement(sql); statement.setString(1, settings.uuid()); - statement.setInt(2, settings.mail_accept()); - statement.setInt(3, settings.trade_accept()); - statement.setInt(4, settings.tpa_accept()); + statement.setInt(2, settings.mailAccept()); + statement.setInt(3, settings.tradeAccept()); + statement.setInt(4, settings.tpaAccept()); statement.executeUpdate(); statement.close(); diff --git a/src/main/java/fr/communaywen/core/settings/SettingsMenu.java b/src/main/java/fr/communaywen/core/settings/SettingsMenu.java index 296d79ba..322db547 100644 --- a/src/main/java/fr/communaywen/core/settings/SettingsMenu.java +++ b/src/main/java/fr/communaywen/core/settings/SettingsMenu.java @@ -30,16 +30,16 @@ public class SettingsMenu extends Menu { @Getter @Setter - private int mail_accept, trade_accept, tpa_accept; + private int mailAccept, tradeAccept, tpaAccept; public SettingsMenu(AywenCraftPlugin plugin, Player owner, SettingsManager manager) { super(owner); this.plugin = plugin; this.owner = owner; this.manager = manager; - this.mail_accept = SettingsCache.settingsMap.get(owner.getUniqueId().toString()).mail_accept(); - this.trade_accept = SettingsCache.settingsMap.get(owner.getUniqueId().toString()).trade_accept(); - this.tpa_accept = SettingsCache.settingsMap.get(owner.getUniqueId().toString()).tpa_accept(); + mailAccept = SettingsCache.settingsMap.get(owner.getUniqueId().toString()).mailAccept(); + tradeAccept = SettingsCache.settingsMap.get(owner.getUniqueId().toString()).tradeAccept(); + tpaAccept = SettingsCache.settingsMap.get(owner.getUniqueId().toString()).tpaAccept(); } @Override @@ -63,7 +63,7 @@ public void onInventoryClick(InventoryClickEvent inventoryClickEvent) { map.put(22, new ItemBuilder(this, CustomStack.getInstance("settings:mailbox_settings_btn").getItemStack(), itemMeta -> { itemMeta.setDisplayName(ChatColor.GOLD + "Mailbox"); - itemMeta.setLore(List.of(SettingsUtils.getMailStatus(this.mail_accept))); + itemMeta.setLore(List.of(SettingsUtils.getMailStatus(mailAccept))); }).setNextMenu(new MailboxManagerMenu(owner, this))); map.put(45, new ItemBuilder(this, CustomStack.getInstance("settings:close_btn").getItemStack(), itemMeta -> { itemMeta.setDisplayName(ChatColor.DARK_RED + "Fermer"); @@ -71,7 +71,7 @@ public void onInventoryClick(InventoryClickEvent inventoryClickEvent) { map.put(53, new ItemBuilder(this, CustomStack.getInstance("settings:save_btn").getItemStack(), itemMeta -> { itemMeta.setDisplayName(ChatColor.GREEN + "Sauvegarder"); }).setOnClick(inventoryClickEvent -> { - SettingsCache.settingsMap.replace(owner.getUniqueId().toString(), new PlayerSettings(owner.getUniqueId().toString(), mail_accept, trade_accept, tpa_accept)); + SettingsCache.settingsMap.replace(owner.getUniqueId().toString(), new PlayerSettings(owner.getUniqueId().toString(), mailAccept, tradeAccept, tpaAccept)); MessageManager.sendMessageType(owner, "Settings enregistrés", Prefix.SETTINGS, MessageType.INFO, false); })); return map; diff --git a/src/main/java/fr/communaywen/core/settings/SettingsUtils.java b/src/main/java/fr/communaywen/core/settings/SettingsUtils.java index 21fb0ef6..e96522dc 100644 --- a/src/main/java/fr/communaywen/core/settings/SettingsUtils.java +++ b/src/main/java/fr/communaywen/core/settings/SettingsUtils.java @@ -4,8 +4,8 @@ public class SettingsUtils { - public static String getMailStatus(int mail_accept) { - return switch (mail_accept) { + public static String getMailStatus(int mailAccept) { + return switch (mailAccept) { case 0 -> ChatColor.RED + "Personne"; case 1 -> ChatColor.GOLD + "Amis seulement"; case 2 -> ChatColor.YELLOW + "Team seulement"; diff --git a/src/main/java/fr/communaywen/core/settings/menus/MailboxManagerMenu.java b/src/main/java/fr/communaywen/core/settings/menus/MailboxManagerMenu.java index b889f6e3..f7df8bde 100644 --- a/src/main/java/fr/communaywen/core/settings/menus/MailboxManagerMenu.java +++ b/src/main/java/fr/communaywen/core/settings/menus/MailboxManagerMenu.java @@ -22,7 +22,7 @@ public class MailboxManagerMenu extends Menu { public MailboxManagerMenu(Player owner, SettingsMenu settingsMenu) { super(owner); - this.player = owner; + player = owner; this.settingsMenu = settingsMenu; } @@ -47,30 +47,30 @@ public void onInventoryClick(InventoryClickEvent inventoryClickEvent) { map.put(1, new ItemBuilder(this, Material.RED_WOOL, itemMeta -> { itemMeta.setDisplayName(ChatColor.DARK_RED + "Personne"); - itemMeta.setEnchantmentGlintOverride(settingsMenu.getMail_accept() == 0); + itemMeta.setEnchantmentGlintOverride(settingsMenu.getMailAccept() == 0); }).setOnClick(inventoryClickEvent -> { - settingsMenu.setMail_accept(0); + settingsMenu.setMailAccept(0); back(); })); // map.put(3, new ItemBuilder(this, Material.ORANGE_WOOL, itemMeta -> { // itemMeta.setDisplayName(ChatColor.GOLD + "Amis seulement"); -// itemMeta.setEnchantmentGlintOverride(settingsMenu.getMail_accept() == 1); +// itemMeta.setEnchantmentGlintOverride(settingsMenu.getMailAccept() == 1); // }).setOnClick(inventoryClickEvent -> { -// settingsMenu.setMail_accept(1); +// settingsMenu.setMailAccept(1); // back(); // })); // map.put(5, new ItemBuilder(this, Material.YELLOW_WOOL, itemMeta -> { // itemMeta.setDisplayName(ChatColor.YELLOW + "Team seulement"); -// itemMeta.setEnchantmentGlintOverride(settingsMenu.getMail_accept() == 2); +// itemMeta.setEnchantmentGlintOverride(settingsMenu.getMaiLAccept() == 2); // }).setOnClick(inventoryClickEvent -> { -// settingsMenu.setMail_accept(2); +// settingsMenu.setMailAccept(2); // back(); // })); map.put(7, new ItemBuilder(this, Material.GREEN_WOOL, itemMeta -> { itemMeta.setDisplayName(ChatColor.GREEN + "Tout le monde"); - itemMeta.setEnchantmentGlintOverride(settingsMenu.getMail_accept() == 3); + itemMeta.setEnchantmentGlintOverride(settingsMenu.getMailAccept() == 3); }).setOnClick(inventoryClickEvent -> { - settingsMenu.setMail_accept(3); + settingsMenu.setMailAccept(3); back(); })); return map; diff --git a/src/main/java/fr/communaywen/core/utils/command/InteractiveHelpMenu.java b/src/main/java/fr/communaywen/core/utils/command/InteractiveHelpMenu.java index d5b8a604..9b9db723 100644 --- a/src/main/java/fr/communaywen/core/utils/command/InteractiveHelpMenu.java +++ b/src/main/java/fr/communaywen/core/utils/command/InteractiveHelpMenu.java @@ -39,7 +39,7 @@ * } * *
  • Create the commands that you would like to display the help menu in. Send the help - * menu using {@link InteractiveHelpMenu#sendInteractiveMenu(Audience, CommandHelp, int, ExecutableCommand)}. + * menu using @link InteractiveHelpMenu#sendInteractiveMenu(Audience, CommandHelp, int, ExecutableCommand). * All the parameters should be parameters in the help method, and Lamp will resolve them automatically * to the appropriate values. *
    {@code
    @@ -74,7 +74,7 @@
      *     
  • /foo bar help: Lists all commands in /foo bar
  • *
  • /foo buzz bar help: Lists all commands in /foo buzz bar
  • * - * This is why {@link #sendInteractiveMenu(Audience, CommandHelp, int, ExecutableCommand)} requires + * This is why @link #sendInteractiveMenu(Audience, CommandHelp, int, ExecutableCommand) requires * an {@link ExecutableCommand}, as it uses it to resolve sibling commands that should be * listed in the help menu. */