diff --git a/gradle.properties b/gradle.properties index af82e006..75a6d14e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,4 @@ -org.gradle.parallel=true \ No newline at end of file +org.gradle.caching=true +org.gradle.parallel=true +org.gradle.vfs.watch=false +org.gradle.jvmargs=-Xmx8g \ No newline at end of file diff --git a/nms/v1_21_R1/build.gradle.kts b/nms/v1_21_R1/build.gradle.kts index 9aa232a4..42233929 100644 --- a/nms/v1_21_R1/build.gradle.kts +++ b/nms/v1_21_R1/build.gradle.kts @@ -4,7 +4,7 @@ plugins { } dependencies { - paperweight.paperDevBundle("1.21.1-R0.1-SNAPSHOT") + paperweight.paperDevBundle("1.21-R0.1-SNAPSHOT") compileOnly(project(":nms:v1_20_R4")) compileOnly(project(":api")) } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/Main.java b/plugin/src/main/java/fr/euphyllia/skyllia/Main.java index 94db8c82..60bfe978 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/Main.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/Main.java @@ -116,7 +116,7 @@ private void loadListener() { pluginManager.registerEvents(new PlayerEvent(this.interneAPI), this); pluginManager.registerEvents(new DamageEvent(this.interneAPI), this); pluginManager.registerEvents(new InteractEvent(this.interneAPI), this); - pluginManager.registerEvents(new TeleportEvent(this.interneAPI), this); // Todo Don't work with folia 1.19.4-1.20.6 (can work on Bloom, but don't use it) + pluginManager.registerEvents(new TeleportEvent(this.interneAPI), this); // Todo Don't work with folia 1.19.4-1.21.1 (can work on Bloom, but don't use it) pluginManager.registerEvents(new PistonEvent(this.interneAPI), this); if (VersionUtils.IS_FOLIA) { pluginManager.registerEvents(new PortalAlternativeFoliaEvent(this.interneAPI), this); diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/admin/subcommands/ForceDeleteSubCommands.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/admin/subcommands/ForceDeleteSubCommands.java index 75c92456..77f6a17b 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/admin/subcommands/ForceDeleteSubCommands.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/admin/subcommands/ForceDeleteSubCommands.java @@ -35,18 +35,18 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.admins.commands.island.delete")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } if (args.length < 2) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageADeleteCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messageADeleteCommandNotEnoughArgs); return true; } String playerName = args[0]; String confirm = args[1]; if (!confirm.equalsIgnoreCase("confirm")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageADeleteNotConfirmedArgs); + LanguageToml.sendMessage(player, LanguageToml.messageADeleteNotConfirmedArgs); return true; } try { @@ -59,7 +59,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island island = skyblockManager.getIslandByOwner(playerId).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } @@ -71,13 +71,13 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N WorldEditUtils.deleteIsland(plugin, island, Bukkit.getWorld(worldConfig.name())); } - LanguageToml.sendMessage(plugin, player, LanguageToml.messageIslandDeleteSuccess); + LanguageToml.sendMessage(player, LanguageToml.messageIslandDeleteSuccess); } else { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } } catch (Exception e) { logger.log(Level.FATAL, e.getMessage(), e); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } return true; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/admin/subcommands/SetMaxMembersSubCommands.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/admin/subcommands/SetMaxMembersSubCommands.java index 51bebaf8..420355a1 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/admin/subcommands/SetMaxMembersSubCommands.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/admin/subcommands/SetMaxMembersSubCommands.java @@ -28,19 +28,19 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.admins.commands.island.setmaxmembers")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } if (args.length < 3) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageASetMaxMembersCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messageASetMaxMembersCommandNotEnoughArgs); return true; } String playerName = args[0]; String changeValue = args[1]; String confirm = args[2]; if (!confirm.equalsIgnoreCase("confirm")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageASetMaxMembersNotConfirmedArgs); + LanguageToml.sendMessage(player, LanguageToml.messageASetMaxMembersNotConfirmedArgs); return true; } try { @@ -53,24 +53,24 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island island = skyblockManager.getIslandByOwner(playerId).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } int members = Integer.parseInt(changeValue); boolean updated = island.setMaxMembers(members); if (updated) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageASetSizeSuccess); + LanguageToml.sendMessage(player, LanguageToml.messageASetSizeSuccess); } else { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageASetSizeFailed); + LanguageToml.sendMessage(player, LanguageToml.messageASetSizeFailed); } } catch (Exception e) { if (e instanceof NumberFormatException ignored) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageASetMaxMembersNAN); + LanguageToml.sendMessage(player, LanguageToml.messageASetMaxMembersNAN); } else { logger.log(Level.FATAL, e.getMessage(), e); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } } return true; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/admin/subcommands/SetSizeSubCommands.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/admin/subcommands/SetSizeSubCommands.java index a9bdd9eb..cb2d6267 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/admin/subcommands/SetSizeSubCommands.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/admin/subcommands/SetSizeSubCommands.java @@ -28,19 +28,19 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.admins.commands.island.setsize")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } if (args.length < 3) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageASetSizeCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messageASetSizeCommandNotEnoughArgs); return true; } String playerName = args[0]; String changeValue = args[1]; String confirm = args[2]; if (!confirm.equalsIgnoreCase("confirm")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageASetSizeNotConfirmedArgs); + LanguageToml.sendMessage(player, LanguageToml.messageASetSizeNotConfirmedArgs); return true; } try { @@ -53,24 +53,24 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island island = skyblockManager.getIslandByOwner(playerId).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } double newSize = Double.parseDouble(changeValue); boolean updated = island.setSize(newSize); if (updated) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageASetSizeSuccess); + LanguageToml.sendMessage(player, LanguageToml.messageASetSizeSuccess); } else { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageASetSizeFailed); + LanguageToml.sendMessage(player, LanguageToml.messageASetSizeFailed); } } catch (Exception e) { if (e instanceof NumberFormatException ignored) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageASetSizeNAN); + LanguageToml.sendMessage(player, LanguageToml.messageASetSizeNAN); } else { logger.log(Level.FATAL, e.getMessage(), e); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } } return true; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/SubCommands.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/SubCommands.java index 6a174a62..23d9d77d 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/SubCommands.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/SubCommands.java @@ -33,9 +33,6 @@ public enum SubCommands { VISIT(new VisitSubCommand(), "visit"), WARP(new WarpSubCommand(), "warp"); - private final SubCommandInterface commandInterface; - private final String[] aliases; - private static final Map commandMap = new HashMap<>(); static { @@ -46,6 +43,9 @@ public enum SubCommands { } } + private final SubCommandInterface commandInterface; + private final String[] aliases; + SubCommands(SubCommandInterface subCommandInterface, String... aliases) { this.commandInterface = subCommandInterface; this.aliases = aliases; @@ -55,11 +55,11 @@ public static SubCommands subCommandByName(@NotNull String name) { return commandMap.get(name.toLowerCase()); } - public SubCommandInterface getSubCommandInterface() { - return this.commandInterface; - } - public static Map getCommandMap() { return commandMap; } + + public SubCommandInterface getSubCommandInterface() { + return this.commandInterface; + } } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/AccessSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/AccessSubCommand.java index 154a727a..bed7976c 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/AccessSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/AccessSubCommand.java @@ -37,7 +37,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.island.command.access")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } @@ -45,7 +45,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N Island island = skyblockManager.getIslandByPlayerId(player.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } @@ -55,7 +55,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N PermissionManager permissionManager = new PermissionManager(permissionRoleIsland.permission()); if (!permissionManager.hasPermission(PermissionsCommandIsland.ACCESS)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } } @@ -65,7 +65,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N boolean isUpdate = island.setPrivateIsland(statusAccessUpdate); if (isUpdate) { if (statusAccessUpdate) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageAccessIslandClose); + LanguageToml.sendMessage(player, LanguageToml.messageAccessIslandClose); ConfigToml.worldConfigs.forEach(worldConfig -> { RegionUtils.getEntitiesInRegion(plugin, EntityType.PLAYER, Bukkit.getWorld(worldConfig.name()), island.getPosition().x(), island.getPosition().z(), entity -> { Player playerInIsland = (Player) entity; @@ -77,7 +77,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N }); }); } else { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageAccessIslandOpen); + LanguageToml.sendMessage(player, LanguageToml.messageAccessIslandOpen); } } return true; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/BanSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/BanSubCommand.java index fecfd831..b729dc56 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/BanSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/BanSubCommand.java @@ -32,17 +32,17 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.island.command.ban")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } if (args.length < 1) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageBanCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messageBanCommandNotEnoughArgs); return true; } SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island island = skyblockManager.getIslandByPlayerId(player.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } @@ -53,7 +53,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N PermissionManager permissionManager = new PermissionManager(permissionRoleIsland.permission()); if (!permissionManager.hasPermission(PermissionsCommandIsland.BAN)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } } @@ -62,20 +62,20 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N Players players = island.getMember(playerBan); if (players != null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageBanImpossiblePlayerInIsland); + LanguageToml.sendMessage(player, LanguageToml.messageBanImpossiblePlayerInIsland); return true; } Player bPlayerBan = Bukkit.getPlayerExact(playerBan); if (bPlayerBan == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerNotFound); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerNotFound); return true; } players = new Players(bPlayerBan.getUniqueId(), playerBan, island.getId(), RoleType.BAN); island.updateMember(players); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageBanPlayerSuccess); + LanguageToml.sendMessage(player, LanguageToml.messageBanPlayerSuccess); ExpelSubCommand.expelPlayer(plugin, island, bPlayerBan, player, true); return true; } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/CreateSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/CreateSubCommand.java index 6dfcac16..89a3d8eb 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/CreateSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/CreateSubCommand.java @@ -49,7 +49,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.island.command.create")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } GameMode olgGM = player.getGameMode(); @@ -65,26 +65,26 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N } Map schematicSettingMap = IslandUtils.getSchematic(schemKey); if (schematicSettingMap == null || schematicSettingMap.isEmpty()) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageIslandSchemNotExist); + LanguageToml.sendMessage(player, LanguageToml.messageIslandSchemNotExist); return true; } IslandSettings islandSettings = IslandUtils.getIslandSettings(schemKey); if (islandSettings == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageIslandTypeNotExist); + LanguageToml.sendMessage(player, LanguageToml.messageIslandTypeNotExist); return true; } if (!player.hasPermission("skyllia.island.command.create.%s".formatted(schemKey))) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } - LanguageToml.sendMessage(plugin, player, LanguageToml.messageIslandInProgress); + LanguageToml.sendMessage(player, LanguageToml.messageIslandInProgress); UUID idIsland = UUID.randomUUID(); boolean isCreate = Boolean.TRUE.equals(skyblockManager.createIsland(idIsland, islandSettings).join()); if (!isCreate) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageIslandError); + LanguageToml.sendMessage(player, LanguageToml.messageIslandError); return true; } islandAtomic.set(skyblockManager.getIslandByIslandId(idIsland).join()); @@ -101,10 +101,11 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N this.setFirstHome(islandAtomic.get(), centerPaste); this.setPermissionsRole(islandAtomic.get()); player.teleportAsync(centerPaste, PlayerTeleportEvent.TeleportCause.PLUGIN); - if (ConfigToml.changeGameModeWhenTeleportIsland) PlayerFolia.setGameMode(player, GameMode.SURVIVAL); + if (ConfigToml.changeGameModeWhenTeleportIsland) + PlayerFolia.setGameMode(player, GameMode.SURVIVAL); this.addOwnerIslandInMember(islandAtomic.get(), player); plugin.getInterneAPI().getPlayerNMS().setOwnWorldBorder(plugin, player, centerPaste, islandAtomic.get().getSize(), 0, 0); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageIslandCreateFinish); + LanguageToml.sendMessage(player, LanguageToml.messageIslandCreateFinish); CompletableFuture.runAsync(() -> Bukkit.getPluginManager().callEvent(new SkyblockLoadEvent(islandAtomic.get()))); isFirstIteration = false; } @@ -115,7 +116,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N } catch (Exception e) { logger.log(Level.FATAL, e.getMessage(), e); if (ConfigToml.changeGameModeWhenTeleportIsland) PlayerFolia.setGameMode(player, olgGM); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } return true; } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DelWarpSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DelWarpSubCommand.java index 22c63696..ecd49367 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DelWarpSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DelWarpSubCommand.java @@ -33,11 +33,11 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (args.length < 1) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageWarpCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messageWarpCommandNotEnoughArgs); return true; } if (!player.hasPermission("skyllia.island.command.delwarp")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } @@ -47,12 +47,12 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island island = skyblockManager.getIslandByPlayerId(player.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } if (warpName.equalsIgnoreCase("home")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageIslandNotDeleteHome); + LanguageToml.sendMessage(player, LanguageToml.messageIslandNotDeleteHome); return true; } @@ -62,20 +62,20 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N PermissionRoleIsland permissionRoleIsland = skyblockManager.getPermissionIsland(island.getId(), PermissionsType.COMMANDS, executorPlayer.getRoleType()).join(); PermissionManager permissionManager = new PermissionManager(permissionRoleIsland.permission()); if (!permissionManager.hasPermission(PermissionsCommandIsland.DEL_WARP)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } } boolean deleteWarp = island.delWarp(warpName); if (deleteWarp) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageWarpDeleteSuccess); + LanguageToml.sendMessage(player, LanguageToml.messageWarpDeleteSuccess); } else { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } } catch (Exception e) { logger.log(Level.FATAL, e.getMessage(), e); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } return true; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DeleteSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DeleteSubCommand.java index 8a9929e1..767b24b4 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DeleteSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DeleteSubCommand.java @@ -56,21 +56,21 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.island.command.delete")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } try { SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island island = skyblockManager.getIslandByOwner(player.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } Players executorPlayer = island.getMember(player.getUniqueId()); if (!executorPlayer.getRoleType().equals(RoleType.OWNER)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageOnlyOwnerCanDeleteIsland); + LanguageToml.sendMessage(player, LanguageToml.messageOnlyOwnerCanDeleteIsland); return true; } @@ -83,13 +83,13 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N WorldEditUtils.deleteIsland(plugin, island, Bukkit.getWorld(worldConfig.name())); } - LanguageToml.sendMessage(plugin, player, LanguageToml.messageIslandDeleteSuccess); + LanguageToml.sendMessage(player, LanguageToml.messageIslandDeleteSuccess); } else { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } } catch (Exception e) { logger.log(Level.FATAL, e.getMessage(), e); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } return true; } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DemoteSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DemoteSubCommand.java index 3a2e5db2..91c0e216 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DemoteSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/DemoteSubCommand.java @@ -32,11 +32,11 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.island.command.demote")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } if (args.length < 1) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageDemoteCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messageDemoteCommandNotEnoughArgs); return true; } try { @@ -45,7 +45,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island island = skyblockManager.getIslandByPlayerId(player.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } @@ -56,7 +56,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N PermissionManager permissionManager = new PermissionManager(permissionRoleIsland.permission()); if (!permissionManager.hasPermission(PermissionsCommandIsland.DEMOTE)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } } @@ -64,26 +64,26 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N Players players = island.getMember(playerName); if (players == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerNotFound); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerNotFound); return true; } if (players.getRoleType().equals(RoleType.OWNER) || executorPlayer.getRoleType().getValue() <= players.getRoleType().getValue()) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageDemotePlayerFailedHighOrEqualsStatus); + LanguageToml.sendMessage(player, LanguageToml.messageDemotePlayerFailedHighOrEqualsStatus); return true; } RoleType demoteResult = RoleType.getRoleById(players.getRoleType().getValue() - 1); if (demoteResult.getValue() == 0 || demoteResult.getValue() == -1) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageDemotePlayerFailed.formatted(playerName)); + LanguageToml.sendMessage(player, LanguageToml.messageDemotePlayerFailed.formatted(playerName)); return true; } players.setRoleType(demoteResult); island.updateMember(players); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageDemotePlayer.formatted(playerName)); + LanguageToml.sendMessage(player, LanguageToml.messageDemotePlayer.formatted(playerName)); } catch (Exception e) { logger.log(Level.FATAL, e.getMessage(), e); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } return true; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/ExpelSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/ExpelSubCommand.java index 3fd3c54a..431c3b98 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/ExpelSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/ExpelSubCommand.java @@ -35,7 +35,7 @@ public class ExpelSubCommand implements SubCommandInterface { public static void expelPlayer(Main plugin, Island island, Player bPlayerToExpel, Player executor, boolean silent) { Location bPlayerExpelLocation = bPlayerToExpel.getLocation(); if (Boolean.FALSE.equals(WorldUtils.isWorldSkyblock(bPlayerExpelLocation.getWorld().getName()))) { - if (!silent) LanguageToml.sendMessage(plugin, executor, LanguageToml.messageExpelPlayerFailedNotInIsland); + if (!silent) LanguageToml.sendMessage(executor, LanguageToml.messageExpelPlayerFailedNotInIsland); return; } @@ -46,7 +46,7 @@ public static void expelPlayer(Main plugin, Island island, Player bPlayerToExpel Position playerRegionPosition = RegionHelper.getRegionInChunk(chunkLocX, chunkLocZ); if (islandPosition.x() != playerRegionPosition.x() || islandPosition.z() != playerRegionPosition.z()) { - if (!silent) LanguageToml.sendMessage(plugin, executor, LanguageToml.messageExpelPlayerFailedNotInIsland); + if (!silent) LanguageToml.sendMessage(executor, LanguageToml.messageExpelPlayerFailedNotInIsland); return; } @@ -59,11 +59,11 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.island.command.expel")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } if (args.length < 1) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageExpelCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messageExpelCommandNotEnoughArgs); return true; } try { @@ -71,7 +71,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N Island island = skyblockManager.getIslandByPlayerId(player.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } @@ -81,7 +81,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N PermissionManager permissionManager = new PermissionManager(permissionRoleIsland.permission()); if (!permissionManager.hasPermission(PermissionsCommandIsland.EXPEL)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } } @@ -89,15 +89,15 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N String playerToExpel = args[0]; Player bPlayerToExpel = Bukkit.getPlayerExact(playerToExpel); if (bPlayerToExpel == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerNotFound); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerNotFound); return true; } if (!bPlayerToExpel.isOnline()) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerNotConnected); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerNotConnected); return true; } if (bPlayerToExpel.hasPermission("skyllia.island.command.expel.bypass")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageExpelPlayerFailed); + LanguageToml.sendMessage(player, LanguageToml.messageExpelPlayerFailed); return true; } @@ -105,7 +105,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N } catch (Exception e) { logger.log(Level.FATAL, e.getMessage(), e); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } return true; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/GameRuleSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/GameRuleSubCommand.java index 2722e424..1e642bf8 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/GameRuleSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/GameRuleSubCommand.java @@ -35,11 +35,11 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.island.command.gamerule")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } if (args.length < 2) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageGameRuleCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messageGameRuleCommandNotEnoughArgs); return true; } String permissionRaw = args[0]; // Permission @@ -48,7 +48,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island island = skyblockManager.getIslandByPlayerId(player.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } @@ -59,7 +59,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N PermissionManager permissionManager = new PermissionManager(permissionRoleIsland.permission()); if (!permissionManager.hasPermission(PermissionsCommandIsland.MANAGE_GAMERULE)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } } @@ -69,7 +69,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N try { gameRuleIsland = GameRuleIsland.valueOf(permissionRaw.toUpperCase()); } catch (IllegalArgumentException exception) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageGameRuleInvalid); + LanguageToml.sendMessage(player, LanguageToml.messageGameRuleInvalid); return true; } @@ -80,13 +80,13 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N boolean updateGameRuleIsland = island.updateGamerule(permissionManager.getPermissions()); if (updateGameRuleIsland) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageGameRuleUpdateSuccess); + LanguageToml.sendMessage(player, LanguageToml.messageGameRuleUpdateSuccess); } else { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageGameRuleUpdateFailed); + LanguageToml.sendMessage(player, LanguageToml.messageGameRuleUpdateFailed); } } catch (Exception e) { logger.log(Level.FATAL, e.getMessage(), e); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } return true; } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/HomeSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/HomeSubCommand.java index 4f1f0a59..0ddb260c 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/HomeSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/HomeSubCommand.java @@ -37,7 +37,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.island.command.home")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } @@ -45,7 +45,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island island = skyblockManager.getIslandByPlayerId(player.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } if (ConfigToml.changeGameModeWhenTeleportIsland) PlayerFolia.setGameMode(player, GameMode.SPECTATOR); @@ -63,11 +63,11 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N player.teleportAsync(loc, PlayerTeleportEvent.TeleportCause.PLUGIN); if (ConfigToml.changeGameModeWhenTeleportIsland) PlayerFolia.setGameMode(player, GameMode.SURVIVAL); plugin.getInterneAPI().getPlayerNMS().setOwnWorldBorder(plugin, player, RegionHelper.getCenterRegion(loc.getWorld(), island.getPosition().x(), island.getPosition().z()), rayon, 0, 0); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageHomeIslandSuccess); + LanguageToml.sendMessage(player, LanguageToml.messageHomeIslandSuccess); }, null, 0L); } catch (Exception exception) { logger.log(Level.FATAL, exception.getMessage(), exception); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } return true; } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/InviteSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/InviteSubCommand.java index 40103170..dee24b6e 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/InviteSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/InviteSubCommand.java @@ -37,31 +37,31 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.island.command.invite")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } if (args.length < 1) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageInviteCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messageInviteCommandNotEnoughArgs); return true; } String type = args[0]; if (type.equalsIgnoreCase("add")) { if (args.length < 2) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageInviteAddCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messageInviteAddCommandNotEnoughArgs); return true; } String playerOrOwner = args[1]; invitePlayer(plugin, player, playerOrOwner); } else if (type.equalsIgnoreCase("accept")) { if (args.length < 2) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageInviteAcceptCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messageInviteAcceptCommandNotEnoughArgs); return true; } String playerOrOwner = args[1]; acceptPlayer(plugin, player, playerOrOwner); } else if (type.equalsIgnoreCase("decline")) { if (args.length < 2) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageInviteDeclineCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messageInviteDeclineCommandNotEnoughArgs); return true; } String playerOrOwner = args[1]; @@ -86,7 +86,7 @@ private void invitePlayer(Main plugin, Player ownerIsland, String playerInvited) SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island island = skyblockManager.getIslandByPlayerId(ownerIsland.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, ownerIsland, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(ownerIsland, LanguageToml.messagePlayerHasNotIsland); return; } @@ -97,26 +97,26 @@ private void invitePlayer(Main plugin, Player ownerIsland, String playerInvited) PermissionManager permissionManager = new PermissionManager(permissionRoleIsland.permission()); if (!permissionManager.hasPermission(PermissionsCommandIsland.INVITE)) { - LanguageToml.sendMessage(plugin, ownerIsland, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(ownerIsland, LanguageToml.messagePlayerPermissionDenied); return; } } UUID playerInvitedId = Bukkit.getPlayerUniqueId(playerInvited); if (playerInvitedId == null) { - LanguageToml.sendMessage(plugin, ownerIsland, LanguageToml.messagePlayerNotFound); + LanguageToml.sendMessage(ownerIsland, LanguageToml.messagePlayerNotFound); return; } InviteCacheExecution.addInviteCache(island.getId(), playerInvitedId); - LanguageToml.sendMessage(plugin, ownerIsland, LanguageToml.messageInvitePlayerInvited.formatted(playerInvited)); + LanguageToml.sendMessage(ownerIsland, LanguageToml.messageInvitePlayerInvited.formatted(playerInvited)); Player bPlayerInvited = Bukkit.getPlayer(playerInvitedId); if (bPlayerInvited != null && bPlayerInvited.isOnline()) { - LanguageToml.sendMessage(plugin, bPlayerInvited, LanguageToml.messageInvitePlayerNotification.replaceAll("%player_invite%", ownerIsland.getName())); + LanguageToml.sendMessage(bPlayerInvited, LanguageToml.messageInvitePlayerNotification.replaceAll("%player_invite%", ownerIsland.getName())); } } catch (Exception e) { logger.log(Level.FATAL, e.getMessage(), e); - LanguageToml.sendMessage(plugin, ownerIsland, LanguageToml.messageError); + LanguageToml.sendMessage(ownerIsland, LanguageToml.messageError); } } @@ -125,30 +125,30 @@ private void acceptPlayer(Main plugin, Player playerWantJoin, String ownerIsland SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island islandPlayer = skyblockManager.getIslandByPlayerId(playerWantJoin.getUniqueId()).join(); if (islandPlayer != null) { - LanguageToml.sendMessage(plugin, playerWantJoin, LanguageToml.messageInviteAlreadyIsland); + LanguageToml.sendMessage(playerWantJoin, LanguageToml.messageInviteAlreadyIsland); return; } UUID ownerIslandId = Bukkit.getPlayerUniqueId(ownerIsland); if (ownerIslandId == null) { - LanguageToml.sendMessage(plugin, playerWantJoin, LanguageToml.messagePlayerNotFound); + LanguageToml.sendMessage(playerWantJoin, LanguageToml.messagePlayerNotFound); return; } Island islandOwner = skyblockManager.getIslandByOwner(ownerIslandId).join(); if (islandOwner == null) { - LanguageToml.sendMessage(plugin, playerWantJoin, LanguageToml.messageInviteAcceptOwnerHasNotIsland); + LanguageToml.sendMessage(playerWantJoin, LanguageToml.messageInviteAcceptOwnerHasNotIsland); return; } InviteCacheExecution.removeInviteCache(islandOwner.getId(), playerWantJoin.getUniqueId()); if (islandOwner.getMaxMembers() >= islandOwner.getMembers().size()) { Players newPlayers = new Players(playerWantJoin.getUniqueId(), playerWantJoin.getName(), islandOwner.getId(), RoleType.MEMBER); islandOwner.updateMember(newPlayers); - LanguageToml.sendMessage(plugin, playerWantJoin, LanguageToml.messageInviteJoinIsland); + LanguageToml.sendMessage(playerWantJoin, LanguageToml.messageInviteJoinIsland); } else { - LanguageToml.sendMessage(plugin, playerWantJoin, LanguageToml.messageInviteMaxMemberExceededIsland); + LanguageToml.sendMessage(playerWantJoin, LanguageToml.messageInviteMaxMemberExceededIsland); } } catch (Exception e) { logger.log(Level.FATAL, e.getMessage(), e); - LanguageToml.sendMessage(plugin, playerWantJoin, LanguageToml.messageError); + LanguageToml.sendMessage(playerWantJoin, LanguageToml.messageError); } } @@ -157,24 +157,24 @@ private void declinePlayer(Main plugin, Player playerWantDecline, String ownerIs SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island island = skyblockManager.getIslandByPlayerId(playerWantDecline.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, playerWantDecline, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(playerWantDecline, LanguageToml.messagePlayerHasNotIsland); return; } UUID ownerIslandId = Bukkit.getPlayerUniqueId(ownerIsland); if (ownerIslandId == null) { - LanguageToml.sendMessage(plugin, playerWantDecline, LanguageToml.messagePlayerNotFound); + LanguageToml.sendMessage(playerWantDecline, LanguageToml.messagePlayerNotFound); return; } Island islandOwner = skyblockManager.getIslandByOwner(ownerIslandId).join(); if (islandOwner == null) { - LanguageToml.sendMessage(plugin, playerWantDecline, LanguageToml.messageInviteDeclineOwnerHasNotIsland); + LanguageToml.sendMessage(playerWantDecline, LanguageToml.messageInviteDeclineOwnerHasNotIsland); return; } InviteCacheExecution.removeInviteCache(islandOwner.getId(), playerWantDecline.getUniqueId()); - LanguageToml.sendMessage(plugin, playerWantDecline, LanguageToml.messageInviteDeclineDeleteInvitation.replaceAll("%player_invite%", ownerIsland)); + LanguageToml.sendMessage(playerWantDecline, LanguageToml.messageInviteDeclineDeleteInvitation.replaceAll("%player_invite%", ownerIsland)); } catch (Exception e) { logger.log(Level.FATAL, e.getMessage(), e); - LanguageToml.sendMessage(plugin, playerWantDecline, LanguageToml.messageError); + LanguageToml.sendMessage(playerWantDecline, LanguageToml.messageError); } } } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/KickSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/KickSubCommand.java index 0f587489..c71b9a26 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/KickSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/KickSubCommand.java @@ -31,17 +31,17 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.island.command.kick")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } if (args.length < 1) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageKickCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messageKickCommandNotEnoughArgs); return true; } SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island island = skyblockManager.getIslandByPlayerId(player.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } @@ -52,7 +52,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N PermissionManager permissionManager = new PermissionManager(permissionRoleIsland.permission()); if (!permissionManager.hasPermission(PermissionsCommandIsland.KICK)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } } @@ -61,21 +61,21 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N Players players = island.getMember(playerKick); if (players == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerNotFound); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerNotFound); return true; } if (players.getRoleType().equals(RoleType.OWNER) || executorPlayer.getRoleType().getValue() <= players.getRoleType().getValue()) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageKickPlayerFailedHighOrEqualsStatus); + LanguageToml.sendMessage(player, LanguageToml.messageKickPlayerFailedHighOrEqualsStatus); return true; } boolean isRemoved = island.removeMember(players); if (isRemoved) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageKickPlayerSuccess); + LanguageToml.sendMessage(player, LanguageToml.messageKickPlayerSuccess); DeleteSubCommand.checkClearPlayer(plugin, skyblockManager, players); } else { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageKickPlayerFailed); + LanguageToml.sendMessage(player, LanguageToml.messageKickPlayerFailed); } return true; } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/LeaveSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/LeaveSubCommand.java index 99f0083d..cda5ad20 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/LeaveSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/LeaveSubCommand.java @@ -27,28 +27,28 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.island.command.leave")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island island = skyblockManager.getIslandByPlayerId(player.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } Players players = island.getMember(player.getUniqueId()); if (players.getRoleType().equals(RoleType.OWNER)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageLeaveFailedIsOwnerIsland); + LanguageToml.sendMessage(player, LanguageToml.messageLeaveFailedIsOwnerIsland); return true; } boolean hasLeave = island.removeMember(players); if (hasLeave) { DeleteSubCommand.checkClearPlayer(plugin, skyblockManager, players); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageLeaveSuccess); + LanguageToml.sendMessage(player, LanguageToml.messageLeaveSuccess); } else { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageLeavePlayerFailed); + LanguageToml.sendMessage(player, LanguageToml.messageLeavePlayerFailed); } return true; } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/PermissionSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/PermissionSubCommand.java index ff7bc948..d4c75a30 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/PermissionSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/PermissionSubCommand.java @@ -35,11 +35,11 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.island.command.permission")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } if (args.length < 4) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePermissionCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messagePermissionCommandNotEnoughArgs); return true; } String permissionsTypeRaw = args[0]; // ISLAND / COMMANDS / INVENTORY @@ -53,7 +53,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island island = skyblockManager.getIslandByPlayerId(player.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } @@ -64,34 +64,34 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N PermissionManager permissionManager = new PermissionManager(permissionRoleIsland.permission()); if (!permissionManager.hasPermission(PermissionsCommandIsland.MANAGE_PERMISSION)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } } if (executorPlayer.getRoleType().getValue() <= permissionFormat.roleType.getValue()) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePermissionPlayerFailedHighOrEqualsStatus); + LanguageToml.sendMessage(player, LanguageToml.messagePermissionPlayerFailedHighOrEqualsStatus); return true; } if (updatePermissions(skyblockManager, island, permissionFormat)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePermissionsUpdateSuccess); + LanguageToml.sendMessage(player, LanguageToml.messagePermissionsUpdateSuccess); } else { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePermissionsUpdateFailed); + LanguageToml.sendMessage(player, LanguageToml.messagePermissionsUpdateFailed); } } else { // RESET ! if (!executorPlayer.getRoleType().equals(RoleType.OWNER)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageOnlyOwner); + LanguageToml.sendMessage(player, LanguageToml.messageOnlyOwner); } if (resetPermission(island, permissionFormat)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePermissionsUpdateSuccess); + LanguageToml.sendMessage(player, LanguageToml.messagePermissionsUpdateSuccess); } else { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePermissionsUpdateFailed); + LanguageToml.sendMessage(player, LanguageToml.messagePermissionsUpdateFailed); } } } catch (Exception e) { logger.log(Level.FATAL, e.getMessage(), e); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } return true; } @@ -130,14 +130,14 @@ private PermissionFormat getPermissionFormat(Main main, Entity entity, String pe try { permissionsType = PermissionsType.valueOf(permissionsTypeRaw.toUpperCase()); } catch (IllegalArgumentException e) { - LanguageToml.sendMessage(main, entity, LanguageToml.messagePermissionPermissionTypeInvalid); + LanguageToml.sendMessage(entity, LanguageToml.messagePermissionPermissionTypeInvalid); return null; } RoleType roleType; try { roleType = RoleType.valueOf(roleTypeRaw.toUpperCase()); } catch (IllegalArgumentException e) { - LanguageToml.sendMessage(main, entity, LanguageToml.messagePermissionRoleTypeInvalid); + LanguageToml.sendMessage(entity, LanguageToml.messagePermissionRoleTypeInvalid); return null; } Permissions permissions = null; @@ -150,7 +150,7 @@ private PermissionFormat getPermissionFormat(Main main, Entity entity, String pe }; } } catch (IllegalArgumentException e) { - LanguageToml.sendMessage(main, entity, LanguageToml.messagePermissionsPermissionsValueInvalid); + LanguageToml.sendMessage(entity, LanguageToml.messagePermissionsPermissionsValueInvalid); return null; } boolean value = Boolean.parseBoolean(valueRaw); diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/PromoteSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/PromoteSubCommand.java index 1934ae6a..5846f057 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/PromoteSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/PromoteSubCommand.java @@ -32,11 +32,11 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.island.command.promote")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } if (args.length < 1) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePromoteCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messagePromoteCommandNotEnoughArgs); return true; } try { @@ -45,7 +45,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island island = skyblockManager.getIslandByPlayerId(player.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } @@ -56,7 +56,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N PermissionManager permissionManager = new PermissionManager(permissionRoleIsland.permission()); if (!permissionManager.hasPermission(PermissionsCommandIsland.PROMOTE)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } } @@ -64,26 +64,26 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N Players players = island.getMember(playerName); if (players == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerNotFound); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerNotFound); return true; } if (executorPlayer.getRoleType().getValue() <= players.getRoleType().getValue()) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePromotePlayerFailedLowOrEqualsStatus); + LanguageToml.sendMessage(player, LanguageToml.messagePromotePlayerFailedLowOrEqualsStatus); return true; } RoleType promoteResult = RoleType.getRoleById(players.getRoleType().getValue() + 1); if (promoteResult.getValue() == 0 || promoteResult.getValue() == RoleType.OWNER.getValue()) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePromotePlayerFailed.formatted(playerName)); + LanguageToml.sendMessage(player, LanguageToml.messagePromotePlayerFailed.formatted(playerName)); return true; } players.setRoleType(promoteResult); island.updateMember(players); - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePromotePlayer.formatted(playerName)); + LanguageToml.sendMessage(player, LanguageToml.messagePromotePlayer.formatted(playerName)); } catch (Exception e) { logger.log(Level.FATAL, e.getMessage(), e); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } return true; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetBiomeSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetBiomeSubCommand.java index fa8df7c4..41c9bb9a 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetBiomeSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetBiomeSubCommand.java @@ -42,11 +42,11 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.island.command.biome")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } if (args.length < 1) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageBiomeCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messageBiomeCommandNotEnoughArgs); return true; } @@ -60,16 +60,16 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N try { biome = Biome.valueOf(selectBiome.toUpperCase()); } catch (IllegalArgumentException e) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageBiomeNotExist.formatted(selectBiome)); + LanguageToml.sendMessage(player, LanguageToml.messageBiomeNotExist.formatted(selectBiome)); return true; } if (!player.hasPermission("skyllia.island.command.biome.%s".formatted(biome.name()))) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageBiomePermissionDenied.formatted(selectBiome)); + LanguageToml.sendMessage(player, LanguageToml.messageBiomePermissionDenied.formatted(selectBiome)); } if (Boolean.FALSE.equals(WorldUtils.isWorldSkyblock(playerLocation.getWorld().getName()))) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageBiomeOnlyIsland); + LanguageToml.sendMessage(player, LanguageToml.messageBiomeOnlyIsland); return true; } @@ -77,12 +77,12 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N Island island = skyblockManager.getIslandByPlayerId(player.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } final UUID islandId = island.getId(); if (CommandCacheExecution.isAlreadyExecute(islandId, "biome")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageCommandAlreadyExecution); + LanguageToml.sendMessage(player, LanguageToml.messageCommandAlreadyExecution); return true; } CommandCacheExecution.addCommandExecute(islandId, "biome"); @@ -94,7 +94,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N PermissionManager permissionManager = new PermissionManager(permissionRoleIsland.permission()); if (!permissionManager.hasPermission(PermissionsCommandIsland.SET_BIOME)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } } @@ -103,21 +103,21 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N Position playerRegionPosition = RegionHelper.getRegionInChunk(chunkLocX, chunkLocZ); if (islandPosition.x() != playerRegionPosition.x() || islandPosition.z() != playerRegionPosition.z()) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerNotInIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerNotInIsland); return true; } World world = player.getWorld(); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageBiomeChangeInProgress); + LanguageToml.sendMessage(player, LanguageToml.messageBiomeChangeInProgress); boolean biomeChanged = WorldEditUtils.changeBiomeChunk(plugin, world, biome, island).join(); if (biomeChanged) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageBiomeChangeSuccess); + LanguageToml.sendMessage(player, LanguageToml.messageBiomeChangeSuccess); CommandCacheExecution.removeCommandExec(islandId, "biome"); } } catch (Exception e) { logger.log(Level.FATAL, e.getMessage(), e); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetHomeSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetHomeSubCommand.java index e9b783b9..351f1382 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetHomeSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetHomeSubCommand.java @@ -35,7 +35,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.island.command.sethome")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } Location playerLocation = player.getLocation(); @@ -46,14 +46,14 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island island = skyblockManager.getIslandByPlayerId(player.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } Position islandPosition = island.getPosition(); Position playerRegionPosition = RegionHelper.getRegionInChunk(regionLocX, regionLocZ); if (islandPosition.x() != playerRegionPosition.x() || islandPosition.z() != playerRegionPosition.z()) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerNotInIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerNotInIsland); return true; } @@ -63,20 +63,20 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N PermissionRoleIsland permissionRoleIsland = skyblockManager.getPermissionIsland(island.getId(), PermissionsType.COMMANDS, executorPlayer.getRoleType()).join(); PermissionManager permissionManager = new PermissionManager(permissionRoleIsland.permission()); if (!permissionManager.hasPermission(PermissionsCommandIsland.SET_HOME)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } } boolean updateOrCreateHome = island.addWarps("home", playerLocation, false); if (updateOrCreateHome) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageHomeCreateSuccess); + LanguageToml.sendMessage(player, LanguageToml.messageHomeCreateSuccess); } else { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } } catch (Exception e) { logger.log(Level.FATAL, e.getMessage(), e); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } return true; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetWarpSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetWarpSubCommand.java index 910d9844..524bdc9f 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetWarpSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/SetWarpSubCommand.java @@ -36,17 +36,17 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (args.length < 1) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageWarpCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messageWarpCommandNotEnoughArgs); return true; } if (!player.hasPermission("skyllia.island.command.setwarp")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } Location playerLocation = player.getLocation(); if (Boolean.FALSE.equals(WorldUtils.isWorldSkyblock(playerLocation.getWorld().getName()))) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerIsNotOnAnIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerIsNotOnAnIsland); return true; } @@ -59,7 +59,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island island = skyblockManager.getIslandByPlayerId(player.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } @@ -69,7 +69,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N PermissionRoleIsland permissionRoleIsland = skyblockManager.getPermissionIsland(island.getId(), PermissionsType.COMMANDS, executorPlayer.getRoleType()).join(); PermissionManager permissionManager = new PermissionManager(permissionRoleIsland.permission()); if (!permissionManager.hasPermission(PermissionsCommandIsland.SET_WARP)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } } @@ -78,19 +78,19 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N Position playerRegionPosition = RegionHelper.getRegionInChunk(regionLocX, regionLocZ); if (islandPosition.x() != playerRegionPosition.x() || islandPosition.z() != playerRegionPosition.z()) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerNotInIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerNotInIsland); return true; } boolean updateOrCreateWarps = island.addWarps(warpName, playerLocation, false); if (updateOrCreateWarps) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageWarpCreateSuccess); + LanguageToml.sendMessage(player, LanguageToml.messageWarpCreateSuccess); } else { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } } catch (Exception e) { logger.log(Level.FATAL, e.getMessage(), e); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } return true; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/TPSSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/TPSSubCommand.java index 38fd2fa2..b1cc5042 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/TPSSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/TPSSubCommand.java @@ -22,19 +22,19 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.island.command.tps")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } Location playerLocation = player.getLocation(); if (Boolean.FALSE.equals(WorldUtils.isWorldSkyblock(playerLocation.getWorld().getName()))) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerIsNotOnAnIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerIsNotOnAnIsland); return true; } double @Nullable [] tpsIsland = SkylliaAPI.getTPS(playerLocation); if (tpsIsland == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerIsNotOnAnIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerIsNotOnAnIsland); return true; } player.sendMessage(TPSFormatter.displayTPS(tpsIsland).asComponent()); diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/TransferSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/TransferSubCommand.java index 618ebcaf..c4210451 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/TransferSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/TransferSubCommand.java @@ -37,18 +37,18 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N } Players ownerIsland = skyblockManager.getOwnerByIslandID(island).join(); if (ownerIsland == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); return true; } if (!ownerIsland.getMojangId().equals(player.getUniqueId())) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageOnlyOwner); + LanguageToml.sendMessage(player, LanguageToml.messageOnlyOwner); return true; } String newOwner = args[0]; Players players = island.getMember(newOwner); if (players == null || !players.getRoleType().equals(RoleType.MEMBER) || !players.getRoleType().equals(RoleType.MODERATOR)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageNotMember); + LanguageToml.sendMessage(player, LanguageToml.messageNotMember); return true; } @@ -59,7 +59,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N // Nouveau proprio players.setRoleType(RoleType.OWNER); island.updateMember(players); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageTransfertSuccess.replace("%new_owner%", players.getLastKnowName())); + LanguageToml.sendMessage(player, LanguageToml.messageTransfertSuccess.replace("%new_owner%", players.getLastKnowName())); // msg ok } catch (Exception e) { logger.log(Level.FATAL, e.getMessage(), e); diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/TrustSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/TrustSubCommand.java index 379c91e5..f50468cd 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/TrustSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/TrustSubCommand.java @@ -36,17 +36,17 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.island.command.access")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } if (args.length < 1) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageTrustCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messageTrustCommandNotEnoughArgs); return true; } try { UUID playerTrustedId = Bukkit.getPlayerUniqueId(args[0]); if (playerTrustedId == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerNotFound); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerNotFound); return true; } @@ -54,7 +54,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N Island island = skyblockManager.getIslandByPlayerId(player.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } @@ -64,16 +64,16 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N PermissionManager permissionManager = new PermissionManager(permissionRoleIsland.permission()); if (!permissionManager.hasPermission(PermissionsCommandIsland.MANAGE_TRUST)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } } PlayersInIslandCache.addPlayerTrustedInIsland(island.getId(), playerTrustedId); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageTrustSuccess); + LanguageToml.sendMessage(player, LanguageToml.messageTrustSuccess); } catch (Exception e) { logger.log(Level.FATAL, e.getMessage(), e); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } return true; } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/UnbanSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/UnbanSubCommand.java index 0cccb0ba..dd7d7651 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/UnbanSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/UnbanSubCommand.java @@ -31,17 +31,17 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.island.command.unban")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } if (args.length < 1) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageUnbanCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messageUnbanCommandNotEnoughArgs); return true; } SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island island = skyblockManager.getIslandByPlayerId(player.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } @@ -52,7 +52,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N PermissionManager permissionManager = new PermissionManager(permissionRoleIsland.permission()); if (!permissionManager.hasPermission(PermissionsCommandIsland.UNBAN)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } } @@ -61,15 +61,15 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N Players players = island.getMember(playerBan); if (players == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageUnbanPlayerNotBanned); + LanguageToml.sendMessage(player, LanguageToml.messageUnbanPlayerNotBanned); return true; } boolean isRemoved = island.removeMember(players); if (isRemoved) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageUnBanPlayerSuccess); + LanguageToml.sendMessage(player, LanguageToml.messageUnBanPlayerSuccess); } else { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageUnbanPlayerFailed); + LanguageToml.sendMessage(player, LanguageToml.messageUnbanPlayerFailed); } return true; } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/UntrustSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/UntrustSubCommand.java index e45b7300..4a3c84b8 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/UntrustSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/UntrustSubCommand.java @@ -36,17 +36,17 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.island.command.access")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } if (args.length < 1) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageUntrustCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messageUntrustCommandNotEnoughArgs); return true; } try { UUID playerTrustedId = Bukkit.getPlayerUniqueId(args[0]); if (playerTrustedId == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerNotFound); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerNotFound); return true; } @@ -54,7 +54,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N Island island = skyblockManager.getIslandByPlayerId(player.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } @@ -64,20 +64,20 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N PermissionManager permissionManager = new PermissionManager(permissionRoleIsland.permission()); if (!permissionManager.hasPermission(PermissionsCommandIsland.MANAGE_TRUST)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } } boolean isRemove = PlayersInIslandCache.removePlayerTrustedInIsland(island.getId(), playerTrustedId); if (isRemove) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageUntrustSuccess); + LanguageToml.sendMessage(player, LanguageToml.messageUntrustSuccess); } else { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageUntrustFailed); + LanguageToml.sendMessage(player, LanguageToml.messageUntrustFailed); } } catch (Exception e) { logger.log(Level.FATAL, e.getMessage(), e); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } return true; } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/VisitSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/VisitSubCommand.java index a0f29208..e8775057 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/VisitSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/VisitSubCommand.java @@ -37,11 +37,11 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (!player.hasPermission("skyllia.island.command.visit")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } if (args.length < 1) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageVisitCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messageVisitCommandNotEnoughArgs); return true; } @@ -54,25 +54,25 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N visitPlayerId = Bukkit.getPlayerUniqueId(visitPlayer); } if (visitPlayerId == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerNotFound); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerNotFound); return true; } SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island island = skyblockManager.getIslandByPlayerId(visitPlayerId).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageVisitPlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messageVisitPlayerHasNotIsland); return true; } if (!player.hasPermission("skyllia.island.command.visit.bypass")) { if (island.isPrivateIsland()) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageVisitIslandIsPrivate); + LanguageToml.sendMessage(player, LanguageToml.messageVisitIslandIsPrivate); return true; } Players memberIsland = island.getMember(player.getUniqueId()); if (memberIsland != null && memberIsland.getRoleType().equals(RoleType.BAN)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageVisitIslandPlayerBanned); + LanguageToml.sendMessage(player, LanguageToml.messageVisitIslandPlayerBanned); return true; } } @@ -89,11 +89,11 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N player.teleportAsync(loc, PlayerTeleportEvent.TeleportCause.PLUGIN); plugin.getInterneAPI().getPlayerNMS().setOwnWorldBorder(plugin, player, RegionHelper.getCenterRegion(loc.getWorld(), island.getPosition().x(), island.getPosition().z()), island.getSize(), 0, 0); if (ConfigToml.changeGameModeWhenTeleportIsland) player.setGameMode(GameMode.SURVIVAL); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageVisitIslandSuccess.replaceAll("%player%", visitPlayer)); + LanguageToml.sendMessage(player, LanguageToml.messageVisitIslandSuccess.replaceAll("%player%", visitPlayer)); }, null, 0L); } catch (Exception exception) { logger.log(Level.FATAL, exception.getMessage(), exception); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } return true; } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/WarpSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/WarpSubCommand.java index 91ecf6e6..5e365fdc 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/WarpSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/WarpSubCommand.java @@ -35,11 +35,11 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N return true; } if (args.length < 1) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageWarpCommandNotEnoughArgs); + LanguageToml.sendMessage(player, LanguageToml.messageWarpCommandNotEnoughArgs); return true; } if (!player.hasPermission("skyllia.island.command.warp")) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } @@ -49,7 +49,7 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N SkyblockManager skyblockManager = plugin.getInterneAPI().getSkyblockManager(); Island island = skyblockManager.getIslandByPlayerId(player.getUniqueId()).join(); if (island == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerHasNotIsland); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerHasNotIsland); return true; } @@ -59,22 +59,22 @@ public boolean onCommand(@NotNull Main plugin, @NotNull CommandSender sender, @N PermissionRoleIsland permissionRoleIsland = skyblockManager.getPermissionIsland(island.getId(), PermissionsType.COMMANDS, executorPlayer.getRoleType()).join(); PermissionManager permissionManager = new PermissionManager(permissionRoleIsland.permission()); if (!permissionManager.hasPermission(PermissionsCommandIsland.TP_WARP)) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messagePlayerPermissionDenied); + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return true; } } WarpIsland warp = island.getWarpByName(warpName); if (warp == null) { - LanguageToml.sendMessage(plugin, player, LanguageToml.messageWarpNotExist); + LanguageToml.sendMessage(player, LanguageToml.messageWarpNotExist); return true; } player.teleportAsync(warp.location(), PlayerTeleportEvent.TeleportCause.PLUGIN); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageWarpTeleportSuccess); + LanguageToml.sendMessage(player, LanguageToml.messageWarpTeleportSuccess); } catch (Exception e) { logger.log(Level.FATAL, e.getMessage(), e); - LanguageToml.sendMessage(plugin, player, LanguageToml.messageError); + LanguageToml.sendMessage(player, LanguageToml.messageError); } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/configuration/LanguageToml.java b/plugin/src/main/java/fr/euphyllia/skyllia/configuration/LanguageToml.java index da9dd4f7..a9badfe6 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/configuration/LanguageToml.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/configuration/LanguageToml.java @@ -360,8 +360,9 @@ private static void islandVisitLanguage() { } - public static void sendMessage(Main plugin, Entity entity, String msg) { + public static void sendMessage(Entity entity, String msg) { + // Todo MultiLangue future version if (msg.isEmpty()) return; - entity.sendMessage(plugin.getInterneAPI().getMiniMessage().deserialize(msg)); + entity.sendMessage(Main.getPlugin(Main.class).getInterneAPI().getMiniMessage().deserialize(msg)); } } diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/listeners/bukkitevents/player/InventoryEvent.java b/plugin/src/main/java/fr/euphyllia/skyllia/listeners/bukkitevents/player/InventoryEvent.java index 39a02ef3..8f371eb4 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/listeners/bukkitevents/player/InventoryEvent.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/listeners/bukkitevents/player/InventoryEvent.java @@ -77,7 +77,10 @@ public void onPlayerInteractEvent(final PlayerInteractEvent event) { case HOPPER -> { ListenersUtils.checkPermission(player.getLocation(), player, PermissionsInventory.OPEN_HOPPER, event); } - case SHULKER_BOX, WHITE_SHULKER_BOX, ORANGE_SHULKER_BOX, MAGENTA_SHULKER_BOX, LIGHT_BLUE_SHULKER_BOX, YELLOW_SHULKER_BOX, LIME_SHULKER_BOX, PINK_SHULKER_BOX, GRAY_SHULKER_BOX, LIGHT_GRAY_SHULKER_BOX, CYAN_SHULKER_BOX, PURPLE_SHULKER_BOX, BLUE_SHULKER_BOX, BROWN_SHULKER_BOX, GREEN_SHULKER_BOX, RED_SHULKER_BOX, BLACK_SHULKER_BOX -> { + case SHULKER_BOX, WHITE_SHULKER_BOX, ORANGE_SHULKER_BOX, MAGENTA_SHULKER_BOX, LIGHT_BLUE_SHULKER_BOX, + YELLOW_SHULKER_BOX, LIME_SHULKER_BOX, PINK_SHULKER_BOX, GRAY_SHULKER_BOX, LIGHT_GRAY_SHULKER_BOX, + CYAN_SHULKER_BOX, PURPLE_SHULKER_BOX, BLUE_SHULKER_BOX, BROWN_SHULKER_BOX, GREEN_SHULKER_BOX, + RED_SHULKER_BOX, BLACK_SHULKER_BOX -> { ListenersUtils.checkPermission(player.getLocation(), player, PermissionsInventory.OPEN_SHULKER_BOX, event); } case BARREL -> { diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/listeners/bukkitevents/player/TeleportEvent.java b/plugin/src/main/java/fr/euphyllia/skyllia/listeners/bukkitevents/player/TeleportEvent.java index 67bb715a..f2d8e4ca 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/listeners/bukkitevents/player/TeleportEvent.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/listeners/bukkitevents/player/TeleportEvent.java @@ -3,9 +3,7 @@ import fr.euphyllia.skyllia.api.InterneAPI; import fr.euphyllia.skyllia.api.configuration.PortalConfig; import fr.euphyllia.skyllia.api.configuration.WorldConfig; -import fr.euphyllia.skyllia.api.event.players.PlayerPrepareChangeWorldSkyblockEvent; import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsIsland; -import fr.euphyllia.skyllia.api.utils.VersionUtils; import fr.euphyllia.skyllia.listeners.ListenersUtils; import fr.euphyllia.skyllia.utils.WorldUtils; import org.apache.logging.log4j.LogManager; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/listeners/skyblockevents/SkyblockEvent.java b/plugin/src/main/java/fr/euphyllia/skyllia/listeners/skyblockevents/SkyblockEvent.java index e41ad8b7..db0f64c5 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/listeners/skyblockevents/SkyblockEvent.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/listeners/skyblockevents/SkyblockEvent.java @@ -85,6 +85,7 @@ public void onSkyblockSize(final SkyblockChangeSizeEvent event) { private void teleportOtherWorld(Player player, PlayerPrepareChangeWorldSkyblockEvent event, PermissionsIsland permissionsIsland) { Island island = ListenersUtils.checkPermission(player.getLocation(), player, permissionsIsland, event); if (island == null) { + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return; } try { @@ -95,6 +96,7 @@ private void teleportOtherWorld(Player player, PlayerPrepareChangeWorldSkyblockE } else if (permissionsIsland.equals(PermissionsIsland.USE_END_PORTAL)) { portalConfig = worldConfig.endPortal(); } else { + LanguageToml.sendMessage(player, LanguageToml.messagePlayerPermissionDenied); return; } if (Boolean.FALSE.equals(WorldUtils.isWorldSkyblock(portalConfig.direction()))) { @@ -119,7 +121,7 @@ private void teleportOtherWorld(Player player, PlayerPrepareChangeWorldSkyblockE if (!playerChangeWorldSkyblockEvent.checkSafeLocation() || WorldUtils.isSafeLocation(playerChangeWorldSkyblockEvent.getTo())) { player.teleportAsync(playerChangeWorldSkyblockEvent.getTo(), PlayerTeleportEvent.TeleportCause.PLUGIN); } else { - LanguageToml.sendMessage(this.api.getPlugin(), player, LanguageToml.messageLocationNotSafe); + LanguageToml.sendMessage(player, LanguageToml.messageLocationNotSafe); } }); } catch (Exception e) {