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

Keep items updated with configurations #2247

Open
LoneDev6 opened this issue Jan 7, 2023 · 2 comments
Open

Keep items updated with configurations #2247

LoneDev6 opened this issue Jan 7, 2023 · 2 comments
Labels
type: feature request Feature request.
Milestone

Comments

@LoneDev6
Copy link
Collaborator

LoneDev6 commented Jan 7, 2023

Continuation of #2166 to remove old comments and repeated information.

Note: This task is very complex to achieve and can lead to an extreme amount of incompatibilities.
This feature can be enabled in the config.yml of ItemsAdder since not everyone will want it for the risk of introducing incompatibilities.

Item updating logic

  • add enchants which are in the yml file and not in the world item but keep enchants that are not in the yml (because users might have enchanted the item)
  • update the name and lore (even if this might cause some information to be lost because the lore might have been edited by another plugin)
  • I won't update the custommodeldata since ItemsAdder already ensures that this value is not changed in any way as it has a cache system for this particular reason. Also updating the custommodeldata will break the replace_properties feature, for example for the lightsaber of the default pack.
  • I will automatically update the custom (leather) armors color code in case it changed in the yml file to make sure the armors don't have the wrong "worn" texture
  • ??? Do you have any other thing in mind?

Ability to decide when to trigger the item updater

Some of them may impact the performance but would be convenient

  1. Picking up an item
  2. Joining server (update all items in the inventory)
  3. Changing world (same as above)
  4. Placing an item in the craft table
  5. Moving & dragging an item

Ability to disable the updater per-itemstack

Would be nice to have a command /iaitem <disable-auto-update> to disable auto update for the current hold itemstack.
This is useful if you want to have an instance of the item that can't change during updates.
It will save a custom NBT attribute into the itemstack which will be checked later on during update and will make the itemstack skipped.

There would also be needed a way to disable auto-updating for certain items completely, in their configuration file, because for example you might want to change the attack damage of a sword to a higher value and also their recipe or drop rate, but you don't want already crafted swords to have the new attack damage because they would be too op, because people might have crafted a lot of them. So the already crafted swords will still keep the old attack damage.

This needs some thinking to come up with the best updating method.
Maybe I could add some "javascript" processing to allow admins to code conditional updating logic for items to apply some properties or not.

Refer to: #3622

@PSYCHEER
Copy link

  1. Placing an item in the craft table
    Is not needed at all as and maybe 5. as you can do it on inventory click on item onInventoryClickItem

Will remove not needed updates as drag, move etc, just as far as item will be clicked, will be updated

@nhanledev
Copy link

I think each item should include a configuration setting to specify whether it needs to be updated to stay in sync with the server configuration. That behavior can be seen in other plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request Feature request.
Projects
Status: No status
Development

No branches or pull requests

3 participants