Ascync tp is disabled for now

Ascync TP is done in 1.18 already, and this is just a dirty fix to stop crashing/ lol
This commit is contained in:
Brian Fopiano 2022-03-18 16:05:38 -07:00
parent 99713ac964
commit 15bc964fcc

View File

@ -69,24 +69,31 @@ public abstract class EngineAssignedWorldManager extends EngineAssignedComponent
protected AtomicBoolean ignoreTP = new AtomicBoolean(false);
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void on(PlayerTeleportEvent e) {
if(ignoreTP.get()) {
return;
}
if(!PaperLib.isPaper() || e.getTo() == null) {
return;
}
try {
if(e.getTo().getWorld().equals(getTarget().getWorld().realWorld())) {
getEngine().getWorldManager().teleportAsync(e);
}
} catch(Throwable ex) {
}
}
// @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
// public void on(PlayerTeleportEvent e) {
// if(ignoreTP.get()) {
// System.out.println("IgTP1");
// return;
// }
//
// if(!PaperLib.isPaper() || e.getTo() == null) {
// System.out.println("IgTP2");
//
//// return;
// }
//
//// try {
//// System.out.println("IgTP3");
////
//// if(e.getTo().getWorld().equals(getTarget().getWorld().realWorld())) {
//// System.out.println("IgTP4");
////
//// getEngine().getWorldManager().teleportAsync(e);
//// }
//// } catch(Throwable ex) {
////
//// }
// }
@EventHandler
public void on(WorldSaveEvent e) {