Resynchronize custom event

This commit is contained in:
Xephi 2013-04-14 15:34:01 +02:00
parent 1c2b585a6f
commit 2350a9e6d2
3 changed files with 106 additions and 106 deletions

View File

@ -28,7 +28,7 @@
</plugin>
</plugins>
</build>
<version>2.7.15</version>
<version>2.7.15b1</version>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>

View File

@ -155,58 +155,58 @@ public class Management {
utils.packCoords(getAuth.getQuitLocX(), getAuth.getQuitLocY(), getAuth.getQuitLocZ(), player);
}
else {
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, limbo.getLoc());
pm.callEvent(tpEvent);
if(!tpEvent.isCancelled()) {
final Location fLoc = tpEvent.getTo();
Bukkit.getScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, limbo.getLoc());
pm.callEvent(tpEvent);
Location fLoc = tpEvent.getTo();
if (!tpEvent.isCancelled()) {
if (!fLoc.getChunk().isLoaded()) {
fLoc.getChunk().load();
}
player.teleport(fLoc);
}
});
}
});
}
}
else if (Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName())) {
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawnLoc, true);
pm.callEvent(tpEvent);
if(!tpEvent.isCancelled()) {
final Location fLoc = tpEvent.getTo();
final Location spawnL = spawnLoc;
Bukkit.getScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawnL, true);
pm.callEvent(tpEvent);
if(!tpEvent.isCancelled()) {
Location fLoc = tpEvent.getTo();
if (!fLoc.getChunk().isLoaded()) {
fLoc.getChunk().load();
}
player.teleport(fLoc);
}
});
}
});
}
else if ((Settings.isSaveQuitLocationEnabled) && (getAuth.getQuitLocY() != 0))
{
utils.packCoords(getAuth.getQuitLocX(), getAuth.getQuitLocY(), getAuth.getQuitLocZ(), player);
}
else {
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, limbo.getLoc());
pm.callEvent(tpEvent);
if(!tpEvent.isCancelled()) {
final Location fLoc = tpEvent.getTo();
Bukkit.getScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, limbo.getLoc());
pm.callEvent(tpEvent);
Location fLoc = tpEvent.getTo();
if (!tpEvent.isCancelled()) {
if (!fLoc.getChunk().isLoaded()) {
fLoc.getChunk().load();
}
player.teleport(fLoc);
}
});
}
});
}
Bukkit.getScheduler().runTask(plugin, new Runnable() {
@ -315,90 +315,90 @@ public class Management {
if ((Settings.isTeleportToSpawnEnabled) && (!Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName())))
{
if ((Settings.isSaveQuitLocationEnabled) && (database.getAuth(name).getQuitLocY() != 0)) {
Location quitLoc = new Location(player.getWorld(), database.getAuth(name).getQuitLocX() + 0.5D, database.getAuth(name).getQuitLocY() + 0.5D, database.getAuth(name).getQuitLocZ() + 0.5D);
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, quitLoc);
pm.callEvent(tpEvent);
if(!tpEvent.isCancelled()) {
final Location fLoc = tpEvent.getTo();
final Location quitLoc = new Location(player.getWorld(), database.getAuth(name).getQuitLocX() + 0.5D, database.getAuth(name).getQuitLocY() + 0.5D, database.getAuth(name).getQuitLocZ() + 0.5D);
Bukkit.getScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, quitLoc);
pm.callEvent(tpEvent);
Location fLoc = tpEvent.getTo();
if (!tpEvent.isCancelled()) {
if (!fLoc.getChunk().isLoaded()) {
fLoc.getChunk().load();
}
player.teleport(fLoc);
}
});
}
});
}
else
{
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, limbo.getLoc());
pm.callEvent(tpEvent);
if(!tpEvent.isCancelled()) {
final Location fLoc = tpEvent.getTo();
Bukkit.getScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, limbo.getLoc());
pm.callEvent(tpEvent);
Location fLoc = tpEvent.getTo();
if (!tpEvent.isCancelled()) {
if (!fLoc.getChunk().isLoaded()) {
fLoc.getChunk().load();
}
player.teleport(fLoc);
}
});
}
});
}
}
else if (Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName())) {
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawnLoc, true);
pm.callEvent(tpEvent);
if(!tpEvent.isCancelled()) {
final Location fLoc = tpEvent.getTo();
final Location spawnL = spawnLoc;
Bukkit.getScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawnL, true);
pm.callEvent(tpEvent);
if(!tpEvent.isCancelled()) {
Location fLoc = tpEvent.getTo();
if (!fLoc.getChunk().isLoaded()) {
fLoc.getChunk().load();
}
player.teleport(fLoc);
}
});
}
});
}
else if ((Settings.isSaveQuitLocationEnabled) && (database.getAuth(name).getQuitLocY() != 0)) {
Location quitLoc = new Location(player.getWorld(), database.getAuth(name).getQuitLocX() + 0.5D, database.getAuth(name).getQuitLocY() + 0.5D, database.getAuth(name).getQuitLocZ() + 0.5D);
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, quitLoc);
pm.callEvent(tpEvent);
if(!tpEvent.isCancelled()) {
final Location fLoc = tpEvent.getTo();
final Location quitLoc = new Location(player.getWorld(), database.getAuth(name).getQuitLocX() + 0.5D, database.getAuth(name).getQuitLocY() + 0.5D, database.getAuth(name).getQuitLocZ() + 0.5D);
Bukkit.getScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, quitLoc);
pm.callEvent(tpEvent);
Location fLoc = tpEvent.getTo();
if (!tpEvent.isCancelled()) {
if (!fLoc.getChunk().isLoaded()) {
fLoc.getChunk().load();
}
player.teleport(fLoc);
}
});
}
});
}
else
{
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, limbo.getLoc());
pm.callEvent(tpEvent);
if(!tpEvent.isCancelled()) {
final Location fLoc = tpEvent.getTo();
Bukkit.getScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, limbo.getLoc());
pm.callEvent(tpEvent);
Location fLoc = tpEvent.getTo();
if (!tpEvent.isCancelled()) {
if (!fLoc.getChunk().isLoaded()) {
fLoc.getChunk().load();
}
player.teleport(fLoc);
}
});
}
});
}
Bukkit.getScheduler().runTask(plugin, new Runnable() {

View File

@ -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.15
version: 2.7.15b1
softdepend: [Vault, ChestShop, Spout, Multiverse-Core, Notifications, Citizens, CombatTag]
commands:
register: