Skip to content

Commit

Permalink
Fixed player being able to place TNT before the game starts.
Browse files Browse the repository at this point in the history
This also prevents players from blowing themselves before the game starts and get stuck in spectator mode
  • Loading branch information
Minemobs committed Jul 24, 2024
1 parent 18cfb67 commit ade6bf0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/kotlin/fr/sunderia/bomberman/Bomberman.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package fr.sunderia.bomberman

import fr.sunderia.bomberman.InstanceCreator.Companion.createInstanceContainer
import fr.sunderia.bomberman.party.Game
import fr.sunderia.bomberman.party.GameCommand
import fr.sunderia.bomberman.party.Party
import fr.sunderia.bomberman.party.PartyCommand
import fr.sunderia.bomberman.party.*
import fr.sunderia.bomberman.utils.Axis
import fr.sunderia.bomberman.utils.Cooldown
import fr.sunderia.bomberman.utils.NPC
Expand Down Expand Up @@ -289,6 +286,7 @@ class Bomberman {

val player = it.player
if(player.gameMode != GameMode.ADVENTURE && player.gameMode != GameMode.CREATIVE) return@addListener
if(Game.getGame(it.instance)!!.gameStatus != GameStatus.RUNNING) return@addListener

val blockBelowPlayer = player.instance.getBlock(it.blockPosition.sub(.0, 1.0, .0))
if(blockBelowPlayer.id() != Block.STONE.id() || player.instance.getBlock(it.blockPosition.add(.0, 1.0, .0)).isSolid) return@addListener
Expand Down

0 comments on commit ade6bf0

Please sign in to comment.