Essentials/providers/BaseProviders/src/main/java/net/ess3/provider/PersistentDataProvider.java
Josh Roy ec50b28f4b
Add ItemStack 1.8.8+ cross-version PersistentDataContainer (#4143)
This PR itself does nothing on its own but creates the underlying backbone I need to make a less hacky solution in #3963 lmfao.

This PR creates a provider which uses NBT on 1.8.8-1.13 to mimic the exact structure of a PersistentDataContainer on 1.14+ which will allow us make any possible upgrades (which don't die from the lack of DFU on >1.13) work as expected. Additionally, this does not use reflection on modern Minecraft versions and thus will not need to be maintained/updated on MC version updates.

In the future, we will need to find a way to store data on tile entities (signs namely) so that we are able to store UUIDs on signs for future plans, but for now ItemStacks work to fix our spawner issues.
2021-05-28 11:23:44 +00:00

12 lines
297 B
Java

package net.ess3.provider;
import org.bukkit.inventory.ItemStack;
public interface PersistentDataProvider extends Provider {
void set(ItemStack itemStack, String key, String value);
String getString(ItemStack itemStack, String key);
void remove(ItemStack itemStack, String key);
}