Skript icon indicating copy to clipboard operation
Skript copied to clipboard

Seems like #4681 has been reintroducted.

Open friyes opened this issue 1 year ago • 6 comments

Skript/Server Version

[20:50:36 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[20:50:36 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[20:50:36 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[20:50:36 INFO]: [Skript] Server Version: 1.20.6-137-bd5867a (MC: 1.20.6)
[20:50:36 INFO]: [Skript] Skript Version: 2.8.7 (skriptlang-github)
[20:50:36 INFO]: [Skript] Installed Skript Addons:
[20:50:36 INFO]: [Skript]  - skript-placeholders v1.6.0 (https://github.com/APickledWalrus/skript-placeholders)
[20:50:36 INFO]: [Skript]  - skNoise v1.0
[20:50:36 INFO]: [Skript]  - skript-particle v1.3.1 (https://github.com/sovdeeth/skript-particle)
[20:50:36 INFO]: [Skript]  - DiSky v4.17.2
[20:50:36 INFO]: [Skript]  - skript-reflect v2.4 (https://github.com/SkriptLang/skript-reflect)
[20:50:36 INFO]: [Skript]  - SkBee v3.5.5 (https://github.com/ShaneBeee/SkBee)
[20:50:36 INFO]: [Skript]  - SkJson v3.0.91
[20:50:36 INFO]: [Skript] Installed dependencies:
[20:50:36 INFO]: [Skript]  - Vault v1.7.3-b131
[20:50:36 INFO]: [Skript]  - WorldGuard v7.0.10+d9424b1

Bug Description

Like #4681 says, Doing this,

on inventory open:
    broadcast event-inventory's holder's location

Will broadcast nothing when opening a double chest.

Expected Behavior

I expected to get the location like for single chests.

Steps to Reproduce

Upload and reload the example script. Place a single chest and a double chest. Right click both. Observe that only the single chest returns its location.

Errors or Screenshots

No response

Other

No response

Agreement

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

friyes avatar Jun 23 '24 18:06 friyes

You're sure it's double chests and not #6424 ?

sovdeeth avatar Jun 23 '24 19:06 sovdeeth

You're sure it's double chests and not #6424 ?

This might be true, broadcast event-inventory's holder returns, 'chest' at -66.5, 70.5, 133.5 in world 'world' for double chests and BlockState{type=CHEST,location=Location{world=CraftWorld{name=world},x=-67.0,y=70.0,z=135.0,pitch=0.0,yaw=0.0}} for single chests...

friyes avatar Jun 23 '24 19:06 friyes

can confirm this After talking to friyes on discord, I tried: broadcast "Loc: %location of holder of event-inventory%" for a single chest it sends the location for a double chest it sends none

ShaneBeee avatar Jun 23 '24 19:06 ShaneBeee

Misclick whoops!

I meant to say that yeah, looks like double chests are silly and need their own check

sovdeeth avatar Jun 23 '24 19:06 sovdeeth

A holder instanceof DoubleChest check needs added to this converter: https://github.com/SkriptLang/Skript/blob/e2928ceae90c94beabe51240358d401b22524fba/src/main/java/ch/njol/skript/classes/data/DefaultConverters.java#L172-L180

It can prefer to return the location of the left-side of the chest. Should be rather simple.

APickledWalrus avatar Jun 23 '24 19:06 APickledWalrus

regression test too, please!

Pikachu920 avatar Jun 24 '24 16:06 Pikachu920