-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
More Item Comparison Improvements #4162
More Item Comparison Improvements #4162
Conversation
- Fixes Slot-ItemType comparison issues with AIR - Fixes comparison issues where the arguments would be reversed (does not work for items, so it was an issue)
EDIT: Nevermind - that was a total disaster and I will focus on such changes for another PR lol - going to focus on fixing #4163 |
Well done 🚀 |
Yes - I have amended the description to clarify so 😁 |
I'm using skript nightly version with this improvement but there's problem My players just found error to duplicate money cuz comparison was blind to name and lore of item I was using a checks system like that
and in skript 2.5 everything was working smoothly, on 2.6 even with these improvements it counts unnamed paper to number o checks! so, welp, the problem is that it counts unnamed paper as player's tool, but when I'm using "remove all player's tool from player's inventory" it's not removing all paper |
Yep - I was just made aware of this issue the other day :) I will have an update coming later today to this PR. EDIT: Okay, I have pushed some new commits. Please try them out and let me know how it's working. |
Yeah, it solved that problem. |
I'm not sure if it's this feature issue, but my skript
It got bugged and it's not deleting when {pt} is 0 at every 1 seconds (when I changed it to "if {pt} is greater than 1:" it's working) ====== okay that nightly build is broken XD "else ifs" doesn't work too ===== |
using the latest nightly build of this PR I don't seem to have that issue. the following counts down and eventually prints out before terminating: every 1 seconds:
if {pt} is set:
broadcast "BEFORE: %{pt}%"
if {pt} is greater than 0:
set {pt} to {pt}-1
else:
delete {pt}
broadcast "AFTER: %{pt}%"
on script load:
set {pt} to 10 EDIT: I have updated the PR to the latest commit as there were actually issues with conditions and such on the Skript build this PR was based on. Please download the latest nightly build from that commit. |
Oh, yes counting it's okay, but it seems not to delete the variable. I asked my friend to test it with https://github.com/SkriptLang/Skript/actions/runs/1052985157 and this code:
Output on skript 2.5.3 on 1.16.5 looks like that: Output on this version on 1.17.1 looks like that: So - on 1.17.1 I'm not getting "The End" message even on empty server where I have only skript |
So it's not working, even with the latest commit to bring this PR up to date with the master branch? |
yes, I compared results with https://github.com/SkriptLang/Skript/actions/runs/1049093891 (which is latest nightly master) and the problem exists here too so it's not this commit issue. I see master have problems with executing "else" (I don't know where to report it since it's nightly). There are a lot of different skripts where else aren't working (but in some cases else is working properly)
When you reload skript and type /settest 1 and then /whatstest - its working. Now without reloading skript type /settest 2 and /whatstest - and it will not work (sends nothing). But when you reload skript - /whatstest command will work again as intended. I'm not sure if my English is good enough so I prepared a video with example https://www.youtube.com/watch?v=k6XhLVKmUU8 |
This is fallout from #4175, and unrelated to this PR.
You can report issues with nightly builds the same as you would report normal issues, they're just as valid, if not more. We appreciate people testing nightly builds, since it allows us to fix bugs before releasing a new version. You can open an issue for this, but I'll probably make a PR fixing this soon |
I just merged it with "Fix combined conditional running on non-first runs" in master 2 days ago. I'm using it on my server for 2 days and I don't see any issues. Works cool! <3 Good job APickledWalrus :) |
I got one I created a written book and named it to "&b&lPrace"
|
Great improvements so far, well done. Btw, is this related? #999 |
Sorry for the lack of a response - I have been away recently. I'll take a look into the mentioned issues and update here :) |
@iOshawott I think I got this working as intended now. See results: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving, because the only comment is formatting
The latest commit makes some changes to how comparisons work for blocks. As of now, it is using the new comparison method. I have also reworked that method to make it clearer on what MatchQuality is required. I have also added a new check for blocks/itemtypes that sets the minimum required quality to SAME_MATERIAL. This quality will apply if the "first" itemtype is not a block but the "second" itemtype is. EDIT: has issues as expected, will try to patch asap EDIT 2: Issue should be fixed. To those testing this PR, I would appreciate it if you could test out whether there are any new issues with block comparisons. |
Description
Welcome to the third or fourth iteration of item comparison improvement PRs
This PR aims to fix a small issue @TheBentoBox reported to me with air comparisons. The
slot
ItemStack would have an amount of 0, when we should just handle it as 1 in this case. Essentially, Skript was comparing:0 air is 1 air
It also fixes an issue with item comparisons where Skript would invert the arguments to try and find a comparator. While this is okay in most cases, it is not okay for item comparisons. EXAMPLE:
This is valid because the player's tool has all of the qualities of that second item. It is also allowed to have more. The condition correctly passes.
In this case, the condition also passes. This is invalid and incorrect as the first item (
a diamond sword of sharpness 3
) does not have all of the qualitiesplayer's tool
has. It is passing because Skript inverts the arguments.To solve this, I have registered additional converters with opposite types (e.g.
Slot - ItemType
ANDItemType - Slot
exist now). I also had to make some minor changes to the way Skript searches for comparators, but the behavior should remain the same.Target Minecraft Versions: Any
Requirements: None
Related Issues: