Fixed regression - wilderness levers and obelisk teleports

This commit is contained in:
Ceikry 2023-08-07 02:59:29 +00:00 committed by Ryan
parent c6cd12703f
commit ab17ef11a1

View file

@ -1,5 +1,6 @@
package core.game.node.entity.player.link;
import content.region.wilderness.handlers.WildernessObeliskPlugin;
import core.ServerConstants;
import core.game.node.entity.Entity;
import core.game.node.entity.impl.Animator.Priority;
@ -11,6 +12,8 @@ import core.game.world.map.Location;
import core.game.world.update.flag.context.Animation;
import core.game.world.update.flag.context.Graphics;
import static core.api.ContentAPIKt.hasTimerActive;
/**
* Handles the entity teleport.
* @author SonicForce41
@ -90,14 +93,17 @@ public class TeleportManager {
* @return {@code True} if the player successfully started teleporting.
*/
public boolean send(Location location, TeleportType type, int teleportType) {
if (teleportType == WILDY_TELEPORT || type == TeleportType.OBELISK) {
if (hasTimerActive(entity, "teleblock")) return false;
} else {
if (!entity.getZoneMonitor().teleport(teleportType, null)) {
return false;
}
if (teleportType != -1 && entity.isTeleBlocked()) {
if (entity.isPlayer()) {
if (entity.isPlayer())
entity.asPlayer().sendMessage("A magical force has stopped you from teleporting.");
}
return false;
}
if ((teleportType != WILDY_TELEPORT && type != TeleportType.OBELISK) && !entity.getZoneMonitor().teleport(teleportType, null)) {
return false;
}
if (teleportType != -1) {
if (entity instanceof Player) {