Skript

Skript

743k Downloads

Comparators being forced when not needed to

ShaneBeee opened this issue ยท 0 comments

commented

Skript/Server Version

[11:05:01 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[11:05:01 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[11:05:01 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[11:05:01 INFO]: [Skript] Server Version: git-Paper-393 (MC: 1.20.4)
[11:05:01 INFO]: [Skript] Skript Version: 2.8.0 (selfbuilt-unknown)
[11:05:01 INFO]: [Skript] Installed Skript Addons: 
[11:05:01 INFO]: [Skript]  - skript-reflect v2.4 (https://github.com/SkriptLang/skript-reflect)
[11:05:01 INFO]: [Skript]  - SkBee v3.2.0 (https://github.com/ShaneBeee/SkBee)
[11:05:01 INFO]: [Skript] Installed dependencies: 
[11:05:01 INFO]: [Skript]  - Vault v1.7.3-b131

Bug Description

Since SkBee came out, I noticed a bug which item comparison weren't working. #6366
After some digging, turned out it was a comparator in SkBee causing issue.
After further digging, turns out Skript is forcing a comparator when it shouldn't.

In this case, SkBee has a comparator ItemStack -> RecipeChoice which should only be called upon when in SkBee's recipe code.
When doing a simple test code:

on load:
	if birch planks is any plank:
		send "&aYAY"
	else:
		send "&cBOO"

This was failing, sending "BOO"

Here is the the debug:

[11:12:25 INFO]: load (script load):
[11:12:25 INFO]:         send "&aYAY" to event-player/console
[11:12:25 INFO]:     if [[itemtype:birch wood wooden planks]] is equal to [[itemtype:oak wood wooden planks, spruce wood wooden planks, birch wood wooden planks, jungle wood wooden planks, acacia wood wooden planks, dark oak wood wooden planks, crimson wooden planks, warped wooden planks, mangrove wood wooden planks, cherry wood wooden planks or bamboo wood wooden planks]] (comparator: ch.njol.skript.classes.data.DefaultComparators$11@12c3cbcd)
[11:12:25 INFO]:         send "&cBOO" to event-player/console
[11:12:25 INFO]:     else
[11:12:25 INFO]: load (script load)
[11:12:25 INFO]: YAY
[11:12:25 INFO]:     send "&aYAY" to [commandsender:CONSOLE]

As we can see here, Skript is forcing SkBee's RecipeChoice comparator when it has no reason to be doing just that.

Expected Behavior

Skript shouldn't be using comparators when they're not needed in the instance.

Steps to Reproduce

(see description)

Errors or Screenshots

No response

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this report.