Skript

Skript

743k Downloads

Seems like #4681 has been reintroducted.

friyes opened this issue ยท 6 comments

commented

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

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

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

commented

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...

commented

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

commented

Misclick whoops!

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

commented

A holder instanceof DoubleChest check needs added to this converter:

Converters.registerConverter(InventoryHolder.class, Location.class, holder -> {
if (holder instanceof Entity)
return ((Entity) holder).getLocation();
if (holder instanceof Block)
return ((Block) holder).getLocation();
if (holder instanceof BlockState)
return BlockUtils.getLocation(((BlockState) holder).getBlock());
return null;
});

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

commented

regression test too, please!