Add some extra code statements as NBT was not updating properly
This commit is contained in:
parent
8f475afc9f
commit
20f405a809
3 changed files with 14 additions and 6 deletions
|
@ -5,4 +5,4 @@ org.gradle.daemon=false
|
||||||
|
|
||||||
mc_version=1.19.2
|
mc_version=1.19.2
|
||||||
forge_version=43.2.3
|
forge_version=43.2.3
|
||||||
myversion=1.0.3.1
|
myversion=1.0.3.2
|
|
@ -56,10 +56,17 @@ public class LoreContainer {
|
||||||
AssertLoreExists();
|
AssertLoreExists();
|
||||||
|
|
||||||
// Set the Lore
|
// Set the Lore
|
||||||
ListTag lst = associatedItem.getTag().getCompound(ItemStack.TAG_DISPLAY).getList(ItemStack.TAG_LORE, Tag.TAG_STRING);
|
CompoundTag tag = associatedItem.getTag();
|
||||||
|
CompoundTag display = tag.getCompound(ItemStack.TAG_DISPLAY);
|
||||||
|
ListTag lore = display.getList(ItemStack.TAG_LORE, Tag.TAG_STRING);
|
||||||
|
|
||||||
// Set the lore entry
|
// Set the lore entry
|
||||||
SetOrUpdateIndex(lst, loreEntryNumber, StringTag.valueOf(miscData.saveJson()));
|
SetOrUpdateIndex(lore, loreEntryNumber, StringTag.valueOf(miscData.saveJson()));
|
||||||
|
display.put(ItemStack.TAG_LORE, lore);
|
||||||
|
tag.put(ItemStack.TAG_DISPLAY, display);
|
||||||
|
associatedItem.setTag(tag);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetOrUpdateIndex(ListTag lst, int pos, Tag insert)
|
private void SetOrUpdateIndex(ListTag lst, int pos, Tag insert)
|
||||||
|
@ -92,6 +99,7 @@ public class LoreContainer {
|
||||||
if(display==null)
|
if(display==null)
|
||||||
{
|
{
|
||||||
tag.put(ItemStack.TAG_DISPLAY, new CompoundTag());
|
tag.put(ItemStack.TAG_DISPLAY, new CompoundTag());
|
||||||
|
associatedItem.setTag(tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,8 +113,8 @@ public class LoreContainer {
|
||||||
{
|
{
|
||||||
lore = new ListTag();
|
lore = new ListTag();
|
||||||
display.put(ItemStack.TAG_LORE, lore);
|
display.put(ItemStack.TAG_LORE, lore);
|
||||||
//tag.put(ItemStack.TAG_DISPLAY, display);
|
tag.put(ItemStack.TAG_DISPLAY, display);
|
||||||
//associatedItem.setTag(tag);
|
associatedItem.setTag(tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ modId="libzontreck" #mandatory
|
||||||
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
|
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
|
||||||
# ${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata
|
# ${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata
|
||||||
# see the associated build.gradle script for how to populate this completely automatically during a build
|
# see the associated build.gradle script for how to populate this completely automatically during a build
|
||||||
version="1.0.3.1" #mandatory
|
version="1.0.3.2" #mandatory
|
||||||
# A display name for the mod
|
# A display name for the mod
|
||||||
displayName="LibZontreck" #mandatory
|
displayName="LibZontreck" #mandatory
|
||||||
# A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/
|
# A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/
|
||||||
|
|
Reference in a new issue