Add final keywords

This commit is contained in:
Michael Smith 2020-08-23 22:09:15 -07:00
parent 88642327e3
commit b74ead594f
No known key found for this signature in database
GPG Key ID: 41F47A53EDE95BE1
11 changed files with 32 additions and 32 deletions

View File

@ -30,10 +30,10 @@ import org.bukkit.block.data.type.WallSign;
*/
public class Blox {
private int x;
private int y;
private int z;
private World world;
private final int x;
private final int y;
private final int z;
private final World world;
private Blox parent = null;
public Blox (World world, int x, int y, int z) {

View File

@ -39,18 +39,18 @@ public class Gate {
private static final Character ANYTHING = ' ';
private static final Character ENTRANCE = '.';
private static final Character EXIT = '*';
private static HashMap<String, Gate> gates = new HashMap<>();
private static HashMap<Material, ArrayList<Gate>> controlBlocks = new HashMap<>();
private static HashSet<Material> frameBlocks = new HashSet<>();
private static final HashMap<String, Gate> gates = new HashMap<>();
private static final HashMap<Material, ArrayList<Gate>> controlBlocks = new HashMap<>();
private static final HashSet<Material> frameBlocks = new HashSet<>();
private String filename;
private Character[][] layout;
private HashMap<Character, Material> types;
private final String filename;
private final Character[][] layout;
private final HashMap<Character, Material> types;
private RelativeBlockVector[] entrances = new RelativeBlockVector[0];
private RelativeBlockVector[] border = new RelativeBlockVector[0];
private RelativeBlockVector[] controls = new RelativeBlockVector[0];
private RelativeBlockVector exitBlock = null;
private HashMap<RelativeBlockVector, Integer> exits = new HashMap<>();
private final HashMap<RelativeBlockVector, Integer> exits = new HashMap<>();
private Material portalBlockOpen = Material.NETHER_PORTAL;
private Material portalBlockClosed = Material.AIR;

View File

@ -31,12 +31,12 @@ import java.util.Set;
*/
public class LangLoader {
private String UTF8_BOM = "\uFEFF";
private final String UTF8_BOM = "\uFEFF";
// Variables
private String datFolder;
private final String datFolder;
private String lang;
private HashMap<String, String> strList;
private HashMap<String, String> defList;
private final HashMap<String, String> defList;
public LangLoader(String datFolder, String lang) {
this.lang = lang;

View File

@ -70,14 +70,14 @@ public class Portal {
private static final HashMap<String, Portal> bungeePortals = new HashMap<>();
// Gate location block info
private Blox topLeft;
private int modX;
private int modZ;
private float rotX;
private Axis rot;
private final Blox topLeft;
private final int modX;
private final int modZ;
private final float rotX;
private final Axis rot;
// Block references
private Blox id;
private final Blox id;
private Blox button;
private Blox[] frame;
private Blox[] entrances;
@ -87,10 +87,10 @@ public class Portal {
private String destination;
private String lastDest = "";
private String network;
private Gate gate;
private final Gate gate;
private String ownerName = "";
private UUID ownerUUID = null;
private World world;
private final World world;
private boolean verified;
private boolean fixed;

View File

@ -97,8 +97,8 @@ public class Stargate extends JavaPlugin {
private static boolean destroyExplosion = false;
public static int maxGates = 0;
private static String langName = "en";
private static int activeTime = 10;
private static int openTime = 10;
private static final int activeTime = 10;
private static final int openTime = 10;
public static boolean destMemory = false;
public static boolean handleVehicles = true;
public static boolean sortLists = false;

View File

@ -24,7 +24,7 @@ import net.TheDgtl.Stargate.Portal;
*/
public class StargateAccessEvent extends StargateEvent {
private Player player;
private final Player player;
private boolean deny;
private static final HandlerList handlers = new HandlerList();

View File

@ -26,7 +26,7 @@ import net.TheDgtl.Stargate.Portal;
*/
public class StargateActivateEvent extends StargateEvent {
private Player player;
private final Player player;
private ArrayList<String> destinations;
private String destination;

View File

@ -23,10 +23,10 @@ import org.bukkit.event.HandlerList;
*/
public class StargateCreateEvent extends StargateEvent {
private Player player;
private final Player player;
private boolean deny;
private String denyReason;
private String[] lines;
private final String[] lines;
private int cost;
private static final HandlerList handlers = new HandlerList();

View File

@ -23,7 +23,7 @@ import org.bukkit.event.HandlerList;
*/
public class StargateDestroyEvent extends StargateEvent {
private Player player;
private final Player player;
private boolean deny;
private String denyReason;
private int cost;

View File

@ -24,7 +24,7 @@ import org.bukkit.event.HandlerList;
*/
public class StargateOpenEvent extends StargateEvent {
private Player player;
private final Player player;
private boolean force;
private static final HandlerList handlers = new HandlerList();

View File

@ -25,8 +25,8 @@ import org.bukkit.event.HandlerList;
*/
public class StargatePortalEvent extends StargateEvent {
private Player player;
private Portal destination;
private final Player player;
private final Portal destination;
private Location exit;
private static final HandlerList handlers = new HandlerList();