-
Posts
407 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Leomelonseeds
-
Sorry I mean does your animated texture work? If not see if the name of your mcmeta file is correct.
-
[1.9.4] Registering Blocks - Back to square one
Leomelonseeds replied to TheA13X's topic in Modder Support
Do you have a crash? Or does it just not exist? Also, you should give the block an actual registry name (eg. "mod_leaves" with quotations) instead of just "name". -
Does your texture work?
-
What is the function of markDirty()?
Leomelonseeds replied to JamesWilsonProductions's topic in Modder Support
If you use eclipse, you can hover your mouse over markDirty() and it will explain what it is. -
Recommended place to start modding?
Leomelonseeds replied to DireDoesGames's topic in General Discussion
You should check out the bedrockminer.jimdo.com. I know its dead and for 1.8, but nothing big has changed. -
Oh yes. I don't like that either. And why do you still use windows 7?
-
Check how the vanilla furnace does this, it might or might not be helpful as the furnace is registered as two blocks with the same unlocalized name(net.minecraft.init.Blocks, net.minecraft.block.Block, and the BLockFurnace class). You can also see how it is stored as a simple boolean.
-
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Leomelonseeds replied to Leomelonseeds's topic in Modder Support
Bump again. Why is no one interested. -
What are you using the active boolean for? My custom furnace has a boolean isBurning that is not encoded into the metadata but still works.
-
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Leomelonseeds replied to Leomelonseeds's topic in Modder Support
Bump. I think each time the gui changes, the lid stays open, but sometimes it works, so i don't know. Also, I managed to figure out the inventory rendering, but every time the grill opens, the lid in my inventory opens too . TESR: 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); int i = 0; if (grill.hasWorldObj()) { Block block = grill.getBlockType(); i = grill.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 { 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); 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); } } } } -
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Leomelonseeds replied to Leomelonseeds's topic in Modder Support
Ok all my original problems are now solved, but now new problems arise: When I open the grill and start cooking something, it doesn't close until I open it again and then exit it, then it will close. Also, I just discovered that the grill texture files had the textures 14x14, is there anyway to make them 16x16, and what parts of the code do I have to modify to get a 16x16 texture(I made my own ModelGrill class)? Btw the inventory rendering is still not working anymore -
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Leomelonseeds replied to Leomelonseeds's topic in Modder Support
Do I use renderInventoryBlock? -
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Leomelonseeds replied to Leomelonseeds's topic in Modder Support
The grill lid opens now but does not close The item is not rendering in the inventory anymore. If I place grills next to each other, they will appear to render one higher then another, and if I move around, they will change heights and stuff. Also, why is the chest smaller than normal blocks? Which line in my TESR makes it so that it is a bit smaller? Or is it a line in the ModelChest class? Here is TESR: package com.leomelonseeds.moarstuff.client.render.blocks; import com.leomelonseeds.moarstuff.blocks.BlockGrill; import com.leomelonseeds.moarstuff.blocks.Modblocks; 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 ModelChest simpleChest = new ModelChest(); Grill grill = new Grill(); BlockGrill bg = new BlockGrill("grill", false); public TileGrillRenderer(){ } @Override public void renderTileEntityAt(Grill te, double x, double y, double z, float partialTicks, int destroyStage) { if(te != null){ GlStateManager.depthFunc(515); GlStateManager.depthMask(true); GlStateManager.scale(1.1, 1.1, 1.1); int i; if (te.hasWorldObj()) { Block block = te.getBlockType(); i = te.getBlockMetadata(); } else { i = 0; } ModelChest modelchest = 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; modelchest.chestLid.rotateAngleX = -(f * ((float)Math.PI / 2F)); modelchest.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{ ForgeHooksClient.registerTESRItemStack(Item.getItemFromBlock(Modblocks.grill), 0, Grill.class); } } } And the grill faces me now, didnt need to do what choonster said, just copied some code from blockfurnace class. -
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Leomelonseeds replied to Leomelonseeds's topic in Modder Support
Problem is when I do that very weird stuff happens -
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Leomelonseeds replied to Leomelonseeds's topic in Modder Support
Because I used ForgeHooksClient.registerTESRItemStack, and since the inventory te does not have a world, I have to store an instance of them in the TESR. The question is how do I detect if it is the inventory rendering or the block rendering? -
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Leomelonseeds replied to Leomelonseeds's topic in Modder Support
And, why is the chest smaller than normal blocks? Which line in my TESR makes it so that it is a bit smaller? Or is it a line in the ModelChest class? -
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Leomelonseeds replied to Leomelonseeds's topic in Modder Support
Ok so I experimented around with the TESR and found some VERY weird sh#t... package com.leomelonseeds.moarstuff.client.render.blocks; import com.leomelonseeds.moarstuff.blocks.BlockGrill; 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.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.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 ModelChest simpleChest = new ModelChest(); Grill grill = new Grill(); BlockGrill bg = new BlockGrill("grill"); public TileGrillRenderer(){ } @Override public void renderTileEntityAt(Grill te, double x, double y, double z, float partialTicks, int destroyStage) { GlStateManager.depthFunc(515); GlStateManager.depthMask(true); GlStateManager.scale(1.1, 1.1, 1.1); int i; if (grill.hasWorldObj()) { Block block = te.getBlockType(); i = te.getBlockMetadata(); } else { i = 0; } ModelChest modelchest = 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(bg.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); //if(te != null){ float f = grill.prevLidAngle + (grill.lidAngle - grill.prevLidAngle) * partialTicks; f = 1.0F - f; f = 1.0F - f * f * f; modelchest.chestLid.rotateAngleX = -(f * ((float)Math.PI / 2F)); modelchest.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); } } } If I uncomment the if(te != null) and replace grill with te, ingame NO item names or tileentity gui's show up, I get error Stack Overflow in console, and the grill lid will open but will not close. If I place grills next to each other, they will appear to render one higher then another, and if I move around, they will change heights and stuff. wtf is happening? -
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Leomelonseeds replied to Leomelonseeds's topic in Modder Support
Do I put getStateForPlacement and getHorizontalFacing in my TESR? Or is it in my block class? -
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Leomelonseeds replied to Leomelonseeds's topic in Modder Support
What is the super method of getStateForPlacement -
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Leomelonseeds replied to Leomelonseeds's topic in Modder Support
getStateForPlacement doesn't seem to exist anymore... I mean which line of code in the TESR scales it. I mean that now I have to replace all the te in my TESR for grill, and according to what diesieben07 says, if I do that the lid wont open anymore. -
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Leomelonseeds replied to Leomelonseeds's topic in Modder Support
Yey it renders in the inventory! Problems: It crashes each time te in the TESR is called, so I had to change them all to grill, but then the lid will not open if I use grill, right. Also, how do you get it so that it faces you when you place it down? Ive already got the properties and stuff ready, but dont know how to use it in the TESR Which GlStateManager scales it so that its a bit smaller than normal blocks? -
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Leomelonseeds replied to Leomelonseeds's topic in Modder Support
OK I identified the error at line 39 (if (te.hasWorldObj())). What should I do for that? Since the inventory doesn't have a worldObj, shouldn't that just ignore it? -
[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.tileentity.Grill; import net.minecraft.block.Block; import net.minecraft.client.model.ModelChest; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityChest; import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; 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 ModelChest simpleChest = new ModelChest(); public TileGrillRenderer(){ } @Override public void renderTileEntityAt(Grill te, double x, double y, double z, float partialTicks, int destroyStage) { GlStateManager.depthFunc(515); GlStateManager.depthMask(true); GlStateManager.scale(1.1, 1.1, 1.1); if(te.hasWorldObj() == true){ EnumFacing facing = te.getWorld().getBlockState(te.getPos()).getValue(BlockGrill.FACING); } int i; if (te.hasWorldObj()) { Block block = te.getBlockType(); i = te.getBlockMetadata(); } else { i = 0; } ModelChest modelchest = 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; modelchest.chestLid.rotateAngleX = -(f * ((float)Math.PI / 2F)); modelchest.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); } } } -
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Leomelonseeds replied to Leomelonseeds's topic in Modder Support
It crashes, still. Read the earlier posts. -
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Leomelonseeds replied to Leomelonseeds's topic in Modder Support
Still not working: if(te.hasWorldObj() == true){ EnumFacing facing = te.getWorld().getBlockState(te.getPos()).getValue(BlockGrill.FACING); } (in TESR)