Remove unique ids from wands
NathanWolf opened this issue ยท 11 comments
I'd like to get rid of the UUID stored in wand data if I can.
Putting this here in case this would affect anyone watching the repo.
This would mean Wand.getId no longer works, and I'm not sure yet if we would have to get rid of lost wand tracking.
Any particular reason why? (Duplication?)
I am not using this API, but the (replaced) custom properties API to do something similar.
Perhaps other users could use that for their purposes too?
A few reasons:
-
I've been thinking of getting rid of the lost wand system, for which the ids were originally created. Hoping I can keep it in part at least.
-
It interferes with shop plugins that use in-game items since the item in the shop ends up with an id on it and they're no longer unique
-
I'm trying to get rid of all the wand data I can right now
-
It feels like a hack so I can identify identical wands, now that spigot's item meta is actually comparable with custom data it seems like it shouldn't be necessary though.
Let me know if you can think of any reason to keep them! I could also maybe make it optional, though I'd rather not.
Sounds completely reasonable to remove them then.
If we can expose a custom property API, plugins could create their own wand IDs if they really need them. (I am already effectively doing this in production with the former custom properties and have not any issues with it.)
Agreed!
How were you retrieving your custom properties btw? I didn't see an API add for that, I may have missed it.
implWand.getCustomProperty(String)
(
Ah cool - so if we end up with a getProperty on the Wand API that'll be an easy transition for you?
After thinking about this some more, my current plan is to revert the wand id functionality back to when it was only used for "lost" wands, wands that have been dropped.
As part of phase 2 I'm going to make this an optional off-by-default feature, as well as separately make wands not despawning an off-by-default feature (instead of having it based on the indestructible flag like it is now).
Done in latest dev build, will be in 6.6.
You can now control whether or not wands have ids with a "unique" parameter. It is off by default.
Wands can have a "track" parameter which will give them a unique id when dropped and track them in the lost wand DB.
I also separated out some functionality that was tied to the "invulnerable" property but shouldn't have been:
"immortal": Dropped wands will never despawn
"invulnerable": Dropped wands can't be destroyed by damage
These are currently on by default, but only via configs- if you want this behavior you'll need to add the properties to your wands. These will probably be off by default in 7.0, where I plan on making wands more like normal items again.