Initial commit

This commit is contained in:
2024-12-30 00:58:28 +13:00
commit aac3d2d4cb
18 changed files with 1048 additions and 0 deletions

View File

@ -0,0 +1,38 @@
package com.pobnellion.aoe.ui
import org.bukkit.Location
class PlaceHintValidators {
companion object {
fun alwaysTrue(location: Location, sizeX: Float, sizeY: Float, sizeZ: Float): Boolean {
return true
}
fun allAir(location: Location, sizeX: Float, sizeY: Float, sizeZ: Float): Boolean {
for (x in 0..<sizeX.toInt())
for (y in 0..<sizeY.toInt())
for (z in 0..<sizeZ.toInt())
if (!location.world.getBlockAt(
location.blockX + x,
location.blockY + y,
location.blockZ + z ).isEmpty)
return false
return true
}
fun allReplaceable(location: Location, sizeX: Float, sizeY: Float, sizeZ: Float): Boolean {
for (x in 0..<sizeX.toInt())
for (y in 0..<sizeY.toInt())
for (z in 0..<sizeZ.toInt())
if (!location.world.getBlockAt(
location.blockX + x,
location.blockY + y,
location.blockZ + z ).isReplaceable)
return false
return true
}
}
}