Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace metadata with API class #79

Open
Mwthorn opened this issue Jan 17, 2021 · 7 comments
Open

Replace metadata with API class #79

Mwthorn opened this issue Jan 17, 2021 · 7 comments

Comments

@Mwthorn
Copy link

Mwthorn commented Jan 17, 2021

Metadata is "a really inefficient global hashmap of uuid to data list".
I suggest replacing metadata with an API class to access the values.

@Techjar
Copy link
Collaborator

Techjar commented Jan 17, 2021

Hashmaps are pretty fast, and metadata is far easier to implement without creating a hard dependency.

@DeeCaaD
Copy link

DeeCaaD commented Feb 14, 2023

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:

We kinda don't want to make compatibility for 1.12 - 1.19 only to support Vec3 from this plugin

@Techjar
Copy link
Collaborator

Techjar commented Feb 14, 2023

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?

@DeeCaaD
Copy link

DeeCaaD commented Feb 15, 2023

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.

@Techjar
Copy link
Collaborator

Techjar commented Feb 15, 2023

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.

@DeeCaaD
Copy link

DeeCaaD commented Feb 15, 2023

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.

@CJCrafter
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants