Jump to content

Leomelonseeds

Forge Modder
  • Posts

    407
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Leomelonseeds

  1. package com.leomelonseeds.moarstuff.client.render.blocks; import com.leomelonseeds.moarstuff.blocks.BlockGrill; import com.leomelonseeds.moarstuff.blocks.Modblocks; import com.leomelonseeds.moarstuff.client.model.ModelGrill; import com.leomelonseeds.moarstuff.tileentity.Grill; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.model.ModelChest; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.client.ForgeHooksClient; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class TileGrillRenderer extends TileEntitySpecialRenderer<Grill> { private static final ResourceLocation TEXTURE_BURNING = new ResourceLocation("moarstuff:textures/entity/grill/grill_on.png"); private static final ResourceLocation TEXTURE_NORMAL = new ResourceLocation("moarstuff:textures/entity/grill/grill_off.png"); private final ModelGrill simpleChest = new ModelGrill(); public TileGrillRenderer(){ } @Override public void renderTileEntityAt(Grill te, double x, double y, double z, float partialTicks, int destroyStage) { Grill grill = new Grill(); if(te != null){ GlStateManager.enableDepth(); GlStateManager.depthFunc(515); GlStateManager.depthMask(true); int i; if (te.hasWorldObj()) { Block block = te.getBlockType(); i = te.getBlockMetadata(); } else { i = 0; } ModelGrill modelgrill = this.simpleChest; if (destroyStage >= 0) { this.bindTexture(DESTROY_STAGES[destroyStage]); GlStateManager.matrixMode(5890); GlStateManager.pushMatrix(); GlStateManager.scale(4.0F, 4.0F, 1.0F); GlStateManager.translate(0.0625F, 0.0625F, 0.0625F); GlStateManager.matrixMode(5888); } else if(te.isBurning == true){ this.bindTexture(TEXTURE_BURNING); } else { this.bindTexture(TEXTURE_NORMAL); } GlStateManager.pushMatrix(); GlStateManager.enableRescaleNormal(); if (destroyStage < 0) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); } GlStateManager.translate((float)x, (float)y + 1.0F, (float)z + 1.0F); GlStateManager.scale(1.0F, -1.0F, -1.0F); GlStateManager.translate(0.5F, 0.5F, 0.5F); int j = 0; if (i == 2) { j = 180; } if (i == 3) { j = 0; } if (i == 4) { j = 90; } if (i == 5) { j = -90; } GlStateManager.rotate((float)j, 0.0F, 1.0F, 0.0F); GlStateManager.translate(-0.5F, -0.5F, -0.5F); float f = te.prevLidAngle + (te.lidAngle - te.prevLidAngle) * partialTicks; f = 1.0F - f; f = 1.0F - f * f * f; modelgrill.chestLid.rotateAngleX = -(f * ((float)Math.PI / 2F)); modelgrill.renderAll(); GlStateManager.disableRescaleNormal(); GlStateManager.popMatrix(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); if (destroyStage >= 0) { GlStateManager.matrixMode(5890); GlStateManager.popMatrix(); GlStateManager.matrixMode(5888); } }else{ GlStateManager.enableDepth(); GlStateManager.depthFunc(515); GlStateManager.depthMask(true); ModelGrill mg = this.simpleChest; if (destroyStage >= 0) { this.bindTexture(DESTROY_STAGES[destroyStage]); GlStateManager.matrixMode(5890); GlStateManager.pushMatrix(); GlStateManager.scale(4.0F, 4.0F, 1.0F); GlStateManager.translate(0.0625F, 0.0625F, 0.0625F); GlStateManager.matrixMode(5888); } else { this.bindTexture(TEXTURE_NORMAL); } GlStateManager.pushMatrix(); GlStateManager.enableRescaleNormal(); if (destroyStage < 0) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); } GlStateManager.translate((float)x, (float)y + 1.0F, (float)z + 1.0F); GlStateManager.scale(1.0F, -1.0F, -1.0F); GlStateManager.translate(0.5F, 0.5F, 0.5F); GlStateManager.translate(-0.5F, -0.5F, -0.5F); mg.renderAll(); GlStateManager.disableRescaleNormal(); GlStateManager.popMatrix(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); if (destroyStage >= 0) { GlStateManager.matrixMode(5890); GlStateManager.popMatrix(); GlStateManager.matrixMode(5888); } } } } Also, read the above posts.
  2. hmmmmm... my grill is opening in the inventory too, how do I fix that...
  3. OK so in my tileentity class, how would I detect if it is being rendered in the invertory?
  4. I think you need to add something like this: this.tasks.addTask(2, new EntityAIZombieAttack(this, 1.0D, false));
  5. When the mod is in the mods folder it automatically goes into minecraft so yes, go into a singleplayer world and test it out.
  6. Import the forge src jar into your project java build path libraries.
  7. Okkk. I guess not doing that is simpler, too.
  8. Whats wrong with extending BlockContainer though
  9. Check out this: http://www.minecraftforge.net/forum/topic/29927-the-entity-attribute-system-how-to-manipulate-it-in-code/
  10. What was that random f word for tho
  11. So it works? Good. Yeah it is weird, huh.
  12. Ok then downgrade upgrade because that exact version has problems with minecraft.
  13. You know how to override a method right?
  14. Are you using an nvidia driver? If not this might help.
  15. Still, try. You never know whats gonna work.
  16. Jesus, dont vomit a crash into your post. 1.7.10 is NO LONGER SUPPORTED by forge.
  17. Download forge for 1.8, go to launcher and select the profile forge 1.8, run it, go to .minecraft/mods folder, put flans mod jar/zip into it, run minecraft, enjoy.
  18. ohhhhhhh, try setting it to 2G, see if that works. BTW are all the values generating the EXACT same error?
  19. try even less.
  20. Forge 1.7.10 is no longer supported.
  21. Exactly how much ram u have?
  22. Actually, try even smaller numbers, like 30M.
  23. did you try putting like -Xmx250M -Xms250M or -Xmx1G -Xms1G ? Newer versions of jdk will not help you.
×
×
  • Create New...

Important Information

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