шиза с моделями и блокстейтами кабелей

This commit is contained in:
YuRaNnNzZZ 2024-01-19 15:55:48 +03:00
parent 317cb98613
commit d669fcb28d
Signed by: YuRaNnNzZZ
GPG Key ID: 5F71738C85A6006D
17 changed files with 202 additions and 509 deletions

View File

@ -10,6 +10,12 @@ fun addBlockModels(provider: MatteryBlockModelProvider) {
resourceCubeAll(MBlocks.DEEPSLATE_TRITANIUM_ORE)
resourceCubeAll(MBlocks.TRITANIUM_INGOT_BLOCK)
cable("crude_energy_cable", "block/power_cable_0")
cable("regular_energy_cable", "block/power_cable_1")
cable("advanced_energy_cable", "block/power_cable_2")
cable("superconductor_energy_cable", "block/power_cable_3")
cable("storage_cable", "block/storage_cable")
colored(MBlocks.COBBLESTONE_GENERATOR, listOf("0", "particle"))
colored(MBlocks.ESSENCE_STORAGE, listOf("0", "particle"))
colored(MBlocks.ITEM_MONITOR, listOf("0", "particle"))

View File

@ -191,5 +191,49 @@ fun addBlockStates(provider: MatteryBlockStateProvider) {
part().modelFile(provider.models().getExistingFile(modLocation("storage_cable_core")))
.addModel().end()
}
with(provider.getMultipartBuilder(MBlocks.MATTER_CABLE)) {
for (dir in BlockRotationFreedom.DIRECTIONAL.possibleValues) {
part().modelFile(provider.models().getExistingFile(modLocation("matter_cable_connection")))
.rotationX(dir.front.xRotationBlockstateSouth())
.rotationY(dir.front.yRotationBlockstateSouth())
.addModel()
.condition(CableBlock.MAPPING_CONNECTION_PROP[dir.front]!!, true)
.end()
}
part().modelFile(provider.models().getExistingFile(modLocation("matter_cable_core")))
.addModel().end()
}
with(provider.getMultipartBuilder(MBlocks.STORAGE_CABLE)) {
for (dir in BlockRotationFreedom.DIRECTIONAL.possibleValues) {
part().modelFile(provider.models().getExistingFile(modLocation("storage_cable_connection")))
.rotationX(dir.front.xRotationBlockstateSouth())
.rotationY(dir.front.yRotationBlockstateSouth())
.addModel()
.condition(CableBlock.MAPPING_CONNECTION_PROP[dir.front]!!, true)
.end()
}
part().modelFile(provider.models().getExistingFile(modLocation("storage_cable_core")))
.addModel().end()
}
for (block in MBlocks.ENERGY_CABLES) {
with(provider.getMultipartBuilder(block.value)) {
for (dir in BlockRotationFreedom.DIRECTIONAL.possibleValues) {
part().modelFile(provider.models().getExistingFile(modLocation("${block.value.registryName!!.path}_connection")))
.rotationX(dir.front.xRotationBlockstateSouth())
.rotationY(dir.front.yRotationBlockstateSouth())
.addModel()
.condition(CableBlock.MAPPING_CONNECTION_PROP[dir.front]!!, true)
.end()
}
part().modelFile(provider.models().getExistingFile(modLocation("${block.value.registryName!!.path}_core")))
.addModel().end()
}
}
}
}

View File

