Makes sure manager classes cannot be instantiated or extended

This commit is contained in:
Kristian Knarvik 2022-01-22 17:14:25 +01:00
parent 6cee659bd0
commit d1a7735b51
3 changed files with 15 additions and 3 deletions

View File

@ -7,10 +7,14 @@ import org.bukkit.entity.Player;
/** /**
* A manager that performs all Economy tasks * A manager that performs all Economy tasks
*/ */
public class EconomyManager { public final class EconomyManager {
private static Economy economy; private static Economy economy;
private EconomyManager() {
}
/** /**
* Initializes the economy manager * Initializes the economy manager
* *

View File

@ -20,12 +20,16 @@ import java.util.logging.Level;
/** /**
* A manager that performs all Permission tasks * A manager that performs all Permission tasks
*/ */
public class PermissionManager { public final class PermissionManager {
private static Permission permission; private static Permission permission;
private static Queue<TemporaryPermission> temporaryPermissions = new PriorityBlockingQueue<>(); private static Queue<TemporaryPermission> temporaryPermissions = new PriorityBlockingQueue<>();
private static final File permissionsFile = new File(PermissionSigns.getInstance().getDataFolder(), "data.yml"); private static final File permissionsFile = new File(PermissionSigns.getInstance().getDataFolder(), "data.yml");
private PermissionManager() {
}
/** /**
* Initializes the permission manager * Initializes the permission manager
* *

View File

@ -25,11 +25,15 @@ import java.util.logging.Level;
/** /**
* A manager for keeping track of known signs * A manager for keeping track of known signs
*/ */
public class SignManager { public final class SignManager {
private static Map<Location, PermissionSign> managedSigns = new HashMap<>(); private static Map<Location, PermissionSign> managedSigns = new HashMap<>();
private static final File signsFile = new File(PermissionSigns.getInstance().getDataFolder(), "data.yml"); private static final File signsFile = new File(PermissionSigns.getInstance().getDataFolder(), "data.yml");
private SignManager() {
}
/** /**
* Gets the permission sign at the given location * Gets the permission sign at the given location
* *