Skip to content

Commit

Permalink
stupid fix, but fixes render types
Browse files Browse the repository at this point in the history
  • Loading branch information
gnembon committed Nov 16, 2023
1 parent df017bb commit c1ddcfa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/carpet/script/utils/ShapesRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LightLayer;
import net.minecraft.world.level.block.EntityBlock;
import net.minecraft.world.level.block.LeavesBlock;
import net.minecraft.world.level.block.RenderShape;
import net.minecraft.world.level.block.ShulkerBoxBlock;
import net.minecraft.world.level.block.entity.BlockEntity;
Expand Down Expand Up @@ -407,7 +408,13 @@ public void renderLines(PoseStack matrices, Tesselator tessellator, BufferBuilde
float red = (color >> 16 & 0xFF) / 255.0F;
float green = (color >> 8 & 0xFF) / 255.0F;
float blue = (color & 0xFF) / 255.0F;
client.getBlockRenderer().getModelRenderer().renderModel(matrices.last(), immediate.getBuffer(ItemBlockRenderTypes.getChunkRenderType(blockState)), blockState, bakedModel, red, green, blue, light, OverlayTexture.NO_OVERLAY);
RenderType type;
if (blockState.getBlock() instanceof LeavesBlock && !Minecraft.useFancyGraphics()) {
type = RenderType.solid();
} else {
type = ItemBlockRenderTypes.getRenderType(blockState, false);
}
client.getBlockRenderer().getModelRenderer().renderModel(matrices.last(), immediate.getBuffer(type), blockState, bakedModel, red, green, blue, light, OverlayTexture.NO_OVERLAY);
}

// draw the block`s entity part
Expand Down

0 comments on commit c1ddcfa

Please sign in to comment.