fix MAXMC-T-2

This commit is contained in:
TONY_All 2023-06-16 01:27:30 +08:00
parent f1ae6d7f4c
commit 1053fde43f
Signed by: tony_all
GPG Key ID: 08A2261D5D6F746A
1 changed files with 8 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package cc.maxmc.blastingcrisis.listener package cc.maxmc.blastingcrisis.listener
import cc.maxmc.blastingcrisis.game.GamePlaceBreakRule import cc.maxmc.blastingcrisis.game.GamePlaceBreakRule
import cc.maxmc.blastingcrisis.game.team
import cc.maxmc.blastingcrisis.misc.Area import cc.maxmc.blastingcrisis.misc.Area
import cc.maxmc.blastingcrisis.misc.GameManager import cc.maxmc.blastingcrisis.misc.GameManager
import cc.maxmc.blastingcrisis.misc.debug import cc.maxmc.blastingcrisis.misc.debug
@ -10,6 +11,7 @@ import org.bukkit.event.block.BlockPlaceEvent
import org.bukkit.event.entity.EntityExplodeEvent import org.bukkit.event.entity.EntityExplodeEvent
import org.bukkit.event.player.PlayerInteractEvent import org.bukkit.event.player.PlayerInteractEvent
import org.bukkit.event.player.PlayerMoveEvent import org.bukkit.event.player.PlayerMoveEvent
import org.bukkit.event.player.PlayerRespawnEvent
import taboolib.common.platform.event.SubscribeEvent import taboolib.common.platform.event.SubscribeEvent
import taboolib.platform.util.sendLang import taboolib.platform.util.sendLang
@ -61,4 +63,10 @@ object GameListener {
placeEvent.isCancelled = true placeEvent.isCancelled = true
player.sendLang("game_cant_place_block") player.sendLang("game_cant_place_block")
} }
@SubscribeEvent
fun onRespawn(respawnEvent: PlayerRespawnEvent) {
val team = respawnEvent.player.team ?: return // ignore none game player
respawnEvent.respawnLocation = team.teamInfo.spawn
}
} }