mirror of
https://github.com/Artillex-Studios/AxMinions.git
synced 2025-01-07 18:58:23 +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.block.Block
|
||||
import org.bukkit.block.BlockFace
|
||||
import org.bukkit.block.data.Waterlogged
|
||||
|
||||
object MinionUtils {
|
||||
private val FACES =
|
||||
@ -44,13 +45,14 @@ object MinionUtils {
|
||||
val locBlock = location.block
|
||||
FACES.fastFor {
|
||||
val relative = locBlock.getRelative(it)
|
||||
val type = relative.type
|
||||
val state = relative.state
|
||||
val type = state.type
|
||||
if (!lava) {
|
||||
lava = type == Material.LAVA
|
||||
}
|
||||
|
||||
if (!water) {
|
||||
water = type == Material.WATER
|
||||
water = type == Material.WATER || (state as? Waterlogged)?.isWaterlogged ?: return@fastFor
|
||||
}
|
||||
|
||||
if (water && lava) {
|
||||
|
Loading…
Reference in New Issue
Block a user