Skip to content

Commit bbee9e6

Browse files
committed
Fix
1 parent 6a252dc commit bbee9e6

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

src/main/resources/forge-1.19.4/utils/mcitems.ftl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,15 @@
169169
<#return (extension?has_content)?then("_" + extension, "")>
170170
</#function>
171171

172-
<#function mappedMCItemToItemObjectJSON mappedBlock>
172+
<#function mappedMCItemToItemObjectJSON mappedBlock itemKey="item">
173173
<#if mappedBlock.getUnmappedValue().startsWith("CUSTOM:")>
174174
<#assign customelement = generator.getRegistryNameFromFullName(mappedBlock.getUnmappedValue())!""/>
175175
<#if customelement?has_content>
176-
<#return "\"item\": \"" + "${modid}:" + customelement
176+
<#return "\"" + itemKey + "\": \"" + "${modid}:" + customelement
177177
+ transformExtension(mappedBlock)
178178
+ "\"">
179179
<#else>
180-
<#return "\"item\": \"minecraft:air\"">
180+
<#return "\"" + itemKey + "\": \"minecraft:air\"">
181181
</#if>
182182
<#elseif mappedBlock.getUnmappedValue().startsWith("TAG:")>
183183
<#return "\"tag\": \"" + mappedBlock.getUnmappedValue().replace("TAG:", "").replace("mod:", modid + ":")?lower_case + "\"">
@@ -186,9 +186,9 @@
186186
<#if mapped.startsWith("#")>
187187
<#return "\"tag\": \"" + mapped.replace("#", "") + "\"">
188188
<#elseif mapped.contains(":")>
189-
<#return "\"item\": \"" + mapped + "\"">
189+
<#return "\"" + itemKey + "\": \"" + mapped + "\"">
190190
<#else>
191-
<#return "\"item\": \"minecraft:" + mapped + "\"">
191+
<#return "\"" + itemKey + "\": \"minecraft:" + mapped + "\"">
192192
</#if>
193193
</#if>
194194
</#function>
@@ -318,6 +318,9 @@
318318
<#assign properties += [{"name": "axis", "value": "y"}] />
319319
</#if>
320320
</#if>
321+
<#list ge.customProperties as prop>
322+
<#assign properties += [{"name": prop.property().getName().replace("CUSTOM:", ""), "value": prop.value()}] />
323+
</#list>
321324
</#if>
322325
</#if>
323326

@@ -356,4 +359,4 @@
356359
</#if>
357360
</#if>
358361
<#return '{ "Name": "minecraft:air" }'>
359-
</#function>
362+
</#function>

src/main/resources/forge-1.19.4/variables/itemstack.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ scopes:
3636
set: |
3737
<#include "mcitems.ftl">
3838
{
39-
ItemStack _setval = ${mappedMCItemToItemStackCode(value, 1)}.copy();
39+
ItemStack _setval = ${mappedMCItemToItemStackCode(value, 1)};
4040
${entity}.getCapability(${JavaModName}Variables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
41-
capability.${name} = _setval;
41+
capability.${name} = _setval.copy();
4242
capability.syncPlayerVariables(${entity});
4343
});
4444
}
@@ -52,9 +52,9 @@ scopes:
5252
set: |
5353
<#include "mcitems.ftl">
5454
{
55-
ItemStack _setval = ${mappedMCItemToItemStackCode(value, 1)}.copy();
55+
ItemStack _setval = ${mappedMCItemToItemStackCode(value, 1)};
5656
${entity}.getCapability(${JavaModName}Variables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
57-
capability.${name} = _setval;
57+
capability.${name} = _setval.copy();
5858
capability.syncPlayerVariables(${entity});
5959
});
6060
}

0 commit comments

Comments
 (0)