Skip to content

Restore safe End portal falling-block duplication - #307

Merged
R00tB33rMan merged 12 commits into
CraftCanvasMC:mainfrom
BaconCat1:fix/sand-duplication
Aug 12, 2026
Merged

Restore safe End portal falling-block duplication#307
R00tB33rMan merged 12 commits into
CraftCanvasMC:mainfrom
BaconCat1:fix/sand-duplication

Conversation

@BaconCat1

@BaconCat1 BaconCat1 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Fixes #271

This restores normal End portal gravity-block duping when Paper's existing allow-unsafe-end-portal-teleportation setting is enabled. When it is disabled, nothing changes and Canvas keeps the current behavior.

The main problem with the other suggested implementations is that they keep ticking the original falling block after the portal transfer has already removed or invalidated it. That violates Folia's region ownership invariant. This instead prepares a separate source-side continuation before the transfer finishes. It gets a fresh UUID, copies the falling block's state without yoinking its Bukkit wrapper, clears its portal state, and is properly registered in the source world before any tick logic runs.

The continuation skips the part of the tick that already happened, like gravity, movement, and portal handling, then runs the unchanged landing and placement logic that traditional sand dupers need. It is discarded immediately afterward so it cannot tick again or go through the portal twice.

Testing

I rebuilt and applied the full patch stack, compiled canvas-server, tested multiple End portal duping machines from YouTube on a local server, and also verified it with a local regression test.

@BaconCat1
BaconCat1 marked this pull request as draft July 30, 2026 01:03
@BaconCat1
BaconCat1 marked this pull request as ready for review July 30, 2026 14:30
@Dueris Dueris added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed upstream: folia Caused by or related to our Folia upstream needs-docs Requires documentation to be written and in an open and approved PR before merging priority: low priority: medium folia-fix Fixes a Folia issue status: waiting for review Waiting for review from an official member of the team labels Jul 31, 2026
Comment thread canvas-server/minecraft-patches/base/0004-Region-Threading.patch Outdated
Comment thread canvas-server/minecraft-patches/base/0004-Region-Threading.patch Outdated
Comment thread canvas-server/minecraft-patches/base/0004-Region-Threading.patch Outdated
Comment thread canvas-server/minecraft-patches/base/0004-Region-Threading.patch Outdated
Comment thread canvas-server/minecraft-patches/base/0004-Region-Threading.patch
Comment thread canvas-server/minecraft-patches/base/0004-Region-Threading.patch Outdated
Comment thread canvas-server/minecraft-patches/base/0004-Region-Threading.patch Outdated
Comment thread canvas-server/minecraft-patches/base/0004-Region-Threading.patch Outdated
Comment thread canvas-server/minecraft-patches/base/0004-Region-Threading.patch Outdated
Comment thread canvas-server/minecraft-patches/base/0004-Region-Threading.patch
@Dueris

Dueris commented Aug 1, 2026

Copy link
Copy Markdown
Member

#271

Are you able to test this issue report to see if it works? Specifically the YT link in there.

@BaconCat1

Copy link
Copy Markdown
Contributor Author

#271

Are you able to test this issue report to see if it works? Specifically the YT link in there.

I already did and it does work

Comment thread canvas-server/minecraft-patches/base/0004-Region-Threading.patch Outdated
Comment thread canvas-server/minecraft-patches/base/0004-Region-Threading.patch Outdated
Comment thread canvas-server/minecraft-patches/base/0004-Region-Threading.patch Outdated
Comment thread canvas-server/minecraft-patches/base/0004-Region-Threading.patch Outdated
Comment thread canvas-server/minecraft-patches/base/0004-Region-Threading.patch Outdated
Comment thread canvas-server/minecraft-patches/base/0004-Region-Threading.patch Outdated

@R00tB33rMan R00tB33rMan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a glance from prior reviews looks fine

@devnootnoot

Copy link
Copy Markdown
Contributor

I think it's fine, I tested it locally and seems to work? Code looks good to me overall

@devnootnoot
devnootnoot self-requested a review August 10, 2026 19:06
Comment thread canvas-server/minecraft-patches/base/0004-Region-Threading.patch
Comment thread canvas-server/minecraft-patches/base/0004-Region-Threading.patch
@Dueris

Dueris commented Aug 11, 2026

Copy link
Copy Markdown
Member

Please fix conflicts with the main branch. Comment when done and Ill merge. Final call for everyone else if you wanna review!

@R00tB33rMan R00tB33rMan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@R00tB33rMan
R00tB33rMan merged commit 8ecc784 into CraftCanvasMC:main Aug 12, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request folia-fix Fixes a Folia issue help wanted Extra attention is needed needs-docs Requires documentation to be written and in an open and approved PR before merging priority: low priority: medium status: waiting for review Waiting for review from an official member of the team upstream: folia Caused by or related to our Folia upstream

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sand Duplication Machines Broken on Canvas

4 participants