From 1d638db07830ba70246c4653ffa3544f772ca6a7 Mon Sep 17 00:00:00 2001 From: Moritz Ruth Date: Sun, 21 Jun 2020 15:18:43 +0200 Subject: [PATCH] Fix round not ending when the Second Chance times out --- .../de/moritzruth/spigot_ttt/game/GeneralGameListener.kt | 6 ------ .../de/moritzruth/spigot_ttt/game/corpses/CorpseListener.kt | 2 +- .../moritzruth/spigot_ttt/game/items/impl/SecondChance.kt | 1 + 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/de/moritzruth/spigot_ttt/game/GeneralGameListener.kt b/src/main/kotlin/de/moritzruth/spigot_ttt/game/GeneralGameListener.kt index 9936df9..b7ec9a7 100644 --- a/src/main/kotlin/de/moritzruth/spigot_ttt/game/GeneralGameListener.kt +++ b/src/main/kotlin/de/moritzruth/spigot_ttt/game/GeneralGameListener.kt @@ -21,7 +21,6 @@ import org.bukkit.event.EventHandler import org.bukkit.event.EventPriority import org.bukkit.event.Listener import org.bukkit.event.block.Action -import org.bukkit.event.entity.EntityDamageByBlockEvent import org.bukkit.event.entity.EntityDamageByEntityEvent import org.bukkit.event.entity.EntityDamageEvent import org.bukkit.event.entity.PlayerDeathEvent @@ -85,11 +84,6 @@ object GeneralGameListener : Listener { } } - @EventHandler - fun onEntityDamageByBlock(event: EntityDamageByBlockEvent) { - println(event.damager?.type) - } - @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) fun onEntityDamageHighest(event: EntityDamageEvent) { if (event.entity !is Player) return diff --git a/src/main/kotlin/de/moritzruth/spigot_ttt/game/corpses/CorpseListener.kt b/src/main/kotlin/de/moritzruth/spigot_ttt/game/corpses/CorpseListener.kt index 84f9a54..cc26a03 100644 --- a/src/main/kotlin/de/moritzruth/spigot_ttt/game/corpses/CorpseListener.kt +++ b/src/main/kotlin/de/moritzruth/spigot_ttt/game/corpses/CorpseListener.kt @@ -36,7 +36,7 @@ object CorpseListener: Listener { if ( Duration.between(tttCorpse.timestamp, Instant.now()).toMillis() < 200 || - event.player.location.distance(tttCorpse.location) > 1.5 + event.player.location.distance(tttCorpse.location) > 2.0 ) return if (event.player.inventory.itemInMainHand.type != Material.AIR) diff --git a/src/main/kotlin/de/moritzruth/spigot_ttt/game/items/impl/SecondChance.kt b/src/main/kotlin/de/moritzruth/spigot_ttt/game/items/impl/SecondChance.kt index ad392d3..a46cfc6 100644 --- a/src/main/kotlin/de/moritzruth/spigot_ttt/game/items/impl/SecondChance.kt +++ b/src/main/kotlin/de/moritzruth/spigot_ttt/game/items/impl/SecondChance.kt @@ -99,6 +99,7 @@ object SecondChance: TTTItem( }, 0, 1) private fun onTimeout() { + instance.preventRoundEnd = false try { PlayerManager.letRemainingRoleGroupWin() } catch (e: IllegalStateException) {}