Jump to content

Recommended Posts

Posted

Hello, so i am working on a new mod right now that involves a lot of TileEntities, but whenever i try to render one using a TESR it just loads it as an invisible block in game,

 

My Block code:

public class GrindingFactory extends Block implements ITileEntityProvider {

public GrindingFactory(String unlocalizedName, Material material, float hardness) {
	super(material);
	this.setHardness(3.0F);
	this.setUnlocalizedName("GrindingFactory");
	this.setCreativeTab(JATMA.jatma);
        this.isBlockContainer = true;
}

public GrindingFactory(String unlocalizedName, float hardness) {
        this(unlocalizedName, Material.rock, hardness);
    }

    public GrindingFactory(String unlocalizedName) {
        this(unlocalizedName, 3.0F);
    }


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

    @Override
    public boolean isFullCube() {
        return false;
    }
    
    public int getRenderType()
    {
        return 2;
    }

@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
	return new TileEntityGrindingFactory();
}

@Override
    public void breakBlock(World world, BlockPos pos, IBlockState state) {
        super.breakBlock(world, pos, state);
        world.removeTileEntity(pos);
    }

    @Override
    public boolean onBlockEventReceived(World worldIn, BlockPos pos, IBlockState state, int eventID, int eventParam) {
        super.onBlockEventReceived(worldIn, pos, state, eventID, eventParam);
        TileEntity tileentity = worldIn.getTileEntity(pos);
        return tileentity == null ? false : tileentity.receiveClientEvent(eventID, eventParam);
    }

}

 

My TileEntity Code:

public class TileEntityGrindingFactory extends TileEntity implements IWrenchable, IEnergyHandler {

    protected EnergyStorage storage = new EnergyStorage(10000);

    @Override
    public void readFromNBT(NBTTagCompound nbt) {

        super.readFromNBT(nbt);
        storage.readFromNBT(nbt);
    }

    @Override
    public void writeToNBT(NBTTagCompound nbt) {

        super.writeToNBT(nbt);
        storage.writeToNBT(nbt);
    }

@Override
public boolean canConnectEnergy(EnumFacing from) {
	return true;
}

@Override
public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate) {
	return storage.receiveEnergy(maxReceive, simulate);
}

@Override
public int extractEnergy(EnumFacing from, int maxExtract, boolean simulate) {
	return 0;
}

@Override
public int getEnergyStored(EnumFacing from) {
	return storage.getEnergyStored();
}

@Override
public int getMaxEnergyStored(EnumFacing from) {
	return storage.getEnergyStored();
}

@Override
public ArrayList<ItemStack> dismantleBlock(EntityPlayer player, World world, BlockPos pos, boolean returnDrops) {
	return null;
}

@Override
public boolean canDismantle(EntityPlayer player, World world, BlockPos pos) {
	return true;
}

}

 

My TESR class:

public class RenderGrindingFactory extends TileEntitySpecialRenderer {

    private final ResourceLocation textureLocation = new ResourceLocation("jatma", "textures/blocks/grindingfactory.png");


@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage) {

        GL11.glPushMatrix();
        GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
      
        bindTexture(textureLocation);
        GL11.glPushMatrix();
        GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
        
            int rotation = 0;
            switch (te.getBlockMetadata() % 4) {
                case 0:
                    rotation = 270;
                    break;
                case 1:
                    rotation = 0;
                    break;
                case 2:
                    rotation = 90;
                    break;
                case 3:
                    rotation = 180;
                    break;
            }
          GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F);
            
            
        GL11.glPopMatrix();
        GL11.glPopMatrix();

}

}

 

I have binded my TileEntity class with my TESR class in my BlockRenderRegistry,

public class BlockRenderRegister {

public static String modid = info.MODID;

public static void registerBlockRenderer() {

	reg(ModBlocks.GrindingFactory);
	        
        ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGrindingFactory.class, new RenderGrindingFactory());

}

public static void reg(Block block) {
    Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
    .register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(modid + ":" + block.getUnlocalizedName().substring(5), "inventory"));
}

}

 

My TileEntity is registered, So i was wondering if i was rendering it wrong, or if i was doing something wrong

Posted

It doesn't seem like you are actually rendering anything in the TESR. You are binding a texture, but not rendering anything. I could be mistaken, but in 1.7.10 you would have to get the model and then bind the texture and render it. You might not need a TESR, though. What do you want the block to look like, and can you post the JSONs?

