Skip to content

Commit

Permalink
-Fixed issue where redstone panel item with no data was not being ren…
Browse files Browse the repository at this point in the history
…dered.
  • Loading branch information
dannydjdk committed Oct 21, 2021
1 parent 9d39208 commit fa2f5d0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 28 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

version = '1.16.5-1.10.7'
version = '1.16.5-1.11.1'
group = 'com.dannyandson.tinyredstone' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'tinyredstone'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,33 +57,7 @@ public void renderByItem(ItemStack stack, ItemCameraTransforms.TransformType p_2
}
} else {

matrixStack.pushPose();
matrixStack.mulPose(Vector3f.XP.rotationDegrees(270));
matrixStack.translate(0, -1, 0.125);
drawRectangle(builder, matrixStack, 0, 1, 0, 1, sprite, combinedLight, color);

matrixStack.mulPose(Vector3f.XP.rotationDegrees(90));
matrixStack.translate(0, -0.125, 0);
drawRectangle(builder, matrixStack, 0, 1, 0, .125f, sprite, combinedLight, color);

matrixStack.mulPose(Vector3f.YP.rotationDegrees(90));
matrixStack.translate(0, 0, 1);
drawRectangle(builder, matrixStack, 0, 1, 0, .125f, sprite, combinedLight, color);

matrixStack.mulPose(Vector3f.YP.rotationDegrees(90));
matrixStack.translate(0, 0, 1);
drawRectangle(builder, matrixStack, 0, 1, 0, .125f, sprite, combinedLight, color);

matrixStack.mulPose(Vector3f.YP.rotationDegrees(90));
matrixStack.translate(0, 0, 1);
drawRectangle(builder, matrixStack, 0, 1, 0, .125f, sprite, combinedLight, color);

matrixStack.mulPose(Vector3f.XP.rotationDegrees(90));
matrixStack.translate(0, -1, 0);
drawRectangle(builder, matrixStack, 0, 1, 0, 1, sprite, combinedLight, color);

matrixStack.popPose();

renderBase(matrixStack,builder,sprite,combinedLight,color);

CompoundNBT cellsNBT = stack.getTag().getCompound("BlockEntityTag").getCompound("cells");
for (Integer i = 0; i < 448; i++) {
Expand All @@ -107,12 +81,43 @@ public void renderByItem(ItemStack stack, ItemCameraTransforms.TransformType p_2
}
}
}
} else {
renderBase(matrixStack,builder,sprite,combinedLight,color);
}

matrixStack.popPose();

}

private void renderBase(MatrixStack matrixStack, IVertexBuilder builder, TextureAtlasSprite sprite, int combinedLight, int color){
matrixStack.pushPose();
matrixStack.mulPose(Vector3f.XP.rotationDegrees(270));
matrixStack.translate(0, -1, 0.125);
drawRectangle(builder, matrixStack, 0, 1, 0, 1, sprite, combinedLight, color);

matrixStack.mulPose(Vector3f.XP.rotationDegrees(90));
matrixStack.translate(0, -0.125, 0);
drawRectangle(builder, matrixStack, 0, 1, 0, .125f, sprite, combinedLight, color);

matrixStack.mulPose(Vector3f.YP.rotationDegrees(90));
matrixStack.translate(0, 0, 1);
drawRectangle(builder, matrixStack, 0, 1, 0, .125f, sprite, combinedLight, color);

matrixStack.mulPose(Vector3f.YP.rotationDegrees(90));
matrixStack.translate(0, 0, 1);
drawRectangle(builder, matrixStack, 0, 1, 0, .125f, sprite, combinedLight, color);

matrixStack.mulPose(Vector3f.YP.rotationDegrees(90));
matrixStack.translate(0, 0, 1);
drawRectangle(builder, matrixStack, 0, 1, 0, .125f, sprite, combinedLight, color);

matrixStack.mulPose(Vector3f.XP.rotationDegrees(90));
matrixStack.translate(0, -1, 0);
drawRectangle(builder, matrixStack, 0, 1, 0, 1, sprite, combinedLight, color);

matrixStack.popPose();
}

private void renderCell(MatrixStack matrixStack, Integer index, IPanelCell panelCell, Direction cellDirection, IRenderTypeBuffer buffer, int combinedLight, int combinedOverlay)
{
float scale = 0.125f;
Expand Down

0 comments on commit fa2f5d0

Please sign in to comment.