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 000000000..ad6523e89 Binary files /dev/null and b/src/main/resources/assets/refinedstorage/textures/blocks/detector_side_on_glow.png differ 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