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