Jump to content

[UNSOLVED][1.10.2]Need help with TESR and tileentity item


Leomelonseeds

Recommended Posts

So My Grill worked, thanks to diesieben07 and Animefan8888 for helping. Now I need some bugfixing:

1. Currently my Grill is like 25% smaller then the collision box.

2. How do you make the grill render in the inventory, and how does vanilla minecraft do it?

3. Why does it keep asking me for blockstates.json for grill and why doesn't vanilla minecraft need one.

4.When I right-click the grill, it is supposed to open like a chest but it doesn't.

 

Here is my TESR:

package com.leomelonseeds.moarstuff.client.render.blocks;

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.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class TileGrillRenderer extends TileEntitySpecialRenderer
{
    
    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();
    private boolean isBurning;

    
    @Override
    public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage)
    {
    	
    	TileEntityChest tec = new TileEntityChest();
    	
    	System.out.println("RENDERING");
        GlStateManager.enableDepth();
        GlStateManager.depthFunc(515);
        GlStateManager.depthMask(true);
        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
                {
                    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 = tec.prevLidAngle + (tec.lidAngle - tec.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);
            }
        }
    }

 

 

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.

Link to comment
Share on other sites

I mean for the Grill item, I used a json file. The texture to that file is a blank entity. Check assets.minecraft.model.item.chest.json. I copied off that one

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.

Link to comment
Share on other sites

Sorry, but I don't understand your answer to the last question. What is a raw type, and what do you mean by:

YOu need to use the TileEntity you get passed in.

 

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.

Link to comment
Share on other sites

And in setCustomStateMapper, what do I put for IStateMapper mapper?

 

An IStateMapper implementation.

Here's one of mine.

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.

Link to comment
Share on other sites

Here is ClientProxy:

package com.leomelonseeds.moarstuff;

import java.util.Collections;

import com.leomelonseeds.moarstuff.blocks.BlockMegaTNT;
import com.leomelonseeds.moarstuff.blocks.BlockNuke;
import com.leomelonseeds.moarstuff.blocks.Modblocks;
import com.leomelonseeds.moarstuff.client.render.blocks.BlockRenderRegister;
import com.leomelonseeds.moarstuff.client.render.blocks.TileGrillRenderer;
import com.leomelonseeds.moarstuff.client.render.entity.RenderMegaTNTPrimed;
import com.leomelonseeds.moarstuff.client.render.entity.RenderNukePrimed;
import com.leomelonseeds.moarstuff.client.render.items.ItemRenderRegister;
import com.leomelonseeds.moarstuff.entity.MegaTNTPrimed;
import com.leomelonseeds.moarstuff.entity.NukePrimed;
import com.leomelonseeds.moarstuff.tileentity.Grill;

import net.minecraft.block.properties.IProperty;
import net.minecraft.client.renderer.block.statemap.StateMap;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.EntityRegistry;



public class ClientProxy extends CommonProxy {

@Override
public void preInit(FMLPreInitializationEvent e){ 
	super.preInit(e);

	ModelLoader.setCustomStateMapper(Modblocks.megatnt, (new StateMap.Builder()).ignore(new IProperty[] {BlockMegaTNT.EXPLODE}).build());
	ModelLoader.setCustomStateMapper(Modblocks.nuke, (new StateMap.Builder()).ignore(new IProperty[] {BlockNuke.EXPLODE}).build());
   RenderingRegistry.registerEntityRenderingHandler(NukePrimed.class, RenderNukePrimed::new);
    RenderingRegistry.registerEntityRenderingHandler(MegaTNTPrimed.class, RenderMegaTNTPrimed::new);
    ModelLoader.setCustomStateMapper(Modblocks.grill, null);
  
}
@Override
public void init(FMLInitializationEvent e) {
	super.init(e);
	 BlockRenderRegister.registerBlockRenderer();
	 ItemRenderRegister.registerItemRenderer();
	 EntityRegistry.registerModEntity(MegaTNTPrimed.class, "megatnt", 1, Main.instance, 160, 10, true);
	 EntityRegistry.registerModEntity(NukePrimed.class, "nuke", 2, Main.instance, 160, 10, true);
	 ClientRegistry.bindTileEntitySpecialRenderer(Grill.class, new TileGrillRenderer());


}

@Override
public void postInit(FMLPostInitializationEvent e) {
	super.postInit(e);
}

}

 

And my BlockGrill:

package com.leomelonseeds.moarstuff.blocks;

import java.util.Collections;
import java.util.Map;

import javax.annotation.Nullable;

import com.leomelonseeds.moarstuff.Main;
import com.leomelonseeds.moarstuff.items.Moditems;
import com.leomelonseeds.moarstuff.network.GUIHandlerGrill;
import com.leomelonseeds.moarstuff.tileentity.Grill;

