diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/BlockModels.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/BlockModels.kt index 0919c9a83..884505d6c 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/BlockModels.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/BlockModels.kt @@ -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")) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/BlockStates.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/BlockStates.kt index e9de264e2..cd07f3fde 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/BlockStates.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/BlockStates.kt @@ -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() + } + } } } diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt index d3de3d6dc..2d3244968 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt @@ -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") diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/models/MatteryModelProvider.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/models/MatteryModelProvider.kt index 6384439fb..63ec5c1f1 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/models/MatteryModelProvider.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/models/MatteryModelProvider.kt @@ -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) + } + } } diff --git a/src/main/resources/assets/overdrive_that_matters/blockstates/advanced_energy_cable.json b/src/main/resources/assets/overdrive_that_matters/blockstates/advanced_energy_cable.json deleted file mode 100644 index ae8a815be..000000000 --- a/src/main/resources/assets/overdrive_that_matters/blockstates/advanced_energy_cable.json +++ /dev/null @@ -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 - } - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/blockstates/crude_energy_cable.json b/src/main/resources/assets/overdrive_that_matters/blockstates/crude_energy_cable.json deleted file mode 100644 index ae8a815be..000000000 --- a/src/main/resources/assets/overdrive_that_matters/blockstates/crude_energy_cable.json +++ /dev/null @@ -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 - } - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/blockstates/matter_cable.json b/src/main/resources/assets/overdrive_that_matters/blockstates/matter_cable.json deleted file mode 100644 index e751d40ea..000000000 --- a/src/main/resources/assets/overdrive_that_matters/blockstates/matter_cable.json +++ /dev/null @@ -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 - } - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/blockstates/regular_energy_cable.json b/src/main/resources/assets/overdrive_that_matters/blockstates/regular_energy_cable.json deleted file mode 100644 index ae8a815be..000000000 --- a/src/main/resources/assets/overdrive_that_matters/blockstates/regular_energy_cable.json +++ /dev/null @@ -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 - } - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/blockstates/storage_cable.json b/src/main/resources/assets/overdrive_that_matters/blockstates/storage_cable.json deleted file mode 100644 index ae8a815be..000000000 --- a/src/main/resources/assets/overdrive_that_matters/blockstates/storage_cable.json +++ /dev/null @@ -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 - } - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/blockstates/superconductor_energy_cable.json b/src/main/resources/assets/overdrive_that_matters/blockstates/superconductor_energy_cable.json deleted file mode 100644 index ae8a815be..000000000 --- a/src/main/resources/assets/overdrive_that_matters/blockstates/superconductor_energy_cable.json +++ /dev/null @@ -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 - } - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/models/block/base_cable_connection.json b/src/main/resources/assets/overdrive_that_matters/models/block/base_cable_connection.json new file mode 100644 index 000000000..c774f91ee --- /dev/null +++ b/src/main/resources/assets/overdrive_that_matters/models/block/base_cable_connection.json @@ -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" } + } + } + ] +} diff --git a/src/main/resources/assets/overdrive_that_matters/models/block/base_cable_core.json b/src/main/resources/assets/overdrive_that_matters/models/block/base_cable_core.json new file mode 100644 index 000000000..353685030 --- /dev/null +++ b/src/main/resources/assets/overdrive_that_matters/models/block/base_cable_core.json @@ -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" } + } + } + ] +} diff --git a/src/main/resources/assets/overdrive_that_matters/models/block/storage_cable_connection.json b/src/main/resources/assets/overdrive_that_matters/models/block/storage_cable_connection.json deleted file mode 100644 index 21034ce5a..000000000 --- a/src/main/resources/assets/overdrive_that_matters/models/block/storage_cable_connection.json +++ /dev/null @@ -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" } - } - } - ] -} diff --git a/src/main/resources/assets/overdrive_that_matters/models/block/storage_cable_core.json b/src/main/resources/assets/overdrive_that_matters/models/block/storage_cable_core.json deleted file mode 100644 index 82ce8a212..000000000 --- a/src/main/resources/assets/overdrive_that_matters/models/block/storage_cable_core.json +++ /dev/null @@ -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" } - } - } - ] -} diff --git a/src/main/resources/assets/overdrive_that_matters/models/item/base_cable.json b/src/main/resources/assets/overdrive_that_matters/models/item/base_cable.json new file mode 100644 index 000000000..80b3fb46b --- /dev/null +++ b/src/main/resources/assets/overdrive_that_matters/models/item/base_cable.json @@ -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] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/models/item/matter_cable.json b/src/main/resources/assets/overdrive_that_matters/models/item/matter_cable.json new file mode 100644 index 000000000..530e26553 --- /dev/null +++ b/src/main/resources/assets/overdrive_that_matters/models/item/matter_cable.json @@ -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] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/models/item/storage_cable.json b/src/main/resources/assets/overdrive_that_matters/models/item/storage_cable.json deleted file mode 100644 index e0355ccb3..000000000 --- a/src/main/resources/assets/overdrive_that_matters/models/item/storage_cable.json +++ /dev/null @@ -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" } - } - } - ] -}