Compare commits
4 Commits
9305b1e0ef
...
611c4bb0ae
Author | SHA1 | Date |
---|---|---|
Shadowfacts | 611c4bb0ae | |
Shadowfacts | 4ab6dbbf38 | |
Shadowfacts | f536bf72a9 | |
Shadowfacts | a86058f8bd |
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
base_color=blue
|
||||
|
||||
modulate() {
|
||||
echo $1, $2
|
||||
mkdir -p src/main/resources/assets/phycon/textures/block/cable/$1
|
||||
for f in src/main/resources/assets/phycon/textures/block/cable/$base_color/*; do
|
||||
echo $f
|
||||
convert $f -modulate $2 src/main/resources/assets/phycon/textures/block/cable/$1/$(basename $f)
|
||||
done
|
||||
echo "---"
|
||||
}
|
||||
|
||||
# modulate <color> <brightness>,<saturation>,<hue>
|
||||
# brightness: 100 is initial, +/- 100
|
||||
# saturnation: 100 is initial, +/- 100
|
||||
# hue: (<gimp hue> / 180) * 100 + 100
|
||||
|
||||
modulate white 200,0,100
|
||||
modulate orange 100,120,200
|
||||
modulate magenta 100,100,146
|
||||
modulate light_blue 140,65,100
|
||||
modulate yellow 100,109,8
|
||||
modulate lime 100,100,53
|
||||
modulate pink 172,50,172
|
||||
modulate gray 60,10,100
|
||||
modulate light_gray 105,3,39
|
||||
modulate cyan 112,65,84
|
||||
modulate purple 109,76,133
|
||||
modulate brown 60,45,190
|
||||
modulate green 60,50,30
|
||||
modulate red 100,100,176
|
||||
modulate black 30,0,100
|
||||
|
|
@ -8,6 +8,7 @@ import net.minecraft.item.ItemPlacementContext
|
|||
import net.minecraft.state.StateManager
|
||||
import net.minecraft.state.property.EnumProperty
|
||||
import net.minecraft.util.ActionResult
|
||||
import net.minecraft.util.DyeColor
|
||||
import net.minecraft.util.Hand
|
||||
import net.minecraft.util.Identifier
|
||||
import net.minecraft.util.hit.BlockHitResult
|
||||
|
@ -32,7 +33,9 @@ import java.util.*
|
|||
/**
|
||||
* @author shadowfacts
|
||||
*/
|
||||
class CableBlock: Block(
|
||||
class CableBlock(
|
||||
val color: DyeColor,
|
||||
): Block(
|
||||
FabricBlockSettings.of(CABLE_MATERIAL)
|
||||
.strength(0.3f)
|
||||
.nonOpaque()
|
||||
|
@ -112,22 +115,20 @@ class CableBlock: Block(
|
|||
val offsetPos = pos.offset(direction)
|
||||
val state = world.getBlockState(offsetPos)
|
||||
val block = state.block
|
||||
return when (block) {
|
||||
this -> {
|
||||
val prop = CONNECTIONS[direction.opposite]
|
||||
when (state[prop]) {
|
||||
CableConnection.DISABLED -> CableConnection.DISABLED
|
||||
else -> CableConnection.ON
|
||||
}
|
||||
return if (block == this) {
|
||||
val prop = CONNECTIONS[direction.opposite]
|
||||
when (state[prop]) {
|
||||
CableConnection.DISABLED -> CableConnection.DISABLED
|
||||
else -> CableConnection.ON
|
||||
}
|
||||
is NetworkComponentBlock -> {
|
||||
if (block.getNetworkConnectedSides(state, world, offsetPos).contains(direction.opposite)) {
|
||||
CableConnection.ON
|
||||
} else {
|
||||
CableConnection.OFF
|
||||
}
|
||||
} else if (block is NetworkComponentBlock && block !is CableBlock) {
|
||||
if (block.getNetworkConnectedSides(state, world, offsetPos).contains(direction.opposite)) {
|
||||
CableConnection.ON
|
||||
} else {
|
||||
CableConnection.OFF
|
||||
}
|
||||
else -> CableConnection.OFF
|
||||
} else {
|
||||
CableConnection.OFF
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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,10 @@ 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 CABLES = DyeColor.values().map {
|
||||
Identifier(PhysicalConnectivity.MODID, "block/cable/${it.getName()}") to it
|
||||
}.toMap()
|
||||
}
|
||||
|
||||
override fun loadModelResource(resourceId: Identifier, context: ModelProviderContext): UnbakedModel? {
|
||||
|
@ -32,6 +38,7 @@ class PhyModelProvider(resourceManager: ResourceManager) : ModelResourceProvider
|
|||
REDSTONE_EMITTER -> SimpleFaceDeviceModel(REDSTONE_EMITTER_SIDE)
|
||||
EXTRACTOR -> SimpleFaceDeviceModel(EXTRACTOR_SIDE)
|
||||
INSERTER -> SimpleFaceDeviceModel(INSERTER_SIDE)
|
||||
in CABLES -> ColoredCableModel(CABLES[resourceId]!!)
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<BakedModel?> = Array(6) { null }
|
||||
private var center: Array<BakedModel?> = Array(6) { null }
|
||||
private var diagCorner = mutableMapOf<ModelRotation, BakedModel>()
|
||||
private var diagCornerCont = mutableMapOf<ModelRotation, BakedModel>()
|
||||
private var diagCornerXZ = mutableMapOf<ModelRotation, BakedModel>()
|
||||
private var diagCornerXZCont = mutableMapOf<ModelRotation, BakedModel>()
|
||||
|
||||
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<Identifier> {
|
||||
return setOf(
|
||||
SIDE,
|
||||
CENTER,
|
||||
DIAG_CORNER,
|
||||
DIAG_CORNER_CONT,
|
||||
DIAG_CORNER_XZ,
|
||||
DIAG_CORNER_XZ_CONT,
|
||||
)
|
||||
}
|
||||
|
||||
override fun getTextureDependencies(
|
||||
unbakedModelGetter: Function<Identifier, UnbakedModel>,
|
||||
unresolvedTextureDependencies: MutableSet<Pair<String, String>>
|
||||
): Collection<SpriteIdentifier> {
|
||||
val newSet = mutableSetOf<Pair<String, String>>()
|
||||
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<SpriteIdentifier, Sprite>,
|
||||
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<SpriteIdentifier, Sprite>, 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<BakedQuad> {
|
||||
if (state == null) {
|
||||
return center.flatMap {
|
||||
it?.getQuads(state, face, random) ?: listOf()
|
||||
}
|
||||
}
|
||||
|
||||
val quads = mutableListOf<BakedQuad>()
|
||||
|
||||
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
|
||||
}
|
|
@ -89,7 +89,7 @@ abstract class FaceDeviceModel: UnbakedModel, BakedModel {
|
|||
}
|
||||
|
||||
override fun getQuads(state: BlockState?, face: Direction?, random: Random): List<BakedQuad> {
|
||||
if (state == null) return listOf()
|
||||
if (state == null) return listOf()
|
||||
val facing = state[FaceDeviceBlock.FACING]
|
||||
val connection = state[FaceDeviceBlock.CABLE_CONNECTION]
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package net.shadowfacts.phycon.init
|
||||
|
||||
import net.minecraft.block.Block
|
||||
import net.minecraft.util.DyeColor
|
||||
import net.minecraft.util.Identifier
|
||||
import net.minecraft.util.registry.Registry
|
||||
import net.shadowfacts.phycon.PhysicalConnectivity
|
||||
import net.shadowfacts.phycon.block.cable.CableBlock
|
||||
import net.shadowfacts.phycon.block.extractor.ExtractorBlock
|
||||
import net.shadowfacts.phycon.block.inserter.InserterBlock
|
||||
|
@ -18,10 +20,11 @@ import net.shadowfacts.phycon.block.terminal.TerminalBlock
|
|||
*/
|
||||
object PhyBlocks {
|
||||
|
||||
val CABLES = DyeColor.values().map { it to CableBlock(it) }.toMap()
|
||||
|
||||
val INTERFACE = InterfaceBlock()
|
||||
val TERMINAL = TerminalBlock()
|
||||
val SWITCH = SwitchBlock()
|
||||
val CABLE = CableBlock()
|
||||
val EXTRACTOR = ExtractorBlock()
|
||||
val INSERTER = InserterBlock()
|
||||
val MINER = MinerBlock()
|
||||
|
@ -29,10 +32,13 @@ object PhyBlocks {
|
|||
val REDSTONE_EMITTER = RedstoneEmitterBlock()
|
||||
|
||||
fun init() {
|
||||
for ((color, block) in CABLES) {
|
||||
register(Identifier(PhysicalConnectivity.MODID, "cable_${color.getName()}"), block)
|
||||
}
|
||||
|
||||
register(InterfaceBlock.ID, INTERFACE)
|
||||
register(TerminalBlock.ID, TERMINAL)
|
||||
register(SwitchBlock.ID, SWITCH)
|
||||
register(CableBlock.ID, CABLE)
|
||||
register(ExtractorBlock.ID, EXTRACTOR)
|
||||
register(InserterBlock.ID, INSERTER)
|
||||
register(MinerBlock.ID, MINER)
|
||||
|
|
|
@ -24,10 +24,13 @@ import net.shadowfacts.phycon.item.FaceDeviceBlockItem
|
|||
*/
|
||||
object PhyItems {
|
||||
|
||||
val CABLES = PhyBlocks.CABLES.map { (color, block) ->
|
||||
color to BlockItem(block, Item.Settings())
|
||||
}.toMap()
|
||||
|
||||
val INTERFACE = FaceDeviceBlockItem(PhyBlocks.INTERFACE, Item.Settings())
|
||||
val TERMINAL = DeviceBlockItem(PhyBlocks.TERMINAL, Item.Settings())
|
||||
val SWITCH = BlockItem(PhyBlocks.SWITCH, Item.Settings())
|
||||
val CABLE = BlockItem(PhyBlocks.CABLE, Item.Settings())
|
||||
val EXTRACTOR = FaceDeviceBlockItem(PhyBlocks.EXTRACTOR, Item.Settings())
|
||||
val INSERTER = FaceDeviceBlockItem(PhyBlocks.INSERTER, Item.Settings())
|
||||
val MINER = DeviceBlockItem(PhyBlocks.MINER, Item.Settings())
|
||||
|
@ -44,10 +47,13 @@ object PhyItems {
|
|||
val REDSTONE_PROCESSOR = Item(Item.Settings())
|
||||
|
||||
fun init() {
|
||||
for ((color, item) in CABLES) {
|
||||
register(Identifier(PhysicalConnectivity.MODID, "cable_${color.getName()}"), item)
|
||||
}
|
||||
|
||||
register(InterfaceBlock.ID, INTERFACE)
|
||||
register(TerminalBlock.ID, TERMINAL)
|
||||
register(SwitchBlock.ID, SWITCH)
|
||||
register(CableBlock.ID, CABLE)
|
||||
register(ExtractorBlock.ID, EXTRACTOR)
|
||||
register(InserterBlock.ID, INSERTER)
|
||||
register(MinerBlock.ID, MINER)
|
||||
|
|
|
@ -15,7 +15,7 @@ class FaceDeviceBlockItem(block: FaceDeviceBlock<*>, settings: Settings = Settin
|
|||
|
||||
override fun getPlacementState(context: ItemPlacementContext): BlockState? {
|
||||
val hitState = context.world.getBlockState(context.blockPos)
|
||||
if (hitState.block == PhyBlocks.CABLE) {
|
||||
if (hitState.block is CableBlock) {
|
||||
val hitBlockEdge = context.hitPos.getComponentAlongAxis(context.side.axis) % 1 == 0.0
|
||||
|
||||
val placementSide = if (hitBlockEdge) context.side.opposite else context.side
|
||||
|
|
|
@ -14,6 +14,7 @@ import net.minecraft.util.math.Vec3d
|
|||
import net.shadowfacts.phycon.PhysicalConnectivity
|
||||
import net.shadowfacts.phycon.block.DeviceBlock
|
||||
import net.shadowfacts.phycon.block.FaceDeviceBlock
|
||||
import net.shadowfacts.phycon.block.cable.CableBlock
|
||||
import net.shadowfacts.phycon.init.PhyBlocks
|
||||
import net.shadowfacts.phycon.util.containsInclusive
|
||||
|
||||
|
@ -34,7 +35,7 @@ class ScrewdriverItem: Item(Settings().maxCount(1)) {
|
|||
val newState =
|
||||
when (block) {
|
||||
is DeviceBlock<*> -> screwdriverDeviceBlock(context, state, block)
|
||||
PhyBlocks.CABLE -> screwdriverCableBlock(context)
|
||||
is CableBlock -> screwdriverCableBlock(context, state)
|
||||
PhyBlocks.SWITCH -> screwdriverSwitchBlock(context)
|
||||
else -> null
|
||||
}
|
||||
|
@ -81,19 +82,19 @@ class ScrewdriverItem: Item(Settings().maxCount(1)) {
|
|||
val faceShape = block.faceShapes[state[FaceDeviceBlock.FACING]]!!
|
||||
// if we hit the face part of block, leave the cable behind
|
||||
if (faceShape.boundingBox.containsInclusive(hitInsideBlock)) {
|
||||
return PhyBlocks.CABLE.getInitialState(context.world, context.blockPos)
|
||||
return (state.block as CableBlock).getInitialState(context.world, context.blockPos)
|
||||
} else {
|
||||
if (!context.world.isClient) {
|
||||
val cable = ItemEntity(context.world, context.blockPos.x.toDouble(), context.blockPos.y.toDouble(), context.blockPos.z.toDouble(), ItemStack(PhyBlocks.CABLE))
|
||||
val cable = ItemEntity(context.world, context.blockPos.x.toDouble(), context.blockPos.y.toDouble(), context.blockPos.z.toDouble(), ItemStack(state.block))
|
||||
context.world.spawnEntity(cable)
|
||||
}
|
||||
return Blocks.AIR.defaultState
|
||||
}
|
||||
}
|
||||
|
||||
private fun screwdriverCableBlock(context: ItemUsageContext): BlockState? {
|
||||
private fun screwdriverCableBlock(context: ItemUsageContext, state: BlockState): BlockState? {
|
||||
if (!context.world.isClient) {
|
||||
val entity = ItemEntity(context.world, context.blockPos.x.toDouble(), context.blockPos.y.toDouble(), context.blockPos.z.toDouble(), ItemStack(PhyBlocks.CABLE))
|
||||
val entity = ItemEntity(context.world, context.blockPos.x.toDouble(), context.blockPos.y.toDouble(), context.blockPos.z.toDouble(), ItemStack(state.block))
|
||||
context.world.spawnEntity(entity)
|
||||
}
|
||||
return Blocks.AIR.defaultState
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
package net.shadowfacts.phycon.screen
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack
|
||||
import net.minecraft.util.Identifier
|
||||
import net.shadowfacts.cacao.geometry.Point
|
||||
import net.shadowfacts.cacao.geometry.Size
|
||||
import net.shadowfacts.cacao.util.texture.Texture
|
||||
import net.shadowfacts.cacao.view.TextureView
|
||||
import net.shadowfacts.cacao.view.button.AbstractButton
|
||||
import net.shadowfacts.phycon.PhysicalConnectivity
|
||||
|
||||
/**
|
||||
* @author shadowfacts
|
||||
*/
|
||||
class ClipboardButton(
|
||||
handler: (ClipboardButton) -> Unit,
|
||||
): AbstractButton<ClipboardButton>(
|
||||
TextureView(DEFAULT)
|
||||
) {
|
||||
|
||||
companion object {
|
||||
private val DEFAULT = Texture(Identifier(PhysicalConnectivity.MODID, "textures/gui/icons.png"), 16, 0)
|
||||
private val HOVER = Texture(Identifier(PhysicalConnectivity.MODID, "textures/gui/icons.png"), 0, 0)
|
||||
}
|
||||
|
||||
private val textureView: TextureView
|
||||
get() = content as TextureView
|
||||
|
||||
init {
|
||||
intrinsicContentSize = Size(9.0, 7.0)
|
||||
content.intrinsicContentSize = Size(9.0, 7.0)
|
||||
|
||||
this.handler = handler
|
||||
|
||||
this.background = null
|
||||
this.hoveredBackground = null
|
||||
this.disabledBackground = null
|
||||
}
|
||||
|
||||
override fun draw(matrixStack: MatrixStack, mouse: Point, delta: Float) {
|
||||
textureView.texture = if (mouse in bounds) HOVER else DEFAULT
|
||||
super.draw(matrixStack, mouse, delta)
|
||||
}
|
||||
|
||||
}
|
|
@ -1,13 +1,16 @@
|
|||
package net.shadowfacts.phycon.screen.console
|
||||
|
||||
import net.minecraft.client.MinecraftClient
|
||||
import net.minecraft.text.TranslatableText
|
||||
import net.shadowfacts.cacao.geometry.Axis
|
||||
import net.shadowfacts.cacao.util.Color
|
||||
import net.shadowfacts.cacao.view.Label
|
||||
import net.shadowfacts.cacao.view.StackView
|
||||
import net.shadowfacts.cacao.view.View
|
||||
import net.shadowfacts.cacao.viewcontroller.ViewController
|
||||
import net.shadowfacts.kiwidsl.dsl
|
||||
import net.shadowfacts.phycon.block.DeviceBlockEntity
|
||||
import net.shadowfacts.phycon.screen.ClipboardButton
|
||||
|
||||
/**
|
||||
* @author shadowfacts
|
||||
|
@ -30,14 +33,29 @@ class DeviceDetailsViewController(val device: DeviceBlockEntity): ViewController
|
|||
textColor = Color.TEXT
|
||||
}
|
||||
stack.addArrangedSubview(ipLabel)
|
||||
val copyIP = ClipboardButton {
|
||||
MinecraftClient.getInstance().keyboard.clipboard = device.ipAddress.toString()
|
||||
}
|
||||
view.addSubview(copyIP)
|
||||
|
||||
val macLabel = Label(TranslatableText("gui.phycon.console.details.mac", device.macAddress.toString())).apply {
|
||||
textColor = Color.TEXT
|
||||
}
|
||||
stack.addArrangedSubview(macLabel)
|
||||
val copyMAC = ClipboardButton {
|
||||
MinecraftClient.getInstance().keyboard.clipboard = device.macAddress.toString()
|
||||
}
|
||||
view.addSubview(copyMAC)
|
||||
|
||||
view.solver.dsl {
|
||||
stack.leftAnchor equalTo view.leftAnchor
|
||||
stack.topAnchor equalTo view.topAnchor
|
||||
|
||||
copyIP.leftAnchor equalTo (ipLabel.rightAnchor + 2)
|
||||
copyIP.topAnchor equalTo ipLabel.topAnchor
|
||||
|
||||
copyMAC.leftAnchor equalTo (macLabel.rightAnchor + 2)
|
||||
copyMAC.topAnchor equalTo macLabel.topAnchor
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,244 +0,0 @@
|
|||
{
|
||||
"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 }
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"multipart": [
|
||||
{
|
||||
"apply": { "model": "phycon:block/cable/black" }
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"multipart": [
|
||||
{
|
||||
"apply": { "model": "phycon:block/cable/blue" }
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"multipart": [
|
||||
{
|
||||
"apply": { "model": "phycon:block/cable/brown" }
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"multipart": [
|
||||
{
|
||||
"apply": { "model": "phycon:block/cable/cyan" }
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"multipart": [
|
||||
{
|
||||
"apply": { "model": "phycon:block/cable/gray" }
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"multipart": [
|
||||
{
|
||||
"apply": { "model": "phycon:block/cable/green" }
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"multipart": [
|
||||
{
|
||||
"apply": { "model": "phycon:block/cable/light_blue" }
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"multipart": [
|
||||
{
|
||||
"apply": { "model": "phycon:block/cable/light_gray" }
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"multipart": [
|
||||
{
|
||||
"apply": { "model": "phycon:block/cable/lime" }
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"multipart": [
|
||||
{
|
||||
"apply": { "model": "phycon:block/cable/magenta" }
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"multipart": [
|
||||
{
|
||||
"apply": { "model": "phycon:block/cable/orange" }
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"multipart": [
|
||||
{
|
||||
"apply": { "model": "phycon:block/cable/pink" }
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"multipart": [
|
||||
{
|
||||
"apply": { "model": "phycon:block/cable/purple" }
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"multipart": [
|
||||
{
|
||||
"apply": { "model": "phycon:block/cable/red" }
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"multipart": [
|
||||
{
|
||||
"apply": { "model": "phycon:block/cable/white" }
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"multipart": [
|
||||
{
|
||||
"apply": { "model": "phycon:block/cable/yellow" }
|
||||
}
|
||||
]
|
||||
}
|
|
@ -2,7 +2,22 @@
|
|||
"block.phycon.switch": "Network Switch",
|
||||
"block.phycon.network_interface": "Inventory Interface",
|
||||
"block.phycon.terminal": "Terminal",
|
||||
"block.phycon.cable": "Cable",
|
||||
"block.phycon.cable_white": "White Cable",
|
||||
"block.phycon.cable_orange": "Orange Cable",
|
||||
"block.phycon.cable_magenta": "Magenta Cable",
|
||||
"block.phycon.cable_light_blue": "Light Blue Cable",
|
||||
"block.phycon.cable_yellow": "Yellow Cable",
|
||||
"block.phycon.cable_lime": "Lime Cable",
|
||||
"block.phycon.cable_pink": "Pink Cable",
|
||||
"block.phycon.cable_gray": "Gray Cable",
|
||||
"block.phycon.cable_light_gray": "Light Gray Cable",
|
||||
"block.phycon.cable_cyan": "Cyan Cable",
|
||||
"block.phycon.cable_purple": "Purple Cable",
|
||||
"block.phycon.cable_blue": "Blue Cable",
|
||||
"block.phycon.cable_brown": "Brown Cable",
|
||||
"block.phycon.cable_green": "Green Cable",
|
||||
"block.phycon.cable_red": "Red Cable",
|
||||
"block.phycon.cable_black": "Black Cable",
|
||||
"block.phycon.extractor": "Inventory Extractor",
|
||||
"block.phycon.inserter": "Inventory Inserter",
|
||||
"block.phycon.miner": "Block Miner",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"textures": {
|
||||
"center": "phycon:block/cable_cap_end",
|
||||
"center": "phycon:block/cable/color/cap_end",
|
||||
"particle": "#center"
|
||||
},
|
||||
"elements": [
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"textures": {
|
||||
"corner": "phycon:block/cable_cap_end"
|
||||
"corner": "phycon:block/cable/color/cap_end"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"textures": {
|
||||
"corner": "phycon:block/cable_straight"
|
||||
"corner": "phycon:block/cable/color/straight"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"textures": {
|
||||
"corner": "phycon:block/cable_cap_end"
|
||||
"corner": "phycon:block/cable/color/cap_end"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"textures": {
|
||||
"corner": "phycon:block/cable_straight_rotated"
|
||||
"corner": "phycon:block/cable/color/straight_rotated"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"parent": "block/block",
|
||||
"textures": {
|
||||
"side": "phycon:block/cable_straight",
|
||||
"side": "phycon:block/cable/color/straight",
|
||||
"particle": "#side"
|
||||
},
|
||||
"elements": [
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"parent": "minecraft:block/block",
|
||||
"textures": {
|
||||
"center": "phycon:block/cable/black/cap_end"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [6, 6, 6],
|
||||
"to": [10, 10, 10],
|
||||
"faces": {
|
||||
"down": {"texture": "#center"},
|
||||
"up": {"texture": "#center"},
|
||||
"north": {"texture": "#center"},
|
||||
"south": {"texture": "#center"},
|
||||
"west": {"texture": "#center"},
|
||||
"east": {"texture": "#center"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"parent": "minecraft:block/block",
|
||||
"textures": {
|
||||
"center": "phycon:block/cable/blue/cap_end"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [6, 6, 6],
|
||||
"to": [10, 10, 10],
|
||||
"faces": {
|
||||
"down": {"texture": "#center"},
|
||||
"up": {"texture": "#center"},
|
||||
"north": {"texture": "#center"},
|
||||
"south": {"texture": "#center"},
|
||||
"west": {"texture": "#center"},
|
||||
"east": {"texture": "#center"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"parent": "minecraft:block/block",
|
||||
"textures": {
|
||||
"center": "phycon:block/cable/brown/cap_end"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [6, 6, 6],
|
||||
"to": [10, 10, 10],
|
||||
"faces": {
|
||||
"down": {"texture": "#center"},
|
||||
"up": {"texture": "#center"},
|
||||
"north": {"texture": "#center"},
|
||||
"south": {"texture": "#center"},
|
||||
"west": {"texture": "#center"},
|
||||
"east": {"texture": "#center"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"parent": "minecraft:block/block",
|
||||
"textures": {
|
||||
"center": "phycon:block/cable/cyan/cap_end"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [6, 6, 6],
|
||||
"to": [10, 10, 10],
|
||||
"faces": {
|
||||
"down": {"texture": "#center"},
|
||||
"up": {"texture": "#center"},
|
||||
"north": {"texture": "#center"},
|
||||
"south": {"texture": "#center"},
|
||||
"west": {"texture": "#center"},
|
||||
"east": {"texture": "#center"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"parent": "minecraft:block/block",
|
||||
"textures": {
|
||||
"center": "phycon:block/cable/gray/cap_end"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [6, 6, 6],
|
||||
"to": [10, 10, 10],
|
||||
"faces": {
|
||||
"down": {"texture": "#center"},
|
||||
"up": {"texture": "#center"},
|
||||
"north": {"texture": "#center"},
|
||||
"south": {"texture": "#center"},
|
||||
"west": {"texture": "#center"},
|
||||
"east": {"texture": "#center"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"parent": "minecraft:block/block",
|
||||
"textures": {
|
||||
"center": "phycon:block/cable/green/cap_end"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [6, 6, 6],
|
||||
"to": [10, 10, 10],
|
||||
"faces": {
|
||||
"down": {"texture": "#center"},
|
||||
"up": {"texture": "#center"},
|
||||
"north": {"texture": "#center"},
|
||||
"south": {"texture": "#center"},
|
||||
"west": {"texture": "#center"},
|
||||
"east": {"texture": "#center"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"parent": "minecraft:block/block",
|
||||
"textures": {
|
||||
"center": "phycon:block/cable/light_blue/cap_end"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [6, 6, 6],
|
||||
"to": [10, 10, 10],
|
||||
"faces": {
|
||||
"down": {"texture": "#center"},
|
||||
"up": {"texture": "#center"},
|
||||
"north": {"texture": "#center"},
|
||||
"south": {"texture": "#center"},
|
||||
"west": {"texture": "#center"},
|
||||
"east": {"texture": "#center"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"parent": "minecraft:block/block",
|
||||
"textures": {
|
||||
"center": "phycon:block/cable/light_gray/cap_end"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [6, 6, 6],
|
||||
"to": [10, 10, 10],
|
||||
"faces": {
|
||||
"down": {"texture": "#center"},
|
||||
"up": {"texture": "#center"},
|
||||
"north": {"texture": "#center"},
|
||||
"south": {"texture": "#center"},
|
||||
"west": {"texture": "#center"},
|
||||
"east": {"texture": "#center"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"parent": "minecraft:block/block",
|
||||
"textures": {
|
||||
"center": "phycon:block/cable/lime/cap_end"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [6, 6, 6],
|
||||
"to": [10, 10, 10],
|
||||
"faces": {
|
||||
"down": {"texture": "#center"},
|
||||
"up": {"texture": "#center"},
|
||||
"north": {"texture": "#center"},
|
||||
"south": {"texture": "#center"},
|
||||
"west": {"texture": "#center"},
|
||||
"east": {"texture": "#center"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"parent": "minecraft:block/block",
|
||||
"textures": {
|
||||
"center": "phycon:block/cable/magenta/cap_end"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [6, 6, 6],
|
||||
"to": [10, 10, 10],
|
||||
"faces": {
|
||||
"down": {"texture": "#center"},
|
||||
"up": {"texture": "#center"},
|
||||
"north": {"texture": "#center"},
|
||||
"south": {"texture": "#center"},
|
||||
"west": {"texture": "#center"},
|
||||
"east": {"texture": "#center"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"parent": "minecraft:block/block",
|
||||
"textures": {
|
||||
"center": "phycon:block/cable/orange/cap_end"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [6, 6, 6],
|
||||
"to": [10, 10, 10],
|
||||
"faces": {
|
||||
"down": {"texture": "#center"},
|
||||
"up": {"texture": "#center"},
|
||||
"north": {"texture": "#center"},
|
||||
"south": {"texture": "#center"},
|
||||
"west": {"texture": "#center"},
|
||||
"east": {"texture": "#center"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"parent": "minecraft:block/block",
|
||||
"textures": {
|
||||
"center": "phycon:block/cable/pink/cap_end"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [6, 6, 6],
|
||||
"to": [10, 10, 10],
|
||||
"faces": {
|
||||
"down": {"texture": "#center"},
|
||||
"up": {"texture": "#center"},
|
||||
"north": {"texture": "#center"},
|
||||
"south": {"texture": "#center"},
|
||||
"west": {"texture": "#center"},
|
||||
"east": {"texture": "#center"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"parent": "minecraft:block/block",
|
||||
"textures": {
|
||||
"center": "phycon:block/cable/purple/cap_end"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [6, 6, 6],
|
||||
"to": [10, 10, 10],
|
||||
"faces": {
|
||||
"down": {"texture": "#center"},
|
||||
"up": {"texture": "#center"},
|
||||
"north": {"texture": "#center"},
|
||||
"south": {"texture": "#center"},
|
||||
"west": {"texture": "#center"},
|
||||
"east": {"texture": "#center"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"parent": "minecraft:block/block",
|
||||
"textures": {
|
||||
"center": "phycon:block/cable_cap_end"
|
||||
"center": "phycon:block/cable/red/cap_end"
|
||||
},
|
||||
"elements": [
|
||||
{
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"parent": "minecraft:block/block",
|
||||
"textures": {
|
||||
"center": "phycon:block/cable/white/cap_end"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [6, 6, 6],
|
||||
"to": [10, 10, 10],
|
||||
"faces": {
|
||||
"down": {"texture": "#center"},
|
||||
"up": {"texture": "#center"},
|
||||
"north": {"texture": "#center"},
|
||||
"south": {"texture": "#center"},
|
||||
"west": {"texture": "#center"},
|
||||
"east": {"texture": "#center"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"parent": "minecraft:block/block",
|
||||
"textures": {
|
||||
"center": "phycon:block/cable/yellow/cap_end"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [6, 6, 6],
|
||||
"to": [10, 10, 10],
|
||||
"faces": {
|
||||
"down": {"texture": "#center"},
|
||||
"up": {"texture": "#center"},
|
||||
"north": {"texture": "#center"},
|
||||
"south": {"texture": "#center"},
|
||||
"west": {"texture": "#center"},
|
||||
"east": {"texture": "#center"}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
After Width: | Height: | Size: 104 B |
After Width: | Height: | Size: 173 B |
After Width: | Height: | Size: 128 B |
After Width: | Height: | Size: 146 B |
After Width: | Height: | Size: 243 B |
After Width: | Height: | Size: 222 B |
After Width: | Height: | Size: 144 B |
After Width: | Height: | Size: 239 B |
After Width: | Height: | Size: 217 B |
After Width: | Height: | Size: 148 B |
After Width: | Height: | Size: 251 B |
After Width: | Height: | Size: 229 B |
After Width: | Height: | Size: 142 B |
After Width: | Height: | Size: 231 B |
After Width: | Height: | Size: 206 B |
After Width: | Height: | Size: 143 B |
After Width: | Height: | Size: 228 B |
After Width: | Height: | Size: 211 B |
After Width: | Height: | Size: 148 B |
After Width: | Height: | Size: 276 B |
After Width: | Height: | Size: 246 B |
After Width: | Height: | Size: 145 B |
After Width: | Height: | Size: 249 B |
After Width: | Height: | Size: 222 B |
After Width: | Height: | Size: 149 B |
After Width: | Height: | Size: 274 B |
After Width: | Height: | Size: 243 B |
After Width: | Height: | Size: 148 B |
After Width: | Height: | Size: 255 B |
After Width: | Height: | Size: 236 B |
After Width: | Height: | Size: 145 B |
After Width: | Height: | Size: 259 B |
After Width: | Height: | Size: 236 B |
After Width: | Height: | Size: 150 B |
After Width: | Height: | Size: 280 B |
After Width: | Height: | Size: 249 B |
After Width: | Height: | Size: 148 B |
After Width: | Height: | Size: 264 B |
After Width: | Height: | Size: 243 B |
After Width: | Height: | Size: 148 B |
After Width: | Height: | Size: 258 B |
After Width: | Height: | Size: 228 B |
After Width: | Height: | Size: 109 B |
After Width: | Height: | Size: 169 B |
After Width: | Height: | Size: 148 B |
After Width: | Height: | Size: 149 B |
After Width: | Height: | Size: 261 B |
After Width: | Height: | Size: 234 B |
Before Width: | Height: | Size: 598 B |