@ -172,7 +172,6 @@ fun addItemModels(provider: MatteryItemModelProvider) {
provider.coloredWithBaseBlock(MItems.MATTER_SCANNER, "matter_scanner", "_idle")
provider.coloredWithBaseBlock(MItems.MATTER_REPLICATOR, "matter_replicator", "_idle")
provider.coloredWithBaseBlock(MItems.DRIVE_VIEWER, "drive_viewer", "_idle")
provider.block(MItems.MATTER_CABLE, "matter_cable_core")
provider.coloredWithBaseBlock(MItems.MATTER_DECOMPOSER, "matter_decomposer", "_idle")
provider.coloredWithBaseBlock(MItems.ENERGY_SERVO, "energy_servo")
provider.coloredWithBaseBlock(MItems.ESSENCE_STORAGE, "essence_storage")

View File

@ -142,4 +142,17 @@ class MatteryBlockModelProvider(event: GatherDataEvent) : BlockModelProvider(eve
colored(modelName, state, textureKeys.associateWith { modelName })
}
}
fun cable(modelName: String, textureName: String) {
exec {
withExistingParent("block/${modelName}_core", modLocation("block/base_cable_core"))
.texture("0", textureName)
withExistingParent("block/${modelName}_connection", modLocation("block/base_cable_connection"))
.texture("0", textureName)
withExistingParent("item/${modelName}", modLocation("item/base_cable"))
.texture("0", textureName)
}
}
}

View File

@ -1,74 +0,0 @@
{
"multipart": [
{
"apply": {
"model": "overdrive_that_matters:block/storage_cable_core"
}
},
{
"when": {
"connect_south": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection"
}
},
{
"when": {
"connect_west": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"y": 90
}
},
{
"when": {
"connect_north": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"y": 180
}
},
{
"when": {
"connect_east": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"y": 270
}
},
{
"when": {
"connect_up": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"x": 90
}
},
{
"when": {
"connect_down": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"x": 270
}
}
]
}

View File

@ -1,74 +0,0 @@
{
"multipart": [
{
"apply": {
"model": "overdrive_that_matters:block/storage_cable_core"
}
},
{
"when": {
"connect_south": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection"
}
},
{
"when": {
"connect_west": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"y": 90
}
},
{
"when": {
"connect_north": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"y": 180
}
},
{
"when": {
"connect_east": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"y": 270
}
},
{
"when": {
"connect_up": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"x": 90
}
},
{
"when": {
"connect_down": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"x": 270
}
}
]
}

View File

@ -1,74 +0,0 @@
{
"multipart": [
{
"apply": {
"model": "overdrive_that_matters:block/matter_cable_core"
}
},
{
"when": {
"connect_south": true
},
"apply": {
"model": "overdrive_that_matters:block/matter_cable_connection"
}
},
{
"when": {
"connect_west": true
},
"apply": {
"model": "overdrive_that_matters:block/matter_cable_connection",
"y": 90
}
},
{
"when": {
"connect_north": true
},
"apply": {
"model": "overdrive_that_matters:block/matter_cable_connection",
"y": 180
}
},
{
"when": {
"connect_east": true
},
"apply": {
"model": "overdrive_that_matters:block/matter_cable_connection",
"y": 270
}
},
{
"when": {
"connect_up": true
},
"apply": {
"model": "overdrive_that_matters:block/matter_cable_connection",
"x": 90
}
},
{
"when": {
"connect_down": true
},
"apply": {
"model": "overdrive_that_matters:block/matter_cable_connection",
"x": 270
}
}
]
}

View File

@ -1,74 +0,0 @@
{
"multipart": [
{
"apply": {
"model": "overdrive_that_matters:block/storage_cable_core"
}
},
{
"when": {
"connect_south": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection"
}
},
{
"when": {
"connect_west": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"y": 90
}
},
{
"when": {
"connect_north": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"y": 180
}
},
{
"when": {
"connect_east": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"y": 270
}
},
{
"when": {
"connect_up": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"x": 90
}
},
{
"when": {
"connect_down": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"x": 270
}
}
]
}

View File

@ -1,74 +0,0 @@
{
"multipart": [
{
"apply": {
"model": "overdrive_that_matters:block/storage_cable_core"
}
},
{
"when": {
"connect_south": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection"
}
},
{
"when": {
"connect_west": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"y": 90
}
},
{
"when": {
"connect_north": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"y": 180
}
},
{
"when": {
"connect_east": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"y": 270
}
},
{
"when": {
"connect_up": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"x": 90
}
},
{
"when": {
"connect_down": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"x": 270
}
}
]
}

View File

