JohnnyJayJay / spigot-maps

A library to simplify the use of customised maps in Spigot.
GNU Lesser General Public License v3.0
48 stars 4 forks source link

Add facilities and defaults for MapStorage #7

Open JohnnyJayJay opened 4 years ago

JohnnyJayJay commented 4 years ago

Is your feature request related to a problem? Please describe. Currently, if you want to store map renderers, you have to implement the logic for this from scratch, essentially. There are little to no facilities for this and no proper guidance in terms of best practice.

Describe the solution you'd like There should be more obvious and simple ways to implement MapStorage. There should also be standard implementations for common uses for spigot such as storing maps in a yaml config.

Describe alternatives you've considered /

Additional context This does not mean that the raw, low level MapStorage interface should be changed or even replaced. It should still be possible to tailor storage exactly to your needs.

JohnnyJayJay commented 4 years ago

The default storage could be done via a json/yaml file that stores id -> list of renderers. The renderers could implement ConfigurationSerializable and perhaps even Serializable to facilitate this process. Images could either be encoded as base64 or stored in a sub directory as files.