|
1 | 1 | package org.embeddedt.modernfix.render; |
2 | 2 |
|
3 | | -import com.google.common.collect.ImmutableList; |
4 | 3 | import it.unimi.dsi.fastutil.objects.ObjectArrayList; |
5 | 4 | import net.minecraft.client.renderer.block.model.BakedQuad; |
6 | 5 | import net.minecraft.client.renderer.block.model.ItemOverrides; |
@@ -42,19 +41,20 @@ private boolean isCorrectDirectionForType(Direction direction) { |
42 | 41 |
|
43 | 42 | @Override |
44 | 43 | public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, Random rand) { |
45 | | - if(side != null) { |
46 | | - return isCorrectDirectionForType(side) ? wrappedItem.getQuads(state, side, rand) : ImmutableList.of(); |
47 | | - } else { |
48 | | - nullQuadList.clear(); |
49 | | - List<BakedQuad> realList = wrappedItem.getQuads(state, null, rand); |
50 | | - for(int i = 0; i < realList.size(); i++) { |
51 | | - BakedQuad quad = realList.get(i); |
52 | | - if(isCorrectDirectionForType(quad.getDirection())) { |
53 | | - nullQuadList.add(quad); |
54 | | - } |
| 44 | + boolean isWholeListValid = isCorrectDirectionForType(side); |
| 45 | + List<BakedQuad> realList = wrappedItem.getQuads(state, side, rand); |
| 46 | + if (isWholeListValid) { |
| 47 | + return realList; |
| 48 | + } |
| 49 | + nullQuadList.clear(); |
| 50 | + //noinspection ForLoopReplaceableByForEach |
| 51 | + for(int i = 0; i < realList.size(); i++) { |
| 52 | + BakedQuad quad = realList.get(i); |
| 53 | + if(isCorrectDirectionForType(quad.getDirection())) { |
| 54 | + nullQuadList.add(quad); |
55 | 55 | } |
56 | | - return nullQuadList; |
57 | 56 | } |
| 57 | + return nullQuadList; |
58 | 58 | } |
59 | 59 |
|
60 | 60 | @Override |
|
0 commit comments