feat: add config option to simulate vanilla detached fishing-hook portal behavior#171
feat: add config option to simulate vanilla detached fishing-hook portal behavior#171BaconCat1 wants to merge 26 commits intoCraftCanvasMC:ver/1.21.11from
Conversation
Dueris
left a comment
There was a problem hiding this comment.
I am currently unsure about this, how closely does this match the Vanilla mechanic?
Also, is this something that can be simplified? I don't entirely mind it being a tad complex, however I am curious if it is simplify-able.
It seems to match the vanilla behavior for all practical purposes afaik. I will look through again to see if I left anything redundant, but as the current approach is simulating quite complex behavior of a bug, I'm not sure it can be simplified much. |
|
Can this be made into a base patch? Id rather it be in that, since it is a lot of changes for a bug that Mojang could just fix anytime. |
2aad920 to
cc57375
Compare
There was a problem hiding this comment.
Pull request overview
Adds an opt-in compatibility mode to emulate vanilla’s “detached fishing hook across portals” quirk in a region-threaded environment, intended for technical/wireless-redstone setups that rely on this behavior.
Changes:
- Introduces
combat.restoreDetachedFishingHookPortalBugconfig toggle (default: off). - Patches
Player/FishingHookto preserve and later “realize” hooks during cross-dimension / cross-region-thread transitions. - Adjusts fishing-rod retrieval to schedule retrieval on the hook’s region thread when needed.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
canvas-server/src/main/java/io/canvasmc/canvas/Config.java |
Adds the new combat config option and its admin-facing description. |
canvas-server/minecraft-patches/base/0013-Restore-detached-fishing-hook-portal-bug.patch |
Core implementation: hook detach/realize state handling, portal-transfer marking, and rod retrieval scheduling. |
canvas-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/FishingHook.java.patch |
Adjusts patch hunks/offsets around existing fishing hook behavior. |
canvas-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch |
Adjusts patch hunks/offsets around player logic to align with the new base patch. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… chunk loaders, and make owner restoration/reel-in handling safer across portal transitions and region-thread boundaries.
… player's scheduler
| @@ -1,5 +1,6 @@ | ||
| package net.minecraft.world.item; | ||
|
|
||
| +import net.minecraft.server.level.ServerPlayer; |
There was a problem hiding this comment.
Oops, wasn't thinking when I added this. Will fix.
|
Done testing this, but needs a few polishing changes |
|
Fixed weird issues with patches, has been tested as well. Still wait a bit on merging this because I need to verify smth. |
…od-stasis # Conflicts: # canvas-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch
Have you verified what u wanted to verify yet? |
There was a problem hiding this comment.
I'm not seeing any obvious issues with this. This is probably good to merge, assuming @BaconCat1 is also confident
I haven't found any issues so far. While the patches do apply im not sure on the format. It seems a little strange to me. That being said i'm also unsure how to fix that so.... maybe it's fine ig |
|
If u could fix the conflicts I can go in and cleanup the diff |
Adds a configurable option to simulate vanilla's detached fishing hook behavior during movement through portals. This behavior is relied upon by certain wireless redstone and technical setups but is normally broken by region threading.
When enabled, fishing hooks can temporarily remain in a detached state while their owner or target exists on another region thread or dimension, closely reproducing vanilla behavior.
This is disabled by default and intended only for servers that explicitly want to emulate the vanilla bug.
This change does not alter default gameplay behavior.
Instead, it introduces an optional compatibility mode that recreates a vanilla bug/quirk used in some redstone contraptions and technical mechanics.
Has been production tested without issue.