Skip to content

Commit

Permalink
fix coffin texture
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheaterpaul committed Jun 15, 2024
1 parent d482fbd commit 8ae233e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@
*/
public class ModBlocksRender {

public static final Material[] COFFIN_TEXTURES = Arrays.stream(DyeColor.values()).sorted(Comparator.comparingInt(DyeColor::getId)).map((dye) -> {
return new Material(BLOCK_ATLAS, new ResourceLocation(REFERENCE.MODID, "block/coffin/coffin_" + dye.getName()));
}).toArray(Material[]::new);

public static void register() {
registerRenderType();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public void render(@NotNull CoffinBlockEntity tile, float partialTicks, @NotNull
Direction direction = state.getValue(HORIZONTAL_FACING);

if (!isHeadSafe(tile.getLevel(), tile.getBlockPos())) return;
Material material = ModBlocksRender.COFFIN_TEXTURES[tile.color.getId()];
matrixStack.pushPose();
boolean vertical = state.getValue(CoffinBlock.VERTICAL);
switch (direction) {
Expand Down Expand Up @@ -85,7 +84,7 @@ public void render(@NotNull CoffinBlockEntity tile, float partialTicks, @NotNull
BakedModel baseModel = Minecraft.getInstance().getModelManager().getModel(new ResourceLocation(REFERENCE.MODID, "block/coffin/coffin_bottom_" + tile.color.getName()));
ModelData modelData = baseModel.getModelData(tile.getLevel(), tile.getBlockPos(), state, ModelData.EMPTY);
for (RenderType renderType : baseModel.getRenderTypes(state, RandomSource.create(42), modelData)) {
Minecraft.getInstance().getBlockRenderer().getModelRenderer().renderModel(matrixStack.last(), material.buffer(iRenderTypeBuffer, RenderType::entitySolid), state, baseModel, 1, 1, 1, i, i1, modelData, renderType);
Minecraft.getInstance().getBlockRenderer().getModelRenderer().renderModel(matrixStack.last(), iRenderTypeBuffer.getBuffer(RenderTypeHelper.getEntityRenderType(renderType, false)), state, baseModel, 1, 1, 1, i, i1, modelData, renderType);
}

matrixStack.pushPose();
Expand Down

0 comments on commit 8ae233e

Please sign in to comment.