mirror of
https://github.com/Artillex-Studios/AxMinions.git
synced 2024-11-25 12:05:56 +01:00
Fixes to linking
This commit is contained in:
parent
0cc025b0be
commit
4662561ab9
@ -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)
|
||||||
}
|
}
|
||||||
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user