File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
src/main/resources/forge-1.12.2/variables Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,7 @@ scopes:
3131 read : instance.${var.getName()} = new ItemStack(nbt.getCompoundTag("${var.getName()}"));
3232 write : nbt.setTag("${var.getName()}", instance.${var.getName()}.writeToNBT(new NBTTagCompound()));
3333 get : |
34- /*@ItemStack*/((${entity}.getCapability(${JavaModName}Variables.PLAYER_VARIABLES_CAPABILITY, null)
35- .orElse(new ${JavaModName}Variables.PlayerVariables())).${name})
34+ /*@ItemStack*/((Objects.requireNonNullElseGet(${entity}.getCapability(${JavaModName}Variables.PLAYER_VARIABLES_CAPABILITY, null), PlayerVariables::new).${name})
3635 set : |
3736 <#include "mcitems.ftl">
3837 {
@@ -47,8 +46,7 @@ scopes:
4746 read : instance.${var.getName()} = new ItemStack(nbt.getCompoundTag("${var.getName()}"));
4847 write : nbt.setTag("${var.getName()}", instance.${var.getName()}.writeToNBT(new NBTTagCompound()));
4948 get : |
50- /*@ItemStack*/((${entity}.getCapability(${JavaModName}Variables.PLAYER_VARIABLES_CAPABILITY, null)
51- .orElse(new ${JavaModName}Variables.PlayerVariables())).${name})
49+ /*@ItemStack*/((Objects.requireNonNullElseGet(${entity}.getCapability(${JavaModName}Variables.PLAYER_VARIABLES_CAPABILITY, null), PlayerVariables::new).${name})
5250 set : |
5351 <#include "mcitems.ftl">
5452 {
You can’t perform that action at this time.
0 commit comments