MobArena plugin for Minecraft
Go to file
Andreas Troelsen 0527f116e2 Refactor Vault economy integration.
This commit reworks how MobArena interfaces with Vault economy provider
instances. Instead of affixing an Economy _instance_ to the main plugin
at "setup time", we create an instance of the new _Finance_ abstraction
at "(re)load time", and then use this new abstraction at every call site
(really just the MoneyThing) instead of Economy. This accomplishes two
important things:

1. Due to how the Bukkit load order works and how Vault providers are
registered with the plugin, the Finance abstraction gives us a means of
deferring the retrieval of the Economy provider needed to integrate with
the underlying economy plugin (or script). MobArena still uses Finance
as if it was a "complete" object and is completely unaware of what goes
on under the hodd. This is a much more elegant solution compared to the
terrible past proposals of fragmenting MobArena's bootstrapping phase,
especially considering the past proposals were server tick-centric...

2. It creates a simple and maintainable interface between MobArena and
Vault, effectively giving control back to MobArena as to how everything
should mesh together.

The biggest downside to this solution is that we no longer know if an
economy provider is available for when we need it at a convenient time
in the startup process. Instead, we need to react accordingly when an
economy operation is invoked. The implementation takes a somewhat mild
approach by simply _logging_ any issues encountered and defaulting to
"best effort" operations when an economy provider is not available. At
worst, this is a bunch of log spam and potentially a lot of work for
server owners to clean up after (compensating players for rewards and
stuff like that), but MobArena doesn't handle arbitrary exceptions in
its join/leave and start/end procedures very well, so it's probably a
better way to go about it than throwing exceptions.

If the server does not have Vault installed, an UnsupportedFinance is
created. This implementation just logs errors and "fails to work" on
every operation. If Vault is installed, a VaultFinance is created, and
this implementation should only log errors if a Vault economy provider
couldn't be found. We could have opted for a single implementation, but
this approach allows us to potentially support other economy registrars
in the future, so we (probably) won't have to make sweeping changes in
order to swap to something else.

Closes #797
2024-09-15 20:28:10 +02:00
.github Add 1.21 to supported game versions. 2024-07-23 02:22:48 +02:00
gradle/wrapper Convert to Gradle. 2023-12-09 21:08:09 +01:00
scripts Add hangar format to release note script. 2023-12-31 15:14:25 +01:00
src Refactor Vault economy integration. 2024-09-15 20:28:10 +02:00
.gitignore Convert to Gradle. 2023-12-09 21:08:09 +01:00
build.gradle.kts Bump version to 0.108.1. 2024-06-24 23:30:08 +02:00
changelog.md Refactor Vault economy integration. 2024-09-15 20:28:10 +02:00
gradlew Convert to Gradle. 2023-12-09 21:08:09 +01:00
gradlew.bat Convert to Gradle. 2023-12-09 21:08:09 +01:00
LICENSE Add LICENSE 2018-04-27 16:32:02 +02:00
README.md Add Hangar link to README. 2023-11-13 12:21:40 +01:00
settings.gradle.kts Convert to Gradle. 2023-12-09 21:08:09 +01:00

MobArena Build Status

MobArena is an arena-style minigame for Spigot-based Minecraft servers

Getting Started

If you don't want to compile the plugin yourself, grab a release artifact from one of these two sites:

The wiki here on Github should have all the information you need to get started using the plugin.

Getting Help

If you run into problems or need help with something, feel free to hop on the MobArena Discord server to have a chat: Instant Invite

Remember, though, that this communication channel is idle chat, which means you likely won't get a response immediately. It could take anything from a couple of seconds to a day, but your message will be seen.

Contributing

Found a bug, got a suggestion, or want to dig into the code base? There are many ways to contribute to the project!

Get started here: Contributing