From 235925f15615e23fdaece8c55614b7def7bce5fa Mon Sep 17 00:00:00 2001 From: lijinhong11 Date: Fri, 10 Jul 2026 19:34:20 +0800 Subject: [PATCH 1/4] fix #873 --- .../fluid/placement/FluidPipePlacementService.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/rebar/src/main/kotlin/io/github/pylonmc/rebar/fluid/placement/FluidPipePlacementService.kt b/rebar/src/main/kotlin/io/github/pylonmc/rebar/fluid/placement/FluidPipePlacementService.kt index 8245e135d..3f8be19d9 100644 --- a/rebar/src/main/kotlin/io/github/pylonmc/rebar/fluid/placement/FluidPipePlacementService.kt +++ b/rebar/src/main/kotlin/io/github/pylonmc/rebar/fluid/placement/FluidPipePlacementService.kt @@ -17,6 +17,7 @@ import org.bukkit.event.Listener import org.bukkit.event.player.PlayerItemHeldEvent import org.bukkit.event.player.PlayerQuitEvent import org.bukkit.event.player.PlayerSwapHandItemsEvent +import org.bukkit.event.player.PlayerTeleportEvent import org.bukkit.event.world.ChunkUnloadEvent import org.bukkit.inventory.EquipmentSlot import java.util.UUID @@ -180,6 +181,18 @@ internal object FluidPipePlacementService : Listener { } } + @EventHandler + private fun onTeleport(event: PlayerTeleportEvent) { + if (!connectionsInProgress.containsKey(event.player)) return + + val fromWorld = event.from.world + val toWorld = event.to.world + + if (!fromWorld.equals(toWorld)) { + cancelConnection(event.player) + } + } + /** * Intended to prevent issues if players teleport away while placing a pipe */ From 5746153dcb5165c9ba8cdef0ad32b55aa708fd71 Mon Sep 17 00:00:00 2001 From: lijinhong11 Date: Sun, 12 Jul 2026 18:52:29 +0800 Subject: [PATCH 2/4] fix --- .../fluid/placement/FluidPipePlacementService.kt | 12 ------------ .../rebar/fluid/placement/FluidPipePlacementTask.kt | 6 ++++++ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/rebar/src/main/kotlin/io/github/pylonmc/rebar/fluid/placement/FluidPipePlacementService.kt b/rebar/src/main/kotlin/io/github/pylonmc/rebar/fluid/placement/FluidPipePlacementService.kt index 3f8be19d9..aff697d53 100644 --- a/rebar/src/main/kotlin/io/github/pylonmc/rebar/fluid/placement/FluidPipePlacementService.kt +++ b/rebar/src/main/kotlin/io/github/pylonmc/rebar/fluid/placement/FluidPipePlacementService.kt @@ -181,18 +181,6 @@ internal object FluidPipePlacementService : Listener { } } - @EventHandler - private fun onTeleport(event: PlayerTeleportEvent) { - if (!connectionsInProgress.containsKey(event.player)) return - - val fromWorld = event.from.world - val toWorld = event.to.world - - if (!fromWorld.equals(toWorld)) { - cancelConnection(event.player) - } - } - /** * Intended to prevent issues if players teleport away while placing a pipe */ diff --git a/rebar/src/main/kotlin/io/github/pylonmc/rebar/fluid/placement/FluidPipePlacementTask.kt b/rebar/src/main/kotlin/io/github/pylonmc/rebar/fluid/placement/FluidPipePlacementTask.kt index a818346ab..2e779b8ee 100644 --- a/rebar/src/main/kotlin/io/github/pylonmc/rebar/fluid/placement/FluidPipePlacementTask.kt +++ b/rebar/src/main/kotlin/io/github/pylonmc/rebar/fluid/placement/FluidPipePlacementTask.kt @@ -66,6 +66,12 @@ internal class FluidPipePlacementTask( return } + // Check if player goes to other worlds + if (player.world != origin.position.world) { + FluidPipePlacementService.cancelConnection(player) + return + } + // Check if player has moved too far away if (player.location.distance(origin.position.location) > RebarConfig.PIPE_PLACEMENT_CANCEL_DISTANCE) { FluidPipePlacementService.cancelConnection(player) From d88f4845c117c5ad033dfedad47264f5d89ba19e Mon Sep 17 00:00:00 2001 From: lijinhong11 Date: Sun, 12 Jul 2026 18:59:51 +0800 Subject: [PATCH 3/4] oops --- .../pylonmc/rebar/fluid/placement/FluidPipePlacementService.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rebar/src/main/kotlin/io/github/pylonmc/rebar/fluid/placement/FluidPipePlacementService.kt b/rebar/src/main/kotlin/io/github/pylonmc/rebar/fluid/placement/FluidPipePlacementService.kt index aff697d53..2e372e3db 100644 --- a/rebar/src/main/kotlin/io/github/pylonmc/rebar/fluid/placement/FluidPipePlacementService.kt +++ b/rebar/src/main/kotlin/io/github/pylonmc/rebar/fluid/placement/FluidPipePlacementService.kt @@ -17,10 +17,9 @@ import org.bukkit.event.Listener import org.bukkit.event.player.PlayerItemHeldEvent import org.bukkit.event.player.PlayerQuitEvent import org.bukkit.event.player.PlayerSwapHandItemsEvent -import org.bukkit.event.player.PlayerTeleportEvent import org.bukkit.event.world.ChunkUnloadEvent import org.bukkit.inventory.EquipmentSlot -import java.util.UUID +import java.util.* internal object FluidPipePlacementService : Listener { /** From 4a0801363099f24fbd4e7dce1c051ef86a812ac9 Mon Sep 17 00:00:00 2001 From: lijinhong11 Date: Sun, 12 Jul 2026 19:00:37 +0800 Subject: [PATCH 4/4] wth idea --- .../pylonmc/rebar/fluid/placement/FluidPipePlacementService.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rebar/src/main/kotlin/io/github/pylonmc/rebar/fluid/placement/FluidPipePlacementService.kt b/rebar/src/main/kotlin/io/github/pylonmc/rebar/fluid/placement/FluidPipePlacementService.kt index 2e372e3db..8245e135d 100644 --- a/rebar/src/main/kotlin/io/github/pylonmc/rebar/fluid/placement/FluidPipePlacementService.kt +++ b/rebar/src/main/kotlin/io/github/pylonmc/rebar/fluid/placement/FluidPipePlacementService.kt @@ -19,7 +19,7 @@ import org.bukkit.event.player.PlayerQuitEvent import org.bukkit.event.player.PlayerSwapHandItemsEvent import org.bukkit.event.world.ChunkUnloadEvent import org.bukkit.inventory.EquipmentSlot -import java.util.* +import java.util.UUID internal object FluidPipePlacementService : Listener { /**