Skip to content

Commit

Permalink
Avoid using NBTTagList.tagList, which is only accessible because of a…
Browse files Browse the repository at this point in the history
… transitive AT
  • Loading branch information
phantamanta44 committed Mar 28, 2021
1 parent 579bc04 commit 4c76fbb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/main/java/gregtech/common/datafix/util/DataFixHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import net.minecraftforge.common.util.Constants;

import javax.annotation.Nullable;
import java.util.ListIterator;

public class DataFixHelper {

Expand All @@ -31,9 +30,8 @@ public static void rewriteCompoundTags(NBTTagCompound tag, CompoundRewriter rewr
}

public static void rewriteCompoundTags(NBTTagList tag, CompoundRewriter rewriter) {
ListIterator<NBTBase> iter = tag.tagList.listIterator();
while (iter.hasNext()) {
NBTBase childTag = iter.next();
for (int i = 0; i < tag.tagCount(); i++) {
NBTBase childTag = tag.get(i);
switch (childTag.getId()) {
case Constants.NBT.TAG_LIST:
rewriteCompoundTags((NBTTagList) childTag, rewriter);
Expand All @@ -43,7 +41,7 @@ public static void rewriteCompoundTags(NBTTagList tag, CompoundRewriter rewriter
rewriteCompoundTags(childTagCompound, rewriter);
childTagCompound = rewriter.rewrite(childTagCompound);
if (childTagCompound != null) {
iter.set(childTagCompound);
tag.set(i, childTagCompound);
}
break;
}
Expand Down

0 comments on commit 4c76fbb

Please sign in to comment.