Fixes to linking

This commit is contained in:
TomTom 2024-06-28 09:22:50 +02:00
parent 0cc025b0be
commit 4662561ab9
2 changed files with 7 additions and 1 deletions

View File

@ -15,6 +15,7 @@ import org.bukkit.entity.Player
import org.bukkit.event.EventHandler import org.bukkit.event.EventHandler
import org.bukkit.event.Listener import org.bukkit.event.Listener
import org.bukkit.event.player.PlayerInteractEvent import org.bukkit.event.player.PlayerInteractEvent
import kotlin.math.min
class LinkingListener : Listener { class LinkingListener : Listener {
companion object { companion object {
@ -50,6 +51,11 @@ class LinkingListener : Listener {
return return
} }
val min = minion as com.artillexstudios.axminions.minions.Minion
if (min.broken.get()) {
return
}
event.player.sendMessage(StringUtils.formatToString(Messages.PREFIX() + Messages.LINK_SUCCESS())) event.player.sendMessage(StringUtils.formatToString(Messages.PREFIX() + Messages.LINK_SUCCESS()))
minion.setLinkedChest(event.clickedBlock!!.location) minion.setLinkedChest(event.clickedBlock!!.location)
} }

View File

@ -92,7 +92,7 @@ class Minion(
@Volatile @Volatile
private var ticking = false private var ticking = false
private var debugHologram: Hologram? = null private var debugHologram: Hologram? = null
private val broken = AtomicBoolean(false) val broken = AtomicBoolean(false)
private var ownerOnline = false private var ownerOnline = false
init { init {