From b00387cf6123c16d13375b8853da22500b8e31c1 Mon Sep 17 00:00:00 2001 From: NOYB <61475257+NOYBss@users.noreply.github.com> Date: Tue, 28 Jul 2020 19:44:26 +0300 Subject: [PATCH] Custom Block Item Support --- forge-1.12.2/templates/json/block_item.json.ftl | 13 ++++++++++++- .../templates/json/block_item_cmodel.json.ftl | 10 ++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/forge-1.12.2/templates/json/block_item.json.ftl b/forge-1.12.2/templates/json/block_item.json.ftl index 70094dd..4f92fd1 100644 --- a/forge-1.12.2/templates/json/block_item.json.ftl +++ b/forge-1.12.2/templates/json/block_item.json.ftl @@ -1,3 +1,12 @@ +<#-- @formatter:off --> +<#if data.itemTexture?has_content> +{ + "parent": "item/generated", + "textures": { + "layer0": "${modid}:items/${data.itemTexture}" + } +} +<#else> { "parent": "${modid}:block/${registryname}", "display": { @@ -19,4 +28,6 @@ ] } } -} \ No newline at end of file +} + +<#-- @formatter:on --> \ No newline at end of file diff --git a/forge-1.12.2/templates/json/block_item_cmodel.json.ftl b/forge-1.12.2/templates/json/block_item_cmodel.json.ftl index 507a6a0..aeeffe9 100644 --- a/forge-1.12.2/templates/json/block_item_cmodel.json.ftl +++ b/forge-1.12.2/templates/json/block_item_cmodel.json.ftl @@ -1,6 +1,12 @@ +<#-- @formatter:off --> { "parent": "item/handheld", "textures": { -"layer0": "${modid}:blocks/${data.texture}" + <#if data.itemTexture?has_content> + "layer0": "${modid}:items/${data.itemTexture}" + <#else> + "layer0": "${modid}:blocks/${data.texture}" + } -} \ No newline at end of file +} +<#-- @formatter:on --> \ No newline at end of file