mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-13 17:37:58 -04:00
fluid models: fix texture path fixing
This commit is contained in:
parent
704eca3c00
commit
767d69e41b
@ -47,7 +47,9 @@ open class PixLyzerItem(resourceLocation: ResourceLocation, registries: Registri
|
||||
val className = data["class"]?.toString()
|
||||
var factory = PixLyzerItemFactories[className]
|
||||
if (factory == null) {
|
||||
Log.log(LogMessageType.LOADING, LogLevels.VERBOSE) { "Item for class $className not found, defaulting..." }
|
||||
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
|
||||
|
@ -27,12 +27,12 @@ class LavaFluidModel : FluidModel {
|
||||
override val transparency = TextureTransparencies.OPAQUE// TODO: from texture
|
||||
|
||||
override fun load(context: RenderContext) {
|
||||
still = context.textures.staticTextures.createTexture(context.models.block.fixPath(STILL).texture())
|
||||
flowing = context.textures.staticTextures.createTexture(context.models.block.fixPath(FLOWING).texture())
|
||||
still = context.textures.staticTextures.createTexture(context.models.block.fixTexturePath(STILL).texture())
|
||||
flowing = context.textures.staticTextures.createTexture(context.models.block.fixTexturePath(FLOWING).texture())
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val STILL = minecraft("block/lava_still").texture()
|
||||
private val FLOWING = minecraft("block/lava_flow").texture()
|
||||
private val STILL = minecraft("block/lava_still")
|
||||
private val FLOWING = minecraft("block/lava_flow")
|
||||
}
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ class WaterFluidModel : FluidModel {
|
||||
override val transparency = TextureTransparencies.TRANSLUCENT// TODO: from texture
|
||||
|
||||
override fun load(context: RenderContext) {
|
||||
still = context.textures.staticTextures.createTexture(context.models.block.fixPath(STILL).texture())
|
||||
flowing = context.textures.staticTextures.createTexture(context.models.block.fixPath(FLOWING).texture())
|
||||
still = context.textures.staticTextures.createTexture(context.models.block.fixTexturePath(STILL).texture())
|
||||
flowing = context.textures.staticTextures.createTexture(context.models.block.fixTexturePath(FLOWING).texture())
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
@ -74,12 +74,12 @@ class BlockLoader(private val loader: ModelLoader) {
|
||||
this.cache.clear()
|
||||
}
|
||||
|
||||
fun fixPath(name: ResourceLocation): ResourceLocation {
|
||||
return ResourceLocation(name.namespace, name.path.fixPrefix(loader.packFormat, 4, "block/", "blocks/"))
|
||||
fun fixTexturePath(name: ResourceLocation): ResourceLocation {
|
||||
return ResourceLocation(name.namespace, name.path.fixPrefix(loader.packFormat, 4, "blocks/", "block/"))
|
||||
}
|
||||
|
||||
private fun ResourceLocation.blockModel(): ResourceLocation {
|
||||
return fixPath(this).model()
|
||||
return this.prefix("block/").model()
|
||||
}
|
||||
|
||||
|
||||
|
@ -73,11 +73,11 @@ class ItemLoader(private val loader: ModelLoader) {
|
||||
this.cache.clear()
|
||||
}
|
||||
|
||||
fun fixPath(name: ResourceLocation): ResourceLocation {
|
||||
return ResourceLocation(name.namespace, name.path.fixPrefix(loader.packFormat, 4, "item/", "items/"))
|
||||
fun fixTexturePath(name: ResourceLocation): ResourceLocation {
|
||||
return ResourceLocation(name.namespace, name.path.fixPrefix(loader.packFormat, 4, "items/", "item/"))
|
||||
}
|
||||
|
||||
private fun ResourceLocation.itemModel(): ResourceLocation {
|
||||
return fixPath(this).model()
|
||||
return this.prefix("item/").model()
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user