import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.block.statemap.IStateMapper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryHelper;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockGrill extends Block implements IStateMapper{

public static boolean isBurning;
public BlockGrill(String unlocalizedName, boolean isBurning) {
        super(Material.ROCK);
        this.setUnlocalizedName("grill");
        this.setCreativeTab(Moditems.moarStuff);
        this.isBlockContainer = true;
        this.isBurning = isBurning;
        
    }


    @Override
    public TileEntity createTileEntity(World worldIn, IBlockState state) {
        return new Grill();
    }
    
    @Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {

	if (worldIn.isRemote) return true;

	playerIn.openGui(Main.instance, GUIHandlerGrill.getGuiID(), worldIn, pos.getX(), pos.getY(), pos.getZ());
	return true;
}

@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
	TileEntity tileEntity = worldIn.getTileEntity(pos);
	if (tileEntity instanceof IInventory) {
		InventoryHelper.dropInventoryItems(worldIn, pos, (IInventory)tileEntity);
	}




	super.breakBlock(worldIn, pos, state);
}

public boolean eventReceived(IBlockState state, World worldIn, BlockPos pos, int id, int param)
    {
        super.eventReceived(state, worldIn, pos, id, param);
        TileEntity tileentity = worldIn.getTileEntity(pos);
        return tileentity == null ? false : tileentity.receiveClientEvent(id, param);
    }







@Override
public boolean isOpaqueCube(IBlockState iBlockState) {
	return false;
}

public EnumBlockRenderType getRenderType(IBlockState state)
    {
        return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
    }

    public boolean isFullCube(IBlockState state)
    {
        return false;
    }
    public boolean hasTileEntity(IBlockState state)
    {
    	return true;
    }


@Override
public Map<IBlockState, ModelResourceLocation> putStateModelLocations(Block blockIn) {
	// TODO Auto-generated method stub
	return Collections.emptyMap();
}




    
    

}

What should I change "null" in clientproxy to and is my blockgrill file correct?

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.

Link to comment
Share on other sites

Oh wait, I just noticed that my custom tnt already has setCustomStateMapper :P

But how do I make it ignore blockstates.json

Also, grill lid still doesnt open:

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.TileEntityChest;
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 void renderTileEntityAt(Grill te, double x, double y, double z, float partialTicks, int destroyStage)
    {
    	
    	TileEntityChest tec = new TileEntityChest();
    	

        GlStateManager.enableDepth();
        GlStateManager.depthFunc(515);
        GlStateManager.depthMask(true);
        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(BlockGrill.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 = tec.prevLidAngle + (tec.lidAngle - tec.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);
            }
        }
    }

And it automatically sets the texture to burning, even though I said false to isBurning

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.

Link to comment
Share on other sites

If you tell it to use the default state mapper and not your own implementation, of course it's going to keep looking.

 

ModelLoader.setCustomStateMapper(Modblocks.megatnt, (new StateMap.Builder()).ignore(new IProperty[] {BlockMegaTNT.EXPLODE}).build());

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.

Link to comment
Share on other sites

Draco18s: Actually, my block is the tileentity BlockGrill, not BlockMegaTNT.

Diesieben07: Hopefully I can correct those errors. Thanks for the help! Also, how do I get it to always return an empty map? Doesn't my current method already return an empty map? And, I don't see any generic types in my TESR posted above.

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.

Link to comment
Share on other sites

Whoops.

 

Still.

 

You had this:

ModelLoader.setCustomStateMapper(Modblocks.grill, null);

 

Which was still not creating an instance of your custom IStateMapper.

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.

Link to comment
Share on other sites

Here is BlockGrill(Implements IStateMapper):

package com.leomelonseeds.moarstuff.blocks;

import java.util.Collections;
import java.util.Map;

import javax.annotation.Nullable;

import com.leomelonseeds.moarstuff.Main;
import com.leomelonseeds.moarstuff.items.Moditems;
import com.leomelonseeds.moarstuff.network.GUIHandlerGrill;
import com.leomelonseeds.moarstuff.tileentity.Grill;

import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.block.statemap.IStateMapper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryHelper;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockGrill extends Block implements IStateMapper{

public static boolean isBurning;

public BlockGrill(String unlocalizedName, boolean isBurning) {
        super(Material.ROCK);
        this.setUnlocalizedName("grill");
        this.setCreativeTab(Moditems.moarStuff);
        this.isBlockContainer = true;
        this.isBurning = isBurning;
        
    }


    @Override
    public TileEntity createTileEntity(World worldIn, IBlockState state) {
        return new Grill();
    }
    
    @Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {

	if (worldIn.isRemote) return true;

	playerIn.openGui(Main.instance, GUIHandlerGrill.getGuiID(), worldIn, pos.getX(), pos.getY(), pos.getZ());
	return true;
}

@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
	TileEntity tileEntity = worldIn.getTileEntity(pos);
	if (tileEntity instanceof IInventory) {
		InventoryHelper.dropInventoryItems(worldIn, pos, (IInventory)tileEntity);
	}




	super.breakBlock(worldIn, pos, state);
}

public boolean eventReceived(IBlockState state, World worldIn, BlockPos pos, int id, int param)
    {
        super.eventReceived(state, worldIn, pos, id, param);
        TileEntity tileentity = worldIn.getTileEntity(pos);
        return tileentity == null ? false : tileentity.receiveClientEvent(id, param);
    }







