Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hi, my model I imported is just black and not using my texture.

 

t3MC0aw.png

 

Model

 

 

package tattyseal.e.plane;

 

import net.minecraft.client.model.ModelBase;

import net.minecraft.util.ResourceLocation;

import net.minecraftforge.client.model.AdvancedModelLoader;

import net.minecraftforge.client.model.IModelCustom;

 

import org.lwjgl.opengl.GL11;

 

import cpw.mods.fml.client.FMLClientHandler;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

@SideOnly(Side.CLIENT)

public class ModelPlane extends ModelBase

{

    private IModelCustom modelTutBox;

   

    public ModelPlane()

    {

        modelTutBox = AdvancedModelLoader.loadModel("/assets/ee/models/Plane.obj");

    }

   

    public void renderAll()

    {

        modelTutBox.renderAll();

    }

   

    public void render(TilePlane box, double x, double y, double z)

    {

        // Push a blank matrix onto the stack

        GL11.glPushMatrix();

           

        // Move the object into the correct position on the block (because the OBJ's origin is the center of the object)

        GL11.glTranslatef((float)x + 0.5f, (float)y + 1f, (float)z + 0.5f);

   

        // Scale our object to about half-size in all directions (the OBJ file is a little large)

        GL11.glScalef(0.25f, 0.25f, 0.25f);

   

        //GL11.gl

       

        // Bind the texture, so that OpenGL properly textures our block.

        FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("ee", "models/biplane.png"));

   

        // Render the object, using modelTutBox.renderAll();

        this.renderAll();

   

        // Pop this matrix from the stack.

        GL11.glPopMatrix();

    }

}

 

 

 

Renderer

 

 

package tattyseal.e.plane;

 

import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;

import net.minecraft.tileentity.TileEntity;

 

public class TilePlaneRender extends TileEntitySpecialRenderer

{

    private ModelPlane modelTutBox = new ModelPlane();

   

    @Override

    public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick)

    {

        modelTutBox.render((TilePlane)tileEntity, x, y, z);

    }

}

 

 

I'm just taking a guess here. But should there be a leading slash in the file path for this line?

 

// Bind the texture, so that OpenGL properly textures our block.
        FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("ee", "models/biplane.png"));

 

Shouldn't it be this instead?

 

// Bind the texture, so that OpenGL properly textures our block.
        FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("ee", "/models/biplane.png"));

 

Like I said I know very little about OpenGL but its a guess.

“Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program.” - Linus Torvalds

I'm just taking a guess here. But should there be a leading slash in the file path for this line?

 

// Bind the texture, so that OpenGL properly textures our block.
        FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("ee", "models/biplane.png"));

 

Shouldn't it be this instead?

 

// Bind the texture, so that OpenGL properly textures our block.
        FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("ee", "/models/biplane.png"));

 

Like I said I know very little about OpenGL but its a guess.

 

Umm.. I am sorry, but no. And also, that is MINECRAFT code not OpenGL code! ResourceLocations are just returning Icons in the end anyway I think... I am not entirely sure. But anyway. The extra slash is not needed.

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.