Skip to content

Commit

Permalink
fix incorrect manual list insert (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
Glease authored Dec 1, 2023
1 parent 947eaa6 commit 099ac74
Showing 1 changed file with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,22 +187,7 @@ private void onButtonPress(PEventButton event)
((NBTTagCompound)nbt).setTag(flKey.getValue(), selected);
} else if(nbt.getId() == 9)
{
NBTTagList l = (NBTTagList)nbt;

if(index == l.tagCount())
{
l.appendTag(selected);
} else
{
// Shift entries up manually
List<NBTBase> tagList = NBTConverter.getTagList(l);
for(int n = tagList.size() - 1; n >= index; n--)
{
tagList.set(n + 1, tagList.get(n));
}

tagList.set(index, selected);
}
NBTConverter.getTagList((NBTTagList)nbt).add(index, selected);
}

mc.displayGuiScreen(this.parent);
Expand Down

0 comments on commit 099ac74

Please sign in to comment.