replace some todos with broken

This commit is contained in:
Bixilon 2022-04-22 14:02:40 +02:00
parent e2cbcaadb2
commit 00c1f1d1d0
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
3 changed files with 20 additions and 2 deletions

View File

@ -28,6 +28,7 @@ import de.bixilon.minosoft.data.text.ChatColors
import de.bixilon.minosoft.data.world.ChunkSection
import de.bixilon.minosoft.gui.rendering.util.vec.vec3.Vec3Util.get
import de.bixilon.minosoft.protocol.protocol.ProtocolDefinition
import de.bixilon.minosoft.util.Broken
import kotlin.math.abs
enum class Directions(
@ -82,7 +83,7 @@ enum class Directions(
SOUTH -> WEST
WEST -> NORTH
EAST -> SOUTH
else -> TODO()
else -> Broken("Rotation: $this")
}
}

View File

@ -23,6 +23,7 @@ import de.bixilon.minosoft.gui.rendering.util.VecUtil
import de.bixilon.minosoft.gui.rendering.util.VecUtil.getWorldOffset
import de.bixilon.minosoft.gui.rendering.util.vec.vec3.Vec3iUtil.toVec3
import de.bixilon.minosoft.gui.rendering.world.mesh.WorldMesh
import de.bixilon.minosoft.gui.rendering.world.preparer.cull.SolidCullSectionPreparer
import java.util.*
class BakedBlockStateModel(
@ -58,7 +59,7 @@ class BakedBlockStateModel(
continue
}
tint = tints?.getOrNull(face.tintIndex) ?: -1
currentLight = (face.cullFace?.let { light[it.ordinal] } ?: light[6]).toInt()
currentLight = (face.cullFace?.let { light[it.ordinal] } ?: light[SolidCullSectionPreparer.SELF_LIGHT_INDEX]).toInt()
face.singleRender(positionArray, mesh, currentLight, ambientLight, tint)
if (!rendered) {
rendered = true

View File

@ -0,0 +1,16 @@
/*
* Minosoft
* Copyright (C) 2020-2022 Moritz Zwerger
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* This software is not affiliated with Mojang AB, the original developer of Minecraft.
*/
package de.bixilon.minosoft.util
fun Broken(reason: String = ""): Nothing = throw IllegalStateException("Something is broken: $reason")