-
Posts
407 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Leomelonseeds
-
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Leomelonseeds replied to Leomelonseeds's topic in Modder Support
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. -
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Leomelonseeds replied to Leomelonseeds's topic in Modder Support
hmmmmm... my grill is opening in the inventory too, how do I fix that... -
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Leomelonseeds replied to Leomelonseeds's topic in Modder Support
OK so in my tileentity class, how would I detect if it is being rendered in the invertory? -
I think you need to add something like this: this.tasks.addTask(2, new EntityAIZombieAttack(this, 1.0D, false));
-
When the mod is in the mods folder it automatically goes into minecraft so yes, go into a singleplayer world and test it out.
-
Import the forge src jar into your project java build path libraries.
-
Okkk. I guess not doing that is simpler, too.
-
Whats wrong with extending BlockContainer though
-
Check out this: http://www.minecraftforge.net/forum/topic/29927-the-entity-attribute-system-how-to-manipulate-it-in-code/
-
Block with blockstates don't render as item models
Leomelonseeds replied to kitsushadow's topic in Modder Support
What was that random f word for tho -
Block with blockstates don't render as item models
Leomelonseeds replied to kitsushadow's topic in Modder Support
You know how to override a method right? -
Still, try. You never know whats gonna work.
-
-
Jesus, dont vomit a crash into your post. 1.7.10 is NO LONGER SUPPORTED by forge.
-
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.
-
ohhhhhhh, try setting it to 2G, see if that works. BTW are all the values generating the EXACT same error?
-
Forge 1.7.10 is no longer supported.
-
Exactly how much ram u have?
-
Actually, try even smaller numbers, like 30M.
-
did you try putting like -Xmx250M -Xms250M or -Xmx1G -Xms1G ? Newer versions of jdk will not help you.