diff --git a/common/src/main/java/org/embeddedt/modernfix/render/SimpleItemModelView.java b/common/src/main/java/org/embeddedt/modernfix/render/SimpleItemModelView.java index 0b745c3fb..3ab43fe42 100644 --- a/common/src/main/java/org/embeddedt/modernfix/render/SimpleItemModelView.java +++ b/common/src/main/java/org/embeddedt/modernfix/render/SimpleItemModelView.java @@ -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; @@ -42,19 +41,20 @@ private boolean isCorrectDirectionForType(Direction direction) { @Override public List 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 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 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