Initial commit
This commit is contained in:
23
src/main/kotlin/com/pobnellion/aoe/building/Blacksmith.kt
Normal file
23
src/main/kotlin/com/pobnellion/aoe/building/Blacksmith.kt
Normal file
@ -0,0 +1,23 @@
|
||||
package com.pobnellion.aoe.building
|
||||
|
||||
import com.pobnellion.aoe.ui.PlaceHint
|
||||
import com.pobnellion.aoe.ui.PlaceHintValidators
|
||||
import org.bukkit.Location
|
||||
import org.bukkit.Material
|
||||
import org.bukkit.entity.Player
|
||||
|
||||
class Blacksmith: Building {
|
||||
override fun showPlaceHint(player: Player) {
|
||||
PlaceHint.add(player, 4.0f, 3.0f, 4.0f, ::place, PlaceHintValidators::allReplaceable)
|
||||
}
|
||||
|
||||
fun place(location: Location, sizeX: Float, sizeY: Float, sizeZ: Float) {
|
||||
for (x in 0..<sizeX.toInt())
|
||||
for (y in 0..<sizeY.toInt())
|
||||
for (z in 0..<sizeZ.toInt())
|
||||
location.world.getBlockAt(
|
||||
location.blockX + x,
|
||||
location.blockY + y,
|
||||
location.blockZ + z ).type = Material.SMOOTH_STONE
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user