From 8938fc8e672a900fa7edb4cfef4df490958a216f Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 30 Jul 2017 16:43:27 +0200 Subject: [PATCH] Added CTM integration for Detector --- .../refinedstorage/proxy/ProxyClient.java | 9 +- .../blockstates/detector_glow.json | 31 ++ .../models/block/detector_glow.json | 350 ++++++++++++++++++ .../textures/blocks/detector_side_on_glow.png | Bin 0 -> 262 bytes .../blocks/detector_side_on_glow.png.mcmeta | 9 + 5 files changed, 398 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/assets/refinedstorage/blockstates/detector_glow.json create mode 100644 src/main/resources/assets/refinedstorage/models/block/detector_glow.json create mode 100644 src/main/resources/assets/refinedstorage/textures/blocks/detector_side_on_glow.png create mode 100644 src/main/resources/assets/refinedstorage/textures/blocks/detector_side_on_glow.png.mcmeta diff --git a/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyClient.java b/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyClient.java index 5d0d01382..c18425561 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyClient.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyClient.java @@ -206,7 +206,6 @@ public class ProxyClient extends ProxyCommon { ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.READER), 0, new ModelResourceLocation("refinedstorage:reader", "inventory")); ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.WRITER), 0, new ModelResourceLocation("refinedstorage:writer", "inventory")); ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.SOLDERER), 0, new ModelResourceLocation("refinedstorage:solderer", "inventory")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.DETECTOR), 0, new ModelResourceLocation("refinedstorage:detector", "inventory")); ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.RELAY), 0, new ModelResourceLocation("refinedstorage:relay", "inventory")); ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.INTERFACE), 0, new ModelResourceLocation("refinedstorage:interface", "inventory")); ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.FLUID_INTERFACE), 0, new ModelResourceLocation("refinedstorage:fluid_interface", "inventory")); @@ -272,6 +271,14 @@ public class ProxyClient extends ProxyCommon { } }); + ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.DETECTOR), 0, new ModelResourceLocation("refinedstorage:detector", "inventory")); + ModelLoader.setCustomStateMapper(RSBlocks.DETECTOR, new StateMapperBase() { + @Override + protected ModelResourceLocation getModelResourceLocation(IBlockState state) { + return new ModelResourceLocation("refinedstorage:detector" + (Loader.isModLoaded("ctm") ? "_glow" : ""), getPropertyString(state.getProperties())); + } + }); + ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(RSBlocks.CONTROLLER), stack -> { ControllerEnergyType energyType = stack.getItemDamage() == ControllerType.CREATIVE.getId() ? ControllerEnergyType.ON : TileController.getEnergyType(ItemBlockController.getEnergyStored(stack), ItemBlockController.getEnergyCapacity(stack)); diff --git a/src/main/resources/assets/refinedstorage/blockstates/detector_glow.json b/src/main/resources/assets/refinedstorage/blockstates/detector_glow.json new file mode 100644 index 000000000..0fb810fc4 --- /dev/null +++ b/src/main/resources/assets/refinedstorage/blockstates/detector_glow.json @@ -0,0 +1,31 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "refinedstorage:detector_glow", + "textures": { + "particle": "refinedstorage:blocks/detector_top", + "torch": "refinedstorage:blocks/detector_side_off", + "side": "refinedstorage:blocks/detector_side_off", + "top": "refinedstorage:blocks/detector_top", + "bottom": "refinedstorage:blocks/detector_bottom", + "glow": "refinedstorage:blocks/none" + } + }, + "variants": { + "inventory": [ + { + "transform": "forge:default-block" + } + ], + "powered": { + "true": { + "textures": { + "torch": "refinedstorage:blocks/detector_side_on", + "glow": "refinedstorage:blocks/detector_side_on_glow" + } + }, + "false": { + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/refinedstorage/models/block/detector_glow.json b/src/main/resources/assets/refinedstorage/models/block/detector_glow.json new file mode 100644 index 000000000..3dc37813d --- /dev/null +++ b/src/main/resources/assets/refinedstorage/models/block/detector_glow.json @@ -0,0 +1,350 @@ +{ + "__comment": "Model made by CyanideX", + "elements": [ + { + "name": "Element", + "from": [ + 7.0, + 5.0, + 7.0 + ], + "to": [ + 9.0, + 10.0, + 9.0 + ], + "shade": false, + "faces": { + "north": { + "texture": "#torch", + "uv": [ + 7.0, + 5.0, + 9.0, + 11.0 + ] + }, + "east": { + "texture": "#torch", + "uv": [ + 7.0, + 5.0, + 9.0, + 11.0 + ] + }, + "south": { + "texture": "#torch", + "uv": [ + 7.0, + 5.0, + 9.0, + 11.0 + ] + }, + "west": { + "texture": "#torch", + "uv": [ + 7.0, + 5.0, + 9.0, + 11.0 + ] + }, + "up": { + "texture": "#torch", + "uv": [ + 7.0, + 5.0, + 9.0, + 7.0 + ] + }, + "down": { + "texture": "#torch", + "uv": [ + 7.0, + 7.0, + 9.0, + 9.0 + ] + } + } + }, + { + "name": "Element", + "from": [ + 7.0, + 5.0, + 6.0 + ], + "to": [ + 9.0, + 11.0, + 10.0 + ], + "shade": false, + "faces": { + "east": { + "texture": "#torch", + "uv": [ + 6.0, + 4.0, + 10.0, + 11.0 + ] + }, + "west": { + "texture": "#torch", + "uv": [ + 6.0, + 4.0, + 10.0, + 11.0 + ] + } + } + }, + { + "name": "Element", + "from": [ + 6.0, + 5.0, + 7.0 + ], + "to": [ + 10.0, + 11.0, + 9.0 + ], + "shade": false, + "faces": { + "north": { + "texture": "#torch", + "uv": [ + 6.0, + 4.0, + 10.0, + 11.0 + ] + }, + "south": { + "texture": "#torch", + "uv": [ + 6.0, + 4.0, + 10.0, + 11.0 + ] + } + } + }, + { + "name": "Element", + "from": [ + 7.0, + 5.0, + 7.0 + ], + "to": [ + 9.0, + 10.0, + 9.0 + ], + "shade": false, + "faces": { + "north": { + "texture": "#glow", + "uv": [ + 7.0, + 5.0, + 9.0, + 11.0 + ] + }, + "east": { + "texture": "#glow", + "uv": [ + 7.0, + 5.0, + 9.0, + 11.0 + ] + }, + "south": { + "texture": "#glow", + "uv": [ + 7.0, + 5.0, + 9.0, + 11.0 + ] + }, + "west": { + "texture": "#glow", + "uv": [ + 7.0, + 5.0, + 9.0, + 11.0 + ] + }, + "up": { + "texture": "#glow", + "uv": [ + 7.0, + 5.0, + 9.0, + 7.0 + ] + }, + "down": { + "texture": "#glow", + "uv": [ + 7.0, + 7.0, + 9.0, + 9.0 + ] + } + } + }, + { + "name": "Element", + "from": [ + 7.0, + 5.0, + 6.0 + ], + "to": [ + 9.0, + 11.0, + 10.0 + ], + "shade": false, + "faces": { + "east": { + "texture": "#glow", + "uv": [ + 6.0, + 4.0, + 10.0, + 11.0 + ] + }, + "west": { + "texture": "#glow", + "uv": [ + 6.0, + 4.0, + 10.0, + 11.0 + ] + } + } + }, + { + "name": "Element", + "from": [ + 6.0, + 5.0, + 7.0 + ], + "to": [ + 10.0, + 11.0, + 9.0 + ], + "shade": false, + "faces": { + "north": { + "texture": "#glow", + "uv": [ + 6.0, + 4.0, + 10.0, + 11.0 + ] + }, + "south": { + "texture": "#glow", + "uv": [ + 6.0, + 4.0, + 10.0, + 11.0 + ] + } + } + }, + { + "name": "base", + "from": [ + 0.0, + 0.0, + 0.0 + ], + "to": [ + 16.0, + 5.0, + 16.0 + ], + "faces": { + "north": { + "texture": "#side", + "uv": [ + 0.0, + 11.0, + 16.0, + 16.0 + ] + }, + "east": { + "texture": "#side", + "uv": [ + 0.0, + 11.0, + 16.0, + 16.0 + ] + }, + "south": { + "texture": "#side", + "uv": [ + 0.0, + 11.0, + 16.0, + 16.0 + ] + }, + "west": { + "texture": "#side", + "uv": [ + 0.0, + 11.0, + 16.0, + 16.0 + ] + }, + "up": { + "texture": "#top", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + }, + "down": { + "texture": "#bottom", + "uv": [ + 0.0, + 0.0, + 16.0, + 16.0 + ] + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/detector_side_on_glow.png b/src/main/resources/assets/refinedstorage/textures/blocks/detector_side_on_glow.png new file mode 100644 index 0000000000000000000000000000000000000000..ad6523e89de92ccee19338c2ad418032f471136c GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33 zJwr2>%=KS^ipo4)978Ppm!8?k#S|#ueDTl!_Q*~JE+r1JB*jx=+})`)8~1UubzhE2 zQ@UM$@WufUl!%&l>CcDj)rV#ukVrmY^?vPXMP}u-cLI5Q%U|!&1m08pbHp0UHx3vIVCg!09UeHiU0rr literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/detector_side_on_glow.png.mcmeta b/src/main/resources/assets/refinedstorage/textures/blocks/detector_side_on_glow.png.mcmeta new file mode 100644 index 000000000..eea6c1fe1 --- /dev/null +++ b/src/main/resources/assets/refinedstorage/textures/blocks/detector_side_on_glow.png.mcmeta @@ -0,0 +1,9 @@ +{ + "ctm": { + "ctm_version": 1, + "layer": "CUTOUT", + "extra": { + "light": 15 + } + } +} \ No newline at end of file