This introduces state in the ScoreboardManager for keeping track of the scoreboards that players have before the arena session starts, if any. Upon leaving, the scoreboards are restored.
Ideally, this change should be re-implemented as a Step of the join/leave process, but that would require opening up Arena or ScoreboardManager in ways that would probably be best handled in a rewrite of the scoreboards, so we'll leave it in ScoreboardManager for now.
Fixes#366
A new section in global-settings called pet-items is used to define pet item transformation items. By default, bones are transformed into wolves, but the item type can now be changed to support using actual bones in classes.
This refactors the pet spawning into its own class to reduce some of the massive responsibility of ArenaImpl.
This closes#467
In this commit, the ItemParser's behavior changes from one that requires or encourages numeric IDs for everything to one that discourages it by logging a warning that suggests using a string instead of a numeric value.
While this doesn't actually make things that much better for updating to Minecraft 1.13, the "ID nagging" hopefully increases awareness about the upcoming breaking changes.
Fixes#382
This follows from the removal of the set class command being removed and the cascading removal of the methods in ArenaMasterImpl that referenced the parseString methods in ItemParser.
Similar to a88556771f.
This specific change may stir the pot a bit, since some people may rely on the set command. However, class chests solve a lot of the problems that the initial command set out to tackle, and we can probably do better in a rewrite of the command if it's missed anyway.
The removed commands render a few methods in ArenaMaster obsolete.
These commands solve a very, very specific problem that it's safe to assume nobody has. It's safe to assume that most config editing happens in the actual config-file, and changing class permissions is probably one of the last things people would expect to find a command for.
Removing these commands renders some methods in ArenaMaster and ArenaClass obsolete.
Instead of the obscure error thrown from ArenaClass when the SHIELD enum value on Material isn't found, MobArena throws its own, more human-friendly error.
Fixes#469
When the arena ends, the MonsterManager is cleared, which means that all references to health bars are lost. Before this, we remove all players from any boss bars to make sure that the boss bars don't stick to players upon dying.
Fixes#473
This changes the upgrade waves from the local Upgrade interface to the Thing interface. This means that all Things can now be used in upgrade waves, including commands, money, potion effects, and permissions.
Unfortunately, the weapons upgrade/replace functionality has been gutted as a result of the Things API not supporting it. We could add it back in later down the road, but for now let's just see if it causes anyone any inconvenience.
Closes#468
This replaces the Map<String, Boolean> approach in ArenaClass with a List<Thing> approach. This greatly simplifies how per-class permissions are handled.
This commit introduces the PermissionThing and associated parser. The parser determines the value (grant/revoke) of the permission by looking at the first character of the input string - if it is a minus (-) or caret (^), the value is false (revoke), otherwise it is true (grant). To distinguish permissions from other things, the parser requires a prefix of "perm:".
This removes the map of attachments in ArenaImpl and makes the permissions "replacement" happen via the Bukkit API's PermissionAttachmentInfo. Bukkit already keeps track of which attachments we've added to a player, so removing them is just a matter of looping through and finding those. This reduces the coupling between the Arena interface and UpgradeWave (which is the only interface that used the methods removed from the Arena interface).
The goal with these specific metrics is to figure out if some of the arena settings can be removed. If everyone uses the same values for these settings, there is no point in having the added complexity in the code.
Three different types of health bars are implemented behind a basic Strategy Pattern. A new per-arena setting, boss-health-bar, can be used to configure which one of the three types (if any) of health bar should be used for bosses in the given arena:
- `boss-bar` creates a boss bar at the top of the screen as if the players were fighting an ender dragon or a wither.
- `title` uses the Chapters/Titles API in Bukkit to display the health of the boss as a "subtitle" whenever it takes damage.
- `name` sets the entitiy's health along with an optional custom name above the entity's head.
The announcements file loading method is renamed to indicate that it's also meant for re-loading, and the access modifier is changed from private to package-private to allow ArenaMasterImpl to call it.
Closes#462
The existing issue template tries to cover everything, and as a result it is a bit overwhelming. Using multiple issue templates trims the noise when you know what kind of issue you're submitting.
It's just UTF-8, Maven. No need to throw warnings all over the place...
This commit fixes some of the source encoding warnings Maven would print during compilation.
This commit introduces the PotionEffectThing and associated parser. The parser simply delegates to the existing PotionEffectParser utility class the same way the ItemStackThing parser does it. To distinguish potion effects from other things, the parser requires a prefix of "effect:".
As with the initial Thing API commit, this commit also adds an overload to the existing parser class to avoid spamming the console with meaningless warnings.
Boss waves already support potion effects, but with this commit, the potions node moves up as a common node, so all waves that spawn monsters (all but upgrade waves) can now spawn those monsters with a list of potion effects applied to them. It's not possible to give certain potion effects to specific monster types. All monsters get all the effects listed in the node.
Because we aren't actually giving potions but potion effects, the node is renamed from "potions" to "effects". However, to preserve backwards compatibility, both names are supported in this commit.
Closes#453
The ability to execute commands by hitting signs is already implemented by other plugins, but by creating built-in support for such signs, it's possible to leverage information about the plugin and its current state. This implementation allows for displaying live information about player counts, waves, etc. on the signs in addition to tying actions to them.
Customizable templates defined in the new signs.yml config-file can be bound to signs during the in-game sign creation, and users can define state-specific templates that change based on whether an arena is completely idle, has players in the lobby, or is running and in full swing.
Sign data is stored in data/signs.data as a YAML-formatted file that shouldn't be modified directly, effectively separating configuration (templates in signs.yml) and data (coordinates and parameters in signs.data).
Closes#385
This commit makes it possible for mounted players to dismount. Upon dismounting, the horse AI is set to false to prevent it from moving around. Players attempting to mount an available horse will be thrown off unless they actually own the horse. The owners are free to remount when they want.
Metrics will greatly help the development process in terms of finding out which server versions people are running, as well as which features they are using. For now, we check to see how widespread Vault is, and how many arenas and classes people have.
Advanced bar charts are, at the time of this commit, not supported in the bStats dashboard. When they are supported again, we can look into usage statistics for specific settings and features.