Removes the last of the unprotected variables from Stargate
Makes all classes use getInstance() to get a Stargate instance Removes the server variable as it's not needed
This commit is contained in:
parent
0237f45046
commit
56ed0495b0
@ -48,8 +48,7 @@ public class Stargate extends JavaPlugin {
|
|||||||
private static final Queue<ChunkUnloadRequest> chunkUnloadQueue = new PriorityQueue<>();
|
private static final Queue<ChunkUnloadRequest> chunkUnloadQueue = new PriorityQueue<>();
|
||||||
|
|
||||||
private static Logger logger;
|
private static Logger logger;
|
||||||
public static Server server;
|
private static Stargate stargate;
|
||||||
public static Stargate stargate;
|
|
||||||
|
|
||||||
private static String pluginVersion;
|
private static String pluginVersion;
|
||||||
|
|
||||||
@ -75,6 +74,15 @@ public class Stargate extends JavaPlugin {
|
|||||||
super(loader, descriptionFile, dataFolder, file);
|
super(loader, descriptionFile, dataFolder, file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets an instance of this plugin
|
||||||
|
*
|
||||||
|
* @return <p>An instance of this plugin, or null if not instantiated</p>
|
||||||
|
*/
|
||||||
|
public static Stargate getInstance() {
|
||||||
|
return stargate;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a block change request to the request queue
|
* Adds a block change request to the request queue
|
||||||
*
|
*
|
||||||
@ -299,7 +307,7 @@ public class Stargate extends JavaPlugin {
|
|||||||
pluginManager = getServer().getPluginManager();
|
pluginManager = getServer().getPluginManager();
|
||||||
FileConfiguration newConfig = this.getConfig();
|
FileConfiguration newConfig = this.getConfig();
|
||||||
logger = Logger.getLogger("Minecraft");
|
logger = Logger.getLogger("Minecraft");
|
||||||
server = getServer();
|
Server server = getServer();
|
||||||
stargate = this;
|
stargate = this;
|
||||||
|
|
||||||
stargateConfig = new StargateConfig(logger);
|
stargateConfig = new StargateConfig(logger);
|
||||||
|
@ -235,7 +235,7 @@ public final class EconomyConfig {
|
|||||||
//Check if vault is loaded
|
//Check if vault is loaded
|
||||||
Plugin vault = pluginManager.getPlugin("Vault");
|
Plugin vault = pluginManager.getPlugin("Vault");
|
||||||
if (vault != null && vault.isEnabled()) {
|
if (vault != null && vault.isEnabled()) {
|
||||||
ServicesManager servicesManager = Stargate.server.getServicesManager();
|
ServicesManager servicesManager = Stargate.getInstance().getServer().getServicesManager();
|
||||||
RegisteredServiceProvider<Economy> economyProvider = servicesManager.getRegistration(Economy.class);
|
RegisteredServiceProvider<Economy> economyProvider = servicesManager.getRegistration(Economy.class);
|
||||||
if (economyProvider != null) {
|
if (economyProvider != null) {
|
||||||
economy = economyProvider.getProvider();
|
economy = economyProvider.getProvider();
|
||||||
|
@ -56,7 +56,7 @@ public final class StargateConfig {
|
|||||||
public StargateConfig(Logger logger) {
|
public StargateConfig(Logger logger) {
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
|
|
||||||
dataFolderPath = Stargate.stargate.getDataFolder().getPath().replaceAll("\\\\", "/");
|
dataFolderPath = Stargate.getInstance().getDataFolder().getPath().replaceAll("\\\\", "/");
|
||||||
portalFolder = dataFolderPath + "/portals/";
|
portalFolder = dataFolderPath + "/portals/";
|
||||||
gateFolder = dataFolderPath + "/gates/";
|
gateFolder = dataFolderPath + "/gates/";
|
||||||
languageLoader = new LanguageLoader(dataFolderPath + "/lang/");
|
languageLoader = new LanguageLoader(dataFolderPath + "/lang/");
|
||||||
@ -260,11 +260,11 @@ public final class StargateConfig {
|
|||||||
String bungeeChannel = "BungeeCord";
|
String bungeeChannel = "BungeeCord";
|
||||||
|
|
||||||
if (start) {
|
if (start) {
|
||||||
messenger.registerOutgoingPluginChannel(Stargate.stargate, bungeeChannel);
|
messenger.registerOutgoingPluginChannel(Stargate.getInstance(), bungeeChannel);
|
||||||
messenger.registerIncomingPluginChannel(Stargate.stargate, bungeeChannel, new BungeeCordListener());
|
messenger.registerIncomingPluginChannel(Stargate.getInstance(), bungeeChannel, new BungeeCordListener());
|
||||||
} else {
|
} else {
|
||||||
messenger.unregisterIncomingPluginChannel(Stargate.stargate, bungeeChannel);
|
messenger.unregisterIncomingPluginChannel(Stargate.getInstance(), bungeeChannel);
|
||||||
messenger.unregisterOutgoingPluginChannel(Stargate.stargate, bungeeChannel);
|
messenger.unregisterOutgoingPluginChannel(Stargate.getInstance(), bungeeChannel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -293,8 +293,8 @@ public final class StargateConfig {
|
|||||||
* Loads all config values
|
* Loads all config values
|
||||||
*/
|
*/
|
||||||
public void loadConfig() {
|
public void loadConfig() {
|
||||||
Stargate.stargate.reloadConfig();
|
Stargate.getInstance().reloadConfig();
|
||||||
FileConfiguration newConfig = Stargate.stargate.getConfig();
|
FileConfiguration newConfig = Stargate.getInstance().getConfig();
|
||||||
|
|
||||||
boolean isMigrating = false;
|
boolean isMigrating = false;
|
||||||
if (newConfig.getString("lang") != null ||
|
if (newConfig.getString("lang") != null ||
|
||||||
@ -329,7 +329,7 @@ public final class StargateConfig {
|
|||||||
//Load all economy config values
|
//Load all economy config values
|
||||||
economyConfig = new EconomyConfig(newConfig);
|
economyConfig = new EconomyConfig(newConfig);
|
||||||
|
|
||||||
Stargate.stargate.saveConfig();
|
Stargate.getInstance().saveConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -403,7 +403,7 @@ public final class StargateConfig {
|
|||||||
* Loads all portals in all un-managed worlds
|
* Loads all portals in all un-managed worlds
|
||||||
*/
|
*/
|
||||||
public void loadAllPortals() {
|
public void loadAllPortals() {
|
||||||
for (World world : Stargate.stargate.getServer().getWorlds()) {
|
for (World world : Stargate.getInstance().getServer().getWorlds()) {
|
||||||
if (!managedWorlds.contains(world.getName())) {
|
if (!managedWorlds.contains(world.getName())) {
|
||||||
PortalFileHelper.loadAllPortals(world);
|
PortalFileHelper.loadAllPortals(world);
|
||||||
managedWorlds.add(world.getName());
|
managedWorlds.add(world.getName());
|
||||||
@ -421,7 +421,8 @@ public final class StargateConfig {
|
|||||||
logger.severe("Unable to create portal directory");
|
logger.severe("Unable to create portal directory");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File newFile = new File(portalFolder, Stargate.stargate.getServer().getWorlds().get(0).getName() + ".db");
|
File newFile = new File(portalFolder, Stargate.getInstance().getServer().getWorlds().get(0).getName() +
|
||||||
|
".db");
|
||||||
if (!newFile.exists() && !newFile.getParentFile().exists()) {
|
if (!newFile.exists() && !newFile.getParentFile().exists()) {
|
||||||
if (!newFile.getParentFile().mkdirs()) {
|
if (!newFile.getParentFile().mkdirs()) {
|
||||||
logger.severe("Unable to create portal database folder: " + newFile.getParentFile().getPath());
|
logger.severe("Unable to create portal database folder: " + newFile.getParentFile().getPath());
|
||||||
|
@ -83,7 +83,8 @@ public class BlockEventListener implements Listener {
|
|||||||
|
|
||||||
Stargate.getMessageSender().sendSuccessMessage(player, Stargate.getString("createMsg"));
|
Stargate.getMessageSender().sendSuccessMessage(player, Stargate.getString("createMsg"));
|
||||||
Stargate.debug("onSignChange", "Initialized stargate: " + portal.getName());
|
Stargate.debug("onSignChange", "Initialized stargate: " + portal.getName());
|
||||||
Stargate.server.getScheduler().scheduleSyncDelayedTask(Stargate.stargate, portal::drawSign, 1);
|
Stargate.getInstance().getServer().getScheduler().scheduleSyncDelayedTask(Stargate.getInstance(),
|
||||||
|
portal::drawSign, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -122,7 +123,7 @@ public class BlockEventListener implements Listener {
|
|||||||
|
|
||||||
//Create and call a StarGateDestroyEvent
|
//Create and call a StarGateDestroyEvent
|
||||||
StargateDestroyEvent destroyEvent = new StargateDestroyEvent(portal, player, deny, denyMessage, cost);
|
StargateDestroyEvent destroyEvent = new StargateDestroyEvent(portal, player, deny, denyMessage, cost);
|
||||||
Stargate.server.getPluginManager().callEvent(destroyEvent);
|
Stargate.getInstance().getServer().getPluginManager().callEvent(destroyEvent);
|
||||||
if (destroyEvent.isCancelled()) {
|
if (destroyEvent.isCancelled()) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
|
@ -67,7 +67,7 @@ public class PlayerTeleporter extends Teleporter {
|
|||||||
*/
|
*/
|
||||||
private Location triggerPlayerPortalEvent(Portal origin, Location exit, PlayerMoveEvent event) {
|
private Location triggerPlayerPortalEvent(Portal origin, Location exit, PlayerMoveEvent event) {
|
||||||
StargatePlayerPortalEvent stargatePlayerPortalEvent = new StargatePlayerPortalEvent(player, origin, portal, exit);
|
StargatePlayerPortalEvent stargatePlayerPortalEvent = new StargatePlayerPortalEvent(player, origin, portal, exit);
|
||||||
Stargate.server.getPluginManager().callEvent(stargatePlayerPortalEvent);
|
Stargate.getInstance().getServer().getPluginManager().callEvent(stargatePlayerPortalEvent);
|
||||||
//Teleport is cancelled. Teleport the player back to where it came from
|
//Teleport is cancelled. Teleport the player back to where it came from
|
||||||
if (stargatePlayerPortalEvent.isCancelled()) {
|
if (stargatePlayerPortalEvent.isCancelled()) {
|
||||||
new PlayerTeleporter(origin, player).teleport(origin, event);
|
new PlayerTeleporter(origin, player).teleport(origin, event);
|
||||||
|
@ -164,7 +164,7 @@ public class PortalActivator {
|
|||||||
*/
|
*/
|
||||||
private boolean triggerStargateActivationEvent(Player player) {
|
private boolean triggerStargateActivationEvent(Player player) {
|
||||||
StargateActivateEvent event = new StargateActivateEvent(portal, player, destinations, destination);
|
StargateActivateEvent event = new StargateActivateEvent(portal, player, destinations, destination);
|
||||||
Stargate.server.getPluginManager().callEvent(event);
|
Stargate.getInstance().getServer().getPluginManager().callEvent(event);
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
Stargate.getStargateConfig().getActivePortalsQueue().remove(portal);
|
Stargate.getStargateConfig().getActivePortalsQueue().remove(portal);
|
||||||
return false;
|
return false;
|
||||||
@ -183,7 +183,7 @@ public class PortalActivator {
|
|||||||
public void deactivate() {
|
public void deactivate() {
|
||||||
//Trigger a stargate deactivate event to allow other plugins to cancel the event
|
//Trigger a stargate deactivate event to allow other plugins to cancel the event
|
||||||
StargateDeactivateEvent event = new StargateDeactivateEvent(portal);
|
StargateDeactivateEvent event = new StargateDeactivateEvent(portal);
|
||||||
Stargate.server.getPluginManager().callEvent(event);
|
Stargate.getInstance().getServer().getPluginManager().callEvent(event);
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,7 @@ public class PortalCreator {
|
|||||||
//Call StargateCreateEvent to let other plugins cancel or overwrite denial
|
//Call StargateCreateEvent to let other plugins cancel or overwrite denial
|
||||||
StargateCreateEvent stargateCreateEvent = new StargateCreateEvent(player, portal, lines, deny,
|
StargateCreateEvent stargateCreateEvent = new StargateCreateEvent(player, portal, lines, deny,
|
||||||
denyMessage, createCost);
|
denyMessage, createCost);
|
||||||
Stargate.server.getPluginManager().callEvent(stargateCreateEvent);
|
Stargate.getInstance().getServer().getPluginManager().callEvent(stargateCreateEvent);
|
||||||
if (stargateCreateEvent.isCancelled()) {
|
if (stargateCreateEvent.isCancelled()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ public class PortalOpener {
|
|||||||
public void openPortal(Player openFor, boolean force) {
|
public void openPortal(Player openFor, boolean force) {
|
||||||
//Call the StargateOpenEvent to allow the opening to be cancelled
|
//Call the StargateOpenEvent to allow the opening to be cancelled
|
||||||
StargateOpenEvent event = new StargateOpenEvent(openFor, portal, force);
|
StargateOpenEvent event = new StargateOpenEvent(openFor, portal, force);
|
||||||
Stargate.server.getPluginManager().callEvent(event);
|
Stargate.getInstance().getServer().getPluginManager().callEvent(event);
|
||||||
if (event.isCancelled() || (isOpen() && !event.getForce())) {
|
if (event.isCancelled() || (isOpen() && !event.getForce())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -152,7 +152,7 @@ public class PortalOpener {
|
|||||||
|
|
||||||
//Call the StargateCloseEvent to allow other plugins to cancel the closing, or change whether to force it closed
|
//Call the StargateCloseEvent to allow other plugins to cancel the closing, or change whether to force it closed
|
||||||
StargateCloseEvent event = new StargateCloseEvent(portal, force);
|
StargateCloseEvent event = new StargateCloseEvent(portal, force);
|
||||||
Stargate.server.getPluginManager().callEvent(event);
|
Stargate.getInstance().getServer().getPluginManager().callEvent(event);
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ public abstract class Teleporter {
|
|||||||
*/
|
*/
|
||||||
public Teleporter(Portal portal) {
|
public Teleporter(Portal portal) {
|
||||||
this.portal = portal;
|
this.portal = portal;
|
||||||
this.scheduler = Stargate.server.getScheduler();
|
this.scheduler = Stargate.getInstance().getServer().getScheduler();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -207,7 +207,7 @@ public abstract class Teleporter {
|
|||||||
*/
|
*/
|
||||||
protected void loadChunks() {
|
protected void loadChunks() {
|
||||||
for (Chunk chunk : getChunksToLoad()) {
|
for (Chunk chunk : getChunksToLoad()) {
|
||||||
chunk.addPluginChunkTicket(Stargate.stargate);
|
chunk.addPluginChunkTicket(Stargate.getInstance());
|
||||||
//Allow the chunk to unload after 3 seconds
|
//Allow the chunk to unload after 3 seconds
|
||||||
Stargate.addChunkUnloadRequest(new ChunkUnloadRequest(chunk, 3000L));
|
Stargate.addChunkUnloadRequest(new ChunkUnloadRequest(chunk, 3000L));
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,8 @@ public class VehicleTeleporter extends Teleporter {
|
|||||||
} else {
|
} else {
|
||||||
//Teleport an empty vehicle
|
//Teleport an empty vehicle
|
||||||
teleportingVehicle.teleport(exit);
|
teleportingVehicle.teleport(exit);
|
||||||
scheduler.scheduleSyncDelayedTask(Stargate.stargate, () -> teleportingVehicle.setVelocity(newVelocity), 1);
|
scheduler.scheduleSyncDelayedTask(Stargate.getInstance(),
|
||||||
|
() -> teleportingVehicle.setVelocity(newVelocity), 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,7 +103,7 @@ public class VehicleTeleporter extends Teleporter {
|
|||||||
private Location triggerEntityPortalEvent(Portal origin, Location exit) {
|
private Location triggerEntityPortalEvent(Portal origin, Location exit) {
|
||||||
StargateEntityPortalEvent stargateEntityPortalEvent = new StargateEntityPortalEvent(teleportingVehicle, origin,
|
StargateEntityPortalEvent stargateEntityPortalEvent = new StargateEntityPortalEvent(teleportingVehicle, origin,
|
||||||
portal, exit);
|
portal, exit);
|
||||||
Stargate.server.getPluginManager().callEvent(stargateEntityPortalEvent);
|
Stargate.getInstance().getServer().getPluginManager().callEvent(stargateEntityPortalEvent);
|
||||||
//Teleport is cancelled. Teleport the entity back to where it came from just for sanity's sake
|
//Teleport is cancelled. Teleport the entity back to where it came from just for sanity's sake
|
||||||
if (stargateEntityPortalEvent.isCancelled()) {
|
if (stargateEntityPortalEvent.isCancelled()) {
|
||||||
new VehicleTeleporter(origin, teleportingVehicle).teleport(origin);
|
new VehicleTeleporter(origin, teleportingVehicle).teleport(origin);
|
||||||
@ -149,7 +150,7 @@ public class VehicleTeleporter extends Teleporter {
|
|||||||
//Set rotation, add passengers and restore velocity
|
//Set rotation, add passengers and restore velocity
|
||||||
newVehicle.setRotation(exit.getYaw(), exit.getPitch());
|
newVehicle.setRotation(exit.getYaw(), exit.getPitch());
|
||||||
handleVehiclePassengers(passengers, newVehicle, 1);
|
handleVehiclePassengers(passengers, newVehicle, 1);
|
||||||
scheduler.scheduleSyncDelayedTask(Stargate.stargate, () -> newVehicle.setVelocity(newVelocity), 1);
|
scheduler.scheduleSyncDelayedTask(Stargate.getInstance(), () -> newVehicle.setVelocity(newVelocity), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -162,7 +163,8 @@ public class VehicleTeleporter extends Teleporter {
|
|||||||
private void handleVehiclePassengers(List<Entity> passengers, Vehicle vehicle, long delay) {
|
private void handleVehiclePassengers(List<Entity> passengers, Vehicle vehicle, long delay) {
|
||||||
for (Entity passenger : passengers) {
|
for (Entity passenger : passengers) {
|
||||||
passenger.eject();
|
passenger.eject();
|
||||||
scheduler.scheduleSyncDelayedTask(Stargate.stargate, () -> teleportAndAddPassenger(vehicle, passenger), delay);
|
scheduler.scheduleSyncDelayedTask(Stargate.getInstance(), () -> teleportAndAddPassenger(vehicle, passenger),
|
||||||
|
delay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ public class ChunkUnloadThread implements Runnable {
|
|||||||
unloadQueue.remove();
|
unloadQueue.remove();
|
||||||
Chunk chunkToUnload = firstElement.getChunkToUnload();
|
Chunk chunkToUnload = firstElement.getChunkToUnload();
|
||||||
//Allow the chunk to be unloaded
|
//Allow the chunk to be unloaded
|
||||||
chunkToUnload.removePluginChunkTicket(Stargate.stargate);
|
chunkToUnload.removePluginChunkTicket(Stargate.getInstance());
|
||||||
firstElement = unloadQueue.peek();
|
firstElement = unloadQueue.peek();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ public final class BungeeHelper {
|
|||||||
//Write the actual message
|
//Write the actual message
|
||||||
dataOutputStream.writeBytes(message);
|
dataOutputStream.writeBytes(message);
|
||||||
//Send the plugin message
|
//Send the plugin message
|
||||||
player.sendPluginMessage(Stargate.stargate, bungeeChannel, byteArrayOutputStream.toByteArray());
|
player.sendPluginMessage(Stargate.getInstance(), bungeeChannel, byteArrayOutputStream.toByteArray());
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Stargate.logSevere("Error sending BungeeCord teleport packet");
|
Stargate.logSevere("Error sending BungeeCord teleport packet");
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
@ -104,7 +104,7 @@ public final class BungeeHelper {
|
|||||||
dataOutputStream.writeUTF(entrancePortal.getNetwork());
|
dataOutputStream.writeUTF(entrancePortal.getNetwork());
|
||||||
|
|
||||||
//Send the plugin message
|
//Send the plugin message
|
||||||
player.sendPluginMessage(Stargate.stargate, bungeeChannel, byteArrayOutputStream.toByteArray());
|
player.sendPluginMessage(Stargate.getInstance(), bungeeChannel, byteArrayOutputStream.toByteArray());
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Stargate.logSevere("Error sending BungeeCord connect packet");
|
Stargate.logSevere("Error sending BungeeCord connect packet");
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
@ -155,7 +155,7 @@ public final class BungeeHelper {
|
|||||||
String destination = messageParts[1];
|
String destination = messageParts[1];
|
||||||
|
|
||||||
//Check if the player is online, if so, teleport, otherwise, queue
|
//Check if the player is online, if so, teleport, otherwise, queue
|
||||||
Player player = Stargate.server.getPlayer(playerUUID);
|
Player player = Stargate.getInstance().getServer().getPlayer(playerUUID);
|
||||||
if (player == null) {
|
if (player == null) {
|
||||||
bungeeQueue.put(playerUUID, destination);
|
bungeeQueue.put(playerUUID, destination);
|
||||||
} else {
|
} else {
|
||||||
|
@ -53,9 +53,9 @@ public final class EconomyHelper {
|
|||||||
PortalOwner owner = entrancePortal.getOwner();
|
PortalOwner owner = entrancePortal.getOwner();
|
||||||
Player portalOwner;
|
Player portalOwner;
|
||||||
if (owner.getUUID() != null) {
|
if (owner.getUUID() != null) {
|
||||||
portalOwner = Stargate.server.getPlayer(owner.getUUID());
|
portalOwner = Stargate.getInstance().getServer().getPlayer(owner.getUUID());
|
||||||
} else {
|
} else {
|
||||||
portalOwner = Stargate.server.getPlayer(owner.getName());
|
portalOwner = Stargate.getInstance().getServer().getPlayer(owner.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
//Notify the gate owner of received payment
|
//Notify the gate owner of received payment
|
||||||
|
@ -81,7 +81,7 @@ public final class PermissionHelper {
|
|||||||
*/
|
*/
|
||||||
public static boolean portalAccessDenied(Player player, Portal portal, boolean deny) {
|
public static boolean portalAccessDenied(Player player, Portal portal, boolean deny) {
|
||||||
StargateAccessEvent event = new StargateAccessEvent(player, portal, deny);
|
StargateAccessEvent event = new StargateAccessEvent(player, portal, deny);
|
||||||
Stargate.server.getPluginManager().callEvent(event);
|
Stargate.getInstance().getServer().getPluginManager().callEvent(event);
|
||||||
return event.getDeny();
|
return event.getDeny();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user