SkriptLang / Skript

Skript is a Spigot plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.
https://docs.skriptlang.org
GNU General Public License v3.0
1.08k stars 373 forks source link

Powered and Unpowered Lever Bug #6998

Open aaaeeeMC opened 3 months ago

aaaeeeMC commented 3 months ago

Skript/Server Version

[Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[Skript] Server Version: 1.21-109-5a5035b (MC: 1.21)
[Skript] Skript Version: 2.9.1 (skriptlang-github)
[Skript] Installed Skript Addons:
[Skript] - SkBee v3.5.8 (https://github.com/ShaneBeee/SkBee)
[Skript] Installed dependencies: None

Bug Description

Skript won't make a difference between a powered and unpowered redstone lever. Currently both powered and unpowered levers are considered powered levers, as seen in the screenshot given in Errors or Screenshots.

Expected Behavior

Skript was supposed to return false to the whether target block is a powered lever check when the lever was deactivated.

Steps to Reproduce

  1. Place a Lever
  2. Look towards the lever
  3. Execute the effect command "send whether target block is a powered lever"
  4. It returns true instead of false
  5. Activate the lever
  6. Execute the effect command "send whether target block is a powered lever" again
  7. It returns true
  8. You now know it returns true to both, when it should return false when it isn't powered

Errors or Screenshots

image

Other

No response

Agreement

TenFont commented 3 months ago

This doesn't seem to be an issue with the lever alias specifically but rather with all aliases that have blockdata, e.g. repeaters, comparators, redstone dust, etc. Even a condition like target block is waterlogged oak stairs passes regardless of whether or not the oak stairs are waterlogged. To be more specific, this is an issue with the comparison. I'm not familiar with the way skript handles comparisons, however I have observed that this issue is most likely due to the fact that skript is trying to be lenient with its comparisons. Like how trying to compare an enchanted item to its regular form, returns true.

Interestingly enough, flipping the expressions around, send whether powered lever is target block works properly; sending true when it's a powered lever and false when it is not. I assume this is because it's now a strict comparison. Like how you can try send whether diamond sword is tool while holding an enchanted diamond sword and it'll send false.

Fusezion commented 3 months ago

issue seems to be similar to https://github.com/SkriptLang/Skript/issues/4582 not super important now with aliases being deprecated so their comparator is pretty useless but that's left to the team to decide as block data is encouraged more

but I guess if we're planning to retain the system for aliases to be created/added by players then this should probably still be fixed