From ee6fb1e725ec379dcb8e29eec71e5e20ba076ca0 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 15 Mar 2021 19:06:17 -0400 Subject: [PATCH] Fix cable recipes, advancements, loot tables, and face device drops --- .../phycon/block/FaceDeviceBlock.kt | 11 +- .../phycon/item/ScrewdriverItem.kt | 3 +- .../data/phycon/advancements/cable.json | 5 +- .../phycon/advancements/recipes/cable.json | 128 +++++++++++++++++- .../phycon/advancements/recipes/switch.json | 2 +- .../loot_tables/blocks/cable_black.json | 19 +++ .../phycon/loot_tables/blocks/cable_blue.json | 19 +++ .../loot_tables/blocks/cable_brown.json | 19 +++ .../phycon/loot_tables/blocks/cable_cyan.json | 19 +++ .../phycon/loot_tables/blocks/cable_gray.json | 19 +++ .../loot_tables/blocks/cable_green.json | 19 +++ .../loot_tables/blocks/cable_light_blue.json | 19 +++ .../loot_tables/blocks/cable_light_gray.json | 19 +++ .../phycon/loot_tables/blocks/cable_lime.json | 19 +++ .../loot_tables/blocks/cable_magenta.json | 19 +++ .../loot_tables/blocks/cable_orange.json | 19 +++ .../phycon/loot_tables/blocks/cable_pink.json | 19 +++ .../loot_tables/blocks/cable_purple.json | 19 +++ .../blocks/{cable.json => cable_red.json} | 2 +- .../loot_tables/blocks/cable_white.json | 19 +++ .../loot_tables/blocks/cable_yellow.json | 19 +++ .../loot_tables/blocks/network_interface.json | 14 -- .../blocks/redstone_controller.json | 14 -- .../loot_tables/blocks/redstone_emitter.json | 14 -- .../data/phycon/recipes/cable/black.json | 17 +++ .../data/phycon/recipes/cable/blue.json | 17 +++ .../data/phycon/recipes/cable/brown.json | 17 +++ .../data/phycon/recipes/cable/cyan.json | 17 +++ .../data/phycon/recipes/cable/gray.json | 17 +++ .../data/phycon/recipes/cable/green.json | 17 +++ .../data/phycon/recipes/cable/light_blue.json | 17 +++ .../data/phycon/recipes/cable/light_gray.json | 17 +++ .../data/phycon/recipes/cable/lime.json | 17 +++ .../data/phycon/recipes/cable/magenta.json | 17 +++ .../data/phycon/recipes/cable/orange.json | 17 +++ .../data/phycon/recipes/cable/pink.json | 17 +++ .../data/phycon/recipes/cable/purple.json | 17 +++ .../recipes/{cable.json => cable/red.json} | 4 +- .../data/phycon/recipes/cable/white.json | 17 +++ .../data/phycon/recipes/cable/yellow.json | 17 +++ .../resources/data/phycon/recipes/switch.json | 2 +- .../data/phycon/tags/items/cable.json | 20 +++ 42 files changed, 703 insertions(+), 56 deletions(-) create mode 100644 src/main/resources/data/phycon/loot_tables/blocks/cable_black.json create mode 100644 src/main/resources/data/phycon/loot_tables/blocks/cable_blue.json create mode 100644 src/main/resources/data/phycon/loot_tables/blocks/cable_brown.json create mode 100644 src/main/resources/data/phycon/loot_tables/blocks/cable_cyan.json create mode 100644 src/main/resources/data/phycon/loot_tables/blocks/cable_gray.json create mode 100644 src/main/resources/data/phycon/loot_tables/blocks/cable_green.json create mode 100644 src/main/resources/data/phycon/loot_tables/blocks/cable_light_blue.json create mode 100644 src/main/resources/data/phycon/loot_tables/blocks/cable_light_gray.json create mode 100644 src/main/resources/data/phycon/loot_tables/blocks/cable_lime.json create mode 100644 src/main/resources/data/phycon/loot_tables/blocks/cable_magenta.json create mode 100644 src/main/resources/data/phycon/loot_tables/blocks/cable_orange.json create mode 100644 src/main/resources/data/phycon/loot_tables/blocks/cable_pink.json create mode 100644 src/main/resources/data/phycon/loot_tables/blocks/cable_purple.json rename src/main/resources/data/phycon/loot_tables/blocks/{cable.json => cable_red.json} (87%) create mode 100644 src/main/resources/data/phycon/loot_tables/blocks/cable_white.json create mode 100644 src/main/resources/data/phycon/loot_tables/blocks/cable_yellow.json create mode 100644 src/main/resources/data/phycon/recipes/cable/black.json create mode 100644 src/main/resources/data/phycon/recipes/cable/blue.json create mode 100644 src/main/resources/data/phycon/recipes/cable/brown.json create mode 100644 src/main/resources/data/phycon/recipes/cable/cyan.json create mode 100644 src/main/resources/data/phycon/recipes/cable/gray.json create mode 100644 src/main/resources/data/phycon/recipes/cable/green.json create mode 100644 src/main/resources/data/phycon/recipes/cable/light_blue.json create mode 100644 src/main/resources/data/phycon/recipes/cable/light_gray.json create mode 100644 src/main/resources/data/phycon/recipes/cable/lime.json create mode 100644 src/main/resources/data/phycon/recipes/cable/magenta.json create mode 100644 src/main/resources/data/phycon/recipes/cable/orange.json create mode 100644 src/main/resources/data/phycon/recipes/cable/pink.json create mode 100644 src/main/resources/data/phycon/recipes/cable/purple.json rename src/main/resources/data/phycon/recipes/{cable.json => cable/red.json} (75%) create mode 100644 src/main/resources/data/phycon/recipes/cable/white.json create mode 100644 src/main/resources/data/phycon/recipes/cable/yellow.json create mode 100644 src/main/resources/data/phycon/tags/items/cable.json diff --git a/src/main/kotlin/net/shadowfacts/phycon/block/FaceDeviceBlock.kt b/src/main/kotlin/net/shadowfacts/phycon/block/FaceDeviceBlock.kt index 8faf586..ab7a303 100644 --- a/src/main/kotlin/net/shadowfacts/phycon/block/FaceDeviceBlock.kt +++ b/src/main/kotlin/net/shadowfacts/phycon/block/FaceDeviceBlock.kt @@ -4,6 +4,8 @@ import net.minecraft.block.Block import net.minecraft.block.BlockState import net.minecraft.block.ShapeContext import net.minecraft.item.ItemPlacementContext +import net.minecraft.item.ItemStack +import net.minecraft.server.world.ServerWorld import net.minecraft.state.StateManager import net.minecraft.state.property.EnumProperty import net.minecraft.state.property.Properties @@ -14,11 +16,11 @@ import net.minecraft.util.math.Direction import net.minecraft.util.shape.VoxelShape import net.minecraft.util.shape.VoxelShapes import net.minecraft.world.BlockView -import net.minecraft.world.World import net.minecraft.world.WorldAccess import net.shadowfacts.phycon.api.Interface import net.shadowfacts.phycon.api.NetworkComponentBlock import net.shadowfacts.phycon.block.cable.CableBlock +import net.shadowfacts.phycon.init.PhyItems import java.util.* @@ -160,4 +162,11 @@ abstract class FaceDeviceBlock(settings: Settings): Device override fun getOutlineShape(state: BlockState, world: BlockView, pos: BlockPos, context: ShapeContext): VoxelShape { return getShape(state[FACING], state[CABLE_CONNECTION]) } + + override fun onStacksDropped(state: BlockState, world: ServerWorld, pos: BlockPos, stack: ItemStack) { + super.onStacksDropped(state, world, pos, stack) + + val cableStack = ItemStack(PhyItems.CABLES[state[COLOR]]) + dropStack(world, pos, cableStack) + } } diff --git a/src/main/kotlin/net/shadowfacts/phycon/item/ScrewdriverItem.kt b/src/main/kotlin/net/shadowfacts/phycon/item/ScrewdriverItem.kt index a3dbe00..77a6fd9 100644 --- a/src/main/kotlin/net/shadowfacts/phycon/item/ScrewdriverItem.kt +++ b/src/main/kotlin/net/shadowfacts/phycon/item/ScrewdriverItem.kt @@ -82,7 +82,8 @@ 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 (state.block as CableBlock).getInitialState(context.world, context.blockPos) + val cableBlock = PhyBlocks.CABLES[state[FaceDeviceBlock.COLOR]]!! + return 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(state.block)) diff --git a/src/main/resources/data/phycon/advancements/cable.json b/src/main/resources/data/phycon/advancements/cable.json index 15b25ea..75c16e6 100644 --- a/src/main/resources/data/phycon/advancements/cable.json +++ b/src/main/resources/data/phycon/advancements/cable.json @@ -2,7 +2,7 @@ "parent": "phycon:root", "display": { "icon": { - "item": "phycon:cable" + "item": "phycon:cable_blue" }, "title": { "translate": "advancements.phycon.cable.title" @@ -19,9 +19,8 @@ "cable": { "trigger": "minecraft:placed_block", "conditions": { - "block": "phycon:cable", "item": { - "item": "phycon:cable" + "tag": "phycon:cable" } } } diff --git a/src/main/resources/data/phycon/advancements/recipes/cable.json b/src/main/resources/data/phycon/advancements/recipes/cable.json index 1737a94..f168726 100644 --- a/src/main/resources/data/phycon/advancements/recipes/cable.json +++ b/src/main/resources/data/phycon/advancements/recipes/cable.json @@ -2,7 +2,22 @@ "parent": "minecraft:recipes/root", "rewards": { "recipes": [ - "phycon:cable" + "phycon:cable/white", + "phycon:cable/orange", + "phycon:cable/magenta", + "phycon:cable/light_blue", + "phycon:cable/yellow", + "phycon:cable/lime", + "phycon:cable/pink", + "phycon:cable/gray", + "phycon:cable/light_gray", + "phycon:cable/cyan", + "phycon:cable/purple", + "phycon:cable/blue", + "phycon:cable/brown", + "phycon:cable/green", + "phycon:cable/red", + "phycon:cable/black" ] }, "criteria": { @@ -16,17 +31,122 @@ ] } }, - "has_the_recipe": { + "has_white_recipe": { "trigger": "minecraft:recipe_unlocked", "conditions": { - "recipe": "phycon:cable" + "recipe": "phycon:cable/white" + } + }, + "has_orange_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "phycon:cable/orange" + } + }, + "has_magenta_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "phycon:cable/magenta" + } + }, + "has_light_blue_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "phycon:cable/light_blue" + } + }, + "has_yellow_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "phycon:cable/yellow" + } + }, + "has_lime_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "phycon:cable/lime" + } + }, + "has_pink_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "phycon:cable/pink" + } + }, + "has_gray_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "phycon:cable/gray" + } + }, + "has_light_gray_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "phycon:cable/light_gray" + } + }, + "has_cyan_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "phycon:cable/cyan" + } + }, + "has_purple_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "phycon:cable/purple" + } + }, + "has_blue_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "phycon:cable/blue" + } + }, + "has_brown_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "phycon:cable/brown" + } + }, + "has_green_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "phycon:cable/green" + } + }, + "has_red_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "phycon:cable/red" + } + }, + "has_black_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "phycon:cable/black" } } }, "requirements": [ [ "has_twisted_pair", - "has_the_recipe" + "has_white_recipe", + "has_orange_recipe", + "has_magenta_recipe", + "has_light_blue_recipe", + "has_yellow_recipe", + "has_lime_recipe", + "has_pink_recipe", + "has_gray_recipe", + "has_light_gray_recipe", + "has_cyan_recipe", + "has_purple_recipe", + "has_blue_recipe", + "has_brown_recipe", + "has_green_recipe", + "has_red_recipe", + "has_black_recipe" ] ] } diff --git a/src/main/resources/data/phycon/advancements/recipes/switch.json b/src/main/resources/data/phycon/advancements/recipes/switch.json index 73b3f42..67ae434 100644 --- a/src/main/resources/data/phycon/advancements/recipes/switch.json +++ b/src/main/resources/data/phycon/advancements/recipes/switch.json @@ -11,7 +11,7 @@ "conditions": { "items": [ { - "item": "phycon:cable" + "tag": "phycon:cable" } ] } diff --git a/src/main/resources/data/phycon/loot_tables/blocks/cable_black.json b/src/main/resources/data/phycon/loot_tables/blocks/cable_black.json new file mode 100644 index 0000000..6925c7e --- /dev/null +++ b/src/main/resources/data/phycon/loot_tables/blocks/cable_black.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "phycon:cable_black" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/phycon/loot_tables/blocks/cable_blue.json b/src/main/resources/data/phycon/loot_tables/blocks/cable_blue.json new file mode 100644 index 0000000..f1f2fca --- /dev/null +++ b/src/main/resources/data/phycon/loot_tables/blocks/cable_blue.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "phycon:cable_blue" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/phycon/loot_tables/blocks/cable_brown.json b/src/main/resources/data/phycon/loot_tables/blocks/cable_brown.json new file mode 100644 index 0000000..4d9d2a6 --- /dev/null +++ b/src/main/resources/data/phycon/loot_tables/blocks/cable_brown.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "phycon:cable_brown" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/phycon/loot_tables/blocks/cable_cyan.json b/src/main/resources/data/phycon/loot_tables/blocks/cable_cyan.json new file mode 100644 index 0000000..8264ba7 --- /dev/null +++ b/src/main/resources/data/phycon/loot_tables/blocks/cable_cyan.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "phycon:cable_cyan" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/phycon/loot_tables/blocks/cable_gray.json b/src/main/resources/data/phycon/loot_tables/blocks/cable_gray.json new file mode 100644 index 0000000..6c60f4f --- /dev/null +++ b/src/main/resources/data/phycon/loot_tables/blocks/cable_gray.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "phycon:cable_gray" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/phycon/loot_tables/blocks/cable_green.json b/src/main/resources/data/phycon/loot_tables/blocks/cable_green.json new file mode 100644 index 0000000..4649875 --- /dev/null +++ b/src/main/resources/data/phycon/loot_tables/blocks/cable_green.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "phycon:cable_green" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/phycon/loot_tables/blocks/cable_light_blue.json b/src/main/resources/data/phycon/loot_tables/blocks/cable_light_blue.json new file mode 100644 index 0000000..cc4fcb7 --- /dev/null +++ b/src/main/resources/data/phycon/loot_tables/blocks/cable_light_blue.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "phycon:cable_light_blue" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/phycon/loot_tables/blocks/cable_light_gray.json b/src/main/resources/data/phycon/loot_tables/blocks/cable_light_gray.json new file mode 100644 index 0000000..4238a7f --- /dev/null +++ b/src/main/resources/data/phycon/loot_tables/blocks/cable_light_gray.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "phycon:cable_light_gray" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/phycon/loot_tables/blocks/cable_lime.json b/src/main/resources/data/phycon/loot_tables/blocks/cable_lime.json new file mode 100644 index 0000000..c09cfd5 --- /dev/null +++ b/src/main/resources/data/phycon/loot_tables/blocks/cable_lime.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "phycon:cable_lime" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/phycon/loot_tables/blocks/cable_magenta.json b/src/main/resources/data/phycon/loot_tables/blocks/cable_magenta.json new file mode 100644 index 0000000..acd92ab --- /dev/null +++ b/src/main/resources/data/phycon/loot_tables/blocks/cable_magenta.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "phycon:cable_magenta" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/phycon/loot_tables/blocks/cable_orange.json b/src/main/resources/data/phycon/loot_tables/blocks/cable_orange.json new file mode 100644 index 0000000..3aedc6c --- /dev/null +++ b/src/main/resources/data/phycon/loot_tables/blocks/cable_orange.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "phycon:cable_orange" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/phycon/loot_tables/blocks/cable_pink.json b/src/main/resources/data/phycon/loot_tables/blocks/cable_pink.json new file mode 100644 index 0000000..04d515d --- /dev/null +++ b/src/main/resources/data/phycon/loot_tables/blocks/cable_pink.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "phycon:cable_pink" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/phycon/loot_tables/blocks/cable_purple.json b/src/main/resources/data/phycon/loot_tables/blocks/cable_purple.json new file mode 100644 index 0000000..82b93f5 --- /dev/null +++ b/src/main/resources/data/phycon/loot_tables/blocks/cable_purple.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "phycon:cable_purple" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/phycon/loot_tables/blocks/cable.json b/src/main/resources/data/phycon/loot_tables/blocks/cable_red.json similarity index 87% rename from src/main/resources/data/phycon/loot_tables/blocks/cable.json rename to src/main/resources/data/phycon/loot_tables/blocks/cable_red.json index 0c45331..6fd41cb 100644 --- a/src/main/resources/data/phycon/loot_tables/blocks/cable.json +++ b/src/main/resources/data/phycon/loot_tables/blocks/cable_red.json @@ -6,7 +6,7 @@ "entries": [ { "type": "minecraft:item", - "name": "phycon:cable" + "name": "phycon:cable_red" } ], "conditions": [ diff --git a/src/main/resources/data/phycon/loot_tables/blocks/cable_white.json b/src/main/resources/data/phycon/loot_tables/blocks/cable_white.json new file mode 100644 index 0000000..8e8db43 --- /dev/null +++ b/src/main/resources/data/phycon/loot_tables/blocks/cable_white.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "phycon:cable_white" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/phycon/loot_tables/blocks/cable_yellow.json b/src/main/resources/data/phycon/loot_tables/blocks/cable_yellow.json new file mode 100644 index 0000000..b73d625 --- /dev/null +++ b/src/main/resources/data/phycon/loot_tables/blocks/cable_yellow.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "phycon:cable_yellow" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} diff --git a/src/main/resources/data/phycon/loot_tables/blocks/network_interface.json b/src/main/resources/data/phycon/loot_tables/blocks/network_interface.json index 0b5821f..40bbb68 100644 --- a/src/main/resources/data/phycon/loot_tables/blocks/network_interface.json +++ b/src/main/resources/data/phycon/loot_tables/blocks/network_interface.json @@ -14,20 +14,6 @@ "condition": "minecraft:survives_explosion" } ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:item", - "name": "phycon:cable" - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] } ] } diff --git a/src/main/resources/data/phycon/loot_tables/blocks/redstone_controller.json b/src/main/resources/data/phycon/loot_tables/blocks/redstone_controller.json index 64f8b7a..c5baf9c 100644 --- a/src/main/resources/data/phycon/loot_tables/blocks/redstone_controller.json +++ b/src/main/resources/data/phycon/loot_tables/blocks/redstone_controller.json @@ -14,20 +14,6 @@ "condition": "minecraft:survives_explosion" } ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:item", - "name": "phycon:cable" - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] } ] } diff --git a/src/main/resources/data/phycon/loot_tables/blocks/redstone_emitter.json b/src/main/resources/data/phycon/loot_tables/blocks/redstone_emitter.json index ef6a425..f005696 100644 --- a/src/main/resources/data/phycon/loot_tables/blocks/redstone_emitter.json +++ b/src/main/resources/data/phycon/loot_tables/blocks/redstone_emitter.json @@ -14,20 +14,6 @@ "condition": "minecraft:survives_explosion" } ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:item", - "name": "phycon:cable" - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] } ] } diff --git a/src/main/resources/data/phycon/recipes/cable/black.json b/src/main/resources/data/phycon/recipes/cable/black.json new file mode 100644 index 0000000..6b800fa --- /dev/null +++ b/src/main/resources/data/phycon/recipes/cable/black.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "CCC", + "TRT", + "CCC" + ], + "key": { + "C": {"item": "minecraft:black_carpet"}, + "T": {"item": "phycon:twisted_pair"}, + "R": {"item": "minecraft:redstone"} + }, + "result": { + "item": "phycon:cable_black", + "count": 3 + } +} diff --git a/src/main/resources/data/phycon/recipes/cable/blue.json b/src/main/resources/data/phycon/recipes/cable/blue.json new file mode 100644 index 0000000..377cb0c --- /dev/null +++ b/src/main/resources/data/phycon/recipes/cable/blue.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "CCC", + "TRT", + "CCC" + ], + "key": { + "C": {"item": "minecraft:blue_carpet"}, + "T": {"item": "phycon:twisted_pair"}, + "R": {"item": "minecraft:redstone"} + }, + "result": { + "item": "phycon:cable_blue", + "count": 3 + } +} diff --git a/src/main/resources/data/phycon/recipes/cable/brown.json b/src/main/resources/data/phycon/recipes/cable/brown.json new file mode 100644 index 0000000..afa9a1a --- /dev/null +++ b/src/main/resources/data/phycon/recipes/cable/brown.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "CCC", + "TRT", + "CCC" + ], + "key": { + "C": {"item": "minecraft:brown_carpet"}, + "T": {"item": "phycon:twisted_pair"}, + "R": {"item": "minecraft:redstone"} + }, + "result": { + "item": "phycon:cable_brown", + "count": 3 + } +} diff --git a/src/main/resources/data/phycon/recipes/cable/cyan.json b/src/main/resources/data/phycon/recipes/cable/cyan.json new file mode 100644 index 0000000..d48f666 --- /dev/null +++ b/src/main/resources/data/phycon/recipes/cable/cyan.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "CCC", + "TRT", + "CCC" + ], + "key": { + "C": {"item": "minecraft:cyan_carpet"}, + "T": {"item": "phycon:twisted_pair"}, + "R": {"item": "minecraft:redstone"} + }, + "result": { + "item": "phycon:cable_cyan", + "count": 3 + } +} diff --git a/src/main/resources/data/phycon/recipes/cable/gray.json b/src/main/resources/data/phycon/recipes/cable/gray.json new file mode 100644 index 0000000..bdf7723 --- /dev/null +++ b/src/main/resources/data/phycon/recipes/cable/gray.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "CCC", + "TRT", + "CCC" + ], + "key": { + "C": {"item": "minecraft:gray_carpet"}, + "T": {"item": "phycon:twisted_pair"}, + "R": {"item": "minecraft:redstone"} + }, + "result": { + "item": "phycon:cable_gray", + "count": 3 + } +} diff --git a/src/main/resources/data/phycon/recipes/cable/green.json b/src/main/resources/data/phycon/recipes/cable/green.json new file mode 100644 index 0000000..ed9c9fd --- /dev/null +++ b/src/main/resources/data/phycon/recipes/cable/green.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "CCC", + "TRT", + "CCC" + ], + "key": { + "C": {"item": "minecraft:green_carpet"}, + "T": {"item": "phycon:twisted_pair"}, + "R": {"item": "minecraft:redstone"} + }, + "result": { + "item": "phycon:cable_green", + "count": 3 + } +} diff --git a/src/main/resources/data/phycon/recipes/cable/light_blue.json b/src/main/resources/data/phycon/recipes/cable/light_blue.json new file mode 100644 index 0000000..f5783e1 --- /dev/null +++ b/src/main/resources/data/phycon/recipes/cable/light_blue.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "CCC", + "TRT", + "CCC" + ], + "key": { + "C": {"item": "minecraft:light_blue_carpet"}, + "T": {"item": "phycon:twisted_pair"}, + "R": {"item": "minecraft:redstone"} + }, + "result": { + "item": "phycon:cable_light_blue", + "count": 3 + } +} diff --git a/src/main/resources/data/phycon/recipes/cable/light_gray.json b/src/main/resources/data/phycon/recipes/cable/light_gray.json new file mode 100644 index 0000000..29fbb09 --- /dev/null +++ b/src/main/resources/data/phycon/recipes/cable/light_gray.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "CCC", + "TRT", + "CCC" + ], + "key": { + "C": {"item": "minecraft:light_gray_carpet"}, + "T": {"item": "phycon:twisted_pair"}, + "R": {"item": "minecraft:redstone"} + }, + "result": { + "item": "phycon:cable_light_gray", + "count": 3 + } +} diff --git a/src/main/resources/data/phycon/recipes/cable/lime.json b/src/main/resources/data/phycon/recipes/cable/lime.json new file mode 100644 index 0000000..13be284 --- /dev/null +++ b/src/main/resources/data/phycon/recipes/cable/lime.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "CCC", + "TRT", + "CCC" + ], + "key": { + "C": {"item": "minecraft:lime_carpet"}, + "T": {"item": "phycon:twisted_pair"}, + "R": {"item": "minecraft:redstone"} + }, + "result": { + "item": "phycon:cable_lime", + "count": 3 + } +} diff --git a/src/main/resources/data/phycon/recipes/cable/magenta.json b/src/main/resources/data/phycon/recipes/cable/magenta.json new file mode 100644 index 0000000..487475a --- /dev/null +++ b/src/main/resources/data/phycon/recipes/cable/magenta.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "CCC", + "TRT", + "CCC" + ], + "key": { + "C": {"item": "minecraft:orange_carpet"}, + "T": {"item": "phycon:twisted_pair"}, + "R": {"item": "minecraft:redstone"} + }, + "result": { + "item": "phycon:cable_orange", + "count": 3 + } +} diff --git a/src/main/resources/data/phycon/recipes/cable/orange.json b/src/main/resources/data/phycon/recipes/cable/orange.json new file mode 100644 index 0000000..487475a --- /dev/null +++ b/src/main/resources/data/phycon/recipes/cable/orange.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "CCC", + "TRT", + "CCC" + ], + "key": { + "C": {"item": "minecraft:orange_carpet"}, + "T": {"item": "phycon:twisted_pair"}, + "R": {"item": "minecraft:redstone"} + }, + "result": { + "item": "phycon:cable_orange", + "count": 3 + } +} diff --git a/src/main/resources/data/phycon/recipes/cable/pink.json b/src/main/resources/data/phycon/recipes/cable/pink.json new file mode 100644 index 0000000..ef26f06 --- /dev/null +++ b/src/main/resources/data/phycon/recipes/cable/pink.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "CCC", + "TRT", + "CCC" + ], + "key": { + "C": {"item": "minecraft:pink_carpet"}, + "T": {"item": "phycon:twisted_pair"}, + "R": {"item": "minecraft:redstone"} + }, + "result": { + "item": "phycon:cable_pink", + "count": 3 + } +} diff --git a/src/main/resources/data/phycon/recipes/cable/purple.json b/src/main/resources/data/phycon/recipes/cable/purple.json new file mode 100644 index 0000000..27e5ae9 --- /dev/null +++ b/src/main/resources/data/phycon/recipes/cable/purple.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "CCC", + "TRT", + "CCC" + ], + "key": { + "C": {"item": "minecraft:purple_carpet"}, + "T": {"item": "phycon:twisted_pair"}, + "R": {"item": "minecraft:redstone"} + }, + "result": { + "item": "phycon:cable_purple", + "count": 3 + } +} diff --git a/src/main/resources/data/phycon/recipes/cable.json b/src/main/resources/data/phycon/recipes/cable/red.json similarity index 75% rename from src/main/resources/data/phycon/recipes/cable.json rename to src/main/resources/data/phycon/recipes/cable/red.json index 0e3065e..03ccfc1 100644 --- a/src/main/resources/data/phycon/recipes/cable.json +++ b/src/main/resources/data/phycon/recipes/cable/red.json @@ -6,12 +6,12 @@ "CCC" ], "key": { - "C": {"tag": "minecraft:carpets"}, + "C": {"item": "minecraft:red_carpet"}, "T": {"item": "phycon:twisted_pair"}, "R": {"item": "minecraft:redstone"} }, "result": { - "item": "phycon:cable", + "item": "phycon:cable_red", "count": 3 } } diff --git a/src/main/resources/data/phycon/recipes/cable/white.json b/src/main/resources/data/phycon/recipes/cable/white.json new file mode 100644 index 0000000..bc73c53 --- /dev/null +++ b/src/main/resources/data/phycon/recipes/cable/white.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "CCC", + "TRT", + "CCC" + ], + "key": { + "C": {"item": "minecraft:white_carpet"}, + "T": {"item": "phycon:twisted_pair"}, + "R": {"item": "minecraft:redstone"} + }, + "result": { + "item": "phycon:cable_white", + "count": 3 + } +} diff --git a/src/main/resources/data/phycon/recipes/cable/yellow.json b/src/main/resources/data/phycon/recipes/cable/yellow.json new file mode 100644 index 0000000..d7e1579 --- /dev/null +++ b/src/main/resources/data/phycon/recipes/cable/yellow.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "CCC", + "TRT", + "CCC" + ], + "key": { + "C": {"item": "minecraft:yellow_carpet"}, + "T": {"item": "phycon:twisted_pair"}, + "R": {"item": "minecraft:redstone"} + }, + "result": { + "item": "phycon:cable_yellow", + "count": 3 + } +} diff --git a/src/main/resources/data/phycon/recipes/switch.json b/src/main/resources/data/phycon/recipes/switch.json index 4eb4d6e..a7bd0b4 100644 --- a/src/main/resources/data/phycon/recipes/switch.json +++ b/src/main/resources/data/phycon/recipes/switch.json @@ -7,7 +7,7 @@ ], "key": { "S": {"item": "phycon:silicon_wafer"}, - "C": {"item": "phycon:cable"}, + "C": {"tag": "phycon:cable"}, "I": {"tag": "c:iron_ingots"} }, "result": { diff --git a/src/main/resources/data/phycon/tags/items/cable.json b/src/main/resources/data/phycon/tags/items/cable.json new file mode 100644 index 0000000..66da95f --- /dev/null +++ b/src/main/resources/data/phycon/tags/items/cable.json @@ -0,0 +1,20 @@ +{ + "values": [ + "phycon:cable_white", + "phycon:cable_orange", + "phycon:cable_magenta", + "phycon:cable_light_blue", + "phycon:cable_yellow", + "phycon:cable_lime", + "phycon:cable_pink", + "phycon:cable_gray", + "phycon:cable_light_gray", + "phycon:cable_cyan", + "phycon:cable_purple", + "phycon:cable_blue", + "phycon:cable_brown", + "phycon:cable_green", + "phycon:cable_red", + "phycon:cable_black" + ] +}