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

Make library compatible across versions #5

Closed JohnnyJayJay closed 4 years ago

JohnnyJayJay commented 4 years ago

This PR changes the approach of implementing MapView for RenderedMap. The class no longer delegates to its internal MapView and instead provides a regular accessor. The consequence of this is that the code does not break anymore when the MapView interface changes, which was the main reason for the previous version policy.

Additionally, this should finally fix #3 . Instead of manually creating the MapMeta in the affected code, this is now left to the getItemMeta() method of ItemStack. This should work on all versions.

Also, the RenderedMap#give method has been removed, since it does not serve any real purpose and really is just there to show in examples. It adds nothing to the class and only pollutes the API.

The gradle build file has been cleaned up. The shadow plugin is no longer there, and java-library is now used instead of java. As this PR introduces many breaking changes, the version has been bumped to 2.0. A github release will be created for this once it's ready.

Changes that still need to be made:

JohnnyJayJay commented 4 years ago

I decided to add the shadow plugin back in to make builds for people who don't use Maven or Gradle

JohnnyJayJay commented 4 years ago

Tests succeeded for newer versions, please report if it doesn't work with legacy.