Jump to content

Entity Texture Issue/Creating an Entity Renderer


sth300

Recommended Posts

I'm trying to create a mod that add quad-rotor entities into the game. 

 

I'm having an issue where my entity (OBJ model) is spawning without its UV mapped texture from blender. No errors are thrown regarding not being able to find the texture file, so I believe it's in the right place. Here is what the item (when thrown on the ground, /summon spawns an invisible entity) looks like in game and how I expect it to look:

Spoiler
 
 
 
 
 
 
 
 
 
 
 
 
Spoiler

1901264099_ScreenshotatMay2210-16-13.thumb.png.ce2fe9484bdca60dd72b0041825229a7.png2099265379_ScreenshotatMay2210-23-33.thumb.png.ddcfd793a061fb916a404b321cbe70a2.png

 

 

 

My hypothesis is that my renderer has issues, in that its a bare bones class that does nothing. Here it is: 

package mod.sth300.dronemod.render;

import mod.sth300.dronemod.DroneMod;
import mod.sth300.dronemod.drones.DroneEntity;

import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraft.util.ResourceLocation;

public class DroneEntityRenderer extends EntityRenderer<DroneEntity> {

    public DroneEntityRenderer(EntityRendererManager renderManager) {
        super(renderManager);
    }

    @Override
    public ResourceLocation getEntityTexture(DroneEntity entity) {
        ResourceLocation res = new ResourceLocation(DroneMod.MODID, "textures/item/drones/drone_quad");
        return res;
    }
}

 

My question is, how do I go about writing a renderer class? I've been unable to find a good tutorial or an example with any kind of explanation of what it's doing. 

 

Update: Still need help with the renderer, but the item texture issue is fixed, that was a problem with Blender. Heres what I had to change in case anyone in the future has a similar issue: 

# Original model.mtl file

newmtl dronemat
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.000000 0.093963 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd dronemod:item/drones/drone_quad


# Modified model.mtl file

newmtl dronemat
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.000000 0.800000 0.800000 <-- changed 2nd value in Kd to 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd dronemod:item/drones/drone_quad

 

 

 

Edited by sth300
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



×
×
  • Create New...

Important Information

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