Posted

Well i have a json model i want the block to use, but not sure how to do that,

my Blockstate:

{
    "variants": {
        "normal": { "model": "jatma:GrindingFactory" }
    }
}

 

My Model Block json, what i want the block to look like

{
    "textures": {
        "0": "blocks/obsidian",
        "1": "blocks/beacon",
        "2": "blocks/bedrock",
        "3": "blocks/glass",
        "4": "jatma:blocks/powerport",
        "5": "jatma:blocks/powerport"
    },
    "elements": [
        {
            "name": "bottom",
            "from": [ 1.0, 0.0, 1.0 ], 
            "to": [ 15.0, 1.0, 15.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 1.0 ] },
                "east": { "texture": "#0", "uv": [ 1.0, 0.0, 15.0, 1.0 ] },
                "south": { "texture": "#0", "uv": [ 15.0, 1.0, 1.0, 0.0 ] },
                "west": { "texture": "#0", "uv": [ 1.0, 1.0, 15.0, 2.0 ] },
                "up": { "texture": "#1", "uv": [ 1.0, 1.0, 15.0, 15.0 ] },
                "down": { "texture": "#1", "uv": [ 1.0, 1.0, 15.0, 15.0 ] }
            }
        },
        {
            "name": "pillar1",
            "from": [ 1.0, 1.0, 14.0 ], 
            "to": [ 2.0, 9.0, 15.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "pillar2",
            "from": [ 14.0, 1.0, 14.0 ], 
            "to": [ 15.0, 9.0, 15.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 9.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, -1.0, 1.0 ] }
            }
        },
        {
            "name": "pillar3",
            "from": [ 1.0, 1.0, 1.0 ], 
            "to": [ 2.0, 9.0, 2.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "pillar4",
            "from": [ 14.0, 1.0, 1.0 ], 
            "to": [ 15.0, 9.0, 2.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "top",
            "from": [ 3.0, 9.0, 3.0 ], 
            "to": [ 13.0, 10.0, 13.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 10.0, 1.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 10.0, 1.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 10.0, 1.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 10.0, 1.0 ] },
                "up": { "texture": "#0", "uv": [ 3.0, 3.0, 13.0, 13.0 ] },
                "down": { "texture": "#0", "uv": [ 3.0, 3.0, 13.0, 13.0 ] }
            }
        },
        {
            "name": "connector",
            "from": [ 2.0, 8.0, 2.0 ], 
            "to": [ 3.0, 10.0, 3.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "connector2",
            "from": [ 2.0, 8.0, 13.0 ], 
            "to": [ 3.0, 10.0, 14.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "connector3",
            "from": [ 13.0, 8.0, 13.0 ], 
            "to": [ 14.0, 10.0, 14.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "connector4",
            "from": [ 13.0, 8.0, 2.0 ], 
            "to": [ 14.0, 10.0, 3.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
                "east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
                "up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "name": "hammerconnector",
            "from": [ 7.0, 6.0, 7.0 ], 
            "to": [ 9.0, 9.0, 9.0 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 0.0, 0.0, 2.0, 3.0 ] },
                "east": { "texture": "#2", "uv": [ 0.0, 0.0, 2.0, 3.0 ] },
                "south": { "texture": "#2", "uv": [ 0.0, 0.0, 2.0, 3.0 ] },
                "west": { "texture": "#2", "uv": [ 0.0, 0.0, 2.0, 3.0 ] },
                "up": { "texture": "#2", "uv": [ 0.0, 0.0, 2.0, 2.0 ] },
                "down": { "texture": "#2", "uv": [ 0.0, 0.0, 2.0, 2.0 ] }
            }
        },
        {
            "name": "hammerbottom",
            "from": [ 6.0, 1.0, 6.0 ], 
            "to": [ 10.0, 2.0, 11.0 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 3.0, 1.0, 14.0, 13.0 ] },
                "east": { "texture": "#2", "uv": [ 15.0, 14.0, -7.0, 4.0 ] },
                "south": { "texture": "#2", "uv": [ 0.0, 0.0, 13.0, 11.0 ] },
                "west": { "texture": "#2", "uv": [ 0.0, 0.0, 14.0, 11.0 ] },
                "up": { "texture": "#2", "uv": [ 5.0, 3.0, 15.0, 16.0 ] },
                "down": { "texture": "#2", "uv": [ 3.0, 5.0, 15.0, 16.0 ] }
            }
        },
        {
            "name": "2",
            "from": [ 5.0, 4.0, 5.0 ], 
            "to": [ 11.0, 5.0, 6.0 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 0.0, 0.0, 14.0, 13.0 ] },
                "east": { "texture": "#2", "uv": [ 0.0, 0.0, 13.0, 12.0 ] },
                "south": { "texture": "#2", "uv": [ 14.0, 0.0, 3.0, 16.0 ] },
                "west": { "texture": "#2", "uv": [ 0.0, 0.0, 13.0, 14.0 ] },
                "up": { "texture": "#2", "uv": [ 0.0, 0.0, 14.0, 12.0 ] },
                "down": { "texture": "#2", "uv": [ 0.0, 0.0, 14.0, 12.0 ] }
            }
        },
        {
            "name": "3",
            "from": [ 5.0, 4.0, 6.0 ], 
            "to": [ 6.0, 5.0, 11.0 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 0.0, 0.0, 10.0, 12.0 ] },
                "east": { "texture": "#2", "uv": [ 0.0, 0.0, 15.0, 13.0 ] },
                "south": { "texture": "#2", "uv": [ 0.0, 0.0, 11.0, 13.0 ] },
                "west": { "texture": "#2", "uv": [ 0.0, 0.0, 15.0, 13.0 ] },
                "up": { "texture": "#2", "uv": [ 0.0, 0.0, 13.0, 15.0 ] },
                "down": { "texture": "#2", "uv": [ 0.0, 0.0, 10.0, 13.0 ] }
            }
        },
        {
            "name": "4",
            "from": [ 10.0, 4.0, 6.0 ], 
            "to": [ 11.0, 5.0, 11.0 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 0.0, 0.0, 15.0, 9.0 ] },
                "east": { "texture": "#2", "uv": [ 0.0, 0.0, 14.0, 12.0 ] },
                "south": { "texture": "#2", "uv": [ 0.0, 0.0, 12.0, 10.0 ] },
                "west": { "texture": "#2", "uv": [ 0.0, 0.0, 14.0, 14.0 ] },
                "up": { "texture": "#2", "uv": [ 0.0, 0.0, 14.0, 14.0 ] },
                "down": { "texture": "#2", "uv": [ 0.0, 0.0, 14.0, 14.0 ] }
            }
        },
        {
            "name": "hammerpart",
            "from": [ 5.0, 5.0, 5.0 ], 
            "to": [ 11.0, 6.0, 11.0 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 0.0, 0.0, 15.0, 12.0 ] },
                "east": { "texture": "#2", "uv": [ 0.0, 0.0, 16.0, 15.0 ] },
                "south": { "texture": "#2", "uv": [ 0.0, 0.0, 14.0, 12.0 ] },
                "west": { "texture": "#2", "uv": [ 0.0, 0.0, 15.0, 14.0 ] },
                "up": { "texture": "#2", "uv": [ 0.0, 0.0, 14.0, 13.0 ] },
                "down": { "texture": "#2", "uv": [ 0.0, 0.0, 15.0, 16.0 ] }
            }
        },
        {
            "name": "windowfront",
            "from": [ 2.0, 1.0, 1.0 ], 
            "to": [ 14.0, 9.0, 2.0 ], 
            "faces": {
                "north": { "texture": "#3", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
                "east": { "texture": "#3", "uv": [ 4.0, 4.0, 5.0, 12.0 ] },
                "south": { "texture": "#3", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
                "west": { "texture": "#3", "uv": [ 8.0, 5.0, 9.0, 11.0 ] },
                "up": { "texture": "#3", "uv": [ 1.0, 1.0, 14.0, 14.0 ] },
                "down": { "texture": "#3", "uv": [ 4.0, 8.0, 16.0, 9.0 ] }
            }
        },
        {
            "name": "windowfrond2",
            "from": [ 2.0, 1.0, 14.0 ], 
            "to": [ 14.0, 9.0, 15.0 ], 
            "faces": {
                "north": { "texture": "#3", "uv": [ 0.0, 0.0, 12.0, 8.0 ] },
                "east": { "texture": "#3", "uv": [ 6.0, 4.0, 7.0, 12.0 ] },
                "south": { "texture": "#3", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
                "west": { "texture": "#3", "uv": [ 8.0, 3.0, 9.0, 9.0 ] },
                "up": { "texture": "#3", "uv": [ 2.0, 1.0, 14.0, 14.0 ] },
                "down": { "texture": "#3", "uv": [ 0.0, 0.0, 12.0, 1.0 ] }
            }
        },
        {
            "name": "powerport",
            "from": [ 14.0, 1.0, 2.0 ], 
            "to": [ 15.0, 9.0, 14.0 ], 
            "faces": {
                "north": { "texture": "#4", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
                "east": { "texture": "#4", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
                "south": { "texture": "#4", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
                "west": { "texture": "#4", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
                "up": { "texture": "#4", "uv": [ 0.0, 0.0, 1.0, 12.0 ] },
                "down": { "texture": "#5", "uv": [ 0.0, 0.0, 1.0, 12.0 ] }
            }
        },
        {
            "name": "powerport2",
            "from": [ 1.0, 1.0, 2.0 ], 
            "to": [ 2.0, 9.0, 14.0 ], 
            "faces": {
                "north": { "texture": "#4", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
                "east": { "texture": "#4", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
                "south": { "texture": "#4", "uv": [ 0.0, 0.0, 1.0, 8.0 ] },
                "west": { "texture": "#4", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
                "up": { "texture": "#4", "uv": [ 0.0, 0.0, 1.0, 12.0 ] },
                "down": { "texture": "#5", "uv": [ 0.0, 0.0, 1.0, 12.0 ] }
            }
        },
        {
            "name": "glassface1",
            "from": [ 13.0, 9.0, 3.0 ], 
            "to": [ 14.0, 10.0, 13.0 ], 
            "faces": {
                "north": { "texture": "#3", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "east": { "texture": "#3", "uv": [ 3.0, 1.0, 15.0, 14.0 ] },
                "south": { "texture": "#3", "uv": [ 0.0, 0.0, 13.0, 13.0 ] },
                "west": { "texture": "#3", "uv": [ 0.0, 13.0, 16.0, 0.0 ] },
                "up": { "texture": "#3", "uv": [ 15.0, 6.0, 3.0, 15.0 ] },
                "down": { "texture": "#3", "uv": [ 0.0, 0.0, 1.0, 10.0 ] }
            }
        },
        {
            "name": "glassface2",
            "from": [ 2.0, 9.0, 3.0 ], 
            "to": [ 3.0, 10.0, 13.0 ], 
            "faces": {
                "north": { "texture": "#3", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "east": { "texture": "#3", "uv": [ 0.0, 0.0, 10.0, 1.0 ] },
                "south": { "texture": "#3", "uv": [ 0.0, 0.0, -2.0, -3.0 ] },
                "west": { "texture": "#3", "uv": [ 1.0, 14.0, 15.0, 3.0 ] },
                "up": { "texture": "#3", "uv": [ 14.0, 3.0, 2.0, 14.0 ] },
                "down": { "texture": "#3", "uv": [ 0.0, 0.0, 1.0, 10.0 ] }
            }
        },
        {
            "name": "glassface3",
            "from": [ 3.0, 9.0, 2.0 ], 
            "to": [ 13.0, 10.0, 3.0 ], 
            "faces": {
                "north": { "texture": "#3", "uv": [ 2.0, 2.0, 12.0, 3.0 ] },
                "east": { "texture": "#3", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "south": { "texture": "#3", "uv": [ 2.0, 2.0, 12.0, 13.0 ] },
                "west": { "texture": "#3", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "up": { "texture": "#3", "uv": [ 1.0, 2.0, 15.0, 13.0 ] },
                "down": { "texture": "#3", "uv": [ 0.0, 0.0, 10.0, 1.0 ] }
            }
        },
        {
            "name": "glassface4",
            "from": [ 3.0, 9.0, 13.0 ], 
            "to": [ 13.0, 10.0, 14.0 ], 
            "faces": {
                "north": { "texture": "#3", "uv": [ 2.0, 2.0, 12.0, 3.0 ] },
                "east": { "texture": "#3", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "south": { "texture": "#3", "uv": [ 2.0, 2.0, 12.0, 13.0 ] },
                "west": { "texture": "#3", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
                "up": { "texture": "#3", "uv": [ 1.0, 2.0, 15.0, 13.0 ] },
                "down": { "texture": "#3", "uv": [ 0.0, 0.0, 10.0, 1.0 ] }
            }
        }
    ]
}

 

My model item:

{
    "parent":"jatma:block/GrindingFactory",
    "display": {
        "thirdperson": {
            "rotation": [ 10, -45, 170 ],
            "translation": [ 0, 1.5, -2.75 ],
            "scale": [ 0.375, 0.375, 0.375 ]
        }
    }
}

 

If there is a way to go about it by not using a TESR and just using the Block json Model, that would be much better

Posted

It renders in your hand as it's supposed to? Maybe try unhooking (don't delete!) the TESR and see how it renders. If it renders in your hand normally, it would be something with the block render (TESR most likely)

Posted

I have tried that, i unhooked the TESR but had no luck, my block was extending BlockContainer and tried all i can with this but had no luck rendering so now im using extends Block implements ITileEntityProvider

Posted

I forgot: At least for BlockContainers, you must override getRenderType() (I believe that's the method). I am using 1.9 right now, so I don't know what you should return (I believe it's an int), but I had the same problem with one of my models. For some reason, BlockContainers are invisible by default.

EDIT: Might want to change the int and see what happens. Didn't see you had it.

EDIT 2: Change it to 3.

Posted

I just tried that but had no luck.

Edit- I was able to fix it by overriding getRenderType() and changing my return from 2 to 3

 

@Override
    public int getRenderType()
    {
        return 3;
    }

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

    • Hey there! I removed Bobby as Pyralis suggested and found that I still had that and a another closely related bug (or same bug, different presentation) wherein a torch only illuminates its own block and gets smoothed 1 block out, then gone.   After comparing your modlist to mine (I'm on fabric, also 1.20.1) I found we had 2 mods with the same versions. Mine || Yours Bobby-5.0.1.jar ||bobby-1.20.1_v5.0.1.jar ImmediatelyFast-Fabric-1.2.17+1.20.4.jar || ImmediatelyFast-Forge-1.2.17+1.20.4.jar Removing ImmediatelyFast.. immediately (😉) seems to have fixed the issue. Since it's client only- no new world needed either! To note, I also removed all mods related to or containing direct requirements for Sodium, Indium and Iris which may have played a role, I did not test with re-adding.
    • For anyone still looking for the equivalent for 1.19.2+, the render type should be set for the model. In datagen, this can be done by using ModelBuilder::renderType, otherwise just add the line directly to the json file. As for the validity of this question, the idiomatic solution is presented nowhere online; ModelBuilder::renderType is never addressed when discussing block render types meaning that the solution I have provided is the first mentioned usage. Furthermore, there are no external references to this function meaning that to discover its existence requires a deep search through Forge's code. Therefore it is not only understandable but expected that most beginner modders would struggle to find this function given the already poor documentation of Forge's API.
    • Same issue without voicechat?
    • Start by following the docs to get a workspace setup: https://docs.minecraftforge.net/en/latest/gettingstarted/ Then poke around some of the tutorials, https://www.mcjty.eu/docs/1.20/ used to be the goto, but not sure if there are any updates for regular forge or not, but if you've brushed up on Java, it will be enough to get you started. Poke around the Minecraft and Forge sources to see how things are done. Read the FAQ for information on how to post code/logs when you run into issues. Share as much info on issues you have as possible. Use github to host projects, chances of someone helping are higher when they can actually see all your code and/or build it themselves. And finally, keep it on the forums, don't direct message people with questions, most people do not provide personal support like that. Also keep in mind forums posts are not always immediately answered, if you're looking for a quicker response, you can always try the Minecraft Forge discord server.
    • Hello, I have a Forge Minecraft sever (I host it at g-portal.com) which has always worked fine and I had no problems, but today it doesn't wanna work anymore. Today I started the server and the status said online, but after a few seconds it said this: "Start failed". And then out of nowhere it restarted itself and the same thing happened again and again and now it's in an infinite loop where it just keeps failing and then restarts. Here's the download link for the server logs: https://www.mediafire.com/file/sq30dgoonjevib1/2025-07-06-1.log/file Does anyone know how to fix this? If yes I would really appreciate help. Best wishes, Gabs1107
  • Topics

×
×
  • Create New...

Important Information

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