@ -1,74 +0,0 @@
{
"multipart": [
{
"apply": {
"model": "overdrive_that_matters:block/storage_cable_core"
}
},
{
"when": {
"connect_south": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection"
}
},
{
"when": {
"connect_west": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"y": 90
}
},
{
"when": {
"connect_north": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"y": 180
}
},
{
"when": {
"connect_east": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"y": 270
}
},
{
"when": {
"connect_up": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"x": 90
}
},
{
"when": {
"connect_down": true
},
"apply": {
"model": "overdrive_that_matters:block/storage_cable_connection",
"x": 270
}
}
]
}

View File

@ -0,0 +1,19 @@
{
"parent": "block/block",
"texture_size": [16, 16],
"textures": {
"particle": "#0"
},
"elements": [
{
"from": [ 5, 5, 11 ],
"to": [ 11, 11, 16 ],
"faces": {
"down": {"uv": [6, 0, 11, 6],"rotation": 90, "texture": "#0" },
"up": {"uv": [6, 0, 11, 6],"rotation": 90, "texture": "#0" },
"west": {"uv": [6, 0, 11, 6], "texture": "#0" },
"east": {"uv": [6, 0, 11, 6], "texture": "#0" }
}
}
]
}

View File

@ -0,0 +1,21 @@
{
"parent": "block/block",
"texture_size": [16, 16],
"textures": {
"particle": "#0"
},
"elements": [
{
"from": [ 5, 5, 5 ],
"to": [ 11, 11, 11 ],
"faces": {
"down": {"uv": [0, 0, 6, 6], "texture": "#0" },
"up": {"uv": [0, 0, 6, 6], "texture": "#0" },
"north": {"uv": [0, 0, 6, 6], "texture": "#0" },
"south": {"uv": [0, 0, 6, 6], "texture": "#0" },
"west": {"uv": [0, 0, 6, 6], "texture": "#0" },
"east": {"uv": [0, 0, 6, 6], "texture": "#0" }
}
}
]
}

View File

@ -1,20 +0,0 @@
{
"parent": "block/block",
"texture_size": [16, 16],
"textures": {
"connection": "overdrive_that_matters:block/storage_cable",
"particle": "overdrive_that_matters:block/storage_cable"
},
"elements": [
{
"from": [ 5, 5, 11 ],
"to": [ 11, 11, 16 ],
"faces": {
"down": {"uv": [6, 0, 11, 6],"rotation": 90, "texture": "#connection" },
"up": {"uv": [6, 0, 11, 6],"rotation": 90, "texture": "#connection" },
"west": {"uv": [6, 0, 11, 6], "texture": "#connection" },
"east": {"uv": [6, 0, 11, 6], "texture": "#connection" }
}
}
]
}

View File

@ -1,22 +0,0 @@
{
"parent": "block/block",
"texture_size": [16, 16],
"textures": {
"core": "overdrive_that_matters:block/storage_cable",
"particle": "overdrive_that_matters:block/storage_cable"
},
"elements": [
{
"from": [ 5, 5, 5 ],
"to": [ 11, 11, 11 ],
"faces": {
"down": {"uv": [0, 0, 6, 6], "texture": "#core" },
"up": {"uv": [0, 0, 6, 6], "texture": "#core" },
"north": {"uv": [0, 0, 6, 6], "texture": "#core" },
"south": {"uv": [0, 0, 6, 6], "texture": "#core" },
"west": {"uv": [0, 0, 6, 6], "texture": "#core" },
"east": {"uv": [0, 0, 6, 6], "texture": "#core" }
}
}
]
}

View File

