Z0rdak / Yet-Another-World-Protector

Yet Another World Protector is a server-side protection mod which allows you to protect your creations against various different events/actions of players, mobs and the environment. It was inspired by the forge mod WorldProtector and the WorldGuard plugin.
https://www.curseforge.com/minecraft/mc-mods/yawp
GNU Affero General Public License v3.0
19 stars 8 forks source link

[Description WIP] Implement an API for other mods to manage regions #13

Open Z0rdak opened 1 year ago

Z0rdak commented 1 year ago

Description

To ease integration and interoperability with other mods, an API to manage the regions of YAWP would be of great value. Among other things, this would help make mod packs easier.

In the first iteration, this API should provide a programmatic abstraction for the functions already be covered by the commands.

To know whether an action was successful, it is important to return an appropriate value for feedback. Most of the time a boolean is just fine, but throwing an exception would also be fine. In this case, a custom Exception implementation would be great.

With this API in place, most of the logic in the command utilities could also be replaced with the corresponding API calls.

Note: These todos serve only as a rough guideline. There will certainly be cases in which it may make sense to deviate from the exemplary method signature.

Important: Implementation target for this feature should be any fabric or forge port above 1.19.2. The backports are done after that by myself.

Todos

Z0rdak commented 1 year ago

Consider an "Endpoint" for providing region area information to display them on mini-map mods.

Z0rdak commented 5 months ago

Events when adding and removing Flags for Regions. This could be usefull for internal thing but as well as for some custom logic for modpack making.

Example: Useful for spawning flags to clear all mobs in a region when a spawning flag is added. Currently this is hard-coded. A event could be used to decouple this logic

Z0rdak commented 1 month ago

Note: FlagBuilder to easily create Flag instances