Conversation
MC-Samuel
commented
Mar 15, 2026
- Fixed bug reported at https://discord.com/channels/315163488085475337/1465757086880366602
- Modernized format of MobArenaPlayerExpansions file and tags
- Converted 'PlayerTag.mobarena.stats[].(stat)' ElementTags to a universal 'PlayerTag.mobarena_stats' MapTag
- Updated pom to latest version
|
|
||
| public class MobArenaPlayerExtensions { | ||
|
|
||
| public static SlowWarning mobArenaPlayerTags = new SlowWarning("mobArenaPlayerTags", "Tags in the format 'PlayerTag.mobarena.x' have been deprecated: check the meta site for updated versions."); |
There was a problem hiding this comment.
in the format X -> in the X format, meta docs for more information
| // NOTE: Requires the player to be in an arena. | ||
| // --> | ||
| PlayerTag.tagProcessor.registerTag(MobArenaArenaTag.class, "current_mobarena", (attribute, player) -> { | ||
| return getArena(player) != null ? new MobArenaArenaTag(getArena(player)) : null; |
There was a problem hiding this comment.
Do we want to be calling getArena twice here? The old code seems to put it in a variable
| // NOTE: Requires the player to be in an arena. | ||
| // --> | ||
| PlayerTag.tagProcessor.registerTag(ElementTag.class, "mobarena_class", (attribute, player) -> { | ||
| return getArena(player) != null ? new ElementTag(getArenaPlayer(player).getArenaClass().getConfigName(), true) : null; |
There was a problem hiding this comment.
Maybe same thing here, alongside making getArenaPlayer null safe?
| // @plugin Depenizen, MobArena | ||
| // @description | ||
| // Returns the stats of a player in their current arena. | ||
| // Valid keys are 'KILLS', 'DAMAGE_DONE', 'DAMAGE_TAKEN', 'LAST_WAVE', 'TIMES_SWUNG', and 'TIMES_HIT'. |
There was a problem hiding this comment.
Maybe includes keys or something? Valid sounds like an input - also stating ElementTag(Number) could be handy
| // @attribute <PlayerTag.mobarena.in_arena> | ||
| // @returns ElementTag(Boolean) | ||
| // @plugin Depenizen, MobArena | ||
| // @deprecated Use 'PlayerTag.in_mobarena' |
There was a problem hiding this comment.
Nitpick but these should start lowercase, as they're used as a part of a bigger message in e.g. VSC
| attribute.fulfill(1); | ||
| return new ElementTag(getArena(player) != null); | ||
| } | ||
| if (getArena(player) != null) { |
There was a problem hiding this comment.
Same here, no need to call it each time - seeing as this is all one big tag block anyway just put it in a variable
|
|
||
| if (attribute.startsWith("stats", 2)) { | ||
| attribute.fulfill(1); | ||
| ArenaPlayerStatistics stats = getArenaPlayer(player).getStats(); |
There was a problem hiding this comment.
Does this not remove functionality? Looks like it let you input any mob arena previously (same for the new mobarena_stats, looks like you can't do what the old tag did currently)