applying changes

This commit is contained in:
Tooze 2026-07-22 23:53:22 -04:00
parent 002b2541b2
commit 4c031132bb
7 changed files with 19 additions and 21 deletions

View file

@ -217,7 +217,7 @@ public final class HouseManager {
if (house.isInHouse(player)) {
player.animate(Animation.RESET);
player.getProperties().setTeleportLocation(house.location.getExitLocation());
player.removeAttribute(lastActivity);
removeAttribute(player,lastActivity);
}
}

View file

@ -77,7 +77,7 @@ public final class HouseZone extends MapZone {
}
registerLogoutListener(pl, "houselogout", (p) -> {
p.setLocation(house.getLocation().getExitLocation());
p.removeAttribute(lastActivity);
removeAttribute(p,lastActivity);
return kotlin.Unit.INSTANCE;
});
}

View file

@ -77,7 +77,6 @@ class FishingTrawlerActivity : ActivityPlugin("fishing trawler",false,false,true
nextStart = GameWorld.ticks + WAIT_TIME
player.dialogueInterpreter.sendDialogue("Trawler will leave in 2 minutes.","If you have a team get them on board now!")
}
//waitingPlayers.add(player)
start(player,true)
}

View file

@ -156,8 +156,8 @@ class FishingTrawlerSession(val activity: FishingTrawlerActivity? = null) : MapA
player.properties.teleportLocation = Location.create(2666, 3162, 0)
player.incrementAttribute("/save:$STATS_BASE:$FISHING_TRAWLER_GAMES_WON")
val rolls = ceil(session.fishAmount / session.players.size.toDouble()).toInt()
player.removeAttribute("ft-session")
player.setAttribute("/save:ft-rolls", rolls)
removeAttribute(player,"ft-session")
setAttribute(player, "/save:ft-rolls", rolls)
clearLogoutListener(player, "ft-logout")
player.removeAttribute(lastActivity)
}

View file

@ -98,12 +98,11 @@ public final class ActivityManager {
}
return;
}
player.debug("[ActivityManager] Recovering from " + activityName);
if (activityName.equals(POH_Activity)) {
HouseZone.remove_items(player);
player.setLocation(player.getHouseManager().getLocation().getExitLocation());
player.removeAttribute("original-loc");
player.removeAttribute(lastActivity);
removeAttribute(player,"original-loc");
removeAttribute(player,lastActivity);
return;
}
try {

View file

@ -13,8 +13,7 @@ import core.plugin.PluginManifest;
import core.plugin.PluginType;
import core.tools.Log;
import static core.api.ContentAPIKt.log;
import static core.api.ContentAPIKt.sendMessage;
import static core.api.ContentAPIKt.*;
import static core.game.activity.ActivityManager.lastActivity;
import static core.game.activity.ActivityManager.saveLastActivity;
@ -136,8 +135,7 @@ public abstract class ActivityPlugin extends MapZone implements Plugin<Player> {
*/
public boolean start(Player player, boolean login, Object... args) {
this.player = player;
player.setAttribute(saveLastActivity, this.getName());
//player.sendMessage(this.getName());
setAttribute(player,saveLastActivity, this.getName());
return true;
}
@ -149,7 +147,7 @@ public abstract class ActivityPlugin extends MapZone implements Plugin<Player> {
}
e.getProperties().setSafeZone(safe);
e.getProperties().safeRespawn = this.safeRespawn;
e.setAttribute("activity", this);
setAttribute(e,"activity", this);
return super.enter(e);
}
@ -164,8 +162,8 @@ public abstract class ActivityPlugin extends MapZone implements Plugin<Player> {
}
e.getProperties().setSafeZone(false);
e.getProperties().safeRespawn = ServerConstants.HOME_LOCATION;
e.removeAttribute("activity");
e.removeAttribute(lastActivity);
removeAttribute(e,"activity");
removeAttribute(e,lastActivity);
return super.leave(e, logout);
}
@ -178,13 +176,13 @@ public abstract class ActivityPlugin extends MapZone implements Plugin<Player> {
public void recover(Player player) {
Location spawn = getSpawnLocation();
if (spawn == null) {
String lastActivity = player.getAttribute(core.game.activity.ActivityManager.lastActivity, null);
String lastActivity = getAttribute(player,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);
player.removeAttribute(lastActivity);
removeAttribute(player,lastActivity);
}
@Override

View file

@ -17,6 +17,8 @@ import core.plugin.PluginType;
import java.util.ArrayList;
import java.util.List;
import static core.api.ContentAPIKt.removeAttribute;
import static core.api.ContentAPIKt.setAttribute;
import static core.game.activity.ActivityManager.lastActivity;
/**
@ -72,9 +74,9 @@ public abstract class CutscenePlugin extends ActivityPlugin {
@Override
public boolean start(final Player player, boolean login, Object... args) {
player.setAttribute("cutscene:original-loc", player.getLocation());
player.removeAttribute("real-end");
player.setAttribute("real-end", player.getLocation());
setAttribute(player,"cutscene:original-loc", player.getLocation());
removeAttribute(player,"real-end");
setAttribute(player,"real-end", player.getLocation());
if (isFade()) {
GameWorld.getPulser().submit(getStartPulse());
} else {
@ -144,7 +146,7 @@ public abstract class CutscenePlugin extends ActivityPlugin {
player.getInterfaceManager().restoreTabs();
player.unlock();// incase he was locked.
player.getWalkingQueue().reset();
player.removeAttribute(lastActivity);
removeAttribute(player,lastActivity);
}
/**