Skip to content

Commit

Permalink
Fix player near location detection
Browse files Browse the repository at this point in the history
  • Loading branch information
gabber235 committed Feb 19, 2024
1 parent b09670e commit 08b7dd4
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.gabber235.typewriter.entries.event

import lirand.api.extensions.math.blockLocation
import me.gabber235.typewriter.adapters.Colors
import me.gabber235.typewriter.adapters.Entry
import me.gabber235.typewriter.adapters.modifiers.Help
Expand Down Expand Up @@ -35,7 +36,10 @@ fun onPlayerNearLocation(event: PlayerMoveEvent, query: Query<PlayerNearLocation
if (!event.hasChangedBlock()) return

query findWhere { entry ->
!event.from.isInRange(entry.location, entry.range) && event.to.isInRange(entry.location, entry.range)
!event.from.blockLocation.isInRange(
entry.location,
entry.range
) && event.to.blockLocation.isInRange(entry.location, entry.range)
} startDialogueWithOrNextDialogue event.player
}

Expand Down

0 comments on commit 08b7dd4

Please sign in to comment.