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