Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Leaderboard

Popular Content

Showing content with the highest reputation on 04/09/17 in all areas

  1. Hello, I'm currently working on a flip animation for a grill block I am creating. The problem I am facing is that the animaton speed varies depending on the FPS. I have read that multiplying your values by partialTicks will solve this issue but this doesn't seem to be the case. I'm wonder if you guys what I am doing wrong, and how it can be fixed? Thanks GrillRenderer package com.mrcrayfish.furniture.render.tileentity; import com.mrcrayfish.furniture.blocks.BlockGrill; import com.mrcrayfish.furniture.tileentity.TileEntityGrill; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; public class GrillRenderer extends TileEntitySpecialRenderer { private ItemStack coal = new ItemStack(Items.coal, 1, 1); private EntityItem entityItem = new EntityItem(Minecraft.getMinecraft().theWorld, 0D, 0D, 0D, coal); private final float MAX_ANIM_TIME = 100F; private final float FLIP_HEIGHT = 0.5F; @Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage) { entityItem.hoverStart = 0; if(!(te.getBlockType() instanceof BlockGrill)) return; BlockGrill grill = (BlockGrill) te.getBlockType(); TileEntityGrill tileEntityGrill = (TileEntityGrill) te; int rotation = grill.getMetaFromState(te.getWorld().getBlockState(te.getPos())); GlStateManager.pushMatrix(); { GlStateManager.translate(x, y, z); GlStateManager.translate(0.5, 0.85, 0.5); GlStateManager.rotate(rotation * -90F, 0, 1, 0); GlStateManager.translate(0.18, 0, -0.35); GlStateManager.rotate(90F, 1, 0, 0); for(int i = 0; i < tileEntityGrill.getCoal(); i++) { GlStateManager.pushMatrix(); { GlStateManager.rotate(15F, 0, 1, 0); entityItem.setEntityItemStack(coal); Minecraft.getMinecraft().getRenderManager().renderEntityWithPosYaw(entityItem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); } GlStateManager.popMatrix(); GlStateManager.translate(-0.2, 0, 0); } } GlStateManager.popMatrix(); GlStateManager.pushMatrix(); { GlStateManager.translate(x, y, z); GlStateManager.translate(0.5, 1, 0.5); GlStateManager.rotate(rotation * -90F, 0, 1, 0); GlStateManager.translate(0.2, 0, -0.32); GlStateManager.rotate(90F, 1, 0, 0); /* Left */ if(tileEntityGrill.getItem(0) != null) { GlStateManager.pushMatrix(); { if(tileEntityGrill.flippedLeft) { if(tileEntityGrill.leftFlippingCount < MAX_ANIM_TIME / 2) { tileEntityGrill.leftCurrentHeight += (FLIP_HEIGHT / (MAX_ANIM_TIME / 2)) * partialTicks; } else if(tileEntityGrill.leftCurrentHeight > 0F) { tileEntityGrill.leftCurrentHeight -= (FLIP_HEIGHT / (MAX_ANIM_TIME / 2)) * partialTicks; } if(tileEntityGrill.leftCurrentHeight >= 0F) { GlStateManager.translate(0, 0, -Math.sqrt(tileEntityGrill.leftCurrentHeight)); } else { tileEntityGrill.leftCurrentHeight = 0F; } } GlStateManager.rotate((tileEntityGrill.leftFlippingCount / MAX_ANIM_TIME * 180F), 0, 1, 0); entityItem.setEntityItemStack(tileEntityGrill.getItem(0)); Minecraft.getMinecraft().getRenderManager().renderEntityWithPosYaw(entityItem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); if(tileEntityGrill.flippedLeft && tileEntityGrill.leftFlippingCount < MAX_ANIM_TIME) { tileEntityGrill.leftFlippingCount += partialTicks; } } GlStateManager.popMatrix(); } else { tileEntityGrill.leftFlippingCount = 0F; } GlStateManager.translate(-0.4, 0, 0); /* Right */ if(tileEntityGrill.getItem(1) != null) { GlStateManager.pushMatrix(); { if(tileEntityGrill.flippedRight) { if(tileEntityGrill.rightFlippingCount < MAX_ANIM_TIME / 2) { tileEntityGrill.rightCurrentHeight += (FLIP_HEIGHT / (MAX_ANIM_TIME / 2)) * partialTicks; } else if(tileEntityGrill.rightCurrentHeight > 0F) { tileEntityGrill.rightCurrentHeight -= (FLIP_HEIGHT / (MAX_ANIM_TIME / 2)) * partialTicks; } if(tileEntityGrill.rightCurrentHeight >= 0F) { GlStateManager.translate(0, 0, -Math.sqrt(tileEntityGrill.rightCurrentHeight)); } else { tileEntityGrill.rightCurrentHeight = 0F; } } //System.out.println("Right Flip Count:" + tileEntityGrill.rightFlippingCount); //System.out.println("Right Current Height:" + tileEntityGrill.rightCurrentHeight); GlStateManager.rotate(tileEntityGrill.rightFlippingCount / MAX_ANIM_TIME * 180F, 0, 1, 0); entityItem.setEntityItemStack(tileEntityGrill.getItem(1)); Minecraft.getMinecraft().getRenderManager().renderEntityWithPosYaw(entityItem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); if(tileEntityGrill.flippedRight && tileEntityGrill.rightFlippingCount < MAX_ANIM_TIME) { tileEntityGrill.rightFlippingCount += partialTicks; } } GlStateManager.popMatrix(); } else { tileEntityGrill.rightFlippingCount = 0F; } } GlStateManager.popMatrix(); } }
  2. I just realized that 1.8 effectively killed the "Camouflage Block." That is: because the texture code moved into the json file, it is impossible to use a different, arbitrary, block's texture. Or at the very least, it made is incredibly more difficult.

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.