Skip to content
This repository has been archived by the owner on Jun 3, 2023. It is now read-only.

Commit

Permalink
Fixed BuildData
Browse files Browse the repository at this point in the history
  • Loading branch information
NichtStudioCode committed Feb 23, 2021
1 parent eeee876 commit 8355677
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions src/main/kotlin/de/studiocode/miniatureblocks/build/BuildData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ class BuildData {
}
}
}

val x = location.blockX - min.blockX
val y = location.blockY - min.blockY
val z = location.blockZ - min.blockZ

val buildBlockData = BuildBlockData(x, y, z, block, blockedSides)
if (!buildBlockData.isSurroundedByBlocks()) data.add(buildBlockData)
}

val x = location.blockX - min.blockX
val y = location.blockY - min.blockY
val z = location.blockZ - min.blockZ

val buildBlockData = BuildBlockData(x, y, z, block, blockedSides)
if (!buildBlockData.isSurroundedByBlocks()) data.add(buildBlockData)
}

this.data = data
this.size = max.blockX - min.blockX
this.size = max.blockX - min.blockX + 1
}

private fun getAllLocations(min: Location, max: Location): List<Location> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Region(player: Player) {
if (lineLocations == null) {
lineLocations = HashMap()
pos1!!.getBoxOutline(pos2!!, true).forEach { lineLocations!![it] = false }
cubePos1!!.getBoxOutline(cubePos2!!, false).forEach { lineLocations!![it] = true }
cubePos1!!.getBoxOutline(cubePos2!!, true).forEach { lineLocations!![it] = true }
}

lineLocations?.forEach { (location, green) ->
Expand All @@ -55,9 +55,9 @@ class Region(player: Player) {
val minX = min(pos1.x, pos2.x)
val minY = min(pos1.y, pos2.y)
val minZ = min(pos1.z, pos2.z)
val maxX = max(pos1.x, pos2.x) + 1
val maxY = max(pos1.y, pos2.y) + 1
val maxZ = max(pos1.z, pos2.z) + 1
val maxX = max(pos1.x, pos2.x)
val maxY = max(pos1.y, pos2.y)
val maxZ = max(pos1.z, pos2.z)

val size = doubleArrayOf(maxX - minX, maxY - minY, maxZ - minZ).sortedDescending()[0]

Expand Down

0 comments on commit 8355677

Please sign in to comment.