mirror of
https://github.com/Artillex-Studios/AxMinions.git
synced 2025-01-08 19:07:41 +01:00
Add support for waterlogged blocks
This commit is contained in:
parent
74f9cd5965
commit
67a516a46b
@ -6,6 +6,7 @@ import org.bukkit.Location
|
|||||||
import org.bukkit.Material
|
import org.bukkit.Material
|
||||||
import org.bukkit.block.Block
|
import org.bukkit.block.Block
|
||||||
import org.bukkit.block.BlockFace
|
import org.bukkit.block.BlockFace
|
||||||
|
import org.bukkit.block.data.Waterlogged
|
||||||
|
|
||||||
object MinionUtils {
|
object MinionUtils {
|
||||||
private val FACES =
|
private val FACES =
|
||||||
@ -44,13 +45,14 @@ object MinionUtils {
|
|||||||
val locBlock = location.block
|
val locBlock = location.block
|
||||||
FACES.fastFor {
|
FACES.fastFor {
|
||||||
val relative = locBlock.getRelative(it)
|
val relative = locBlock.getRelative(it)
|
||||||
val type = relative.type
|
val state = relative.state
|
||||||
|
val type = state.type
|
||||||
if (!lava) {
|
if (!lava) {
|
||||||
lava = type == Material.LAVA
|
lava = type == Material.LAVA
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!water) {
|
if (!water) {
|
||||||
water = type == Material.WATER
|
water = type == Material.WATER || (state as? Waterlogged)?.isWaterlogged ?: return@fastFor
|
||||||
}
|
}
|
||||||
|
|
||||||
if (water && lava) {
|
if (water && lava) {
|
||||||
|
Loading…
Reference in New Issue
Block a user