Skip to content

Commit

Permalink
fix: obj loader not rendering parts with the same name
Browse files Browse the repository at this point in the history
Fixes #1755 on 1.21.4
  • Loading branch information
IThundxr committed Dec 11, 2024
1 parent ac0abaf commit 7d3e6db
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
package net.neoforged.neoforge.client.model.obj;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
import com.google.common.collect.MultimapBuilder;
import com.mojang.math.Transformation;
import java.io.IOException;
import java.util.Arrays;
Expand Down Expand Up @@ -55,7 +56,7 @@ public class ObjModel extends AbstractUnbakedModel {
new Vec2(1, 0),
};

private final Map<String, ModelGroup> parts = Maps.newLinkedHashMap();
private final Multimap<String, ModelGroup> parts = MultimapBuilder.linkedHashKeys().arrayListValues().build();

private final List<Vector3f> positions = Lists.newArrayList();
private final List<Vec2> texCoords = Lists.newArrayList();
Expand Down Expand Up @@ -441,7 +442,7 @@ protected void addNamesRecursively(Set<String> names) {
}

public class ModelGroup extends ModelObject {
final Map<String, ModelObject> parts = Maps.newLinkedHashMap();
final Multimap<String, ModelObject> parts = MultimapBuilder.linkedHashKeys().arrayListValues().build();

ModelGroup(String name) {
super(name);
Expand Down

0 comments on commit 7d3e6db

Please sign in to comment.