Skip to content

Commit

Permalink
yeah
Browse files Browse the repository at this point in the history
  • Loading branch information
UnlikePaladin committed Dec 24, 2023
1 parent 5d25a56 commit a1672b5
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public IModelData getModelData(@NotNull BlockRenderView world, @NotNull BlockPos
return tileData;
}

Map<Sprite, List<BakedQuad>> separatedQuads = new ConcurrentHashMap<>();
Map<Identifier, List<BakedQuad>> separatedQuads = new ConcurrentHashMap<>();
public List<BakedQuad> getQuadsWithTexture(List<BakedQuad> quads, List<Sprite> toReplace, List<Sprite> replacements) {
if (replacements == null || toReplace == null || toReplace.size() != replacements.size()) {
PaladinFurnitureMod.GENERAL_LOGGER.warn("Replacement list is not the same size or was null, skipping transformation");
Expand All @@ -55,7 +55,7 @@ public List<BakedQuad> getQuadsWithTexture(List<BakedQuad> quads, List<Sprite> t
return quads;

for (BakedQuad quad : quads) {
Sprite sprite = quad.getSprite();
Identifier sprite = quad.getSprite().getId();
if (separatedQuads.containsKey(sprite)) {
if (!separatedQuads.get(sprite).contains(quad))
separatedQuads.get(sprite).add(quad);
Expand All @@ -66,8 +66,8 @@ public List<BakedQuad> getQuadsWithTexture(List<BakedQuad> quads, List<Sprite> t
}

List<BakedQuad> transformedQuads = new ArrayList<>(quads.size());
for (Map.Entry<Sprite, List<BakedQuad>> entry : separatedQuads.entrySet()) {
Identifier keyId = entry.getKey().getId();
for (Map.Entry<Identifier, List<BakedQuad>> entry : separatedQuads.entrySet()) {
Identifier keyId = entry.getKey();
int index = IntStream.range(0, toReplace.size())
.filter(i -> keyId.equals(toReplace.get(i).getId()))
.findFirst()
Expand Down Expand Up @@ -120,7 +120,7 @@ else if (quadToTransformedQuad.containsKey(quadKey)) {
return transformedQuads;
}

private static final Map<Pair<VertexFormatElement.Type, Integer>, Integer> ELEMENT_INTEGER_MAP = new HashMap<>();
private static final Map<Pair<VertexFormatElement.Type, Integer>, Integer> ELEMENT_INTEGER_MAP = new ConcurrentHashMap<>();
public static int findVertexElement(VertexFormatElement.Type type, int index) {
Pair<VertexFormatElement.Type, Integer> pairToFind = new Pair<>(type, index);
if (ELEMENT_INTEGER_MAP.containsKey(pairToFind))
Expand Down

0 comments on commit a1672b5

Please sign in to comment.