Jump to content

[1.6.2] Solved Mob won't render correct


kmccmk9

Recommended Posts

Hello, I've been trying to add a mob to the game and have been able to get an egg that can spawn my new mob. However, it comes out like the picture below instead of what it should be, a bee. What is wrong with my code? Below I have posted everything I got for you.

 

P3PtNmh.png

 

Main Class:

package kmccmk9.witchcraft;

import java.awt.Color;

import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityEggInfo;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.src.ModLoader;
import net.minecraft.world.biome.BiomeGenBase;

import kmccmk9.witchcraft.CommonProxy;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid="witchcraft", name="WitchCraft", version="0.0.1")
@NetworkMod(clientSideRequired=true, serverSideRequired=false)

public class WitchCraft {
// The instance of your mod that Forge uses.
    @Instance("WitchCraft")
    public static WitchCraft instance;
    
    // Says where the client and server 'proxy' code is loaded.
    @SidedProxy(clientSide="kmccmk9.witchcraft.client.ClientProxy", serverSide="kmccmk9.witchcraft.CommonProxy")
    public static CommonProxy proxy;
    
    @EventHandler
    public void preInit(FMLPreInitializationEvent event) {
            // Stub Method
    }
    
    @EventHandler
    public void load(FMLInitializationEvent event) {
    	int background = (Color.YELLOW.getRed() << 16) + (Color.YELLOW.getGreen() <<  + Color.YELLOW.getBlue();
    	int foreground = (Color.BLACK.getRed() << 16) + (Color.BLACK.getGreen() <<  + Color.BLACK.getBlue();
    	int id = ModLoader.getUniqueEntityId();
    	EntityRegistry.registerModEntity(EntityBee.class, "Bee", 1, this, 80, 5, true);
    	ModLoader.registerEntityID(EntityBee.class, "Bee",  id, background, foreground);
    	EntityRegistry.addSpawn(EntityBee.class, 7, 1, 4, EnumCreatureType.monster, BiomeGenBase.beach, BiomeGenBase.forest, BiomeGenBase.jungle, BiomeGenBase.plains);
    	LanguageRegistry.instance().addStringLocalization("entity.witchcraft.Bee.name", "Bee");
    	
    	EntityList.IDtoClassMapping.put(id, EntityBee.class);
    	EntityList.entityEggs.put(id, new EntityEggInfo(id, background, foreground));
    	
    }
    
    @EventHandler
    public void postInit(FMLPostInitializationEvent event) {
            // Stub Method
    }
}

 

EntityClass:

package kmccmk9.witchcraft;

import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.item.Item;
import net.minecraft.world.World;
import net.minecraft.src.*;

public class EntityBee extends EntityLiving {

public EntityBee(World par1World) {
	super(par1World);
	this.getNavigator().setAvoidsWater(true);
	this.setSize(0.5F, 0.5F);
	this.setEntityHealth(15F);
	this.setAIMoveSpeed(3F);
}

protected int getDropItemId()
    {
        return Item.porkRaw.itemID;
    }

public String getTexture() {
	return "textures/bee.png";
}

}

 

ModelClass:

package kmccmk9.witchcraft.client;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;




public class ModelBee extends ModelBase
{
  //fields
    ModelRenderer BeeBody;
    ModelRenderer BeeHead;
    ModelRenderer ant1;
    ModelRenderer ant2;
    ModelRenderer wing2;
    ModelRenderer wing1;
  
  public ModelBee()
  {
//constructor:
ant1 = new ModelRenderer(this, 0, 0);
ant1.mirror = true;
ant1.addBox(2F, 4F, -1F, 1, 4, 1);
ant1.rotateAngleZ = 0.17453292519943295F;

ant2 = new ModelRenderer(this, 41, 5);
ant2.mirror = true;
ant2.addBox(2F, 3F, -1F, 1, 4, 1);
ant2.rotateAngleZ = 6.1086523819801535F;

BeeBody = new ModelRenderer(this, 0, 0);
BeeBody.mirror = true;
BeeBody.addBox(0F, 0F, 0F, 5, 4, ;

BeeHead = new ModelRenderer(this, 19, 2);
BeeHead.mirror = true;
BeeHead.addBox(0F, 0F, 0F, 3, 3, 2);
//BeeHead.setPosition(1F, 1F, -2F);

wing1 = new ModelRenderer(this, 31, 1);
wing1.mirror = true;
wing1.addBox(5F, 1F, 2F, 4, 1, 3);
wing1.rotateAngleZ = 6.126105674500097F;

wing2 = new ModelRenderer(this, 31, 5);
wing2.mirror = true;
wing2.addBox(-4F, 2F, 2F, 4, 1, 3);
wing2.rotateAngleZ = 0.15707963267948966F;
  }
  
  public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
  {
    	//render:
ant1.render(f5);
ant2.render(f5);
BeeBody.render(f5);
BeeHead.render(f5);
wing1.render(f5);
wing2.render(f5);
  }
  
  private void setRotation(ModelRenderer model, float x, float y, float z)
  {
    model.rotateAngleX = x;
    model.rotateAngleY = y;
    model.rotateAngleZ = z;
  }
  
  public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
  {
    super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
  }
}

 

RendererClass:

package kmccmk9.witchcraft;

import kmccmk9.witchcraft.client.ModelBee;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;

public class RendererBee extends RenderLiving {
protected ModelBee model;
private static final ResourceLocation field_110775_a = new ResourceLocation("textures/bee.png");
public RendererBee(ModelBee par1ModelBase, float par2) {
	super(par1ModelBase, par2);
	model = (ModelBee)par1ModelBase;
}
@Override
protected ResourceLocation func_110775_a(Entity entity) {
	// TODO Auto-generated method stub
	return null;
}


}

 

Any help is greatly appreciated!

Link to comment
Share on other sites

private static final ResourceLocation field_110775_a = new ResourceLocation("textures/bee.png");
@Override
protected ResourceLocation func_110775_a(Entity entity) {
	// TODO Auto-generated method stub
	return null;
}

*facepalm*

Why do you think that should work ?

Link to comment
Share on other sites

private static final ResourceLocation field_110775_a = new ResourceLocation("textures/bee.png");
@Override
protected ResourceLocation func_110775_a(Entity entity) {
	// TODO Auto-generated method stub
	return null;
}

*facepalm*

Why do you think that should work ?

 

Ya I had a feeling it may be in that class. But I keep trying to follow different tutorials for different forge versions since no one seems to have one for 1.6.2 as of yet. Okay so what would I need to return then?

Link to comment
Share on other sites

I don't recall Minecraft having a bee texture.  :P

Look for "texture" threads, the proper use of ResourceLocation would be explained.

 

Ok I'll check it out cause the tutorials explained that the way I wrote it, would be the root of the mod folder, then textures and then bee.png.

Link to comment
Share on other sites

#RenderingRegistry

 

Great thanks. I was able to get the resuilt below. Okay, now the model seems to be upside down. The texture problem, I have to figure out still.

 

7IcEWbd.png

 

Is there something I can do with the mirror part of the model code? What I"m shooting for is like the below image.

 

0gzyQIl.png

Link to comment
Share on other sites

The way that resource locations are done is defaulted to the vanilla minecraft assets folder

you need to change it to so it's directed towards yours

 

for instance, with mine it's

    private static final ResourceLocation field_110890_f = new ResourceLocation("jnosh_advzelda", "textures/entity/chu.png");

 

as the folder structure goes

 

"assets" folder > "jnosh_advzelda" folder > "textures" folder > "entity" folder > "chu.png"

assets/jnosh_advzelda/textures/entity/chu

 

you need to do yours in a similar way, but using your own folders (obviously)

Link to comment
Share on other sites

The way that resource locations are done is defaulted to the vanilla minecraft assets folder

you need to change it to so it's directed towards yours

 

for instance, with mine it's

    private static final ResourceLocation field_110890_f = new ResourceLocation("jnosh_advzelda", "textures/entity/chu.png");

 

as the folder structure goes

 

"assets" folder > "jnosh_advzelda" folder > "textures" folder > "entity" folder > "chu.png"

assets/jnosh_advzelda/textures/entity/chu

 

you need to do yours in a similar way, but using your own folders (obviously)

 

So textures are no longer placed within your mod folder?

Link to comment
Share on other sites

no, if you're working in Eclipse, they're placed in forge/mcp/src/minecraft/assets

mine is

forge/mcp/src/minecraft/assets/jnosh_advzelda/textures/entity/chu.png

at least, that's the way that I've seen them all set up since 1.6.1 arrived

 

you might wanna invest some time into looking up how to update from 1.5.2 to 1.6.x if you've still got things set up the old way

Link to comment
Share on other sites

no, if you're working in Eclipse, they're placed in forge/mcp/src/minecraft/assets

mine is

forge/mcp/src/minecraft/assets/jnosh_advzelda/textures/entity/chu.png

at least, that's the way that I've seen them all set up since 1.6.1 arrived

 

you might wanna invest some time into looking up how to update from 1.5.2 to 1.6.x if you've still got things set up the old way

 

Okay thanks. Also, following another mod I explored, it was done like so kmccmk9/witchCraft/assets/minecraft/textures/entities/file

Link to comment
Share on other sites

no, if you're working in Eclipse, they're placed in forge/mcp/src/minecraft/assets

mine is

forge/mcp/src/minecraft/assets/jnosh_advzelda/textures/entity/chu.png

at least, that's the way that I've seen them all set up since 1.6.1 arrived

 

you might wanna invest some time into looking up how to update from 1.5.2 to 1.6.x if you've still got things set up the old way

 

OMG thank you I finally got it! Now do you have any idea what's wrong with my model?

Link to comment
Share on other sites

At a guess I'd say that it's because there isn't really alot in your render file atm, so it might not be connecting the render and entity to the model

 

erm... I'd suggest taking a look at the bat render file

it's probably the closest you're gunna get to a bee in vanilla

 

it could be this

 

    public void func_82443_a(EntityBat par1EntityBat, double par2, double par4, double par6, float par8, float par9)
    {
        int i = ((ModelBat)this.mainModel).getBatSize();

        if (i != this.renderedBatSize)
        {
            this.renderedBatSize = i;
            this.mainModel = new ModelBat();
        }

        super.doRenderLiving(par1EntityBat, par2, par4, par6, par8, par9);
    }

 

so try

 

    public void func_82443_a(EntityBee par1EntityBat, double par2, double par4, double par6, float par8, float par9)
    {
        int i = ((ModelBee)this.mainModel);

        this.mainModel = new ModelBee();

        super.doRenderLiving(par1EntityBat, par2, par4, par6, par8, par9);
    }

 

however, that is just a guess

exploring the render files would be a better option

and there are some 1.6.2 entity tutorials out there that may be a better help than me

Link to comment
Share on other sites

the correct texture calling would be for example ("foldername:textures/mob/bee.png")

 

what this means is that bee.png is located in    ("assets/foldername/textures/mob/bee.png")\

 

for a normal icon texture the calling would be different for example a normal icon texture would be ("foldername:icon")

which means the icon would be in ("assets/foldername/textures/[blocks][items]/icon.png")

 

I hope this helps

if (You.likescoding == false){
      You.goaway;
}

Link to comment
Share on other sites

At a guess I'd say that it's because there isn't really alot in your render file atm, so it might not be connecting the render and entity to the model

 

erm... I'd suggest taking a look at the bat render file

it's probably the closest you're gunna get to a bee in vanilla

 

it could be this

 

    public void func_82443_a(EntityBat par1EntityBat, double par2, double par4, double par6, float par8, float par9)
    {
        int i = ((ModelBat)this.mainModel).getBatSize();

        if (i != this.renderedBatSize)
        {
            this.renderedBatSize = i;
            this.mainModel = new ModelBat();
        }

        super.doRenderLiving(par1EntityBat, par2, par4, par6, par8, par9);
    }

 

so try

 

    public void func_82443_a(EntityBee par1EntityBat, double par2, double par4, double par6, float par8, float par9)
    {
        int i = ((ModelBee)this.mainModel);

        this.mainModel = new ModelBee();

        super.doRenderLiving(par1EntityBat, par2, par4, par6, par8, par9);
    }

 

however, that is just a guess

exploring the render files would be a better option

and there are some 1.6.2 entity tutorials out there that may be a better help than me

 

the correct texture calling would be for example ("foldername:textures/mob/bee.png")

 

what this means is that bee.png is located in    ("assets/foldername/textures/mob/bee.png")\

 

for a normal icon texture the calling would be different for example a normal icon texture would be ("foldername:icon")

which means the icon would be in ("assets/foldername/textures/[blocks][items]/icon.png")

 

I hope this helps

 

Ok well from what I gathered, what's messed up is the beehead. Nothing else. But if you look at my model class you 'll see I had to comment out a setPosition line. I think that is the problem. But setPosition is valid so I had to comment it. Otherwise everything is right, the head is just inside the body.

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

    • So i know for a fact this has been asked before but Render stuff troubles me a little and i didnt find any answer for recent version. I have a custom nausea effect. Currently i add both my nausea effect and the vanilla one for the effect. But the problem is that when I open the inventory, both are listed, while I'd only want mine to show up (both in the inv and on the GUI)   I've arrived to the GameRender (on joined/net/minecraft/client) and also found shaders on client-extra/assets/minecraft/shaders/post and client-extra/assets/minecraft/shaders/program but I'm lost. I understand that its like a regular screen, where I'd render stuff "over" the game depending on data on the server, but If someone could point to the right client and server classes that i can read to see how i can manage this or any tip would be apreciated
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
  • Topics

×
×
  • Create New...

Important Information

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