From f536bf72a9894553fe0a46494a7bc559cc75a6c6 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 14 Mar 2021 14:07:56 -0400 Subject: [PATCH] Convert Cable block model to code --- .../phycon/client/PhyModelProvider.kt | 4 + .../phycon/client/model/ColoredCableModel.kt | 282 ++++++++++++++++++ .../phycon/client/model/FaceDeviceModel.kt | 2 +- .../assets/phycon/blockstates/cable.json | 239 +-------------- .../phycon/models/block/cable_center.json | 2 +- .../models/block/cable_diag_corner.json | 4 +- .../models/block/cable_diag_corner_cont.json | 4 +- .../models/block/cable_diag_corner_xz.json | 4 +- .../block/cable_diag_corner_xz_cont.json | 4 +- .../phycon/models/block/cable_side.json | 2 +- .../assets/phycon/models/item/cable.json | 4 +- .../blue/cap_end.png} | Bin .../blue/straight.png} | Bin .../blue/straight_rotated.png} | Bin 14 files changed, 300 insertions(+), 251 deletions(-) create mode 100644 src/main/kotlin/net/shadowfacts/phycon/client/model/ColoredCableModel.kt rename src/main/resources/assets/phycon/textures/block/{cable_cap_end.png => cable/blue/cap_end.png} (100%) rename src/main/resources/assets/phycon/textures/block/{cable_straight.png => cable/blue/straight.png} (100%) rename src/main/resources/assets/phycon/textures/block/{cable_straight_rotated.png => cable/blue/straight_rotated.png} (100%) diff --git a/src/main/kotlin/net/shadowfacts/phycon/client/PhyModelProvider.kt b/src/main/kotlin/net/shadowfacts/phycon/client/PhyModelProvider.kt index eb18cb3..375400f 100644 --- a/src/main/kotlin/net/shadowfacts/phycon/client/PhyModelProvider.kt +++ b/src/main/kotlin/net/shadowfacts/phycon/client/PhyModelProvider.kt @@ -4,8 +4,10 @@ import net.fabricmc.fabric.api.client.model.ModelProviderContext import net.fabricmc.fabric.api.client.model.ModelResourceProvider import net.minecraft.client.render.model.UnbakedModel import net.minecraft.resource.ResourceManager +import net.minecraft.util.DyeColor import net.minecraft.util.Identifier import net.shadowfacts.phycon.PhysicalConnectivity +import net.shadowfacts.phycon.client.model.ColoredCableModel import net.shadowfacts.phycon.client.model.RedstoneControllerModel import net.shadowfacts.phycon.client.model.SimpleFaceDeviceModel @@ -23,6 +25,7 @@ class PhyModelProvider(resourceManager: ResourceManager) : ModelResourceProvider val EXTRACTOR_SIDE = Identifier(PhysicalConnectivity.MODID, "block/extractor_side") val INSERTER = Identifier(PhysicalConnectivity.MODID, "block/inserter") val INSERTER_SIDE = Identifier(PhysicalConnectivity.MODID, "block/inserter_side") + val CABLE_BLUE = Identifier(PhysicalConnectivity.MODID, "block/cable/blue") } override fun loadModelResource(resourceId: Identifier, context: ModelProviderContext): UnbakedModel? { @@ -32,6 +35,7 @@ class PhyModelProvider(resourceManager: ResourceManager) : ModelResourceProvider REDSTONE_EMITTER -> SimpleFaceDeviceModel(REDSTONE_EMITTER_SIDE) EXTRACTOR -> SimpleFaceDeviceModel(EXTRACTOR_SIDE) INSERTER -> SimpleFaceDeviceModel(INSERTER_SIDE) + CABLE_BLUE -> ColoredCableModel(DyeColor.BLUE) else -> null } } diff --git a/src/main/kotlin/net/shadowfacts/phycon/client/model/ColoredCableModel.kt b/src/main/kotlin/net/shadowfacts/phycon/client/model/ColoredCableModel.kt new file mode 100644 index 0000000..59b1128 --- /dev/null +++ b/src/main/kotlin/net/shadowfacts/phycon/client/model/ColoredCableModel.kt @@ -0,0 +1,282 @@ +package net.shadowfacts.phycon.client.model + +import com.mojang.datafixers.util.Pair +import net.minecraft.block.BlockState +import net.minecraft.client.render.model.* +import net.minecraft.client.render.model.json.ModelOverrideList +import net.minecraft.client.render.model.json.ModelTransformation +import net.minecraft.client.texture.Sprite +import net.minecraft.client.texture.SpriteAtlasTexture +import net.minecraft.client.util.SpriteIdentifier +import net.minecraft.util.DyeColor +import net.minecraft.util.Identifier +import net.minecraft.util.math.Direction +import net.shadowfacts.phycon.PhysicalConnectivity +import net.shadowfacts.phycon.block.cable.CableBlock +import net.shadowfacts.phycon.util.CableConnection +import java.util.Random +import java.util.function.Function + +/** + * @author shadowfacts + */ +class ColoredCableModel( + val color: DyeColor, +): UnbakedModel, BakedModel { + companion object { + val SIDE = Identifier(PhysicalConnectivity.MODID, "block/cable_side") + val CENTER = Identifier(PhysicalConnectivity.MODID, "block/cable_center") + val DIAG_CORNER = Identifier(PhysicalConnectivity.MODID, "block/cable_diag_corner") + val DIAG_CORNER_CONT = Identifier(PhysicalConnectivity.MODID, "block/cable_diag_corner_cont") + val DIAG_CORNER_XZ = Identifier(PhysicalConnectivity.MODID, "block/cable_diag_corner_xz") + val DIAG_CORNER_XZ_CONT = Identifier(PhysicalConnectivity.MODID, "block/cable_diag_corner_xz_cont") + } + + private var centerSprite: Sprite? = null + + private var side: Array = Array(6) { null } + private var center: Array = Array(6) { null } + private var diagCorner = mutableMapOf() + private var diagCornerCont = mutableMapOf() + private var diagCornerXZ = mutableMapOf() + private var diagCornerXZCont = mutableMapOf() + + private val sideRotations = listOf( + Direction.DOWN to ModelRotation.X0_Y0, + Direction.UP to ModelRotation.X180_Y0, + Direction.NORTH to ModelRotation.X270_Y0, + Direction.SOUTH to ModelRotation.X90_Y0, + Direction.WEST to ModelRotation.X90_Y90, + Direction.EAST to ModelRotation.X90_Y270, + ) + + override fun getModelDependencies(): Collection { + return setOf( + SIDE, + CENTER, + DIAG_CORNER, + DIAG_CORNER_CONT, + DIAG_CORNER_XZ, + DIAG_CORNER_XZ_CONT, + ) + } + + override fun getTextureDependencies( + unbakedModelGetter: Function, + unresolvedTextureDependencies: MutableSet> + ): Collection { + val newSet = mutableSetOf>() + val res = modelDependencies.map(unbakedModelGetter::apply).flatMap { + it.getTextureDependencies(unbakedModelGetter, newSet) + } + unresolvedTextureDependencies.addAll(newSet) + return res.map { + if (it.textureId.namespace == PhysicalConnectivity.MODID && it.textureId.path.startsWith("block/cable/color/")) { + val newPath = it.textureId.path.replace("block/cable/color/", "block/cable/${color.getName()}/") + SpriteIdentifier(it.atlasId, Identifier(PhysicalConnectivity.MODID, newPath)) + } else { + it + } + } + } + + override fun bake( + loader: ModelLoader, + textureGetter: Function, + rotationContainer: ModelBakeSettings, + modelId: Identifier + ): BakedModel { + centerSprite = textureGetter.apply(SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, Identifier(PhysicalConnectivity.MODID, "block/cable/${color.getName()}/straight"))) + + sideRotations.forEach { (side, rot) -> + this.side[side.ordinal] = loader.bakeRetextured(SIDE, textureGetter, rot) + this.center[side.ordinal] = loader.bakeRetextured(CENTER, textureGetter, rot) + } + + diagCorner.clear() + diagCornerCont.clear() + listOf( + ModelRotation.X0_Y0, + ModelRotation.X0_Y180, + ModelRotation.X180_Y180, + ModelRotation.X180_Y0, + ModelRotation.X0_Y270, + ModelRotation.X0_Y90, + ModelRotation.X180_Y90, + ModelRotation.X180_Y270, + ).forEach { rot -> + diagCorner[rot] = loader.bakeRetextured(DIAG_CORNER, textureGetter, rot) + diagCornerCont[rot] = loader.bakeRetextured(DIAG_CORNER_CONT, textureGetter, rot) + } + + diagCornerXZ.clear() + diagCornerXZCont.clear() + listOf( + ModelRotation.X0_Y0, + ModelRotation.X0_Y90, + ModelRotation.X0_Y180, + ModelRotation.X0_Y270, + ).forEach { rot -> + diagCornerXZ[rot] = loader.bakeRetextured(DIAG_CORNER_XZ, textureGetter, rot) + diagCornerXZCont[rot] = loader.bakeRetextured(DIAG_CORNER_XZ_CONT, textureGetter, rot) + } + + return this + } + + private fun ModelLoader.bakeRetextured(id: Identifier, textureGetter: Function, rot: ModelRotation): BakedModel { + val unbaked = getOrLoadModel(id) + val wrappedTextureGetter: (SpriteIdentifier) -> Sprite = { + var newId = it + if (it.textureId.namespace == PhysicalConnectivity.MODID && it.textureId.path.startsWith("block/cable/color/")) { + val newPath = it.textureId.path.replace("block/cable/color/", "block/cable/${color.getName()}/") + newId = SpriteIdentifier(it.atlasId, Identifier(PhysicalConnectivity.MODID, newPath)) + } + textureGetter.apply(newId) + } + return unbaked.bake(this, wrappedTextureGetter, rot, id)!! + } + + override fun getQuads(state: BlockState?, face: Direction?, random: Random): List { + if (state == null) { + return center.flatMap { + it?.getQuads(state, face, random) ?: listOf() + } + } + + val quads = mutableListOf() + + fun addModel(model: BakedModel?) { + if (model == null) return + quads.addAll(model.getQuads(state, face, random)) + } + + for ((side, prop) in CableBlock.CONNECTIONS) { + if (state[prop] == CableConnection.ON) { + addModel(this.side[side.ordinal]) + } else { + addModel(this.center[side.ordinal]) + } + } + + val down = state[CableBlock.CONNECTIONS[Direction.DOWN]] == CableConnection.ON + val up = state[CableBlock.CONNECTIONS[Direction.UP]] == CableConnection.ON + val north = state[CableBlock.CONNECTIONS[Direction.NORTH]] == CableConnection.ON + val south = state[CableBlock.CONNECTIONS[Direction.SOUTH]] == CableConnection.ON + val west = state[CableBlock.CONNECTIONS[Direction.WEST]] == CableConnection.ON + val east = state[CableBlock.CONNECTIONS[Direction.EAST]] == CableConnection.ON + + if (!down && !north) { + if (up && south && !east && !west) { + addModel(diagCornerCont[ModelRotation.X0_Y0]) + } else { + addModel(diagCorner[ModelRotation.X0_Y0]) + } + } + + if (!down && !south) { + if (up && north && !east && !west) { + addModel(diagCornerCont[ModelRotation.X0_Y180]) + } else { + addModel(diagCorner[ModelRotation.X0_Y180]) + } + } + + if (!up && !north) { + if (down && south && !east && !west) { + addModel(diagCornerCont[ModelRotation.X180_Y180]) + } else { + addModel(diagCorner[ModelRotation.X180_Y180]) + } + } + + if (!up && !south) { + if (down && north && !east && !west) { + addModel(diagCornerCont[ModelRotation.X180_Y0]) + } else { + addModel(diagCorner[ModelRotation.X180_Y0]) + } + } + + if (!down && !west) { + if (up && east && !north && !south) { + addModel(diagCornerCont[ModelRotation.X0_Y270]) + } else { + addModel(diagCorner[ModelRotation.X0_Y270]) + } + } + + if (!down && !east) { + if (up && west && !north && !south) { + addModel(diagCornerCont[ModelRotation.X0_Y90]) + } else { + addModel(diagCorner[ModelRotation.X0_Y90]) + } + } + + if (!up && !west) { + if (down && east && !north && !south) { + addModel(diagCornerCont[ModelRotation.X180_Y90]) + } else { + addModel(diagCorner[ModelRotation.X180_Y90]) + } + } + + if (!up && !east) { + if (down && west && !north && !south) { + addModel(diagCornerCont[ModelRotation.X180_Y270]) + } else { + addModel(diagCorner[ModelRotation.X180_Y270]) + } + } + + if (!north && !west) { + if (south && east && !down && !up) { + addModel(diagCornerXZCont[ModelRotation.X0_Y0]) + } else { + addModel(diagCornerXZ[ModelRotation.X0_Y0]) + } + } + + if (!north && !east) { + if (south && west && !down && !up) { + addModel(diagCornerXZCont[ModelRotation.X0_Y90]) + } else { + addModel(diagCornerXZ[ModelRotation.X0_Y90]) + } + } + + if (!south && !east) { + if (north && west && !down && !up) { + addModel(diagCornerXZCont[ModelRotation.X0_Y180]) + } else { + addModel(diagCornerXZ[ModelRotation.X0_Y180]) + } + } + + if (!south && !west) { + if (north && east && !down && !up) { + addModel(diagCornerXZCont[ModelRotation.X0_Y270]) + } else { + addModel(diagCornerXZ[ModelRotation.X0_Y270]) + } + } + + + return quads + } + + override fun useAmbientOcclusion() = true + + override fun hasDepth() = false + + override fun isSideLit() = false + + override fun isBuiltin() = false + + override fun getSprite() = centerSprite + + override fun getTransformation() = null + + override fun getOverrides() = null +} diff --git a/src/main/kotlin/net/shadowfacts/phycon/client/model/FaceDeviceModel.kt b/src/main/kotlin/net/shadowfacts/phycon/client/model/FaceDeviceModel.kt index 9706be1..fadfe75 100644 --- a/src/main/kotlin/net/shadowfacts/phycon/client/model/FaceDeviceModel.kt +++ b/src/main/kotlin/net/shadowfacts/phycon/client/model/FaceDeviceModel.kt @@ -89,7 +89,7 @@ abstract class FaceDeviceModel: UnbakedModel, BakedModel { } override fun getQuads(state: BlockState?, face: Direction?, random: Random): List { - if (state == null) return listOf() + if (state == null) return listOf() val facing = state[FaceDeviceBlock.FACING] val connection = state[FaceDeviceBlock.CABLE_CONNECTION] diff --git a/src/main/resources/assets/phycon/blockstates/cable.json b/src/main/resources/assets/phycon/blockstates/cable.json index 79227b6..03a690c 100644 --- a/src/main/resources/assets/phycon/blockstates/cable.json +++ b/src/main/resources/assets/phycon/blockstates/cable.json @@ -1,244 +1,7 @@ { "multipart": [ { - "when": { "down": "on" }, - "apply": { "model": "phycon:block/cable_side" } - }, - { - "when": { "up": "on" }, - "apply": { "model": "phycon:block/cable_side", "x": 180 } - }, - { - "when": { "north": "on" }, - "apply": { "model": "phycon:block/cable_side", "x": 270 } - }, - { - "when": { "south": "on" }, - "apply": { "model": "phycon:block/cable_side", "x": 90 } - }, - { - "when": { "west": "on" }, - "apply": { "model": "phycon:block/cable_side", "x": 90, "y": 90 } - }, - { - "when": { "east": "on" }, - "apply": { "model": "phycon:block/cable_side", "x": 90, "y": 270 } - }, - { - "when": { "down": "off|disabled" }, - "apply": { "model": "phycon:block/cable_center" } - }, - { - "when": { "up": "off|disabled" }, - "apply": { "model": "phycon:block/cable_center", "x": 180 } - }, - { - "when": { "north": "off|disabled" }, - "apply": { "model": "phycon:block/cable_center", "x": 270 } - }, - { - "when": { "south": "off|disabled" }, - "apply": { "model": "phycon:block/cable_center", "x": 90 } - }, - { - "when": { "west": "off|disabled" }, - "apply": { "model": "phycon:block/cable_center", "x": 90, "y": 90 } - }, - { - "when": { "east": "off|disabled" }, - "apply": { "model": "phycon:block/cable_center", "x": 90, "y": 270 } - }, - - { - "when": { - "OR": [ - { "down": "off|disabled", "north": "off|disabled", "up": "off|disabled" }, - { "down": "off|disabled", "north": "off|disabled", "south": "off|disabled" }, - { "down": "off|disabled", "north": "off|disabled", "east": "on" }, - { "down": "off|disabled", "north": "off|disabled", "west": "on" } - ] - }, - "apply": { "model": "phycon:block/cable_diag_corner" } - }, - { - "when": { "down": "off|disabled", "north": "off|disabled", "up": "on", "south": "on", "east": "off|disabled", "west": "off|disabled" }, - "apply": { "model": "phycon:block/cable_diag_corner_cont" } - }, - - { - "when": { - "OR": [ - { "down": "off|disabled", "south": "off|disabled", "up": "off|disabled" }, - { "down": "off|disabled", "south": "off|disabled", "north": "off|disabled" }, - { "down": "off|disabled", "south": "off|disabled", "east": "on" }, - { "down": "off|disabled", "south": "off|disabled", "west": "on" } - ] - }, - "apply": { "model": "phycon:block/cable_diag_corner", "y": 180 } - }, - { - "when": { "down": "off|disabled", "south": "off|disabled", "up": "on", "north": "on", "east": "off|disabled", "west": "off|disabled" }, - "apply": { "model": "phycon:block/cable_diag_corner_cont", "y": 180 } - }, - - { - "when": { - "OR": [ - { "up": "off|disabled", "north": "off|disabled", "down": "off|disabled" }, - { "up": "off|disabled", "north": "off|disabled", "south": "off|disabled" }, - { "up": "off|disabled", "north": "off|disabled", "east": "on" }, - { "up": "off|disabled", "north": "off|disabled", "west": "on" } - ] - }, - "apply": { "model": "phycon:block/cable_diag_corner", "x": 180, "y": 180 } - }, - { - "when": { "up": "off|disabled", "north": "off|disabled", "down": "on", "south": "on", "east": "off|disabled", "west": "off|disabled" }, - "apply": { "model": "phycon:block/cable_diag_corner_cont", "x": 180, "y": 180 } - }, - - { - "when": { - "OR": [ - { "up": "off|disabled", "south": "off|disabled", "down": "off|disabled" }, - { "up": "off|disabled", "south": "off|disabled", "north": "off|disabled" }, - { "up": "off|disabled", "south": "off|disabled", "east": "on" }, - { "up": "off|disabled", "south": "off|disabled", "west": "on" } - ] - }, - "apply": { "model": "phycon:block/cable_diag_corner", "x": 180 } - }, - { - "when": { "up": "off|disabled", "south": "off|disabled", "down": "on", "north": "on", "east": "off|disabled", "west": "off|disabled" }, - "apply": { "model": "phycon:block/cable_diag_corner_cont", "x": 180} - }, - - { - "when": { - "OR": [ - { "down": "off|disabled", "west": "off|disabled", "up": "off|disabled" }, - { "down": "off|disabled", "west": "off|disabled", "east": "off|disabled" }, - { "down": "off|disabled", "west": "off|disabled", "north": "on" }, - { "down": "off|disabled", "west": "off|disabled", "south": "on" } - ] - }, - "apply": { "model": "phycon:block/cable_diag_corner", "y": 270 } - }, - { - "when": { "down": "off|disabled", "west": "off|disabled", "up": "on", "east": "on", "north": "off|disabled", "south": "off|disabled" }, - "apply": { "model": "phycon:block/cable_diag_corner_cont", "y": 270 } - }, - - { - "when": { - "OR": [ - { "down": "off|disabled", "east": "off|disabled", "up": "off|disabled" }, - { "down": "off|disabled", "east": "off|disabled", "west": "off|disabled" }, - { "down": "off|disabled", "east": "off|disabled", "north": "on" }, - { "down": "off|disabled", "east": "off|disabled", "south": "on" } - ] - }, - "apply": { "model": "phycon:block/cable_diag_corner", "y": 90 } - }, - { - "when": { "down": "off|disabled", "east": "off|disabled", "up": "on", "west": "on", "north": "off|disabled", "south": "off|disabled" }, - "apply": { "model": "phycon:block/cable_diag_corner_cont", "y": 90 } - }, - - { - "when": { - "OR": [ - { "up": "off|disabled", "west": "off|disabled", "down": "off|disabled" }, - { "up": "off|disabled", "west": "off|disabled", "east": "off|disabled" }, - { "up": "off|disabled", "west": "off|disabled", "north": "on" }, - { "up": "off|disabled", "west": "off|disabled", "south": "on" } - ] - }, - "apply": { "model": "phycon:block/cable_diag_corner", "x": 180, "y": 90 } - }, - { - "when": { "up": "off|disabled", "west": "off|disabled", "down": "on", "east": "on", "north": "off|disabled", "south": "off|disabled" }, - "apply": { "model": "phycon:block/cable_diag_corner_cont", "x": 180, "y": 90 } - }, - - { - "when": { - "OR": [ - { "up": "off|disabled", "east": "off|disabled", "down": "off|disabled" }, - { "up": "off|disabled", "east": "off|disabled", "west": "off|disabled" }, - { "up": "off|disabled", "east": "off|disabled", "north": "on" }, - { "up": "off|disabled", "east": "off|disabled", "south": "on" } - ] - }, - "apply": { "model": "phycon:block/cable_diag_corner", "x": 180, "y": 270 } - }, - { - "when": { "up": "off|disabled", "east": "off|disabled", "down": "on", "west": "on", "north": "off|disabled", "south": "off|disabled" }, - "apply": { "model": "phycon:block/cable_diag_corner_cont", "x": 180, "y": 270 } - }, - - { - "when": { - "OR": [ - { "north": "off|disabled", "west": "off|disabled", "south": "off|disabled" }, - { "north": "off|disabled", "west": "off|disabled", "east": "off|disabled" }, - { "north": "off|disabled", "west": "off|disabled", "down": "on" }, - { "north": "off|disabled", "west": "off|disabled", "up": "on" } - ] - }, - "apply": { "model": "phycon:block/cable_diag_corner_xz" } - }, - { - "when": { "north": "off|disabled", "west": "off|disabled", "south": "on", "east": "on", "down": "off|disabled", "up": "off|disabled" }, - "apply": { "model": "phycon:block/cable_diag_corner_xz_cont" } - }, - - { - "when": { - "OR": [ - { "north": "off|disabled", "east": "off|disabled", "south": "off|disabled" }, - { "north": "off|disabled", "east": "off|disabled", "west": "off|disabled" }, - { "north": "off|disabled", "east": "off|disabled", "down": "on" }, - { "north": "off|disabled", "east": "off|disabled", "up": "on" } - ] - }, - "apply": { "model": "phycon:block/cable_diag_corner_xz", "y": 90 } - }, - { - "when": { "north": "off|disabled", "east": "off|disabled", "south": "on", "west": "on", "down": "off|disabled", "up": "off|disabled" }, - "apply": { "model": "phycon:block/cable_diag_corner_xz_cont", "y": 90 } - }, - - { - "when": { - "OR": [ - { "south": "off|disabled", "east": "off|disabled", "north": "off|disabled" }, - { "south": "off|disabled", "east": "off|disabled", "west": "off|disabled" }, - { "south": "off|disabled", "east": "off|disabled", "down": "on" }, - { "south": "off|disabled", "east": "off|disabled", "up": "on" } - ] - }, - "apply": { "model": "phycon:block/cable_diag_corner_xz", "y": 180 } - }, - { - "when": { "south": "off|disabled", "east": "off|disabled", "north": "on", "west": "on", "down": "off|disabled", "up": "off|disabled" }, - "apply": { "model": "phycon:block/cable_diag_corner_xz_cont", "y": 180 } - }, - - { - "when": { - "OR": [ - { "south": "off|disabled", "west": "off|disabled", "north": "off|disabled" }, - { "south": "off|disabled", "west": "off|disabled", "east": "off|disabled" }, - { "south": "off|disabled", "west": "off|disabled", "down": "on" }, - { "south": "off|disabled", "west": "off|disabled", "up": "on" } - ] - }, - "apply": { "model": "phycon:block/cable_diag_corner_xz", "y": 270 } - }, - { - "when": { "south": "off|disabled", "west": "off|disabled", "north": "on", "east": "on", "down": "off|disabled", "up": "off|disabled" }, - "apply": { "model": "phycon:block/cable_diag_corner_xz_cont", "y": 270 } + "apply": { "model": "phycon:block/cable/blue" } } ] } diff --git a/src/main/resources/assets/phycon/models/block/cable_center.json b/src/main/resources/assets/phycon/models/block/cable_center.json index cfda031..d12b434 100644 --- a/src/main/resources/assets/phycon/models/block/cable_center.json +++ b/src/main/resources/assets/phycon/models/block/cable_center.json @@ -1,6 +1,6 @@ { "textures": { - "center": "phycon:block/cable_cap_end", + "center": "phycon:block/cable/color/cap_end", "particle": "#center" }, "elements": [ diff --git a/src/main/resources/assets/phycon/models/block/cable_diag_corner.json b/src/main/resources/assets/phycon/models/block/cable_diag_corner.json index 26a0b18..a9c436b 100644 --- a/src/main/resources/assets/phycon/models/block/cable_diag_corner.json +++ b/src/main/resources/assets/phycon/models/block/cable_diag_corner.json @@ -1,6 +1,6 @@ { "textures": { - "corner": "phycon:block/cable_cap_end" + "corner": "phycon:block/cable/color/cap_end" }, "elements": [ { @@ -12,4 +12,4 @@ } } ] -} \ No newline at end of file +} diff --git a/src/main/resources/assets/phycon/models/block/cable_diag_corner_cont.json b/src/main/resources/assets/phycon/models/block/cable_diag_corner_cont.json index 1a39d22..56adc34 100644 --- a/src/main/resources/assets/phycon/models/block/cable_diag_corner_cont.json +++ b/src/main/resources/assets/phycon/models/block/cable_diag_corner_cont.json @@ -1,6 +1,6 @@ { "textures": { - "corner": "phycon:block/cable_straight" + "corner": "phycon:block/cable/color/straight" }, "elements": [ { @@ -12,4 +12,4 @@ } } ] -} \ No newline at end of file +} diff --git a/src/main/resources/assets/phycon/models/block/cable_diag_corner_xz.json b/src/main/resources/assets/phycon/models/block/cable_diag_corner_xz.json index 36c0c7a..01f870d 100644 --- a/src/main/resources/assets/phycon/models/block/cable_diag_corner_xz.json +++ b/src/main/resources/assets/phycon/models/block/cable_diag_corner_xz.json @@ -1,6 +1,6 @@ { "textures": { - "corner": "phycon:block/cable_cap_end" + "corner": "phycon:block/cable/color/cap_end" }, "elements": [ { @@ -12,4 +12,4 @@ } } ] -} \ No newline at end of file +} diff --git a/src/main/resources/assets/phycon/models/block/cable_diag_corner_xz_cont.json b/src/main/resources/assets/phycon/models/block/cable_diag_corner_xz_cont.json index 22833ed..d1d8e23 100644 --- a/src/main/resources/assets/phycon/models/block/cable_diag_corner_xz_cont.json +++ b/src/main/resources/assets/phycon/models/block/cable_diag_corner_xz_cont.json @@ -1,6 +1,6 @@ { "textures": { - "corner": "phycon:block/cable_straight_rotated" + "corner": "phycon:block/cable/color/straight_rotated" }, "elements": [ { @@ -12,4 +12,4 @@ } } ] -} \ No newline at end of file +} diff --git a/src/main/resources/assets/phycon/models/block/cable_side.json b/src/main/resources/assets/phycon/models/block/cable_side.json index aa0d460..337c5bf 100644 --- a/src/main/resources/assets/phycon/models/block/cable_side.json +++ b/src/main/resources/assets/phycon/models/block/cable_side.json @@ -1,7 +1,7 @@ { "parent": "block/block", "textures": { - "side": "phycon:block/cable_straight", + "side": "phycon:block/cable/color/straight", "particle": "#side" }, "elements": [ diff --git a/src/main/resources/assets/phycon/models/item/cable.json b/src/main/resources/assets/phycon/models/item/cable.json index d996f2a..abdda00 100644 --- a/src/main/resources/assets/phycon/models/item/cable.json +++ b/src/main/resources/assets/phycon/models/item/cable.json @@ -1,7 +1,7 @@ { "parent": "minecraft:block/block", "textures": { - "center": "phycon:block/cable_cap_end" + "center": "phycon:block/cable/blue/cap_end" }, "elements": [ { @@ -17,4 +17,4 @@ } } ] -} \ No newline at end of file +} diff --git a/src/main/resources/assets/phycon/textures/block/cable_cap_end.png b/src/main/resources/assets/phycon/textures/block/cable/blue/cap_end.png similarity index 100% rename from src/main/resources/assets/phycon/textures/block/cable_cap_end.png rename to src/main/resources/assets/phycon/textures/block/cable/blue/cap_end.png diff --git a/src/main/resources/assets/phycon/textures/block/cable_straight.png b/src/main/resources/assets/phycon/textures/block/cable/blue/straight.png similarity index 100% rename from src/main/resources/assets/phycon/textures/block/cable_straight.png rename to src/main/resources/assets/phycon/textures/block/cable/blue/straight.png diff --git a/src/main/resources/assets/phycon/textures/block/cable_straight_rotated.png b/src/main/resources/assets/phycon/textures/block/cable/blue/straight_rotated.png similarity index 100% rename from src/main/resources/assets/phycon/textures/block/cable_straight_rotated.png rename to src/main/resources/assets/phycon/textures/block/cable/blue/straight_rotated.png