@Override
public boolean isOpaqueCube(IBlockState iBlockState) {
	return false;
}

public EnumBlockRenderType getRenderType(IBlockState state)
    {
        return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
    }

    public boolean isFullCube(IBlockState state)
    {
        return false;
    }
    public boolean hasTileEntity(IBlockState state)
    {
    	return true;
    }


@Override
public Map<IBlockState, ModelResourceLocation> putStateModelLocations(Block blockIn) {
	// TODO Auto-generated method stub
	return Collections.emptyMap();
}




    
    

}

 

Here is my TESR:

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.TileEntityChest;
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(){
    	
    }
    

    

    public void renderTileEntityAt(Grill te, double x, double y, double z, float partialTicks, int destroyStage)
    {
    	
    	TileEntityChest tec = new TileEntityChest();
    	

        GlStateManager.enableDepth();
        GlStateManager.depthFunc(515);
        GlStateManager.depthMask(true);
        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(BlockGrill.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 = tec.prevLidAngle + (tec.lidAngle - tec.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);
            }
        }
    }

 

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.

Link to comment
Share on other sites

Ok ok... I will do it, and for IStateMapper, I just create a new class(like Draco18s') and implement it with ModelLoader.setCustomStateMapper in ClientProxy.preInit()?

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.

Link to comment
Share on other sites

Thanks! Just a question, I set a boolean isBurning for my Grill, which sets the texture to the burning texture when it's burning. The problem is, when I place 2 grills, the texture doesn't show for anyone of them if one of them is not burning, and one is.

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.

Link to comment
Share on other sites

Ok ok... I will do it, and for IStateMapper, I just create a new class(like Draco18s') and implement it with ModelLoader.setCustomStateMapper in ClientProxy.preInit()?

 

The class implements it. setCustomStateMapper registers it.

But yes.

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.

Link to comment
Share on other sites

You need to ask the te if it is burning. If it is for the inventory, then it will always be false, no?

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.

Link to comment
Share on other sites

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

    • They were already updated, and just to double check I even did a cleanup and fresh update from that same page. I'm quite sure drivers are not the problem here. 
    • i tried downloading the drivers but it says no AMD graphics hardware has been detected    
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system  
    • As the title says i keep on crashing on forge 1.20.1 even without any mods downloaded, i have the latest drivers (nvidia) and vanilla minecraft works perfectly fine for me logs: https://pastebin.com/5UR01yG9
    • Hello everyone, I'm making this post to seek help for my modded block, It's a special block called FrozenBlock supposed to take the place of an old block, then after a set amount of ticks, it's supposed to revert its Block State, Entity, data... to the old block like this :  The problem I have is that the system breaks when handling multi blocks (I tried some fix but none of them worked) :  The bug I have identified is that the function "setOldBlockFields" in the item's "setFrozenBlock" function gets called once for the 1st block of multiblock getting frozen (as it should), but gets called a second time BEFORE creating the first FrozenBlock with the data of the 1st block, hence giving the same data to the two FrozenBlock :   Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=head] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@73681674 BlockEntityData : id:"minecraft:bed",x:3,y:-60,z:-6} Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=3, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=2, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} here is the code inside my custom "freeze" item :    @Override     public @NotNull InteractionResult useOn(@NotNull UseOnContext pContext) {         if (!pContext.getLevel().isClientSide() && pContext.getHand() == InteractionHand.MAIN_HAND) {             BlockPos blockPos = pContext.getClickedPos();             BlockPos secondBlockPos = getMultiblockPos(blockPos, pContext.getLevel().getBlockState(blockPos));             if (secondBlockPos != null) {                 createFrozenBlock(pContext, secondBlockPos);             }             createFrozenBlock(pContext, blockPos);             return InteractionResult.SUCCESS;         }         return super.useOn(pContext);     }     public static void createFrozenBlock(UseOnContext pContext, BlockPos blockPos) {         BlockState oldState = pContext.getLevel().getBlockState(blockPos);         BlockEntity oldBlockEntity = oldState.hasBlockEntity() ? pContext.getLevel().getBlockEntity(blockPos) : null;         CompoundTag oldBlockEntityData = oldState.hasBlockEntity() ? oldBlockEntity.serializeNBT() : null;         if (oldBlockEntity != null) {             pContext.getLevel().removeBlockEntity(blockPos);         }         BlockState FrozenBlock = setFrozenBlock(oldState, oldBlockEntity, oldBlockEntityData);         pContext.getLevel().setBlockAndUpdate(blockPos, FrozenBlock);     }     public static BlockState setFrozenBlock(BlockState blockState, @Nullable BlockEntity blockEntity, @Nullable CompoundTag blockEntityData) {         BlockState FrozenBlock = BlockRegister.FROZEN_BLOCK.get().defaultBlockState();         ((FrozenBlock) FrozenBlock.getBlock()).setOldBlockFields(blockState, blockEntity, blockEntityData);         return FrozenBlock;     }  
  • Topics

×
×
  • Create New...

Important Information

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