Fixed wilderness teleblock bug

This commit is contained in:
Ceikry
2023-08-03 13:36:07 +00:00
committed by Ryan
parent 4098f2bf0b
commit 0ca2b8d99c
4 changed files with 9 additions and 7 deletions
@@ -51,7 +51,7 @@ public final class AncientTeleportPlugin extends MagicSpell {
@Override
public boolean cast(Entity entity, Node target) {
if (entity.getLocks().isTeleportLocked() || !super.meetsRequirements(entity, true, false)) {
if (entity.isTeleBlocked() || !super.meetsRequirements(entity, true, false)) {
return false;
}
if (entity.getTeleporter().send(location.transform(0, RandomFunction.random(3), 0), getSpellId() == 28 ? TeleportType.HOME : TeleportType.ANCIENT)) {
@@ -347,10 +347,6 @@ class LunarListeners : SpellListener("lunar"), Commands {
}
private fun sendTeleport(player: Player, xp: Double, loc: Location){
if(player.locks.isTeleportLocked){
player.sendMessage("A magical force prevents you from teleporting.")
return
}
if(player.teleporter.send(loc,TeleportManager.TeleportType.LUNAR)) {
addXP(player, xp)
removeRunes(player)
@@ -361,7 +357,7 @@ class LunarListeners : SpellListener("lunar"), Commands {
private fun sendGroupTeleport(player: Player, xp: Double, destName: String, loc: Location){
RegionManager.getLocalPlayers(player,1).forEach {
if(it == player) return@forEach
if(it.locks.isTeleportLocked) return@forEach
if(it.isTeleBlocked()) return@forEach
if(!it.isActive) return@forEach
if(!it.settings.isAcceptAid) return@forEach
if(it.ironmanManager.isIronman) return@forEach