From c9bcfd29d5121716c4cd10804e2aac1733ba4c1a Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 6 Mar 2021 20:04:32 -0500 Subject: [PATCH] Add Twisted Pair and Cable recipe --- .../net/shadowfacts/phycon/init/PhyItems.kt | 3 ++ .../resources/assets/phycon/lang/en_us.json | 1 + .../phycon/models/item/twisted_pair.json | 6 ++++ .../phycon/textures/item/twisted_pair.png | Bin 0 -> 709 bytes .../phycon/advancements/recipes/cable.json | 32 ++++++++++++++++++ .../advancements/recipes/twisted_pair.json | 32 ++++++++++++++++++ .../resources/data/phycon/recipes/cable.json | 17 ++++++++++ .../data/phycon/recipes/twisted_pair.json | 14 ++++++++ 8 files changed, 105 insertions(+) create mode 100644 src/main/resources/assets/phycon/models/item/twisted_pair.json create mode 100644 src/main/resources/assets/phycon/textures/item/twisted_pair.png create mode 100644 src/main/resources/data/phycon/advancements/recipes/cable.json create mode 100644 src/main/resources/data/phycon/advancements/recipes/twisted_pair.json create mode 100644 src/main/resources/data/phycon/recipes/cable.json create mode 100644 src/main/resources/data/phycon/recipes/twisted_pair.json diff --git a/src/main/kotlin/net/shadowfacts/phycon/init/PhyItems.kt b/src/main/kotlin/net/shadowfacts/phycon/init/PhyItems.kt index 7f89cc3..cedfb54 100644 --- a/src/main/kotlin/net/shadowfacts/phycon/init/PhyItems.kt +++ b/src/main/kotlin/net/shadowfacts/phycon/init/PhyItems.kt @@ -4,6 +4,7 @@ import net.minecraft.item.BlockItem import net.minecraft.item.Item import net.minecraft.util.Identifier import net.minecraft.util.registry.Registry +import net.shadowfacts.phycon.PhysicalConnectivity import net.shadowfacts.phycon.item.ConsoleItem import net.shadowfacts.phycon.item.ScrewdriverItem import net.shadowfacts.phycon.block.cable.CableBlock @@ -34,6 +35,7 @@ object PhyItems { val SCREWDRIVER = ScrewdriverItem() val CONSOLE = ConsoleItem() + val TWISTED_PAIR = Item(Item.Settings()) fun init() { register(InterfaceBlock.ID, INTERFACE) @@ -48,6 +50,7 @@ object PhyItems { register(ScrewdriverItem.ID, SCREWDRIVER) register(ConsoleItem.ID, CONSOLE) + register(Identifier(PhysicalConnectivity.MODID, "twisted_pair"), TWISTED_PAIR) } private fun register(id: Identifier, item: Item) { diff --git a/src/main/resources/assets/phycon/lang/en_us.json b/src/main/resources/assets/phycon/lang/en_us.json index 0a981fd..b475786 100644 --- a/src/main/resources/assets/phycon/lang/en_us.json +++ b/src/main/resources/assets/phycon/lang/en_us.json @@ -11,6 +11,7 @@ "item.phycon.screwdriver": "Screwdriver", "item.phycon.console": "Console", + "item.phycon.twisted_pair": "Twisted Pair", "gui.phycon.terminal_buffer": "Buffer", "gui.phycon.console.details": "Device Details", diff --git a/src/main/resources/assets/phycon/models/item/twisted_pair.json b/src/main/resources/assets/phycon/models/item/twisted_pair.json new file mode 100644 index 0000000..ce0882a --- /dev/null +++ b/src/main/resources/assets/phycon/models/item/twisted_pair.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "phycon:item/twisted_pair" + } +} diff --git a/src/main/resources/assets/phycon/textures/item/twisted_pair.png b/src/main/resources/assets/phycon/textures/item/twisted_pair.png new file mode 100644 index 0000000000000000000000000000000000000000..a4a9c9ae98d753eae1d13c5c08628e47f2f2dfc6 GIT binary patch literal 709 zcmV;$0y_PPP)EX>4Tx04R}tkv&MmKpe$iQ?()$2P=pOW~fdUL`5963Pq?8YK2xEOfLNpnlvOS zE{=k0!NHHks)LKOt`4q(Aou~|=H{g6A|?JWDYS_3;J6>}?mh0_0Ya_BG^=e4&~)2O zCE{WxyCQ~O5kv?201U~@GG-+y3E%N`j{slqVm!;;BvB z;Ji;9VMSRbJ|`YE>4L(i|qi@Ory|+Nus@Gd%AEysMnz~Bf00)P_ zNP)7~eBRyJ+S|Wp8vXqM1pjh-D4BX-00006VoOIv06hQ`006#{+F<|y010qNS#tmY z3ljhU3ljkVnw%H_000McNliru(OBo%BHieValtH3}htt25Zhvp-5@(yWV)`$25o2A)Vr rsuqSI%}PTRkUNJLCj`9yzy3LH2rflT^t|+600000NkvXXu0mjfrx7k# literal 0 HcmV?d00001 diff --git a/src/main/resources/data/phycon/advancements/recipes/cable.json b/src/main/resources/data/phycon/advancements/recipes/cable.json new file mode 100644 index 0000000..1737a94 --- /dev/null +++ b/src/main/resources/data/phycon/advancements/recipes/cable.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "phycon:cable" + ] + }, + "criteria": { + "has_twisted_pair": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "phycon:twisted_pair" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "phycon:cable" + } + } + }, + "requirements": [ + [ + "has_twisted_pair", + "has_the_recipe" + ] + ] +} diff --git a/src/main/resources/data/phycon/advancements/recipes/twisted_pair.json b/src/main/resources/data/phycon/advancements/recipes/twisted_pair.json new file mode 100644 index 0000000..50eb218 --- /dev/null +++ b/src/main/resources/data/phycon/advancements/recipes/twisted_pair.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "phycon:twisted_pair" + ] + }, + "criteria": { + "has_copper_nuggets": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "c:copper_nuggets" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "phycon:twisted_pair" + } + } + }, + "requirements": [ + [ + "has_copper_nuggets", + "has_the_recipe" + ] + ] +} diff --git a/src/main/resources/data/phycon/recipes/cable.json b/src/main/resources/data/phycon/recipes/cable.json new file mode 100644 index 0000000..0e3065e --- /dev/null +++ b/src/main/resources/data/phycon/recipes/cable.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "CCC", + "TRT", + "CCC" + ], + "key": { + "C": {"tag": "minecraft:carpets"}, + "T": {"item": "phycon:twisted_pair"}, + "R": {"item": "minecraft:redstone"} + }, + "result": { + "item": "phycon:cable", + "count": 3 + } +} diff --git a/src/main/resources/data/phycon/recipes/twisted_pair.json b/src/main/resources/data/phycon/recipes/twisted_pair.json new file mode 100644 index 0000000..401e48a --- /dev/null +++ b/src/main/resources/data/phycon/recipes/twisted_pair.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "NNN", + " ", + "NNN" + ], + "key": { + "N": {"tag": "c:copper_nuggets"} + }, + "result": { + "item": "phycon:twisted_pair" + } +}