mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-22 16:48:21 +01:00
Emergency Fix
This commit is contained in:
parent
73c97a39e6
commit
1c2b585a6f
4
pom.xml
4
pom.xml
@ -28,12 +28,12 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<version>2.7.14</version>
|
||||
<version>2.7.15</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.5-R0.1-SNAPSHOT</version>
|
||||
<version>1.5.1-R0.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.milkbowl.vault</groupId>
|
||||
|
@ -483,15 +483,17 @@ public class AuthMe extends JavaPlugin {
|
||||
for (i = 0 ; i <= players.length ; i++) {
|
||||
Random rdm = new Random();
|
||||
int a = rdm.nextInt(players.length);
|
||||
if (!players[a].hasPermission("authme.vip")) {
|
||||
if (!(players[a].hasPermission("authme.vip"))) {
|
||||
player = players[a];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (player == null) {
|
||||
for (Player p : this.getServer().getOnlinePlayers()) {
|
||||
if (p.hasPermission("authme.vip"))
|
||||
for (Player p : players) {
|
||||
if (!(p.hasPermission("authme.vip"))) {
|
||||
player = p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return player;
|
||||
|
@ -159,13 +159,13 @@ public class Management {
|
||||
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, limbo.getLoc());
|
||||
pm.callEvent(tpEvent);
|
||||
if(!tpEvent.isCancelled()) {
|
||||
if (!tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).isLoaded()) {
|
||||
tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).load();
|
||||
}
|
||||
final Location fLoc = tpEvent.getTo();
|
||||
Bukkit.getScheduler().runTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!fLoc.getChunk().isLoaded()) {
|
||||
fLoc.getChunk().load();
|
||||
}
|
||||
player.teleport(fLoc);
|
||||
}
|
||||
});
|
||||
@ -176,16 +176,16 @@ public class Management {
|
||||
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawnLoc, true);
|
||||
pm.callEvent(tpEvent);
|
||||
if(!tpEvent.isCancelled()) {
|
||||
if (!tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).isLoaded()) {
|
||||
tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).load();
|
||||
}
|
||||
final Location fLoc = tpEvent.getTo();
|
||||
Bukkit.getScheduler().runTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.teleport(fLoc);
|
||||
}
|
||||
});
|
||||
final Location fLoc = tpEvent.getTo();
|
||||
Bukkit.getScheduler().runTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!fLoc.getChunk().isLoaded()) {
|
||||
fLoc.getChunk().load();
|
||||
}
|
||||
player.teleport(fLoc);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else if ((Settings.isSaveQuitLocationEnabled) && (getAuth.getQuitLocY() != 0))
|
||||
@ -196,13 +196,13 @@ public class Management {
|
||||
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, limbo.getLoc());
|
||||
pm.callEvent(tpEvent);
|
||||
if(!tpEvent.isCancelled()) {
|
||||
if (!tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).isLoaded()) {
|
||||
tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).load();
|
||||
}
|
||||
final Location fLoc = tpEvent.getTo();
|
||||
Bukkit.getScheduler().runTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!fLoc.getChunk().isLoaded()) {
|
||||
fLoc.getChunk().load();
|
||||
}
|
||||
player.teleport(fLoc);
|
||||
}
|
||||
});
|
||||
@ -319,16 +319,16 @@ public class Management {
|
||||
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, quitLoc);
|
||||
pm.callEvent(tpEvent);
|
||||
if(!tpEvent.isCancelled()) {
|
||||
if (!tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).isLoaded()) {
|
||||
tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).load();
|
||||
}
|
||||
final Location fLoc = tpEvent.getTo();
|
||||
Bukkit.getScheduler().runTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.teleport(fLoc);
|
||||
}
|
||||
});
|
||||
final Location fLoc = tpEvent.getTo();
|
||||
Bukkit.getScheduler().runTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!fLoc.getChunk().isLoaded()) {
|
||||
fLoc.getChunk().load();
|
||||
}
|
||||
player.teleport(fLoc);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -336,16 +336,16 @@ public class Management {
|
||||
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, limbo.getLoc());
|
||||
pm.callEvent(tpEvent);
|
||||
if(!tpEvent.isCancelled()) {
|
||||
if (!tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).isLoaded()) {
|
||||
tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).load();
|
||||
}
|
||||
final Location fLoc = tpEvent.getTo();
|
||||
Bukkit.getScheduler().runTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.teleport(fLoc);
|
||||
}
|
||||
});
|
||||
final Location fLoc = tpEvent.getTo();
|
||||
Bukkit.getScheduler().runTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!fLoc.getChunk().isLoaded()) {
|
||||
fLoc.getChunk().load();
|
||||
}
|
||||
player.teleport(fLoc);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -354,16 +354,16 @@ public class Management {
|
||||
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawnLoc, true);
|
||||
pm.callEvent(tpEvent);
|
||||
if(!tpEvent.isCancelled()) {
|
||||
if (!tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).isLoaded()) {
|
||||
tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).load();
|
||||
}
|
||||
final Location fLoc = tpEvent.getTo();
|
||||
Bukkit.getScheduler().runTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.teleport(fLoc);
|
||||
}
|
||||
});
|
||||
final Location fLoc = tpEvent.getTo();
|
||||
Bukkit.getScheduler().runTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!fLoc.getChunk().isLoaded()) {
|
||||
fLoc.getChunk().load();
|
||||
}
|
||||
player.teleport(fLoc);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else if ((Settings.isSaveQuitLocationEnabled) && (database.getAuth(name).getQuitLocY() != 0)) {
|
||||
@ -371,13 +371,13 @@ public class Management {
|
||||
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, quitLoc);
|
||||
pm.callEvent(tpEvent);
|
||||
if(!tpEvent.isCancelled()) {
|
||||
if (!tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).isLoaded()) {
|
||||
tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).load();
|
||||
}
|
||||
final Location fLoc = tpEvent.getTo();
|
||||
Bukkit.getScheduler().runTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!fLoc.getChunk().isLoaded()) {
|
||||
fLoc.getChunk().load();
|
||||
}
|
||||
player.teleport(fLoc);
|
||||
}
|
||||
});
|
||||
@ -388,13 +388,13 @@ public class Management {
|
||||
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, limbo.getLoc());
|
||||
pm.callEvent(tpEvent);
|
||||
if(!tpEvent.isCancelled()) {
|
||||
if (!tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).isLoaded()) {
|
||||
tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).load();
|
||||
}
|
||||
final Location fLoc = tpEvent.getTo();
|
||||
Bukkit.getScheduler().runTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!fLoc.getChunk().isLoaded()) {
|
||||
fLoc.getChunk().load();
|
||||
}
|
||||
player.teleport(fLoc);
|
||||
}
|
||||
});
|
||||
|
@ -597,25 +597,25 @@ public class AuthMePlayerListener implements Listener {
|
||||
|
||||
if (name.length() > max || name.length() < min) {
|
||||
|
||||
event.disallow(Result.KICK_OTHER, m._("name_len"));
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("name_len"));
|
||||
return;
|
||||
}
|
||||
if (!player.getName().matches(regex) || name.equals("Player")) {
|
||||
try {
|
||||
event.disallow(Result.KICK_OTHER, m._("regex").replaceAll("REG_EX", regex));
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("regex").replaceAll("REG_EX", regex));
|
||||
} catch (StringIndexOutOfBoundsException exc) {
|
||||
event.disallow(Result.KICK_OTHER, "allowed char : " + regex);
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "allowed char : " + regex);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (Settings.isKickNonRegisteredEnabled) {
|
||||
if (!data.isAuthAvailable(name)) {
|
||||
event.disallow(Result.KICK_OTHER, m._("reg_only"));
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("reg_only"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (event.getResult() != Result.KICK_FULL) return;
|
||||
if (event.getResult() != PlayerLoginEvent.Result.KICK_FULL) return;
|
||||
if (player.isBanned()) return;
|
||||
if (!player.hasPermission("authme.vip")) {
|
||||
event.disallow(Result.KICK_FULL, m._("kick_fullserver"));
|
||||
|
@ -3,7 +3,7 @@ author: darkwarriros,Xephi
|
||||
website: http://www.multiplayer-italia.com/
|
||||
description: AuthMe prevents people, which aren't logged in, from doing stuff like placing blocks, moving, typing commands or seeing the inventory of the current player.
|
||||
main: uk.org.whoami.authme.AuthMe
|
||||
version: 2.7.14
|
||||
version: 2.7.15
|
||||
softdepend: [Vault, ChestShop, Spout, Multiverse-Core, Notifications, Citizens, CombatTag]
|
||||
commands:
|
||||
register:
|
||||
|
Loading…
Reference in New Issue
Block a user