Apply 1 suggestion(s) to 1 file(s)

Co-authored-by: GregF <gregf36665@gmail.com>
This commit is contained in:
Tooze 2026-07-23 03:12:17 +00:00
parent e6eda4db9d
commit d567b61024

View file

@ -11,7 +11,10 @@ import core.game.world.map.zone.impl.MultiwayCombatZone;
import core.plugin.Plugin;
import core.plugin.PluginManifest;
import core.plugin.PluginType;
import static core.api.ContentAPIKt.*;
import core.tools.Log;
import static core.api.ContentAPIKt.log;
import static core.api.ContentAPIKt.sendMessage;
import static core.game.activity.ActivityManager.lastActivity;
import static core.game.activity.ActivityManager.saveLastActivity;
@ -133,7 +136,7 @@ public abstract class ActivityPlugin extends MapZone implements Plugin<Player> {
*/
public boolean start(Player player, boolean login, Object... args) {
this.player = player;
setAttribute(player,saveLastActivity, this.getName());
player.setAttribute(saveLastActivity, this.getName());
return true;
}
@ -145,7 +148,7 @@ public abstract class ActivityPlugin extends MapZone implements Plugin<Player> {
}
e.getProperties().setSafeZone(safe);
e.getProperties().safeRespawn = this.safeRespawn;
setAttribute(e,"activity", this);
e.setAttribute("activity", this);
return super.enter(e);
}
@ -160,8 +163,8 @@ public abstract class ActivityPlugin extends MapZone implements Plugin<Player> {
}
e.getProperties().setSafeZone(false);
e.getProperties().safeRespawn = ServerConstants.HOME_LOCATION;
removeAttribute(e,"activity");
removeAttribute(e,lastActivity);
e.removeAttribute("activity");
e.removeAttribute(lastActivity);
return super.leave(e, logout);
}
@ -170,17 +173,17 @@ public abstract class ActivityPlugin extends MapZone implements Plugin<Player> {
*/
public void register() {
}
@SuppressWarnings("deprecation")
public void recover(Player player) {
Location spawn = getSpawnLocation();
if (spawn == null) {
String lastActivity = getAttribute(player,core.game.activity.ActivityManager.lastActivity, null);
String lastActivity = player.getAttribute(core.game.activity.ActivityManager.lastActivity, null);
sendMessage(player, "You were safely removed from an invalid location.");
sendMessage(player, "Activity: " + lastActivity + ", please report this!");
spawn = ServerConstants.HOME_LOCATION;
}
player.setLocation(spawn);
removeAttribute(player,lastActivity);
player.removeAttribute(lastActivity);
}
@Override