From 32d87fbd9da168869d4277c7a5677a84934dd8bc Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 6 Mar 2021 15:32:38 -0500 Subject: [PATCH] Convert Redstone Controller and Emitter to use FaceDeviceModel --- .../phycon/block/DeviceBlockEntity.kt | 7 +- .../phycon/client/PhyModelProvider.kt | 11 +- .../{InterfaceModel.kt => FaceDeviceModel.kt} | 40 ++-- .../client/model/RedstoneControllerModel.kt | 45 +++++ .../client/model/SimpleFaceDeviceModel.kt | 35 ++++ .../phycon/blockstates/network_interface.json | 2 +- .../blockstates/redstone_controller.json | 179 +----------------- .../phycon/blockstates/redstone_emitter.json | 154 +-------------- .../block/redstone_controller_side_off.json | 3 +- .../block/redstone_controller_side_on.json | 3 +- 10 files changed, 122 insertions(+), 357 deletions(-) rename src/main/kotlin/net/shadowfacts/phycon/client/model/{InterfaceModel.kt => FaceDeviceModel.kt} (87%) create mode 100644 src/main/kotlin/net/shadowfacts/phycon/client/model/RedstoneControllerModel.kt create mode 100644 src/main/kotlin/net/shadowfacts/phycon/client/model/SimpleFaceDeviceModel.kt diff --git a/src/main/kotlin/net/shadowfacts/phycon/block/DeviceBlockEntity.kt b/src/main/kotlin/net/shadowfacts/phycon/block/DeviceBlockEntity.kt index 0a30c12..d1cf930 100644 --- a/src/main/kotlin/net/shadowfacts/phycon/block/DeviceBlockEntity.kt +++ b/src/main/kotlin/net/shadowfacts/phycon/block/DeviceBlockEntity.kt @@ -119,10 +119,11 @@ abstract class DeviceBlockEntity(type: BlockEntityType<*>): BlockEntity(type), open fun findDestination(): Interface? { val sides = (cachedState.block as NetworkComponentBlock).getNetworkConnectedSides(cachedState, world!!, pos) - if (sides.size != 1) { - throw RuntimeException("DeviceBlockEntity.findDestination must be overridden by devices which have more than 1 network connected side") + return when (sides.size) { + 0 -> null + 1 -> NetworkUtil.findConnectedInterface(world!!, pos, sides.first()) + else -> throw RuntimeException("DeviceBlockEntity.findDestination must be overridden by devices which have more than 1 network connected side") } - return NetworkUtil.findConnectedInterface(world!!, pos, sides.first()) } override fun tick() { diff --git a/src/main/kotlin/net/shadowfacts/phycon/client/PhyModelProvider.kt b/src/main/kotlin/net/shadowfacts/phycon/client/PhyModelProvider.kt index ba8efcc..2af7267 100644 --- a/src/main/kotlin/net/shadowfacts/phycon/client/PhyModelProvider.kt +++ b/src/main/kotlin/net/shadowfacts/phycon/client/PhyModelProvider.kt @@ -6,7 +6,8 @@ import net.minecraft.client.render.model.UnbakedModel import net.minecraft.resource.ResourceManager import net.minecraft.util.Identifier import net.shadowfacts.phycon.PhysicalConnectivity -import net.shadowfacts.phycon.client.model.InterfaceModel +import net.shadowfacts.phycon.client.model.RedstoneControllerModel +import net.shadowfacts.phycon.client.model.SimpleFaceDeviceModel /** * @author shadowfacts @@ -14,11 +15,17 @@ import net.shadowfacts.phycon.client.model.InterfaceModel class PhyModelProvider(resourceManager: ResourceManager) : ModelResourceProvider { companion object { val INTERFACE = Identifier(PhysicalConnectivity.MODID, "block/network_interface") + val INTERFACE_SIDE = Identifier(PhysicalConnectivity.MODID, "block/interface_side") + val REDSTONE_CONTROLLER = Identifier(PhysicalConnectivity.MODID, "block/redstone_controller") + val REDSTONE_EMITTER = Identifier(PhysicalConnectivity.MODID, "block/redstone_emitter") + val REDSTONE_EMITTER_SIDE = Identifier(PhysicalConnectivity.MODID, "block/redstone_emitter_side") } override fun loadModelResource(resourceId: Identifier, context: ModelProviderContext): UnbakedModel? { return when (resourceId) { - INTERFACE -> InterfaceModel + INTERFACE -> SimpleFaceDeviceModel(INTERFACE_SIDE) + REDSTONE_CONTROLLER -> RedstoneControllerModel + REDSTONE_EMITTER -> SimpleFaceDeviceModel(REDSTONE_EMITTER_SIDE) else -> null } } diff --git a/src/main/kotlin/net/shadowfacts/phycon/client/model/InterfaceModel.kt b/src/main/kotlin/net/shadowfacts/phycon/client/model/FaceDeviceModel.kt similarity index 87% rename from src/main/kotlin/net/shadowfacts/phycon/client/model/InterfaceModel.kt rename to src/main/kotlin/net/shadowfacts/phycon/client/model/FaceDeviceModel.kt index eecdb99..bf0c97c 100644 --- a/src/main/kotlin/net/shadowfacts/phycon/client/model/InterfaceModel.kt +++ b/src/main/kotlin/net/shadowfacts/phycon/client/model/FaceDeviceModel.kt @@ -15,22 +15,32 @@ import java.util.function.Function /** * @author shadowfacts */ -object InterfaceModel: UnbakedModel, BakedModel { +abstract class FaceDeviceModel: UnbakedModel, BakedModel { - private val interfaceSideID = Identifier(PhysicalConnectivity.MODID, "block/interface_side") private val interfaceCableStraightID = Identifier(PhysicalConnectivity.MODID, "block/interface_cable_straight") private val interfaceCableCornerID = Identifier(PhysicalConnectivity.MODID, "block/interface_cable_corner") private val interfaceCableCorner2ID = Identifier(PhysicalConnectivity.MODID, "block/interface_cable_corner_2") private val interfaceCableCapID = Identifier(PhysicalConnectivity.MODID, "block/interface_cable_cap") - private var interfaceSides = Array(6) { null } private var interfaceCableStraight = Array(6) { null } private var interfaceCableCap = Array(6) { null } private var interfaceCableCorner = mutableMapOf() private var interfaceCableCorner2 = mutableMapOf() + protected val defaultRotations = listOf( + ModelRotation.X0_Y0, + ModelRotation.X180_Y0, + ModelRotation.X270_Y0, + ModelRotation.X90_Y0, + ModelRotation.X90_Y90, + ModelRotation.X90_Y270, + ) + + abstract fun getSideModelIDs(): Collection + abstract fun bakeSideModels(loader: ModelLoader) + abstract fun getSideModel(state: BlockState): BakedModel? + override fun getModelDependencies(): Collection { - return listOf( - interfaceSideID, + return getSideModelIDs() + listOf( interfaceCableStraightID, interfaceCableCornerID, interfaceCableCorner2ID, @@ -42,19 +52,13 @@ object InterfaceModel: UnbakedModel, BakedModel { unbakedModelGetter: Function, unresolvedTextureReferences: MutableSet> ): Collection { - return listOf() + return modelDependencies.map(unbakedModelGetter::apply).flatMap { it.getTextureDependencies(unbakedModelGetter, unresolvedTextureReferences) } } override fun bake(loader: ModelLoader, textureGetter: Function, rotationContainer: ModelBakeSettings, modelId: Identifier): BakedModel { - listOf( - ModelRotation.X0_Y0, - ModelRotation.X180_Y0, - ModelRotation.X270_Y0, - ModelRotation.X90_Y0, - ModelRotation.X90_Y90, - ModelRotation.X90_Y270, - ).forEachIndexed { i, rot -> - interfaceSides[i] = loader.bake(interfaceSideID, rot) + bakeSideModels(loader) + + defaultRotations.forEachIndexed { i, rot -> interfaceCableStraight[i] = loader.bake(interfaceCableStraightID, rot) interfaceCableCap[i] = loader.bake(interfaceCableCapID, rot) } @@ -89,7 +93,7 @@ object InterfaceModel: UnbakedModel, BakedModel { val facing = state[FaceDeviceBlock.FACING] val connection = state[FaceDeviceBlock.CABLE_CONNECTION] - val sideQuads = interfaceSides[facing.ordinal]?.getQuads(state, face, random) ?: listOf() + val sideQuads = getSideModel(state)?.getQuads(state, face, random) ?: listOf() val cableQuads = if (connection.direction == facing.opposite) { interfaceCableStraight[facing.ordinal]?.getQuads(state, face, random) ?: listOf() } else if (connection == FaceCableConnection.NONE) { @@ -154,9 +158,7 @@ object InterfaceModel: UnbakedModel, BakedModel { override fun isBuiltin() = false - override fun getSprite(): Sprite { - return interfaceSides.first()!!.sprite - } + abstract override fun getSprite(): Sprite override fun getTransformation() = null diff --git a/src/main/kotlin/net/shadowfacts/phycon/client/model/RedstoneControllerModel.kt b/src/main/kotlin/net/shadowfacts/phycon/client/model/RedstoneControllerModel.kt new file mode 100644 index 0000000..0b71f40 --- /dev/null +++ b/src/main/kotlin/net/shadowfacts/phycon/client/model/RedstoneControllerModel.kt @@ -0,0 +1,45 @@ +package net.shadowfacts.phycon.client.model + +import net.minecraft.block.BlockState +import net.minecraft.client.render.model.BakedModel +import net.minecraft.client.render.model.ModelLoader +import net.minecraft.client.texture.Sprite +import net.minecraft.util.Identifier +import net.shadowfacts.phycon.PhysicalConnectivity +import net.shadowfacts.phycon.block.FaceDeviceBlock +import net.shadowfacts.phycon.block.redstone_controller.RedstoneControllerBlock + +/** + * @author shadowfacts + */ +object RedstoneControllerModel: FaceDeviceModel() { + + private val ON = Identifier(PhysicalConnectivity.MODID, "block/redstone_controller_side_on") + private val OFF = Identifier(PhysicalConnectivity.MODID, "block/redstone_controller_side_off") + private val onModels = Array(6) { null } + private val offModels = Array(6) { null } + + override fun getSideModelIDs(): Collection { + return listOf(ON, OFF) + } + + override fun bakeSideModels(loader: ModelLoader) { + defaultRotations.forEachIndexed { i, rot -> + onModels[i] = loader.bake(ON, rot) + offModels[i] = loader.bake(OFF, rot) + } + } + + override fun getSideModel(state: BlockState): BakedModel? { + return if (state[RedstoneControllerBlock.POWERED]) { + onModels[state[FaceDeviceBlock.FACING].ordinal] + } else { + offModels[state[FaceDeviceBlock.FACING].ordinal] + } + } + + override fun getSprite(): Sprite { + return offModels.first()!!.sprite + } + +} diff --git a/src/main/kotlin/net/shadowfacts/phycon/client/model/SimpleFaceDeviceModel.kt b/src/main/kotlin/net/shadowfacts/phycon/client/model/SimpleFaceDeviceModel.kt new file mode 100644 index 0000000..bc9ca05 --- /dev/null +++ b/src/main/kotlin/net/shadowfacts/phycon/client/model/SimpleFaceDeviceModel.kt @@ -0,0 +1,35 @@ +package net.shadowfacts.phycon.client.model + +import net.minecraft.block.BlockState +import net.minecraft.client.render.model.BakedModel +import net.minecraft.client.render.model.ModelLoader +import net.minecraft.client.texture.Sprite +import net.minecraft.util.Identifier +import net.shadowfacts.phycon.block.FaceDeviceBlock + +/** + * @author shadowfacts + */ +class SimpleFaceDeviceModel( + private val sideModelID: Identifier, +): FaceDeviceModel() { + private val sideModels = Array(6) { null } + + override fun getSideModelIDs(): Collection { + return listOf(sideModelID) + } + + override fun bakeSideModels(loader: ModelLoader) { + defaultRotations.forEachIndexed { i, rot -> + sideModels[i] = loader.bake(sideModelID, rot) + } + } + + override fun getSideModel(state: BlockState): BakedModel? { + return sideModels[state[FaceDeviceBlock.FACING].ordinal] + } + + override fun getSprite(): Sprite { + return sideModels.first()!!.sprite + } +} diff --git a/src/main/resources/assets/phycon/blockstates/network_interface.json b/src/main/resources/assets/phycon/blockstates/network_interface.json index 8c4e294..3f5cb0a 100644 --- a/src/main/resources/assets/phycon/blockstates/network_interface.json +++ b/src/main/resources/assets/phycon/blockstates/network_interface.json @@ -1,7 +1,7 @@ { "multipart": [ { - "_comment": "see InterfaceModel", + "_comment": "see SimpleFaceDeviceModel", "apply": { "model": "phycon:block/network_interface" } } ] diff --git a/src/main/resources/assets/phycon/blockstates/redstone_controller.json b/src/main/resources/assets/phycon/blockstates/redstone_controller.json index 4eedd42..0b4149f 100644 --- a/src/main/resources/assets/phycon/blockstates/redstone_controller.json +++ b/src/main/resources/assets/phycon/blockstates/redstone_controller.json @@ -1,183 +1,8 @@ { "multipart": [ { - "apply": { "model": "phycon:block/cable_center" } - }, - { - "when": { "facing": "down", "powered": "false" }, - "apply": { "model": "phycon:block/redstone_controller_side_off" } - }, - { - "when": { "facing": "up", "powered": "false" }, - "apply": { "model": "phycon:block/redstone_controller_side_off", "x": 180 } - }, - { - "when": { "facing": "north", "powered": "false" }, - "apply": { "model": "phycon:block/redstone_controller_side_off", "x": 270 } - }, - { - "when": { "facing": "south", "powered": "false" }, - "apply": { "model": "phycon:block/redstone_controller_side_off", "x": 90 } - }, - { - "when": { "facing": "west", "powered": "false" }, - "apply": { "model": "phycon:block/redstone_controller_side_off", "x": 90, "y": 90 } - }, - { - "when": { "facing": "east", "powered": "false" }, - "apply": { "model": "phycon:block/redstone_controller_side_off", "x": 90, "y": 270 } - }, - { - "when": { "facing": "down", "powered": "true" }, - "apply": { "model": "phycon:block/redstone_controller_side_on" } - }, - { - "when": { "facing": "up", "powered": "true" }, - "apply": { "model": "phycon:block/redstone_controller_side_on", "x": 180 } - }, - { - "when": { "facing": "north", "powered": "true" }, - "apply": { "model": "phycon:block/redstone_controller_side_on", "x": 270 } - }, - { - "when": { "facing": "south", "powered": "true" }, - "apply": { "model": "phycon:block/redstone_controller_side_on", "x": 90 } - }, - { - "when": { "facing": "west", "powered": "true" }, - "apply": { "model": "phycon:block/redstone_controller_side_on", "x": 90, "y": 90 } - }, - { - "when": { "facing": "east", "powered": "true" }, - "apply": { "model": "phycon:block/redstone_controller_side_on", "x": 90, "y": 270 } - }, - - { - "when": { "cable_connection": "up", "facing": "down" }, - "apply": { "model": "phycon:block/interface_cable_straight" } - }, - { - "when": { "cable_connection": "down", "facing": "up" }, - "apply": { "model": "phycon:block/interface_cable_straight", "x": 180 } - }, - { - "when": { "cable_connection": "north", "facing": "south" }, - "apply": { "model": "phycon:block/interface_cable_straight", "x": 90 } - }, - { - "when": { "cable_connection": "south", "facing": "north" }, - "apply": { "model": "phycon:block/interface_cable_straight", "x": 270 } - }, - { - "when": { "cable_connection": "west", "facing": "east" }, - "apply": { "model": "phycon:block/interface_cable_straight", "x": 90, "y": 270 } - }, - { - "when": { "cable_connection": "east", "facing": "west" }, - "apply": { "model": "phycon:block/interface_cable_straight", "x": 90, "y": 90 } - }, - - { - "when": {"cable_connection": "north", "facing": "down"}, - "apply": { "model": "phycon:block/interface_cable_corner" } - }, - { - "when": {"cable_connection": "east", "facing": "down"}, - "apply": { "model": "phycon:block/interface_cable_corner", "y": 90 } - }, - { - "when": {"cable_connection": "south", "facing": "down"}, - "apply": { "model": "phycon:block/interface_cable_corner", "y": 180 } - }, - { - "when": {"cable_connection": "west", "facing": "down"}, - "apply": { "model": "phycon:block/interface_cable_corner", "y": 270 } - }, - - { - "when": {"cable_connection": "north", "facing": "up"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 180, "y": 180 } - }, - { - "when": {"cable_connection": "east", "facing": "up"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 180, "y": 270 } - }, - { - "when": {"cable_connection": "south", "facing": "up"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 180 } - }, - { - "when": {"cable_connection": "west", "facing": "up"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 180, "y": 90 } - }, - - { - "when": {"cable_connection": "down", "facing": "north"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 90, "y": 180 } - }, - { - "when": {"cable_connection": "up", "facing": "north"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 270 } - }, - { - "when": {"cable_connection": "west", "facing": "north"}, - "apply": { "model": "phycon:block/interface_cable_corner_2" } - }, - { - "when": {"cable_connection": "east", "facing": "north"}, - "apply": { "model": "phycon:block/interface_cable_corner_2", "x": 180, "y": 180 } - }, - - { - "when": {"cable_connection": "down", "facing": "south"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 90 } - }, - { - "when": {"cable_connection": "up", "facing": "south"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 270, "y": 180 } - }, - { - "when": {"cable_connection": "west", "facing": "south"}, - "apply": { "model": "phycon:block/interface_cable_corner_3" } - }, - { - "when": {"cable_connection": "east", "facing": "south"}, - "apply": { "model": "phycon:block/interface_cable_corner_3", "x": 180, "y": 180 } - }, - - { - - "when": {"cable_connection": "down", "facing": "west"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 90, "y": 90 } - }, - { - "when": {"cable_connection": "up", "facing": "west"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 270, "y": 270 } - }, - { - "when": {"cable_connection": "north", "facing": "west"}, - "apply": { "model": "phycon:block/interface_cable_corner_3", "y": 90 } - }, - { - "when": {"cable_connection": "south", "facing": "west"}, - "apply": { "model": "phycon:block/interface_cable_corner_3", "x": 180, "y": 270 } - }, - - { - "when": {"cable_connection": "down", "facing": "east"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 90, "y": 270 } - }, - { - "when": {"cable_connection": "up", "facing": "east"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 270, "y": 90 } - }, - { - "when": {"cable_connection": "north", "facing": "east"}, - "apply": { "model": "phycon:block/interface_cable_corner_2", "y": 90 } - }, - { - "when": {"cable_connection": "south", "facing": "east"}, - "apply": { "model": "phycon:block/interface_cable_corner_2", "x": 180, "y": 270 } + "_comment": "see RedstoneControllerModel", + "apply": { "model": "phycon:block/redstone_controller" } } ] } diff --git a/src/main/resources/assets/phycon/blockstates/redstone_emitter.json b/src/main/resources/assets/phycon/blockstates/redstone_emitter.json index 2165037..42c117c 100644 --- a/src/main/resources/assets/phycon/blockstates/redstone_emitter.json +++ b/src/main/resources/assets/phycon/blockstates/redstone_emitter.json @@ -1,159 +1,7 @@ { "multipart": [ { - "apply": { "model": "phycon:block/cable_center" } - }, - { - "when": { "facing": "down" }, - "apply": { "model": "phycon:block/redstone_emitter_side" } - }, - { - "when": { "facing": "up" }, - "apply": { "model": "phycon:block/redstone_emitter_side", "x": 180 } - }, - { - "when": { "facing": "north" }, - "apply": { "model": "phycon:block/redstone_emitter_side", "x": 270 } - }, - { - "when": { "facing": "south" }, - "apply": { "model": "phycon:block/redstone_emitter_side", "x": 90 } - }, - { - "when": { "facing": "west" }, - "apply": { "model": "phycon:block/redstone_emitter_side", "x": 90, "y": 90 } - }, - { - "when": { "facing": "east" }, - "apply": { "model": "phycon:block/redstone_emitter_side", "x": 90, "y": 270 } - }, - - { - "when": { "cable_connection": "up", "facing": "down" }, - "apply": { "model": "phycon:block/interface_cable_straight" } - }, - { - "when": { "cable_connection": "down", "facing": "up" }, - "apply": { "model": "phycon:block/interface_cable_straight", "x": 180 } - }, - { - "when": { "cable_connection": "north", "facing": "south" }, - "apply": { "model": "phycon:block/interface_cable_straight", "x": 90 } - }, - { - "when": { "cable_connection": "south", "facing": "north" }, - "apply": { "model": "phycon:block/interface_cable_straight", "x": 270 } - }, - { - "when": { "cable_connection": "west", "facing": "east" }, - "apply": { "model": "phycon:block/interface_cable_straight", "x": 90, "y": 270 } - }, - { - "when": { "cable_connection": "east", "facing": "west" }, - "apply": { "model": "phycon:block/interface_cable_straight", "x": 90, "y": 90 } - }, - - { - "when": {"cable_connection": "north", "facing": "down"}, - "apply": { "model": "phycon:block/interface_cable_corner" } - }, - { - "when": {"cable_connection": "east", "facing": "down"}, - "apply": { "model": "phycon:block/interface_cable_corner", "y": 90 } - }, - { - "when": {"cable_connection": "south", "facing": "down"}, - "apply": { "model": "phycon:block/interface_cable_corner", "y": 180 } - }, - { - "when": {"cable_connection": "west", "facing": "down"}, - "apply": { "model": "phycon:block/interface_cable_corner", "y": 270 } - }, - - { - "when": {"cable_connection": "north", "facing": "up"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 180, "y": 180 } - }, - { - "when": {"cable_connection": "east", "facing": "up"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 180, "y": 270 } - }, - { - "when": {"cable_connection": "south", "facing": "up"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 180 } - }, - { - "when": {"cable_connection": "west", "facing": "up"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 180, "y": 90 } - }, - - { - "when": {"cable_connection": "down", "facing": "north"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 90, "y": 180 } - }, - { - "when": {"cable_connection": "up", "facing": "north"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 270 } - }, - { - "when": {"cable_connection": "west", "facing": "north"}, - "apply": { "model": "phycon:block/interface_cable_corner_2" } - }, - { - "when": {"cable_connection": "east", "facing": "north"}, - "apply": { "model": "phycon:block/interface_cable_corner_2", "x": 180, "y": 180 } - }, - - { - "when": {"cable_connection": "down", "facing": "south"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 90 } - }, - { - "when": {"cable_connection": "up", "facing": "south"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 270, "y": 180 } - }, - { - "when": {"cable_connection": "west", "facing": "south"}, - "apply": { "model": "phycon:block/interface_cable_corner_3" } - }, - { - "when": {"cable_connection": "east", "facing": "south"}, - "apply": { "model": "phycon:block/interface_cable_corner_3", "x": 180, "y": 180 } - }, - - { - - "when": {"cable_connection": "down", "facing": "west"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 90, "y": 90 } - }, - { - "when": {"cable_connection": "up", "facing": "west"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 270, "y": 270 } - }, - { - "when": {"cable_connection": "north", "facing": "west"}, - "apply": { "model": "phycon:block/interface_cable_corner_3", "y": 90 } - }, - { - "when": {"cable_connection": "south", "facing": "west"}, - "apply": { "model": "phycon:block/interface_cable_corner_3", "x": 180, "y": 270 } - }, - - { - "when": {"cable_connection": "down", "facing": "east"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 90, "y": 270 } - }, - { - "when": {"cable_connection": "up", "facing": "east"}, - "apply": { "model": "phycon:block/interface_cable_corner", "x": 270, "y": 90 } - }, - { - "when": {"cable_connection": "north", "facing": "east"}, - "apply": { "model": "phycon:block/interface_cable_corner_2", "y": 90 } - }, - { - "when": {"cable_connection": "south", "facing": "east"}, - "apply": { "model": "phycon:block/interface_cable_corner_2", "x": 180, "y": 270 } + "apply": { "model": "phycon:block/redstone_emitter" } } ] } diff --git a/src/main/resources/assets/phycon/models/block/redstone_controller_side_off.json b/src/main/resources/assets/phycon/models/block/redstone_controller_side_off.json index 2c26a3b..437125f 100644 --- a/src/main/resources/assets/phycon/models/block/redstone_controller_side_off.json +++ b/src/main/resources/assets/phycon/models/block/redstone_controller_side_off.json @@ -4,7 +4,8 @@ "cable": "phycon:block/cable_straight", "front": "phycon:block/redstone_controller_front_off", "back": "phycon:block/redstone_controller_back", - "side": "phycon:block/redstone_controller_back" + "side": "phycon:block/redstone_controller_back", + "particle": "#front" }, "elements": [ { diff --git a/src/main/resources/assets/phycon/models/block/redstone_controller_side_on.json b/src/main/resources/assets/phycon/models/block/redstone_controller_side_on.json index 65b44a4..8da9e54 100644 --- a/src/main/resources/assets/phycon/models/block/redstone_controller_side_on.json +++ b/src/main/resources/assets/phycon/models/block/redstone_controller_side_on.json @@ -4,7 +4,8 @@ "cable": "phycon:block/cable_straight", "front": "phycon:block/redstone_controller_front_on", "back": "phycon:block/redstone_controller_back", - "side": "phycon:block/redstone_controller_back" + "side": "phycon:block/redstone_controller_back", + "particle": "#front" }, "elements": [ {