Added ajqueue.make-room permission (disabled by default)
This commit is contained in:
@@ -40,6 +40,12 @@ public abstract class AjQueueAPI {
|
||||
*/
|
||||
public abstract void setTimeBetweenPlayers();
|
||||
|
||||
/**
|
||||
* Gets the server time manager instance, which tracks when players last changed servers
|
||||
* @return The server time manager instance
|
||||
*/
|
||||
public abstract ServerTimeManager getServerTimeManager();
|
||||
|
||||
/**
|
||||
* Gets the ajQueue config
|
||||
* @return the ajQueue config
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package us.ajg0702.queue.api;
|
||||
|
||||
import us.ajg0702.queue.api.players.AdaptedPlayer;
|
||||
|
||||
public interface ServerTimeManager {
|
||||
/**
|
||||
* Gets the time that the player specified was last seen switching servers
|
||||
* @param player The player to check
|
||||
* @return The time that they last switched servers, in miliseconds since midnight, January 1, 1970, UTC
|
||||
*/
|
||||
long getLastServerChange(AdaptedPlayer player);
|
||||
}
|
||||
@@ -59,7 +59,12 @@ public interface Logic {
|
||||
}
|
||||
|
||||
if(fulljoinPriority > 0) {
|
||||
if(server.isFull() && server.canJoinFull(player)) {
|
||||
if(server.isFull() && (server.canJoinFull(player) ||
|
||||
(
|
||||
player.hasPermission("ajqueue.make-room") &&
|
||||
AjQueueAPI.getInstance().getConfig().getBoolean("enable-make-room-permission")
|
||||
)
|
||||
)) {
|
||||
highest = Math.max(highest, fulljoinPriority);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user