Skip to content

Commit

Permalink
Fix player being able to interact with GUIs (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
Iru21 committed Jan 19, 2023
1 parent 2f54e3c commit d0f4703
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/kotlin/me/iru/events/BlockEvents.kt
Expand Up @@ -8,6 +8,7 @@ import org.bukkit.event.block.BlockBreakEvent
import org.bukkit.event.block.BlockPlaceEvent
import org.bukkit.event.entity.EntityDamageByEntityEvent
import org.bukkit.event.entity.EntityDamageEvent
import org.bukkit.event.inventory.InventoryInteractEvent
import org.bukkit.event.player.*

class BlockEvents : Listener {
Expand Down Expand Up @@ -106,4 +107,13 @@ class BlockEvents : Listener {
loginProcess.sendPleaseAuthMessage(e.player)
}
}

@EventHandler
fun onInventoryInteract(e : InventoryInteractEvent) {
val p = e.whoClicked as Player
if(loginProcess.contains(p)) {
e.isCancelled = true
loginProcess.sendPleaseAuthMessage(p)
}
}
}

0 comments on commit d0f4703

Please sign in to comment.