Skip to content

Implemented Folia-safe sign check for teleportation in front instead on top#2342

Open
nezbite wants to merge 1 commit into
QuickShop-Community:hikarifrom
nezbite:feature/teleport-in-front-of-shop-browse
Open

Implemented Folia-safe sign check for teleportation in front instead on top#2342
nezbite wants to merge 1 commit into
QuickShop-Community:hikarifrom
nezbite:feature/teleport-in-front-of-shop-browse

Conversation

@nezbite
Copy link
Copy Markdown

@nezbite nezbite commented May 10, 2026

Summary

What does this PR do?

Teleportation checks sign location of shop and teleports the player there when using /qs browse


Type of Change

  • Feature
  • Bug fix
  • Refactor / Cleanup
  • Documentation
  • Breaking change

Basic Checks

  • I have tested these changes locally
  • I confirm no undocumented AI-generated code was used in this submission

Notes (optional)

Add anything important for reviewers:

  • Teleportation on top does not check for safety, neither does this one, but the chance of it being safe will be greater because of how shops are created with this plugin in general.
  • Double-chest shops need testing

Breaking Changes (if applicable)

  • What changed: Teleport location changed. Could influence users of shops that only know this behaviour.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 10, 2026

CLA assistant check
All committers have signed the CLA.

@nezbite
Copy link
Copy Markdown
Author

nezbite commented May 10, 2026

Double-chest shops have been tested and work as intended.

@Warriorrrr
Copy link
Copy Markdown
Contributor

This doesn't seem thread safe to me, accessing the world state (either directly via Block#getState or via the getSigns method) is explicitly what that note is warning you about, there's no guarantee you're currently on the right region thread for the shop.

A better way to do this would be to only start looking for the teleport location once the teleport action is used and after the inventory is closed, schedule a task on the region thread for the shop that then schedules an async chunk load. Only then can you safely call Shop#getSigns to try and find a valid teleport location.

@creatorfromhell
Copy link
Copy Markdown
Contributor

I'm going to withhold this until the API expansion PR, but as stated above, it mixes world interaction where it shouldn't

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants