Posted April 24, 20205 yr Hello, I updated my mod files from 1.14.4 to 1.15.2 but now me block doesn't render the item public class TERChoppingBlock extends TileEntityRenderer<TileEntityChoppingBlock> { public TERChoppingBlock(TileEntityRendererDispatcher rendererDispatcher) { super(rendererDispatcher); } @Override public void render(TileEntityChoppingBlock tileEntityChoppingBlock, float partialTicks, MatrixStack matrixStack, IRenderTypeBuffer buffer, int combinedLight, int combinedOverlay) { // GlStateManager.pushLightingAttributes(); // GlStateManager.pushMatrix(); matrixStack.push(); BlockPos blockPos = tileEntityChoppingBlock.getPos(); // GlStateManager.translated(blockPos.getX(), blockPos.getY(), blockPos.getZ()); // GlStateManager.disableRescaleNormal(); matrixStack.translate(blockPos.getX(), blockPos.getY(), blockPos.getZ()); renderItem(tileEntityChoppingBlock, matrixStack, buffer, combinedLight, combinedOverlay); matrixStack.pop(); // GlStateManager.popMatrix(); // GlStateManager.popAttributes(); } private void renderItem(TileEntityChoppingBlock tileEntityChoppingBlock, MatrixStack matrixStack, IRenderTypeBuffer buffer, int combinedLight, int combinedOverlay) { IItemHandler itemHandler = tileEntityChoppingBlock.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).orElse(null); if(itemHandler != null) { ItemStack stack = itemHandler.getStackInSlot(0); if(!stack.isEmpty()) { RenderHelper.enableStandardItemLighting(); // GlStateManager.enableLighting(); // GlStateManager.pushMatrix(); matrixStack.push(); // GlStateManager.scaled(0.5f, 0.5f, 0.5f); // GlStateManager.translated(1, 1.5, 1); // GlStateManager.rotatef(-90, 0f, 1f, 0f); matrixStack.scale(0.5f, 0.5f, 0.5f); matrixStack.translate(1, 1.5, 1); matrixStack.rotate(new Quaternion(0f, 1f, 0f, -90)); Minecraft.getInstance().getItemRenderer().renderItem(stack, TransformType.NONE, combinedLight, combinedOverlay, matrixStack, buffer); // Minecraft.getInstance().getItemRenderer().renderItem(stack, TransformType.NONE); matrixStack.pop(); // GlStateManager.popMatrix(); } } } } In the comments is my older 1.14 code. Wanted behavior from 1.14: (now in 1.15 the log block doesn't render) EDIT: I removed this line "matrixStack.translate(blockPos.getX(), blockPos.getY(), blockPos.getZ());" and now this is the result: (o.O) Spoiler Edited April 24, 20205 yr by Boy132
April 24, 20205 yr Author Works now: (it was didn't work because of the "matrixStack.rotate") RenderHelper.enableStandardItemLighting(); matrixStack.push(); matrixStack.scale(0.5f, 0.5f, 0.5f); matrixStack.translate(1, 1.5, 1); Minecraft.getInstance().getItemRenderer().renderItem(stack, TransformType.NONE, combinedLight, combinedOverlay, matrixStack, buffer); matrixStack.pop();
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.