From f228d2178d3d93e5dedbc89420166b55a465df4b Mon Sep 17 00:00:00 2001 From: malte0811 Date: Sun, 5 Aug 2018 21:21:05 +0200 Subject: [PATCH] Recipe and better texture for the redstone controller --- .../industrialWires/IndustrialWires.java | 1 + .../blocks/controlpanel/BlockTypes_Panel.java | 3 +- .../factories/OtherBundledRedstone.java | 31 ++++++++++++++++++ .../blockstates/control_panel.json | 14 +++++--- .../industrialwires/models/block/rings.json | 16 +++++++++ .../industrialwires/recipes/_factories.json | 3 +- .../recipes/control_panel_rs_other.json | 26 +++++++++++++++ ...roller.json => control_panel_rs_wire.json} | 0 .../textures/blocks/rs_panel_others.png | Bin 621 -> 538 bytes .../blocks/rs_panel_others_flipped.png | Bin 0 -> 585 bytes 10 files changed, 88 insertions(+), 6 deletions(-) create mode 100644 src/main/java/malte0811/industrialWires/crafting/factories/OtherBundledRedstone.java create mode 100644 src/main/resources/assets/industrialwires/models/block/rings.json create mode 100644 src/main/resources/assets/industrialwires/recipes/control_panel_rs_other.json rename src/main/resources/assets/industrialwires/recipes/{control_panel_rs_controller.json => control_panel_rs_wire.json} (100%) create mode 100644 src/main/resources/assets/industrialwires/textures/blocks/rs_panel_others_flipped.png diff --git a/src/main/java/malte0811/industrialWires/IndustrialWires.java b/src/main/java/malte0811/industrialWires/IndustrialWires.java index 113419e..3fd6cb7 100644 --- a/src/main/java/malte0811/industrialWires/IndustrialWires.java +++ b/src/main/java/malte0811/industrialWires/IndustrialWires.java @@ -189,6 +189,7 @@ public class IndustrialWires { GameRegistry.registerTileEntity(TileEntityJacobsLadder.class, new ResourceLocation(MODID, "jacobsLadder")); GameRegistry.registerTileEntity(TileEntityMarx.class, new ResourceLocation(MODID, "marx_generator")); GameRegistry.registerTileEntity(TileEntityPanel.class, new ResourceLocation(MODID, "control_panel")); + GameRegistry.registerTileEntity(TileEntityGeneralCP.class, new ResourceLocation(MODID, "gcp")); GameRegistry.registerTileEntity(TileEntityRSPanelIE.class, new ResourceLocation(MODID, "control_panel_rs")); GameRegistry.registerTileEntity(TileEntityRSPanelOthers.class, new ResourceLocation(MODID, "control_panel_rs_compat")); GameRegistry.registerTileEntity(TileEntityPanelCreator.class, new ResourceLocation(MODID, "panel_creator")); diff --git a/src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockTypes_Panel.java b/src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockTypes_Panel.java index 80077e2..0606ce9 100644 --- a/src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockTypes_Panel.java +++ b/src/main/java/malte0811/industrialWires/blocks/controlpanel/BlockTypes_Panel.java @@ -15,6 +15,7 @@ package malte0811.industrialWires.blocks.controlpanel; +import malte0811.industrialWires.compat.Compat; import net.minecraft.util.IStringSerializable; import java.util.Locale; @@ -35,7 +36,7 @@ public enum BlockTypes_Panel implements IStringSerializable { public boolean showInCreative() { if (this==OTHER_RS_WIRES) { - + return Compat.enableOtherRS; } return this != SINGLE_COMP; } diff --git a/src/main/java/malte0811/industrialWires/crafting/factories/OtherBundledRedstone.java b/src/main/java/malte0811/industrialWires/crafting/factories/OtherBundledRedstone.java new file mode 100644 index 0000000..c3d26fe --- /dev/null +++ b/src/main/java/malte0811/industrialWires/crafting/factories/OtherBundledRedstone.java @@ -0,0 +1,31 @@ +/* + * This file is part of Industrial Wires. + * Copyright (C) 2016-2018 malte0811 + * Industrial Wires is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * Industrial Wires is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with Industrial Wires. If not, see . + */ + +package malte0811.industrialWires.crafting.factories; + +import com.google.gson.JsonObject; +import malte0811.industrialWires.compat.Compat; +import net.minecraftforge.common.crafting.IConditionFactory; +import net.minecraftforge.common.crafting.JsonContext; + +import java.util.function.BooleanSupplier; + +public class OtherBundledRedstone implements IConditionFactory { + + @Override + public BooleanSupplier parse(JsonContext context, JsonObject json) { + return () -> Compat.enableOtherRS; + } +} diff --git a/src/main/resources/assets/industrialwires/blockstates/control_panel.json b/src/main/resources/assets/industrialwires/blockstates/control_panel.json index 3ff974c..84ac7a6 100644 --- a/src/main/resources/assets/industrialwires/blockstates/control_panel.json +++ b/src/main/resources/assets/industrialwires/blockstates/control_panel.json @@ -72,8 +72,11 @@ "model": "industrialwires:smartmodel/panel_single_comp" }, "other_rs_wires": { - "model": "cube_all", - "textures": {"all": "industrialwires:blocks/rs_panel_others"} + "model": "industrialwires:rings", + "textures": { + "normal": "industrialwires:blocks/rs_panel_others", + "flipped": "industrialwires:blocks/rs_panel_others_flipped" + } } }, "inventory,type=rs_wire": { @@ -113,8 +116,11 @@ //Doesn't matter, this will be overridden in code }, "inventory,type=other_rs_wires": { - "model": "cube_all", - "textures": {"all": "industrialwires:blocks/rs_panel_others"} + "model": "industrialwires:rings", + "textures": { + "normal": "industrialwires:blocks/rs_panel_others", + "flipped": "industrialwires:blocks/rs_panel_others_flipped" + } } } } diff --git a/src/main/resources/assets/industrialwires/models/block/rings.json b/src/main/resources/assets/industrialwires/models/block/rings.json new file mode 100644 index 0000000..919a75a --- /dev/null +++ b/src/main/resources/assets/industrialwires/models/block/rings.json @@ -0,0 +1,16 @@ +{ + "parent": "block/block", + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "texture": "#flipped", "cullface": "down", "rotation": 90 }, + "up": { "texture": "#normal", "cullface": "up", "rotation": 0 }, + "north": { "texture": "#flipped", "cullface": "north", "rotation": 0 }, + "south": { "texture": "#normal", "cullface": "south", "rotation": 270 }, + "west": { "texture": "#flipped", "cullface": "west", "rotation": 90 }, + "east": { "texture": "#normal", "cullface": "east", "rotation": 180 } + } + } + ] +} diff --git a/src/main/resources/assets/industrialwires/recipes/_factories.json b/src/main/resources/assets/industrialwires/recipes/_factories.json index b5db864..803dae6 100644 --- a/src/main/resources/assets/industrialwires/recipes/_factories.json +++ b/src/main/resources/assets/industrialwires/recipes/_factories.json @@ -1,6 +1,7 @@ { "conditions" : { - "conversion": "malte0811.industrialWires.crafting.factories.IsConversionEnabled" + "conversion": "malte0811.industrialWires.crafting.factories.IsConversionEnabled", + "other_bundled_redstone": "malte0811.industrialWires.crafting.factories.OtherBundledRedstone" }, "recipes": { "component_init": "malte0811.industrialWires.crafting.factories.InitPCFactory", diff --git a/src/main/resources/assets/industrialwires/recipes/control_panel_rs_other.json b/src/main/resources/assets/industrialwires/recipes/control_panel_rs_other.json new file mode 100644 index 0000000..c19170a --- /dev/null +++ b/src/main/resources/assets/industrialwires/recipes/control_panel_rs_other.json @@ -0,0 +1,26 @@ +{ + "result": { + "item": "industrialwires:control_panel", + "data": 6 + }, + "pattern": [ + " r ", + "rdr", + " r " + ], + "type": "minecraft:crafting_shaped", + "key": { + "r": { + "type": "forge:ore_dict", "ore": "dustRedstone" + }, + "d": { + "item": "industrialwires:control_panel", + "data": 2 + } + }, + "conditions": [ + { + "type": "industrialwires:other_bundled_redstone" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/industrialwires/recipes/control_panel_rs_controller.json b/src/main/resources/assets/industrialwires/recipes/control_panel_rs_wire.json similarity index 100% rename from src/main/resources/assets/industrialwires/recipes/control_panel_rs_controller.json rename to src/main/resources/assets/industrialwires/recipes/control_panel_rs_wire.json diff --git a/src/main/resources/assets/industrialwires/textures/blocks/rs_panel_others.png b/src/main/resources/assets/industrialwires/textures/blocks/rs_panel_others.png index 4fa909cc950ae179d4f702060eca081324de1d39..d19230be008d02c8ad8c7dd9a186eb586dfd0e4f 100644 GIT binary patch delta 483 zcmV<90UZAA1eyepL4O4jBO>IT>OlYi0l7&;K~yNub&|h}6HySyKl651aI<%WfGKj@ zoM2~RafM~Dwll#>un+`0Yr#fD1VymXP7y&Y#8R&k6s`&)Wq@bZ(7+<~$1<+F7y?vKEzkDtS3xp?t>-1tHPUtBN-+xEEKxrw9gfh(0JRMl4z zRU@0*ZFUz$%;)4M>9Smih`Y2qwl5;?Wx<@K;2DE#%;p*6d!FZvq}Cc^{#8K4V4T%d Z>>n|125*Tn?tK6N002ovPDHLkV1l8U?*;$> delta 567 zcmV-70?7TE1nmTnL4N@fH4;(2_-z0H0t`t+K~yNuMUlU26mby6Kl9yPF?V~xB)Z^v z&7qcQBtj5`*xT8N3Pw<{vb7MzM${@2&_V@8#9t}=11t>K2#Sq%BG;T(tR#`#?w;J< zcgAAx&S8pynRzqsJ$d!!4yZAXyJuem%d6kAjE`Se2F2Ec^?%i>WoBk&=p-^!CJQy{ z1$mZ{B*e2#KqRPIf|*Dt62NqxPUBR)vHhOEq+I#EG1o0c&WtZ$f;c1)2?SSV>AQJ< ze$f0=E){d#vJKz@7Y43^cJg*(Z35r~5CK$&&g}sOH+>27hRXhfi!-%_Yd<&Jpc`uy zIg$TQBEi**pMRsE)$V^N$lXkBA)amSw4x5Ec{4Lq&8vB@L$5>AQ53Z5jqQRQ2u~i{ zOcEZaN6V$+p$>rx-pr~i3i+ic+S|9xk2uD~F=+}g>J8PGpl068gBq$jGAqO89w14` zGQv;K7J)|dgzL}SaZ~RVL?m!dy$4kF#`Rx2t?1o>bAQ=x&sApS{rS>&4fQrQedN72 zQ!ukO%yr9bw>K!Zl#k1?N>m5pfgw9IPK+iD#SVlb31A_uk%w zdf-ko@h~xPE)0SIGr&}xbAw_FNK@h%pdd%Y;VLOi^dFTu1OdI{u^<2d002ovPDHLk FV1oX85O@Fp diff --git a/src/main/resources/assets/industrialwires/textures/blocks/rs_panel_others_flipped.png b/src/main/resources/assets/industrialwires/textures/blocks/rs_panel_others_flipped.png new file mode 100644 index 0000000000000000000000000000000000000000..910ab694518fd732fcb7231ccc5a6809d561b280 GIT binary patch literal 585 zcmV-P0=E5$P)<{92XskIMF-*t1rjnaME$rK0005#NklLJ-qgXd@|t)#2X|OCimHSO_+jCum`zhuB%GAaX<-L8~jYunE_sv^a}3MGkYv zWwQs_>>G>CzU&r<1CI|L?>F-sW}bZb_*}uFtmDycM3RQsy+fAc1rG;jY=sF|5BA*~ zRYf(yH&Q{dNFhOWW6FHi!VUu}1Z;&Tv;ixgdm|_+f-mAhNe=T_BXiJ+S&kQ+wki-N zTq`6{6hZJ24?#fnzYY|GXAA(TwWxwYQzupoV4Q=b6LZl#c$jkP_G9}DaW(k8v?4t%pFa=9+0G=tD1At`$T0J@Z|Lgx59*hbODH& zm*~%KA7VQ(b{Ld+WmxC&!7tjtQ@IJu>GnrN5!7lp8i3_^L6HEvKYxQ0!;M}h-rlA} zc>&r6j)9zcyjzL8{SiR`gKs<3Hk(A}V@E%qaf!f}Ki2`c^I*he0$;!Ha1s9nC{f