Skip to content

Commit

Permalink
Merge 1.16 into 1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
embeddedt committed Dec 24, 2023
2 parents cef8abe + 97ba361 commit 7e57ad8
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.embeddedt.modernfix.render;

import com.google.common.collect.ImmutableList;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.ItemOverrides;
Expand Down Expand Up @@ -42,19 +41,20 @@ private boolean isCorrectDirectionForType(Direction direction) {

@Override
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, Random rand) {
if(side != null) {
return isCorrectDirectionForType(side) ? wrappedItem.getQuads(state, side, rand) : ImmutableList.of();
} else {
nullQuadList.clear();
List<BakedQuad> realList = wrappedItem.getQuads(state, null, rand);
for(int i = 0; i < realList.size(); i++) {
BakedQuad quad = realList.get(i);
if(isCorrectDirectionForType(quad.getDirection())) {
nullQuadList.add(quad);
}
boolean isWholeListValid = isCorrectDirectionForType(side);
List<BakedQuad> realList = wrappedItem.getQuads(state, side, rand);
if (isWholeListValid) {
return realList;
}
nullQuadList.clear();
//noinspection ForLoopReplaceableByForEach
for(int i = 0; i < realList.size(); i++) {
BakedQuad quad = realList.get(i);
if(isCorrectDirectionForType(quad.getDirection())) {
nullQuadList.add(quad);
}
return nullQuadList;
}
return nullQuadList;
}

@Override
Expand Down

0 comments on commit 7e57ad8

Please sign in to comment.