You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When exiting a GUI using a button with ajjgui.exit set to 1b, the block above the container is set to air, regardless of what block was there previously.
Looking at ajjgui/function/utils/exit_gui, the following is run at the active GUI marker when the exit button is clicked:
clone ~ ~ ~ ~ ~ ~ ~ ~1 ~
setblock ~ ~ ~ minecraft:air
clone ~ ~1 ~ ~ ~1 ~ ~ ~ ~
setblock ~ ~1 ~ minecraft:air
execute on vehicle if entity @s[type=minecraft:chest_boat,tag=ajjgui.gui_ported] run function ajjgui:control/close_gui_ported
One potential solution would be to store the block at some arbitrary location (X, Y, Z) via clone, then cloning it back once the GUI has been closed, as follows:
clone ~ ~1 ~ ~ ~1 ~ X Y Z
clone ~ ~ ~ ~ ~ ~ ~ ~1 ~
setblock ~ ~ ~ minecraft:air
clone ~ ~1 ~ ~ ~1 ~ ~ ~ ~
clone X Y Z X Y Z ~ ~1 ~
execute on vehicle if entity @s[type=minecraft:chest_boat,tag=ajjgui.gui_ported] run function ajjgui:control/close_gui_ported
However, this has the obvious disadvantage of requiring an absolute location which is always loaded in order to function. While this condition could be met via the shulker box generated by the install function, if two GUIs were closed during the same tick, a race condition would likely occur. Alternatively, the id and NBT of the block could be copied to a temporary storage and then restored after ajjgui/function/utils/exit_gui runs. Unfortunately, this solution would not work for non-block entities, as their id is not accesible via NBT.
The text was updated successfully, but these errors were encountered:
When exiting a GUI using a button with
ajjgui.exit
set to 1b, the block above the container is set to air, regardless of what block was there previously.Looking at
ajjgui/function/utils/exit_gui
, the following is run at the active GUI marker when the exit button is clicked:One potential solution would be to store the block at some arbitrary location (X, Y, Z) via
clone
, then cloning it back once the GUI has been closed, as follows:However, this has the obvious disadvantage of requiring an absolute location which is always loaded in order to function. While this condition could be met via the shulker box generated by the install function, if two GUIs were closed during the same tick, a race condition would likely occur. Alternatively, the id and NBT of the block could be copied to a temporary storage and then restored after
ajjgui/function/utils/exit_gui
runs. Unfortunately, this solution would not work for non-block entities, as their id is not accesible via NBT.The text was updated successfully, but these errors were encountered: