mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-13 17:37:58 -04:00
pixlyzer: don't warn if class not found
This commit is contained in:
parent
43c8a51d3b
commit
b5b6ead31c
@ -55,9 +55,6 @@ import de.bixilon.minosoft.gui.rendering.util.vec.vec3.Vec3Util.EMPTY
|
||||
import de.bixilon.minosoft.protocol.network.connection.play.PlayConnection
|
||||
import de.bixilon.minosoft.protocol.versions.Version
|
||||
import de.bixilon.minosoft.protocol.versions.Versions
|
||||
import de.bixilon.minosoft.util.logging.Log
|
||||
import de.bixilon.minosoft.util.logging.LogLevels
|
||||
import de.bixilon.minosoft.util.logging.LogMessageType
|
||||
import kotlin.reflect.jvm.javaField
|
||||
|
||||
open class PixLyzerBlock(
|
||||
@ -129,11 +126,7 @@ open class PixLyzerBlock(
|
||||
check(registries != null) { "Registries is null!" }
|
||||
|
||||
val className = data["class"].toString()
|
||||
var factory = PixLyzerBlockFactories[className]
|
||||
if (factory == null) {
|
||||
Log.log(LogMessageType.LOADING, LogLevels.VERBOSE) { "Block for class $className not found, defaulting..." }
|
||||
factory = PixLyzerBlock
|
||||
}
|
||||
val factory = PixLyzerBlockFactories[className] ?: PixLyzerBlock
|
||||
|
||||
return factory.build(resourceLocation, registries, data)
|
||||
}
|
||||
|
@ -28,9 +28,6 @@ import de.bixilon.minosoft.data.registries.registries.registry.codec.ResourceLoc
|
||||
import de.bixilon.minosoft.gui.rendering.tint.TintProvider
|
||||
import de.bixilon.minosoft.gui.rendering.tint.TintedBlock
|
||||
import de.bixilon.minosoft.util.KUtil.toResourceLocation
|
||||
import de.bixilon.minosoft.util.logging.Log
|
||||
import de.bixilon.minosoft.util.logging.LogLevels
|
||||
import de.bixilon.minosoft.util.logging.LogMessageType
|
||||
|
||||
open class PixLyzerItem(resourceLocation: ResourceLocation, registries: Registries, data: Map<String, Any>) : Item(resourceLocation), DurableItem, StackableItem, TintedBlock {
|
||||
override val rarity: Rarities = data["rarity"]?.toInt()?.let { Rarities[it] } ?: Rarities.COMMON
|
||||
@ -50,10 +47,6 @@ open class PixLyzerItem(resourceLocation: ResourceLocation, registries: Registri
|
||||
val className = data["class"]?.toString()
|
||||
var factory = PixLyzerItemFactories[className]
|
||||
if (factory == null) {
|
||||
if (className != null) {
|
||||
Log.log(LogMessageType.LOADING, LogLevels.VERBOSE) { "Item for class $className not found, defaulting..." }
|
||||
}
|
||||
// ToDo: This item class got renamed or is not yet implemented
|
||||
factory = if (data["food_properties"] != null) {
|
||||
PixLyzerFoodItem // ToDo: Remove this edge case
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user