@ -0,0 +1,49 @@
{
"parent": "block/block",
"texture_size": [16, 16],
"textures": {
"particle": "#0"
},
"elements": [
{
"from": [5, 5, 5],
"to": [11, 11, 11],
"faces": {
"north": {"uv": [0, 0, 6, 6], "texture": "#0"},
"south": {"uv": [0, 0, 6, 6], "texture": "#0"},
"up": {"uv": [0, 0, 6, 6], "rotation": 180, "texture": "#0"},
"down": {"uv": [0, 0, 6, 6], "rotation": 180, "texture": "#0"}
}
},
{
"from": [0, 5, 5],
"to": [5, 11, 11],
"faces": {
"north": {"uv": [6, 0, 11, 6], "texture": "#0"},
"south": {"uv": [6, 6, 11, 0], "rotation": 180, "texture": "#0"},
"west": {"uv": [0, 0, 6, 6], "texture": "#0"},
"up": {"uv": [6, 0, 11, 6], "rotation": 180, "texture": "#0"},
"down": {"uv": [6, 0, 11, 6], "rotation": 180, "texture": "#0"}
}
},
{
"from": [11, 5, 5],
"to": [16, 11, 11],
"faces": {
"north": {"uv": [11, 0, 16, 6], "texture": "#0"},
"east": {"uv": [0, 0, 6, 6], "texture": "#0"},
"south": {"uv": [11, 6, 16, 0], "rotation": 180, "texture": "#0"},
"up": {"uv": [11, 0, 16, 6], "rotation": 180, "texture": "#0"},
"down": {"uv": [11, 0, 16, 6], "rotation": 180, "texture": "#0"}
}
}
],
"gui_light": "front",
"display": {
"gui": {
"rotation": [0, 0, 0],
"translation": [0, 0, 0],
"scale": [1, 1, 1]
}
}
}

View File

@ -0,0 +1,50 @@
{
"parent": "block/block",
"texture_size": [16, 16],
"textures": {
"0": "overdrive_that_matters:block/matter_cable",
"particle": "#0"
},
"elements": [
{
"from": [6, 6, 6],
"to": [10, 10, 10],
"faces": {
"north": {"uv": [0, 0, 4, 4], "texture": "#0"},
"south": {"uv": [0, 0, 4, 4], "texture": "#0"},
"up": {"uv": [0, 0, 4, 4], "texture": "#0"},
"down": {"uv": [0, 0, 4, 4], "texture": "#0"}
}
},
{
"from": [0, 6, 6],
"to": [6, 10, 10],
"faces": {
"north": {"uv": [4, 0, 10, 4], "texture": "#0"},
"south": {"uv": [10, 0, 4, 4], "texture": "#0"},
"west": {"uv": [0, 0, 4, 4], "texture": "#0"},
"up": {"uv": [10, 0, 4, 4], "texture": "#0"},
"down": {"uv": [10, 0, 4, 4], "texture": "#0"}
}
},
{
"from": [10, 6, 6],
"to": [16, 10, 10],
"faces": {
"north": {"uv": [10, 0, 16, 4], "texture": "#0"},
"east": {"uv": [0, 0, 4, 4], "texture": "#0"},
"south": {"uv": [16, 0, 10, 4], "texture": "#0"},
"up": {"uv": [16, 0, 10, 4], "texture": "#0"},
"down": {"uv": [16, 0, 10, 4], "texture": "#0"}
}
}
],
"gui_light": "front",
"display": {
"gui": {
"rotation": [0, 0, 0],
"translation": [0, 0, 0],
"scale": [1, 1, 1]
}
}
}

View File

@ -1,22 +0,0 @@
{
"parent": "block/block",
"texture_size": [16, 16],
"textures": {
"core": "overdrive_that_matters:block/storage_cable",
"particle": "overdrive_that_matters:block/storage_cable"
},
"elements": [
{
"from": [ 6, 6, 6 ],
"to": [ 10, 10, 10 ],
"faces": {
"down": {"uv": [0, 0, 4, 4], "texture": "#core" },
"up": {"uv": [0, 0, 4, 4], "texture": "#core" },
"north": {"uv": [0, 0, 4, 4], "texture": "#core" },
"south": {"uv": [0, 0, 4, 4], "texture": "#core" },
"west": {"uv": [0, 0, 4, 4], "texture": "#core" },
"east": {"uv": [0, 0, 4, 4], "texture": "#core" }
}
}
]
}