Vivecraft_Spigot_Extensions
Vivecraft_Spigot_Extensions copied to clipboard
Replace metadata with API class
Metadata is "a really inefficient global hashmap of uuid to data list". I suggest replacing metadata with an API class to access the values.
Hashmaps are pretty fast, and metadata is far easier to implement without creating a hard dependency.
It should definitely be replaced with API which doesn't require us to use NMS as it does currently.
WeaponMechanics users have experienced some random metadata loss in multiworld servers making the Vivecraft pretty much unusable with weapons
Even having this method return bukkit Vector would be enough to solve our problems:
- https://github.com/jrbudda/Vivecraft_Spigot_Extensions/blob/1.19/src/org/vivecraft/VivePlayer.java#L120
We kinda don't want to make compatibility for 1.12 - 1.19 only to support Vec3 from this plugin
Yeah I'm not sure what multiworld is doing to break the metadata stuff, will have to investigate that later. Can you open a separate issue for that?
Yeah I'm not sure what multiworld is doing to break the metadata stuff, will have to investigate that later. Can you open a separate issue for that?
I just noticed CJ already fixed everything, see #94. It should be merged, far easier for everyone that way! We will tell people to use that fork until it gets merged to this.
I'm not merging that #94 any time soon for various reasons (namely that it's too sudden/drastic of a codebase change for us). If they or someone else wants to pull out just the metadata bugfix, I'll merge that. Otherwise I guess I'll just have to redo the debugging work myself.
I'm not merging that #94 any time soon for various reasons (namely that it's too sudden/drastic of a codebase change for us). If they or someone else wants to pull out just the metadata bugfix, I'll merge that. Otherwise I guess I'll just have to redo the debugging work myself.
You should definitely give it a try. Its easy to use. Even though its drastic change to codebase you wont kinda need to do anything expect merge (+ simply run few tests). There is also step-by-step guide for adding new version support inside same jar.
Similar system for compatibility is used in WeaponMechanics. The current system isn't good for plugin as it can't support multiple versions and for other plugins its harder to support Vivecraft properly.
Searching for the right metadata key requires us to search through every metadata key in the entity... An API is better. #94 fixes it across all minecraft versions, #97 fixes it in the current version.