Jump to content

Recommended Posts

Posted

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?

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted

The TileEntity passed to TileEntitySpecialRenderer#renderTileEntityAt will be null when it's rendered in the inventory. You need to store an instance of the TileEntity in your TESR to use when it's rendered in the inventory.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted (edited)

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?

Edited by Leomelonseeds

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted
22 minutes ago, Leomelonseeds said:

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.

 

If it's crashing, post the code and the crash report/FML log.

 

 

22 minutes ago, Leomelonseeds said:

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

 

Override Block#getStateForPlacement(World, BlockPos, EnumFacing, float, float, float, int, EntityLivingBase, ItemStack) to do the following:

  • Call the super method to get the state from the metadata
  • Call IBlockState#withProperty on the IBlockState returned by the super method to get an IBlockState with the facing property set based on the placer argument
  • Return the IBlockState

Use Entity#getHorizontalFacing to get the horizontal EnumFacing of an Entity and EnumFacing#getOpposite to get its opposite.

 

 

22 minutes ago, Leomelonseeds said:

Which GlStateManager scales it so that its a bit smaller than normal blocks?

 

I believe it's GlStateManager.scale.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

getStateForPlacement doesn't seem to exist anymore...

 

10 minutes ago, Choonster said:

Which GlStateManager scales it so that its a bit smaller than normal blocks?

I mean which line of code in the TESR scales it.

 

11 minutes ago, Choonster said:
44 minutes ago, Leomelonseeds said:

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.

 

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.

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted
7 minutes ago, Leomelonseeds said:

getStateForPlacement doesn't seem to exist anymore...

 

It was added in Forge 1.10.2-12.18.2.2107, make sure you're using either the Recommended or Latest version of Forge.

 

 

7 minutes ago, Leomelonseeds said:

I mean which line of code in the TESR scales it.

 

The line that calls GlStateManager.scale.

 

 

7 minutes ago, Leomelonseeds said:

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.

 

Only use the Grill instance stored in your TESR (the grill field) if the Grill argument (te) is null (i.e. it's being rendered in the inventory rather than the world).

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted
29 minutes ago, Leomelonseeds said:

What is the super method of getStateForPlacement

 

The super method is the method with the same signature (name and parameters) in the super class (the one overridden by the current method).

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

Do I put getStateForPlacement and getHorizontalFacing in my TESR? Or is it in my block class?

 

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted

Considering that those methods are Block methods, I suggest putting them in your TileEntity

That was sarcasm

.

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

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?

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted

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?

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted

pic.png

Why do you have this here?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted (edited)

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?

Edited by Leomelonseeds

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted
20 hours ago, Choonster said:

if the Grill argument (te) is null (i.e. it's being rendered in the inventory rather than the world).

 

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

Problem is when I do that very weird stuff happens

1 hour ago, Leomelonseeds said:

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?

 

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted

Well you'd need an else {} case, too...

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted (edited)

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.

 

Edited by Leomelonseeds

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted (edited)

Don't register your ItemStack TESR in your renderTileEntityAt... Register it once in your ClientProxy, then inside the else block render the inventory block.

Edited by larsgerrits

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted (edited)

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

Edited by Leomelonseeds

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted (edited)

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 o.O.

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);
                }
    	}
    	
        }
    }

 

Edited by Leomelonseeds

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted

How about the 16x16 texture change and the lid opening in the inventory? Will it work and how do I fix that?

Diesieben07 you should update cameracraft to at least 1.10 so we can use it, it seems pretty cool.

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

Posted

OK so in my tileentity class, how would I detect if it is being rendered in the invertory?

Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements




  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • This is the last line before the crash: [ebwizardry]: Synchronising spell emitters for PixelTraveler But I have no idea what this means
    • What in particular? I barely used that mod this time around, and it's never been a problem in the past.
    • Im trying to build my mod using shade since i use the luaj library however i keep getting this error Reason: Task ':reobfJar' uses this output of task ':shadowJar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. So i try adding reobfJar.dependsOn shadowJar  Could not get unknown property 'reobfJar' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. my gradle file plugins { id 'eclipse' id 'idea' id 'maven-publish' id 'net.minecraftforge.gradle' version '[6.0,6.2)' id 'com.github.johnrengelman.shadow' version '7.1.2' id 'org.spongepowered.mixin' version '0.7.+' } apply plugin: 'net.minecraftforge.gradle' apply plugin: 'org.spongepowered.mixin' apply plugin: 'com.github.johnrengelman.shadow' version = mod_version group = mod_group_id base { archivesName = mod_id } // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. java.toolchain.languageVersion = JavaLanguageVersion.of(17) //jarJar.enable() println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}" minecraft { mappings channel: mapping_channel, version: mapping_version copyIdeResources = true runs { configureEach { workingDirectory project.file('run') property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug' arg "-mixin.config=derp.mixin.json" mods { "${mod_id}" { source sourceSets.main } } } client { // Comma-separated list of namespaces to load gametests from. Empty = all namespaces. property 'forge.enabledGameTestNamespaces', mod_id } server { property 'forge.enabledGameTestNamespaces', mod_id args '--nogui' } gameTestServer { property 'forge.enabledGameTestNamespaces', mod_id } data { workingDirectory project.file('run-data') args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') } } } sourceSets.main.resources { srcDir 'src/generated/resources' } repositories { flatDir { dirs './libs' } maven { url = "https://jitpack.io" } } configurations { shade implementation.extendsFrom shade } dependencies { minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" implementation 'org.luaj:luaj-jse-3.0.2' implementation fg.deobf("com.github.Virtuoel:Pehkui:${pehkui_version}") annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' minecraftLibrary 'luaj:luaj-jse:3.0.2' shade 'luaj:luaj-jse:3.0.2' } // Example for how to get properties into the manifest for reading at runtime. tasks.named('jar', Jar).configure { manifest { attributes([ 'Specification-Title' : mod_id, 'Specification-Vendor' : mod_authors, 'Specification-Version' : '1', // We are version 1 of ourselves 'Implementation-Title' : project.name, 'Implementation-Version' : project.jar.archiveVersion, 'Implementation-Vendor' : mod_authors, 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", "TweakOrder" : 0, "MixinConfigs" : "derp.mixin.json" ]) } rename 'mixin.refmap.json', 'derp.mixin-refmap.json' } shadowJar { archiveClassifier = '' configurations = [project.configurations.shade] finalizedBy 'reobfShadowJar' } assemble.dependsOn shadowJar reobf { re shadowJar {} } publishing { publications { mavenJava(MavenPublication) { artifact jar } } repositories { maven { url "file://${project.projectDir}/mcmodsrepo" } } } my entire project:https://github.com/kevin051606/DERP-Mod/tree/Derp-1.0-1.20
    • All versions of Minecraft Forge suddenly black screen even without mods (tried reinstalling original Minecraft, Java, updating drivers doesn't work)
  • Topics

×
×
  • Create New...

Important Information

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