Skip to content

Commit

Permalink
[ci-skip] clean + reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
Euphillya committed Jan 31, 2024
1 parent 551285d commit 3c610d2
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;

public class SkyblockChangeGameRuleEvent extends Event {
public class SkyblockChangeGameRuleEvent extends Event {


private static final HandlerList handlerList = new HandlerList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import fr.euphyllia.skyllia.api.skyblock.model.Position;
import fr.euphyllia.skyllia.api.skyblock.model.RoleType;
import fr.euphyllia.skyllia.api.skyblock.model.WarpIsland;
import fr.euphyllia.skyllia.api.skyblock.model.gamerule.GameRuleIsland;
import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType;
import org.bukkit.Location;
import org.jetbrains.annotations.Nullable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ public enum PermissionsCommandIsland implements Permissions {
BAN(4_096),
UNBAN(8_192),
MANAGE_TRUST(16_384),
MANAGE_GAMERULE(32_768)
;
MANAGE_GAMERULE(32_768);


private final long permissionValue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
package fr.euphyllia.skyllia.cache;

import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland;
import fr.euphyllia.skyllia.api.skyblock.model.RoleType;
import fr.euphyllia.skyllia.api.skyblock.model.gamerule.GameRuleIsland;
import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

public class PermissionGameRuleInIslandCache {
public class PermissionGameRuleInIslandCache {
private static final Logger logger = LogManager.getLogger(PermissionGameRuleInIslandCache.class);
private static ConcurrentHashMap<UUID, Long> gameruleByIslandId;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
package fr.euphyllia.skyllia.commands.common.subcommands;

import fr.euphyllia.skyllia.Main;
import fr.euphyllia.skyllia.api.event.SkyblockChangePermissionEvent;
import fr.euphyllia.skyllia.api.skyblock.Island;
import fr.euphyllia.skyllia.api.skyblock.Players;
import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland;
import fr.euphyllia.skyllia.api.skyblock.model.RoleType;
import fr.euphyllia.skyllia.api.skyblock.model.gamerule.GameRuleIsland;
import fr.euphyllia.skyllia.api.skyblock.model.permissions.*;
import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsCommandIsland;
import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsInventory;
import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsIsland;
import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType;
import fr.euphyllia.skyllia.commands.SubCommandInterface;
import fr.euphyllia.skyllia.configuration.LanguageToml;
import fr.euphyllia.skyllia.managers.skyblock.PermissionManager;
import fr.euphyllia.skyllia.managers.skyblock.SkyblockManager;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ public class LanguageToml {
public static String messageASetMaxMembersCommandNotEnoughArgs = "La commande est incomplète : /skyllia setmaxmembres value confirm";
public static String messageASetMaxMembersNotConfirmedArgs = "Vous n'avez pas ajouter le \"confirm\" à la fin";
public static String messageASetMaxMembersNAN = "Le nombre indiqué est incorrect.";
public static String messageGameRuleCommandNotEnoughArgs = "La commande est incomplète : /skyllia gamerule <GAMERULE> <true/false>";
public static String messageGameRuleInvalid = "La gamerule n'existe pas";
public static String messageGameRuleUpdateSuccess = "La gamerule a été mise à jour ";
public static String messageGameRuleUpdateFailed = "Une erreur s'est produite lors de la mise à jour de la gamerule";
private static boolean verbose;

public static void init(File configFile) {
Expand Down Expand Up @@ -259,15 +263,10 @@ private static void islandHomeLanguage() {
messageHomeCreateSuccess = getString("island.home.set.success", messageHomeCreateSuccess);
}

public static String messageGameRuleCommandNotEnoughArgs = "La commande est incomplète : /skyllia gamerule <GAMERULE> <true/false>";
public static String messageGameRuleInvalid = "La gamerule n'existe pas";
public static String messageGameRuleUpdateSuccess = "La gamerule a été mise à jour ";
public static String messageGameRuleUpdateFailed = "Une erreur s'est produite lors de la mise à jour de la gamerule";

private static void islandGameRuleLanguage() {
messageGameRuleCommandNotEnoughArgs = getString("island.gamerule.not-enough-args", messageGameRuleCommandNotEnoughArgs);
messageGameRuleInvalid = getString("island.gamerule.gamerule-invalid", messageGameRuleInvalid);
messageGameRuleUpdateSuccess = getString("island.gamerule.success", messageGameRuleUpdateSuccess);
messageGameRuleUpdateSuccess = getString("island.gamerule.success", messageGameRuleUpdateSuccess);
messageGameRuleUpdateFailed = getString("island.gamerule.failed", messageGameRuleUpdateFailed);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import fr.euphyllia.skyllia.api.skyblock.Island;
import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland;
import fr.euphyllia.skyllia.api.skyblock.model.RoleType;
import fr.euphyllia.skyllia.api.skyblock.model.gamerule.GameRuleIsland;
import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package fr.euphyllia.skyllia.listeners.bukkitevents;

import fr.euphyllia.skyllia.api.InterneAPI;
import fr.euphyllia.skyllia.api.configuration.WorldConfig;
import fr.euphyllia.skyllia.api.event.PlayerPrepareChangeWorldSkyblockEvent;
import fr.euphyllia.skyllia.listeners.ListenersUtils;
import fr.euphyllia.skyllia.utils.WorldUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@
import fr.euphyllia.skyllia.api.InterneAPI;
import fr.euphyllia.skyllia.api.skyblock.model.gamerule.GameRuleIsland;
import fr.euphyllia.skyllia.listeners.ListenersUtils;
import fr.euphyllia.skyllia.listeners.bukkitevents.gamerule.BlockGameRuleEvent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bukkit.Location;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Mob;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntityPickupItemEvent;

import java.util.Locale;
import java.util.concurrent.CopyOnWriteArrayList;

public class ExplosionEvent implements Listener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityChangeBlockEvent;

import java.util.Locale;

public class GriefingEvent implements Listener {

private final InterneAPI api;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import fr.euphyllia.skyllia.api.skyblock.model.gamerule.GameRuleIsland;
import fr.euphyllia.skyllia.listeners.ListenersUtils;
import fr.euphyllia.skyllia.utils.EntityUtils;
import fr.euphyllia.skyllia.utils.PlayerUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bukkit.Location;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public PickupEvent(InterneAPI interneAPI) {
@EventHandler(priority = EventPriority.LOW)
public void onPickupItem(final EntityPickupItemEvent event) {
if (event.isCancelled()) return;
if (event.getEntity() instanceof Mob){
if (event.getEntity() instanceof Mob) {
ListenersUtils.checkGameRuleIsland(event.getEntity().getLocation(), GameRuleIsland.MOB_PICKUP_ITEMS, event);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityPickupItemEvent;
import org.bukkit.event.player.*;
import org.bukkit.event.player.PlayerBucketEmptyEvent;
import org.bukkit.event.player.PlayerBucketEvent;
import org.bukkit.event.player.PlayerBucketFillEvent;
import org.bukkit.event.player.PlayerDropItemEvent;

public class PlayerEvent implements Listener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,11 @@

import fr.euphyllia.skyllia.api.InterneAPI;
import fr.euphyllia.skyllia.api.event.PlayerPrepareChangeWorldSkyblockEvent;
import fr.euphyllia.skyllia.api.skyblock.Island;
import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsIsland;
import fr.euphyllia.skyllia.listeners.ListenersUtils;
import fr.euphyllia.skyllia.managers.skyblock.SkyblockManager;
import fr.euphyllia.skyllia.utils.PlayerUtils;
import fr.euphyllia.skyllia.utils.RegionUtils;
import fr.euphyllia.skyllia.utils.WorldUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
Expand Down Expand Up @@ -43,7 +36,7 @@ public void onPlayerTeleportOnIsland(final PlayerTeleportEvent event) {
PlayerTeleportEvent.TeleportCause teleportCause = event.getCause();
if (teleportCause.equals(PlayerTeleportEvent.TeleportCause.END_PORTAL)) {
ListenersUtils.callPlayerPrepareChangeWorldSkyblockEvent(event.getPlayer(),
PlayerPrepareChangeWorldSkyblockEvent.PortalType.END, destination.getWorld().getName());
PlayerPrepareChangeWorldSkyblockEvent.PortalType.END, destination.getWorld().getName());
} else if (teleportCause.equals(PlayerTeleportEvent.TeleportCause.NETHER_PORTAL)) {
ListenersUtils.callPlayerPrepareChangeWorldSkyblockEvent(event.getPlayer(),
PlayerPrepareChangeWorldSkyblockEvent.PortalType.NETHER, destination.getWorld().getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import fr.euphyllia.skyllia.api.skyblock.model.Position;
import fr.euphyllia.skyllia.api.skyblock.model.RoleType;
import fr.euphyllia.skyllia.api.skyblock.model.WarpIsland;
import fr.euphyllia.skyllia.api.skyblock.model.gamerule.GameRuleIsland;
import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType;
import fr.euphyllia.skyllia.configuration.ConfigToml;
import org.bukkit.Bukkit;
Expand Down Expand Up @@ -165,7 +164,8 @@ public boolean updateMember(Players member) {
return this.plugin.getInterneAPI().getSkyblockManager().updateMember(this, member).join();
}

@Override @Deprecated(forRemoval = true)
@Override
@Deprecated(forRemoval = true)
public boolean updatePermissionIsland(PermissionsType permissionsType, RoleType roleType, long permissions) {
return this.plugin.getInterneAPI().getSkyblockManager().updatePermissionIsland(this, permissionsType, roleType, permissions).join();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import fr.euphyllia.skyllia.api.skyblock.model.PermissionRoleIsland;
import fr.euphyllia.skyllia.api.skyblock.model.RoleType;
import fr.euphyllia.skyllia.api.skyblock.model.WarpIsland;
import fr.euphyllia.skyllia.api.skyblock.model.gamerule.GameRuleIsland;
import fr.euphyllia.skyllia.api.skyblock.model.permissions.PermissionsType;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
Expand Down

0 comments on commit 3c610d2

Please sign in to comment.