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

Issue with custom items from itemsadder #3901

Closed
MinecollYT opened this issue Apr 13, 2021 · 12 comments
Closed

Issue with custom items from itemsadder #3901

MinecollYT opened this issue Apr 13, 2021 · 12 comments
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).

Comments

@MinecollYT
Copy link

Description

It seems like Skript changes the lore of an itemsadder item

Steps to Reproduce

|> Install Skript, TuSKe and Itemsadder
|> Create a gui
|> Add a custom item with a lore to that gui
|> Give yourself the itemsadder item that has been used in the GUI

Expected Behavior

Keeping the lore and not changing it

Errors / Screenshots

PluginBugs/Issues-ItemsAdder#821

Server Information

  • Server version/platform: Paper 1.16.5
  • Skript version: 2.5.3

Additional Context

I'm not sure if this belongs into the Skript bug reports or into the TuSKe bug reports - sry If I got it wrong

@TPGamesNL
Copy link
Member

TPGamesNL commented Apr 13, 2021

Show your code and describe exactly what goes wrong

@TPGamesNL TPGamesNL added the waiting for reply The report needs a response from the reporter to determine course of action. label Apr 13, 2021
@MinecollYT
Copy link
Author

MinecollYT commented Apr 13, 2021

Everything should be in the mentioned itemsadder issue, but the important parts of the gui are:

open virtual chest inventory with size 5 named "&4&lW&caffen&4&ls&cchmied" to player
format gui slot (integers from 10 to 16) of player with barrier named "&c&lLEER"
format gui slot (integers from 19 to 25) of player with barrier named "&c&lLEER"
format gui slot (integers from 28 to 34) of player with barrier named "&c&lLEER"
format gui slot 10 of player with customitem "emerald_sword_1" with lore " &8● &7Kosten&8: &e%format(2800)% Coins" and "" and "&a&l[!] &fKlicke um das Item zu kaufen&8." and "&c&l[!] &7&nKeine Rückerstattung&r &7möglich&8!" to close then run function buyCI(player, 2800, "emerald_sword_1")

@TPGamesNL
Copy link
Member

It seems that ItemType isn't immutable, for example:

on death:
	set {_x} to (first element of drops) with lore "abc"

will change the lore of the drops. Related: #3779

@TPGamesNL TPGamesNL added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation). and removed waiting for reply The report needs a response from the reporter to determine course of action. labels Apr 13, 2021
@FranKusmiruk
Copy link
Member

This is actually inteded behaviour, the with lore expression specifically implies it's going to change the given item's lore within its pattern after all. If anything a notice should be added to the documentation.

@FranKusmiruk FranKusmiruk added enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: low Issues that are not harmful to the experience but are related to useful changes or additions. and removed bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation). labels Apr 13, 2021
@MinecollYT
Copy link
Author

This is actually inteded behaviour, the with lore expression specifically implies it's going to change the given item's lore within its pattern after all. If anything a notice should be added to the documentation.

But shouldn't it only change the lore of the item in the current gui?

@AyhamAl-Ali
Copy link
Member

But shouldn't it only change the lore of the item in the current gui?

Back in the days when with lore expression from SkQuery was the only expression available it used to clone the item and apply the new lore on it and return the cloned item instead of changing the original item.

Sometime ago when I updated to 2.3 probably I don't remember exactly (and with lore is now a Skript expression), my script broke because my GUI had a lot of with lore and it kept duplicating lores, I have no idea why Skript wouldn't clone the item and return the cloned one instead of changing the original one.

After long time I thought this is fixed but it seems not, with Skript 2.5.3 I have tested a code and my GUI items keep changing when any player open the GUI and the lore applies on the original item.

This is actually inteded behaviour, the with lore expression specifically implies it's going to change the given item's lore within its pattern after all. If anything a notice should be added to the documentation.

Why is it intended? there must be a reason ofc

@AyhamAl-Ali
Copy link
Member

AyhamAl-Ali commented Apr 13, 2021

Also, before I forget, if this is intended and won't be changed would you add a new expression that allows cloning the item instead of editing the original one? like clone item with lore %string%

@FranKusmiruk
Copy link
Member

Also, before I forget, if this is intended and won't be changed would you add a new expression that allows cloning the item instead of editing the original one? like clone item with lore %string%

We have discussed about it and decided to change the behaviour of the ExprWithLore, so this should be fixed whenever a new release comes out.

@TPGamesNL TPGamesNL added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation). and removed enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: low Issues that are not harmful to the experience but are related to useful changes or additions. labels Apr 15, 2021
@TPGamesNL TPGamesNL added PR available Issues which have a yet-to-be merged PR resolving it completed The issue has been fully resolved and the change will be in the next Skript update. and removed PR available Issues which have a yet-to-be merged PR resolving it labels Apr 27, 2021
@ghost
Copy link

ghost commented May 22, 2021

i recommend use SkQuery's GUI

needs Skript-mirror or Skript-reflect:
`
import:
dev.lone.itemsadder.api.ItemsAdder

open chest with 3 rows named "GUI" to player
wait 1 tick
if name of player's current inventory is "GUI":
set slot 0 of player's current inventory to ItemsAdder.getCustomItem("itemsadder:item") named "Test"

on inventory click:
if name of player's current inventory is "GUI":
cancel event
`

@MinecollYT
Copy link
Author

NONONONO!!!!
DON'T USE SKQUERY FOR A GUI!!!!!!

And it seems like this issue has been fixed
//closed

@TPGamesNL
Copy link
Member

We don't close issues until they are fixed in a public release

@TPGamesNL TPGamesNL reopened this May 22, 2021
@MinecollYT
Copy link
Author

We don't close issues until they are fixed in a public release

oh sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).
Projects
None yet
Development

No branches or pull requests

5 participants