Skip to content

Commit

Permalink
fix: water flowing through furniture collision-hitbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed Dec 5, 2024
1 parent 1f0f248 commit 8b992bc
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import org.bukkit.event.Listener
import org.bukkit.event.block.Action
import org.bukkit.event.block.BlockBreakEvent
import org.bukkit.event.block.BlockDamageEvent
import org.bukkit.event.block.BlockFromToEvent
import org.bukkit.event.player.PlayerInteractEvent
import org.bukkit.event.player.PlayerQuitEvent
import org.bukkit.util.Vector
Expand Down Expand Up @@ -192,6 +193,12 @@ class BlockyFurnitureListener : Listener {
player.leaveVehicle()
}

@EventHandler
fun BlockFromToEvent.onLiquid() {
FurniturePacketHelpers.baseFurnitureFromCollisionHitbox(toBlock.toBlockPos()) ?: return
isCancelled = true
}

private fun Player.sitOnBlockySeat(entity: ItemDisplay, location: Location = entity.location) {
BlockyFurnitures.blockySeat(entity, location)?.addPassenger(this)
}
Expand Down

0 comments on commit 8b992bc

Please sign in to comment.