Jump to content

Rendering a 3D item as a throwable item


Thornack

Recommended Posts

Hi,

 

I have been working on my mod and have figured out how to render a 3D item when held as well as when dropped. I am having trouble getting it to render on right click after it is thrown. Id like the public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, method to throw my 3D item (Ball) and for that item to land some distance away.

 

 

 

public class Ball extends CustomItem {

public static int itemID;

public Ball(int par1) {
	super(par1);
	itemID = par1;
	setUnlocalizedName("Ball");
	setCreativeTab(CreativeTabs.tabMisc);
	setFull3D();
}

public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World,
		EntityPlayer par3EntityPlayer) {
	if (!par3EntityPlayer.capabilities.isCreativeMode) {
		--par1ItemStack.stackSize;
	}
	par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F,
			0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));


	if (!par2World.isRemote) {
		par2World.spawnEntityInWorld(new EntityBall(par2World));


	}
	return par1ItemStack;
}

}

 

My Entity class is as follows:

 

 

public class EntityBall extends EntityThrowable 
{
    public EntityBall(World par1World)
    {
        super(par1World);
        //this.texture = "/mods/soccer/textures/items/Ball3D.png";
        this.setSize(0.9F, 0.9F); //hit-box size? 
    }

    public EntityBall(World par1World, EntityLiving par2EntityLiving)
    {
        super(par1World, par2EntityLiving);
    }

    public EntityBall(World par1World, double par2, double par4, double par6)
    {
        super(par1World, par2, par4, par6);
    }

    /**
     * Called when this EntityThrowable hits a block or entity.
     */
    protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
    {
        for (int i = 0; i < 8; ++i)
        {
            this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
        }

        if (!this.worldObj.isRemote)
        {
            this.setDead();
        }
    }
}

 

It renders fine when I drop it and when the item is held in my hand but I cannot get it to render after it is thrown. Nothing shows up. My render file is as follows:

 

 

public class ItemRenderBall implements IItemRenderer {

protected ItemModelBall modelBall;

public ItemRenderBall() {
	modelBall = new ItemModelBall();
}

@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
	switch (type) {
	case EQUIPPED:
	case EQUIPPED_FIRST_PERSON:
	case ENTITY:
		return true;
	default:
		return false;
	}
}

@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,
		ItemRendererHelper helper) {
	return false;
}
//Renders the Ball in your hand
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
	switch (type) {
	case EQUIPPED:
	case EQUIPPED_FIRST_PERSON:
		GL11.glPushMatrix();
		Minecraft.getMinecraft().renderEngine
				.bindTexture("/mods/soccer/textures/items/Ball3D.png");
		// rotates the item
		GL11.glRotatef(90, 0, 0, 1);
		GL11.glRotatef(90, 0, 1, 0);
		GL11.glRotatef(230, 1, 0, 0);
		GL11.glTranslatef(0, 0.2f, -0.6f);
		// renders the item
		modelBall.render((Entity) data[1], 0.0f, 0.0f, 0.0f, 0.0f,
				0.0f, 0.0225f);
		GL11.glPopMatrix();

	default:
		break;
		//Renders the Ball on ground after its dropped
	}
	switch (type) {
	case ENTITY:

		GL11.glPushMatrix();
		Minecraft.getMinecraft().renderEngine
				.bindTexture("/mods/soccer/textures/items/Ball3D.png");
		// rotates the item and translates the item
		GL11.glRotatef(90, 0, 0, 1);
		GL11.glRotatef(90, 0, 1, 0);
		GL11.glRotatef(230, 1, 0, 0);
		GL11.glTranslatef(0, 0f, 0f);
		// renders the item
		modelBall.render((Entity) data[1], 0.0f, 0.0f, 0.0f, 0.0f,
				0.0f, 0.0225f);
		GL11.glPopMatrix();
	default:
		break;
	}

}
}

 

Link to comment
Share on other sites

  • Replies 51
  • Created
  • Last Reply

Top Posters In This Topic

Ok so im trying to Render the Ball after it is thrown with the following class and it isnt working. Would you know what the problem is.

 

 

 @SideOnly(Side.CLIENT)
public class RenderBall extends Render
{
    private Item field_94151_a;
    private int field_94150_f;
    private ItemModelBall modelBall;

    public RenderBall()
    {
        modelBall = new ItemModelBall();
    }
    
    public RenderBall(Item par1, int par2)
    {
        this.field_94151_a = par1;
        this.field_94150_f = par2;
        
        modelBall = new ItemModelBall();
    }

    public RenderBall(Item par1)
    {
        this(par1, 0);
    }

    /**
     * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
     * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
     * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
     * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
     */
    public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
    {
    	GL11.glPushMatrix();
	Minecraft.getMinecraft().renderEngine.bindTexture("/mods/soccer/textures/items/Ball3D.png");
	GL11.glRotatef(90, 0, 0, 1);
	GL11.glRotatef(90, 0, 1, 0);
	GL11.glRotatef(230, 1, 0, 0);
	GL11.glTranslatef(0, 0.2f, -0.6f);
	modelBall.render(par1Entity, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0225f);
	System.out.println("HERE");
	GL11.glPopMatrix();
    	
    	Icon icon = this.field_94151_a.getIconFromDamage(this.field_94150_f);

        if (icon != null)
        {
            GL11.glPushMatrix();
            GL11.glTranslatef((float)par2, (float)par4, (float)par6);
            GL11.glEnable(GL12.GL_RESCALE_NORMAL);
            GL11.glScalef(0.5F, 0.5F, 0.5F);
            this.loadTexture("/mods/soccer/textures/items/Ball3D.png");
            Tessellator tessellator = Tessellator.instance;

            if (icon == ItemPotion.func_94589_d("potion_splash"))
            {
                int i = PotionHelper.func_77915_a(((EntityPotion)par1Entity).getPotionDamage(), false);
                float f2 = (float)(i >> 16 & 255) / 255.0F;
                float f3 = (float)(i >> 8 & 255) / 255.0F;
                float f4 = (float)(i & 255) / 255.0F;
                GL11.glColor3f(f2, f3, f4);
                GL11.glPushMatrix();
                this.func_77026_a(tessellator, ItemPotion.func_94589_d("potion_contents"));
                GL11.glPopMatrix();
                GL11.glColor3f(1.0F, 1.0F, 1.0F);
            }

            this.func_77026_a(tessellator, icon);
            GL11.glDisable(GL12.GL_RESCALE_NORMAL);
            GL11.glPopMatrix();
        }
    }

    private void func_77026_a(Tessellator par1Tessellator, Icon par2Icon)
    {
        float f = par2Icon.getMinU();
        float f1 = par2Icon.getMaxU();
        float f2 = par2Icon.getMinV();
        float f3 = par2Icon.getMaxV();
        float f4 = 1.0F;
        float f5 = 0.5F;
        float f6 = 0.25F;
        GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
        par1Tessellator.startDrawingQuads();
        par1Tessellator.setNormal(0.0F, 1.0F, 0.0F);
        par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, (double)f, (double)f3);
        par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, (double)f1, (double)f3);
        par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, (double)f1, (double)f2);
        par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, (double)f, (double)f2);
        par1Tessellator.draw();
    }
}

 

I am not sure what I am doing wrong. My java skills arent the greatest ive been working on this for weeks. Im not sure how to call a render function to get the ball to render using

 protected void onImpact(MovingObjectPosition par1MovingObjectPosition)

Link to comment
Share on other sites

Client Proxy

 

 

 
public class ClientProxy extends CommonProxy{
public void registerRenderInformation(){
RenderingRegistry.registerEntityRenderingHandler(EntityBall.class, new RenderBall());
}

 

Common Proxy

 

 


public class CommonProxy implements IGuiHandler{

//do not remove. This is overridden in ClientProxy to add rendering data for the models (client side only).
public void registerRenderInformation(){}

public void init(){
	registerEntities();
	registerRenderInformation();
}
public void registerEntities(){
EntityRegistry.registerGlobalEntityID(EntityBall.class, "Ball", EntityRegistry.findGlobalUniqueEntityId());
}

public void registerEntity(Class<? extends Entity> entityClass, String entityName, int color1, int color2){
	//add the entity to the entity registry and add the translation
	EntityRegistry.registerGlobalEntityID(entityClass, entityName, EntityRegistry.findGlobalUniqueEntityId(), color1, color2);
	LanguageRegistry.instance().addStringLocalization("entity." + entityName + ".name", entityName);
}

public Object getServerGuiElement(int ID, EntityPlayer player, World world,
		int x, int y, int z) {
	// TODO Auto-generated method stub
	return null;
}


public Object getClientGuiElement(int ID, EntityPlayer player, World world,
		int x, int y, int z) {
	// TODO Auto-generated method stub
	return null;
}


}

 

soccer.java

 

 

 

@Mod(modid="Soccer", name="Soccer Mod", version="0.0.1")
@NetworkMod(clientSideRequired=true, serverSideRequired=false)
public class Soccer {

	// The instance of your mod that Forge uses.
        @Instance("Soccer")
        public static Soccer instance;
        
        @SidedProxy(clientSide="soccer.ClientProxy", serverSide="soccer.CommonProxy")
        public static CommonProxy proxy;
        
        @PreInit
        public void preInit(FMLPreInitializationEvent event) {
                // Stub Method
        }
        
        @Init
        public void load(FMLInitializationEvent event) {
CustomItem ball = new Ball(5000);
        	LanguageRegistry.addName(ball, "Ball");
        	GameRegistry.registerItem(ball, "Soccer"+ball.getUnlocalizedName2());
        	//ItemStack diamondsStack = new ItemStack(Item.diamond, 64);
        	MinecraftForgeClient.registerItemRenderer(5000+256, (IItemRenderer)new ItemRenderBall());
        	registerTileEntity();

  }
        
        @PostInit
        public void postInit(FMLPostInitializationEvent event) {
                // Stub Method
        }
}


}

That is all of the code that deals with the Ball in my mod. Am I missing something

Link to comment
Share on other sites

Hi

 

What are the symptoms exactly?

 

Is it invisible, or is it not there at all? eg if you throw it, can you walk over to where it should be and then pick it up?

 

If it invisible, have you tried putting a breakpoint or System.out.println in your render method to see if it is called?

 

-TGG

Link to comment
Share on other sites

For some reason the renderer I try to use after the ball is thrown isnt being called, I just checked. The ball is invisible when you right click nothing shows up and you cannot go pick it up, but when I change 

 par2World.spawnEntityInWorld(new EntityBall(par2World, par3EntityPlayer)); 

to

 par2World.spawnEntityInWorld(new EntitySnowball(par2World, par3EntityPlayer)); 

in the Ball class the snowball is thrown and that works perfectly. I dont think the ball is being thrown when the

 par2World.spawnEntityInWorld(new EntityBall(par2World, par3EntityPlayer)); 

line is in the class file and Im not sure what the problem is. - All files minus the imports have been posted above in the previous posts.

Link to comment
Share on other sites

add this to your Main class init function:

proxy.registerEntities()

And then add this to your proxy regiserEntities:

EntityRegistry.registerModEntity(EntityBall.class, "Ball", EntityRegistry.findGlobalUniqueEntityId(),Soccer.instance , 128, 1, true);

 

Link to comment
Share on other sites

I added your suggestion and upon right click Minecraft crashes and generates the following error report.

 

 

 

 

-- Head --

Stacktrace:

at soccer.render.RenderBall.doRender(RenderBall.java:64)

 

-- Entity being rendered --

Details:

Entity Type: Ball (soccer.entity.EntityBall)

Entity ID: 483

Entity Name: entity.Ball.name

Entity's Exact location: -105.44, 70.50, 270.44

Entity's Block location: World: (-106,70,270), Chunk: (at 6,4,14 in -7,16; contains blocks -112,0,256 to -97,255,271), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)

Entity's Momentum: 1.23, -0.89, -0.25

 

-- Renderer details --

Details:

Assigned renderer: soccer.render.RenderBall@a70a9c

Location: 0.00,-0.12,0.13 - World: (0,-1,0), Chunk: (at 0,-1,0 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Rotation: 101.324394

Delta: 0.42957675

Stacktrace:

at net.minecraft.client.renderer.entity.RenderManager.renderEntityWithPosYaw(RenderManager.java:310)

at net.minecraft.client.renderer.entity.RenderManager.renderEntity(RenderManager.java:279)

at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:508)

at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1150)

 

-- Affected level --

Details:

Level name: MpServer

All players: 1 total; [EntityClientPlayerMP['Thornack'/300, l='MpServer', x=-105.44, y=70.62, z=270.30]]

Chunk stats: MultiplayerChunkCache: 160

Level seed: 0

Level generator: ID 01 - flat, ver 0. Features enabled: false

Level generator options:

Level spawn location: World: (-42,4,163), Chunk: (at 6,0,3 in -3,10; contains blocks -48,0,160 to -33,255,175), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)

Level time: 24064 game time, 10587 day time

Level dimension: 0

Level storage version: 0x00000 - Unknown?

Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)

Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false

Forced entities: 156 total; [EntityCreeper['Creeper'/10, l='MpServer', x=-177.53, y=16.00, z=206.22], EntitySpider['Spider'/12, l='MpServer', x=-185.81, y=23.00, z=192.56], EntitySkeleton['Skeleton'/13, l='MpServer', x=-182.24, y=15.00, z=208.50], EntitySkeleton['Skeleton'/14, l='MpServer', x=-177.00, y=17.00, z=201.50], EntitySkeleton['Skeleton'/19, l='MpServer', x=-183.18, y=28.00, z=249.94], EntityZombie['Zombie'/21, l='MpServer', x=-183.66, y=26.00, z=253.63], EntitySkeleton['Skeleton'/20, l='MpServer', x=-182.59, y=27.00, z=251.03], EntityCow['Cow'/25, l='MpServer', x=-164.09, y=63.00, z=239.13], EntitySkeleton['Skeleton'/24, l='MpServer', x=-175.50, y=16.00, z=205.50], EntityBat['Bat'/27, l='MpServer', x=-154.83, y=32.31, z=270.46], EntityCow['Cow'/26, l='MpServer', x=-161.78, y=63.00, z=250.81], EntitySheep['Sheep'/29, l='MpServer', x=-165.81, y=64.00, z=267.69], EntitySheep['Sheep'/28, l='MpServer', x=-171.97, y=63.00, z=257.09], EntitySheep['Sheep'/31, l='MpServer', x=-164.50, y=67.00, z=318.66], EntitySheep['Sheep'/30, l='MpServer', x=-170.56, y=63.00, z=284.81], EntityCow['Cow'/34, l='MpServer', x=-144.06, y=65.00, z=265.94], EntityCow['Cow'/35, l='MpServer', x=-150.72, y=64.00, z=269.44], EntityBat['Bat'/32, l='MpServer', x=-156.73, y=27.41, z=273.61], EntityBat['Bat'/33, l='MpServer', x=-145.63, y=34.56, z=267.53], EntityBat['Bat'/38, l='MpServer', x=-148.50, y=34.03, z=273.13], EntitySheep['Sheep'/39, l='MpServer', x=-156.53, y=62.00, z=276.09], EntityCow['Cow'/36, l='MpServer', x=-157.97, y=64.00, z=256.91], EntitySkeleton['Skeleton'/37, l='MpServer', x=-159.47, y=35.00, z=282.94], EntitySheep['Sheep'/42, l='MpServer', x=-152.50, y=64.00, z=295.47], EntityZombie['Zombie'/43, l='MpServer', x=-153.06, y=35.00, z=323.06], EntityCow['Cow'/40, l='MpServer', x=-151.13, y=64.00, z=292.03], EntityCow['Cow'/41, l='MpServer', x=-156.63, y=64.00, z=296.75], EntitySheep['Sheep'/46, l='MpServer', x=-154.25, y=63.00, z=348.63], EntitySheep['Sheep'/47, l='MpServer', x=-138.41, y=64.00, z=240.22], EntityZombie['Zombie'/44, l='MpServer', x=-149.41, y=35.00, z=324.06], EntitySkeleton['Skeleton'/45, l='MpServer', x=-152.94, y=35.00, z=320.78], EntityMinecartChest['entity.MinecartChest.name'/51, l='MpServer', x=-135.50, y=34.85, z=273.50], EntitySheep['Sheep'/50, l='MpServer', x=-133.88, y=67.00, z=266.97], EntityZombie['Zombie'/49, l='MpServer', x=-139.50, y=34.00, z=271.50], EntitySheep['Sheep'/48, l='MpServer', x=-136.13, y=64.00, z=245.91], EntitySheep['Sheep'/55, l='MpServer', x=-142.56, y=64.00, z=294.53], EntitySheep['Sheep'/54, l='MpServer', x=-134.38, y=66.00, z=302.75], EntitySheep['Sheep'/53, l='MpServer', x=-135.88, y=66.00, z=297.06], EntitySheep['Sheep'/52, l='MpServer', x=-136.25, y=65.00, z=279.22], EntityZombie['Zombie'/63, l='MpServer', x=-126.56, y=51.00, z=216.16], EntitySheep['Sheep'/62, l='MpServer', x=-122.94, y=63.00, z=213.94], EntitySheep['Sheep'/61, l='MpServer', x=-117.95, y=63.00, z=215.39], EntityItem['item.item.Ball'/68, l='MpServer', x=-113.59, y=68.13, z=271.13], EntitySheep['Sheep'/69, l='MpServer', x=-122.03, y=68.00, z=267.94], EntityCow['Cow'/70, l='MpServer', x=-121.50, y=68.00, z=262.22], EntityItem['item.item.Ball'/71, l='MpServer', x=-113.41, y=68.13, z=276.47], EntityZombie['Zombie'/64, l='MpServer', x=-127.50, y=48.00, z=214.31], EntitySheep['Sheep'/65, l='MpServer', x=-120.38, y=63.00, z=243.47], EntityPig['Pig'/66, l='MpServer', x=-122.97, y=67.00, z=254.94], EntityZombie['Zombie'/67, l='MpServer', x=-119.44, y=34.00, z=268.91], EntityMinecartChest['entity.MinecartChest.name'/77, l='MpServer', x=-102.50, y=35.85, z=194.50], EntityMinecartChest['entity.MinecartChest.name'/78, l='MpServer', x=-107.50, y=35.85, z=194.50], EntitySheep['Sheep'/79, l='MpServer', x=-109.22, y=63.00, z=205.66], EntitySheep['Sheep'/72, l='MpServer', x=-121.91, y=66.00, z=304.16], EntitySkeleton['Skeleton'/85, l='MpServer', x=-102.00, y=35.00, z=213.06], EntitySkeleton['Skeleton'/84, l='MpServer', x=-107.06, y=35.00, z=216.47], EntitySheep['Sheep'/87, l='MpServer', x=-103.84, y=64.00, z=216.81], EntityClientPlayerMP['Thornack'/300, l='MpServer', x=-105.44, y=70.62, z=270.30], EntitySheep['Sheep'/86, l='MpServer', x=-103.16, y=64.00, z=209.34], EntitySheep['Sheep'/83, l='MpServer', x=-96.97, y=64.00, z=197.09], EntityMinecartChest['entity.MinecartChest.name'/93, l='MpServer', x=-110.50, y=37.85, z=261.50], EntityCreeper['Creeper'/92, l='MpServer', x=-101.97, y=49.00, z=251.59], EntityItem['item.item.Ball'/95, l='MpServer', x=-102.41, y=69.13, z=270.44], EntityItem['item.item.Ball'/94, l='MpServer', x=-105.66, y=69.13, z=268.75], EntitySheep['Sheep'/89, l='MpServer', x=-109.97, y=64.00, z=236.97], EntityCreeper['Creeper'/88, l='MpServer', x=-110.75, y=44.00, z=236.56], EntitySpider['Spider'/91, l='MpServer', x=-103.78, y=48.00, z=250.38], EntityBat['Bat'/90, l='MpServer', x=-107.88, y=38.10, z=247.25], EntitySheep['Sheep'/102, l='MpServer', x=-102.63, y=67.00, z=310.22], EntitySheep['Sheep'/103, l='MpServer', x=-99.06, y=71.00, z=334.09], EntityItem['item.item.Ball'/100, l='MpServer', x=-111.13, y=68.13, z=278.44], EntityItem['item.item.Ball'/101, l='MpServer', x=-111.78, y=68.13, z=276.34], EntityItem['item.item.Ball'/98, l='MpServer', x=-99.53, y=69.13, z=273.78], EntityItem['item.item.Ball'/99, l='MpServer', x=-111.25, y=68.13, z=279.47], EntityCreeper['Creeper'/96, l='MpServer', x=-111.50, y=25.00, z=274.50], EntityBat['Bat'/97, l='MpServer', x=-107.63, y=49.10, z=277.75], EntitySheep['Sheep'/110, l='MpServer', x=-87.53, y=66.00, z=198.91], EntityCreeper['Creeper'/111, l='MpServer', x=-93.56, y=19.00, z=229.28], EntitySkeleton['Skeleton'/108, l='MpServer', x=-92.13, y=46.00, z=201.38], EntityCreeper['Creeper'/109, l='MpServer', x=-92.75, y=45.00, z=200.53], EntityCreeper['Creeper'/119, l='MpServer', x=-91.09, y=25.00, z=250.75], EntitySheep['Sheep'/118, l='MpServer', x=-86.06, y=68.00, z=230.91], EntityZombie['Zombie'/117, l='MpServer', x=-83.59, y=63.00, z=238.00], EntitySkeleton['Skeleton'/116, l='MpServer', x=-82.96, y=37.00, z=228.62], EntitySpider['Spider'/115, l='MpServer', x=-81.06, y=37.00, z=230.94], EntityCreeper['Creeper'/114, l='MpServer', x=-81.47, y=46.00, z=231.34], EntityZombie['Zombie'/113, l='MpServer', x=-83.50, y=47.00, z=230.50], EntitySkeleton['Skeleton'/112, l='MpServer', x=-86.47, y=23.00, z=231.53], EntityZombie['Zombie'/127, l='MpServer', x=-92.50, y=23.00, z=262.50], EntitySkeleton['Skeleton'/126, l='MpServer', x=-92.50, y=23.00, z=258.50], EntitySkeleton['Skeleton'/125, l='MpServer', x=-94.78, y=49.00, z=247.59], EntityCreeper['Creeper'/124, l='MpServer', x=-88.50, y=50.00, z=249.50], EntityCreeper['Creeper'/123, l='MpServer', x=-84.38, y=63.00, z=243.64], EntitySpider['Spider'/122, l='MpServer', x=-83.00, y=63.00, z=241.19], EntityBat['Bat'/121, l='MpServer', x=-82.06, y=25.97, z=251.63], EntityZombie['Zombie'/120, l='MpServer', x=-87.50, y=24.00, z=255.50], EntityZombie['Zombie'/137, l='MpServer', x=-72.13, y=26.00, z=238.56], EntitySkeleton['Skeleton'/136, l='MpServer', x=-64.50, y=36.00, z=224.00], EntityBat['Bat'/139, l='MpServer', x=-72.53, y=38.21, z=230.56], EntityEnderman['Enderman'/138, l='MpServer', x=-66.82, y=37.00, z=228.09], EntitySheep['Sheep'/141, l='MpServer', x=-67.66, y=71.00, z=229.25], EntityBat['Bat'/140, l='MpServer', x=-73.51, y=46.16, z=221.34], EntityCreeper['Creeper'/143, l='MpServer', x=-66.50, y=30.00, z=241.50], EntityBat['Bat'/142, l='MpServer', x=-76.88, y=30.10, z=253.41], EntityItem['item.item.Ball'/129, l='MpServer', x=-94.66, y=69.13, z=267.84], EntityBat['Bat'/128, l='MpServer', x=-94.25, y=36.10, z=258.75], EntityPig['Pig'/131, l='MpServer', x=-85.69, y=70.00, z=307.88], EntitySheep['Sheep'/133, l='MpServer', x=-95.91, y=70.00, z=329.97], EntitySheep['Sheep'/132, l='MpServer', x=-87.72, y=70.00, z=321.16], EntitySkeleton['Skeleton'/135, l='MpServer', x=-65.50, y=38.00, z=220.50], EntitySkeleton['Skeleton'/152, l='MpServer', x=-67.50, y=37.00, z=252.50], EntityCreeper['Creeper'/153, l='MpServer', x=-73.22, y=41.00, z=250.41], EntityCreeper['Creeper'/154, l='MpServer', x=-72.38, y=41.00, z=250.44], EntitySkeleton['Skeleton'/155, l='MpServer', x=-70.44, y=41.00, z=253.50], EntitySheep['Sheep'/156, l='MpServer', x=-69.66, y=61.00, z=254.47], EntityBat['Bat'/157, l='MpServer', x=-70.25, y=24.10, z=259.41], EntitySkeleton['Skeleton'/158, l='MpServer', x=-66.69, y=29.00, z=259.28], EntityBat['Bat'/159, l='MpServer', x=-77.85, y=41.20, z=258.53], EntityCreeper['Creeper'/144, l='MpServer', x=-75.88, y=29.00, z=248.88], EntityCreeper['Creeper'/145, l='MpServer', x=-75.22, y=29.00, z=252.29], EntityCreeper['Creeper'/146, l='MpServer', x=-76.03, y=29.00, z=249.69], EntitySpider['Spider'/147, l='MpServer', x=-77.00, y=29.00, z=252.66], EntitySkeleton['Skeleton'/148, l='MpServer', x=-64.50, y=31.00, z=251.50], EntitySpider['Spider'/149, l='MpServer', x=-73.41, y=24.00, z=252.16], EntityBat['Bat'/150, l='MpServer', x=-71.51, y=26.39, z=244.73], EntityBat['Bat'/151, l='MpServer', x=-77.01, y=24.32, z=251.69], EntityBat['Bat'/171, l='MpServer', x=-58.93, y=32.09, z=229.52], EntitySkeleton['Skeleton'/170, l='MpServer', x=-50.50, y=35.00, z=230.50], EntityZombie['Zombie'/169, l='MpServer', x=-62.94, y=28.00, z=232.50], EntitySpider['Spider'/168, l='MpServer', x=-59.28, y=37.00, z=219.50], EntityCreeper['Creeper'/175, l='MpServer', x=-51.22, y=55.00, z=292.88], EntitySkeleton['Skeleton'/174, l='MpServer', x=-55.50, y=51.00, z=264.50], EntitySkeleton['Skeleton'/173, l='MpServer', x=-62.44, y=12.00, z=265.16], EntitySheep['Sheep'/172, l='MpServer', x=-54.50, y=67.00, z=255.50], EntitySheep['Sheep'/163, l='MpServer', x=-77.06, y=69.00, z=280.97], EntityZombie['Zombie'/162, l='MpServer', x=-64.41, y=53.00, z=267.31], EntityBat['Bat'/161, l='MpServer', x=-69.48, y=53.05, z=273.55], EntityZombie['Zombie'/160, l='MpServer', x=-79.38, y=44.00, z=265.69], EntitySheep['Sheep'/167, l='MpServer', x=-79.47, y=71.00, z=336.70], EntityZombie['Zombie'/166, l='MpServer', x=-67.72, y=57.00, z=305.94], EntitySheep['Sheep'/165, l='MpServer', x=-77.09, y=71.00, z=300.84], EntityPig['Pig'/164, l='MpServer', x=-69.41, y=71.00, z=293.78], EntitySheep['Sheep'/186, l='MpServer', x=-33.19, y=74.00, z=316.13], EntityBat['Bat'/184, l='MpServer', x=-35.53, y=51.10, z=262.25], EntityBat['Bat'/185, l='MpServer', x=-43.52, y=41.89, z=277.08], EntitySheep['Sheep'/190, l='MpServer', x=-29.50, y=69.00, z=257.50], EntityCreeper['Creeper'/191, l='MpServer', x=-26.50, y=51.00, z=309.50], EntitySkeleton['Skeleton'/188, l='MpServer', x=-29.75, y=31.00, z=239.59], EntitySkeleton['Skeleton'/178, l='MpServer', x=-44.91, y=38.00, z=207.44], EntitySheep['Sheep'/179, l='MpServer', x=-47.31, y=70.00, z=192.84], EntitySkeleton['Skeleton'/182, l='MpServer', x=-33.41, y=32.00, z=245.78], EntitySheep['Sheep'/183, l='MpServer', x=-43.94, y=70.00, z=255.09], EntitySheep['Sheep'/180, l='MpServer', x=-33.69, y=67.00, z=194.22], EntitySheep['Sheep'/181, l='MpServer', x=-45.44, y=70.00, z=197.22], EntitySkeleton['Skeleton'/193, l='MpServer', x=-26.50, y=51.00, z=311.50], EntityBall['entity.Ball.name'/483, l='MpServer', x=-105.44, y=70.50, z=270.44]]

Retry entities: 0 total; []

Stacktrace:

at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:441)

at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2414)

at net.minecraft.client.Minecraft.run(Minecraft.java:776)

at java.lang.Thread.run(Unknown Source)

 

-- System Details --

Details:

Minecraft Version: 1.5.2

Operating System: Windows 7 (x86) version 6.1

Java Version: 1.7.0_07, Oracle Corporation

Java VM Version: Java HotSpot Client VM (mixed mode, sharing), Oracle Corporation

Memory: 93981640 bytes (89 MB) / 259522560 bytes (247 MB) up to 259522560 bytes (247 MB)

JVM Flags: 0 total;

AABB Pool Size: 19526 (1093456 bytes; 1 MB) allocated, 2119 (118664 bytes; 0 MB) used

Suspicious classes: FML and Forge are installed

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v7.51 FML v5.2.23.737 Minecraft Forge 7.8.1.737 4 mods loaded, 4 mods active

mcp{7.51} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

FML{5.2.23.737} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Forge{7.8.1.737} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Soccer{0.0.1} [soccer Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

LWJGL: 2.4.2

OpenGL: Intel® HD Graphics 4000 GL version 4.0.0 - Build 9.17.10.2843, Intel

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Texture Pack: Default

Profiler Position: N/A (disabled)

Vec3 Pool Size: 1758 (98448 bytes; 0 MB) allocated, 323 (18088 bytes; 0 MB) used

 

java.lang.NullPointerException

at soccer.render.RenderBall.doRender(RenderBall.java:64)

at net.minecraft.client.renderer.entity.RenderManager.renderEntityWithPosYaw(RenderManager.java:310)

at net.minecraft.client.renderer.entity.RenderManager.renderEntity(RenderManager.java:279)

at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:508)

at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1150)

at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:991)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:871)

at net.minecraft.client.Minecraft.run(Minecraft.java:760)

at java.lang.Thread.run(Unknown Source)

--- END ERROR REPORT 822e503e ----------

 

 

Link to comment
Share on other sites

add this to your Main class init function:

proxy.registerEntities()

And then add this to your proxy regiserEntities:

EntityRegistry.registerModEntity(EntityBall.class, "Ball", EntityRegistry.findGlobalUniqueEntityId(),Soccer.instance , 128, 1, true);

 

...You really shouldn't do that in the proxy class.  That needs to run both client and server side.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

I meant in the common proxy.

 

Also, thornack, it looks like the rendering class has an error in it. Try defining your field field_94151_a in renderball(), or change RenderingRegistry.registerEntityRenderingHandler(EntityBall.class, new RenderBall() in your client proxy to RenderingRegistry.registerEntityRenderingHandler(EntityBall.class, new RenderBall([insert item here])

Link to comment
Share on other sites

I meant in the common proxy.

 

Or you could do it during Init / Post Init like a normal person.  There's basically no reason to shove things into the common proxy.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

I meant in the common proxy.

 

Also, thornack, it looks like the rendering class has an error in it. Try defining your field field_94151_a in renderball(), or change RenderingRegistry.registerEntityRenderingHandler(EntityBall.class, new RenderBall() in your client proxy to RenderingRegistry.registerEntityRenderingHandler(EntityBall.class, new RenderBall([insert item here])

 

Im not really sure how to define the field field_94151_a in renderball. My item class Ball.java is the item but when I insert it into your function it asks to register it as a variable. Im not really sure how to insert the item there. Also, Is there something wrong with having the register in the common proxy? That is where I register my mob entities and now the items also.

 

Link to comment
Share on other sites

ok, your item ball is not held as a public value. In your main class

        @Init
        public void load(FMLInitializationEvent event) {
CustomItem ball = new Ball(5000);
        	LanguageRegistry.addName(ball, "Ball");
        	GameRegistry.registerItem(ball, "Soccer"+ball.getUnlocalizedName2());
        	//ItemStack diamondsStack = new ItemStack(Item.diamond, 64);
        	MinecraftForgeClient.registerItemRenderer(5000+256, (IItemRenderer)new ItemRenderBall());
        	registerTileEntity();

  }

needs to become

public static CustomItem ball;
        @Init
        public void load(FMLInitializationEvent event) {
        ball = new Ball(5000);
        LanguageRegistry.addName(ball, "Ball");
        GameRegistry.registerItem(ball, "Soccer"+ball.getUnlocalizedName2());
        //ItemStack diamondsStack = new ItemStack(Item.diamond, 64);
        MinecraftForgeClient.registerItemRenderer(5000+256, (IItemRenderer)new ItemRenderBall());
        registerTileEntity();

  }

That way, you can use Soccer.ball to reference your item ball.

 

Then, in your client proxy, change RenderingRegistry.registerEntityRenderingHandler(EntityBall.class, new RenderBall()  to RenderingRegistry.registerEntityRenderingHandler(EntityBall.class, new RenderBall(Soccer.ball)

Link to comment
Share on other sites

After I apply your suggested changes Minecraft crashes again upon right click of the Ball and generates this report.

 

 

 

 

-- Head --

Stacktrace:

at soccer.render.RenderBall.doRender(RenderBall.java:64)

 

-- Entity being rendered --

Details:

Entity Type: Ball (soccer.entity.EntityBall)

Entity ID: 472

Entity Name: entity.Ball.name

Entity's Exact location: -105.41, 70.50, 270.44

Entity's Block location: World: (-106,70,270), Chunk: (at 6,4,14 in -7,16; contains blocks -112,0,256 to -97,255,271), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)

Entity's Momentum: 1.04, -1.05, -0.30

 

-- Renderer details --

Details:

Assigned renderer: soccer.render.RenderBall@1afc862

Location: 0.03,-0.12,0.13 - World: (0,-1,0), Chunk: (at 0,-1,0 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Rotation: 106.38287

Delta: 0.4129709

Stacktrace:

at net.minecraft.client.renderer.entity.RenderManager.renderEntityWithPosYaw(RenderManager.java:310)

at net.minecraft.client.renderer.entity.RenderManager.renderEntity(RenderManager.java:279)

at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:508)

at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1150)

 

-- Affected level --

Details:

Level name: MpServer

All players: 1 total; [EntityClientPlayerMP['Thornack'/298, l='MpServer', x=-105.44, y=70.62, z=270.30]]

Chunk stats: MultiplayerChunkCache: 150

Level seed: 0

Level generator: ID 01 - flat, ver 0. Features enabled: false

Level generator options:

Level spawn location: World: (-42,4,163), Chunk: (at 6,0,3 in -3,10; contains blocks -48,0,160 to -33,255,175), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)

Level time: 24777 game time, 11300 day time

Level dimension: 0

Level storage version: 0x00000 - Unknown?

Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)

Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false

Forced entities: 152 total; [EntityCreeper['Creeper'/10, l='MpServer', x=-178.61, y=16.00, z=206.34], EntitySkeleton['Skeleton'/11, l='MpServer', x=-177.47, y=17.00, z=201.66], EntitySkeleton['Skeleton'/12, l='MpServer', x=-176.38, y=16.00, z=201.28], EntitySkeleton['Skeleton'/16, l='MpServer', x=-183.53, y=14.00, z=210.41], EntitySkeleton['Skeleton'/19, l='MpServer', x=-179.56, y=25.00, z=254.09], EntitySkeleton['Skeleton'/18, l='MpServer', x=-183.94, y=27.00, z=250.47], EntityZombie['Zombie'/20, l='MpServer', x=-183.56, y=27.00, z=255.84], EntityCow['Cow'/25, l='MpServer', x=-163.03, y=63.00, z=237.33], EntitySheep['Sheep'/27, l='MpServer', x=-165.81, y=64.00, z=267.69], EntitySheep['Sheep'/26, l='MpServer', x=-170.50, y=63.00, z=256.31], EntitySheep['Sheep'/29, l='MpServer', x=-164.50, y=67.00, z=318.66], EntitySheep['Sheep'/28, l='MpServer', x=-173.50, y=64.00, z=276.34], EntityCow['Cow'/31, l='MpServer', x=-159.50, y=64.00, z=252.75], EntityBat['Bat'/30, l='MpServer', x=-144.51, y=36.49, z=254.25], EntityBat['Bat'/34, l='MpServer', x=-145.11, y=34.62, z=270.44], EntityCow['Cow'/35, l='MpServer', x=-159.75, y=63.00, z=256.78], EntityBat['Bat'/32, l='MpServer', x=-154.20, y=33.00, z=269.60], EntityBat['Bat'/33, l='MpServer', x=-152.50, y=34.03, z=272.34], EntitySkeleton['Skeleton'/38, l='MpServer', x=-159.44, y=35.00, z=282.84], EntitySheep['Sheep'/39, l='MpServer', x=-156.53, y=62.00, z=276.09], EntityCow['Cow'/36, l='MpServer', x=-151.22, y=64.00, z=268.75], EntityCow['Cow'/37, l='MpServer', x=-149.63, y=65.00, z=256.59], EntitySheep['Sheep'/42, l='MpServer', x=-153.19, y=64.00, z=297.91], EntitySheep['Sheep'/43, l='MpServer', x=-144.72, y=64.00, z=297.25], EntityCow['Cow'/40, l='MpServer', x=-147.47, y=64.00, z=293.53], EntityCow['Cow'/41, l='MpServer', x=-156.63, y=64.00, z=296.75], EntitySkeleton['Skeleton'/46, l='MpServer', x=-152.50, y=35.00, z=320.44], EntitySheep['Sheep'/47, l='MpServer', x=-159.57, y=63.00, z=345.37], EntityZombie['Zombie'/44, l='MpServer', x=-152.75, y=35.00, z=322.88], EntityZombie['Zombie'/45, l='MpServer', x=-149.41, y=35.00, z=324.16], EntityZombie['Zombie'/51, l='MpServer', x=-139.50, y=34.00, z=271.50], EntitySheep['Sheep'/50, l='MpServer', x=-136.13, y=64.00, z=245.91], EntitySheep['Sheep'/49, l='MpServer', x=-138.41, y=64.00, z=240.22], EntitySheep['Sheep'/48, l='MpServer', x=-128.09, y=63.00, z=219.97], EntitySheep['Sheep'/55, l='MpServer', x=-135.90, y=66.00, z=297.06], EntitySheep['Sheep'/54, l='MpServer', x=-136.25, y=65.00, z=279.19], EntityMinecartChest['entity.MinecartChest.name'/53, l='MpServer', x=-135.50, y=34.85, z=273.50], EntitySheep['Sheep'/52, l='MpServer', x=-134.09, y=67.00, z=264.94], EntitySheep['Sheep'/56, l='MpServer', x=-135.13, y=65.00, z=293.56], EntityPig['Pig'/68, l='MpServer', x=-121.78, y=67.00, z=251.19], EntityZombie['Zombie'/69, l='MpServer', x=-119.50, y=34.00, z=269.25], EntityItem['item.item.Ball'/70, l='MpServer', x=-113.59, y=68.13, z=271.13], EntitySheep['Sheep'/71, l='MpServer', x=-121.81, y=68.00, z=267.22], EntitySheep['Sheep'/64, l='MpServer', x=-116.59, y=63.00, z=212.75], EntityZombie['Zombie'/65, l='MpServer', x=-124.41, y=50.00, z=217.03], EntityZombie['Zombie'/66, l='MpServer', x=-127.50, y=48.00, z=214.31], EntitySheep['Sheep'/67, l='MpServer', x=-120.38, y=63.00, z=243.47], EntityMinecartChest['entity.MinecartChest.name'/79, l='MpServer', x=-102.50, y=35.85, z=194.50], EntityCow['Cow'/72, l='MpServer', x=-119.03, y=68.00, z=265.88], EntityItem['item.item.Ball'/73, l='MpServer', x=-113.41, y=68.13, z=276.47], EntitySheep['Sheep'/74, l='MpServer', x=-121.91, y=66.00, z=304.16], EntitySkeleton['Skeleton'/85, l='MpServer', x=-107.48, y=35.00, z=214.51], EntitySheep['Sheep'/84, l='MpServer', x=-97.28, y=64.00, z=197.69], EntitySheep['Sheep'/87, l='MpServer', x=-103.16, y=64.00, z=209.34], EntitySkeleton['Skeleton'/86, l='MpServer', x=-102.00, y=35.00, z=213.06], EntitySheep['Sheep'/81, l='MpServer', x=-109.22, y=63.00, z=205.66], EntityMinecartChest['entity.MinecartChest.name'/80, l='MpServer', x=-107.50, y=35.85, z=194.50], EntityClientPlayerMP['Thornack'/298, l='MpServer', x=-105.44, y=70.62, z=270.30], EntityCreeper['Creeper'/93, l='MpServer', x=-102.50, y=48.00, z=250.50], EntityBat['Bat'/92, l='MpServer', x=-107.88, y=38.10, z=247.25], EntitySpider['Spider'/95, l='MpServer', x=-106.94, y=47.00, z=256.72], EntityMinecartChest['entity.MinecartChest.name'/94, l='MpServer', x=-110.50, y=37.85, z=261.50], EntityCreeper['Creeper'/89, l='MpServer', x=-96.44, y=17.00, z=225.88], EntitySheep['Sheep'/88, l='MpServer', x=-103.84, y=64.00, z=216.84], EntitySheep['Sheep'/91, l='MpServer', x=-111.25, y=64.00, z=235.03], EntityCreeper['Creeper'/90, l='MpServer', x=-110.75, y=44.00, z=236.56], EntityItem['item.item.Ball'/102, l='MpServer', x=-111.78, y=68.13, z=276.34], EntitySheep['Sheep'/103, l='MpServer', x=-110.99, y=66.00, z=314.70], EntityItem['item.item.Ball'/100, l='MpServer', x=-111.25, y=68.13, z=279.47], EntityItem['item.item.Ball'/101, l='MpServer', x=-111.13, y=68.13, z=278.44], EntityCreeper['Creeper'/98, l='MpServer', x=-108.35, y=23.00, z=274.22], EntityBat['Bat'/99, l='MpServer', x=-107.63, y=49.10, z=277.75], EntityItem['item.item.Ball'/96, l='MpServer', x=-105.66, y=69.13, z=268.75], EntityItem['item.item.Ball'/97, l='MpServer', x=-102.41, y=69.13, z=270.44], EntitySkeleton['Skeleton'/110, l='MpServer', x=-92.06, y=46.00, z=201.44], EntityCreeper['Creeper'/111, l='MpServer', x=-93.34, y=45.00, z=201.44], EntitySheep['Sheep'/104, l='MpServer', x=-104.44, y=69.00, z=325.22], EntitySheep['Sheep'/105, l='MpServer', x=-96.16, y=71.00, z=336.84], EntityCreeper['Creeper'/119, l='MpServer', x=-91.34, y=26.00, z=250.06], EntitySheep['Sheep'/118, l='MpServer', x=-86.06, y=68.00, z=230.91], EntityZombie['Zombie'/117, l='MpServer', x=-83.69, y=63.00, z=237.63], EntitySpider['Spider'/116, l='MpServer', x=-81.06, y=37.00, z=230.94], EntityCreeper['Creeper'/115, l='MpServer', x=-81.47, y=46.00, z=231.34], EntityZombie['Zombie'/114, l='MpServer', x=-84.50, y=47.00, z=231.47], EntitySkeleton['Skeleton'/113, l='MpServer', x=-83.56, y=24.00, z=230.94], EntitySheep['Sheep'/112, l='MpServer', x=-85.50, y=67.54, z=201.56], EntityBat['Bat'/127, l='MpServer', x=-94.25, y=36.10, z=258.75], EntityZombie['Zombie'/126, l='MpServer', x=-87.50, y=23.00, z=256.78], EntityZombie['Zombie'/125, l='MpServer', x=-93.47, y=22.00, z=261.69], EntitySkeleton['Skeleton'/124, l='MpServer', x=-91.41, y=24.00, z=257.72], EntitySpider['Spider'/123, l='MpServer', x=-84.38, y=63.00, z=241.63], EntitySkeleton['Skeleton'/122, l='MpServer', x=-94.78, y=49.00, z=247.59], EntityCreeper['Creeper'/121, l='MpServer', x=-87.65, y=50.00, z=252.16], EntityCreeper['Creeper'/120, l='MpServer', x=-82.94, y=63.00, z=244.28], EntitySkeleton['Skeleton'/137, l='MpServer', x=-66.44, y=36.00, z=224.25], EntityBat['Bat'/136, l='MpServer', x=-67.75, y=34.10, z=236.34], EntityBat['Bat'/139, l='MpServer', x=-76.88, y=30.10, z=253.41], EntitySheep['Sheep'/138, l='MpServer', x=-67.66, y=71.00, z=229.25], EntityCreeper['Creeper'/141, l='MpServer', x=-75.22, y=29.00, z=252.28], EntityCreeper['Creeper'/140, l='MpServer', x=-76.06, y=29.00, z=248.59], EntitySpider['Spider'/143, l='MpServer', x=-77.00, y=29.00, z=252.66], EntityCreeper['Creeper'/142, l='MpServer', x=-74.97, y=29.00, z=249.53], EntitySheep['Sheep'/129, l='MpServer', x=-86.31, y=70.00, z=315.66], EntityPig['Pig'/128, l='MpServer', x=-85.69, y=70.00, z=307.88], EntitySkeleton['Skeleton'/131, l='MpServer', x=-64.50, y=36.00, z=224.00], EntityCreeper['Creeper'/133, l='MpServer', x=-74.00, y=28.00, z=239.50], EntitySkeleton['Skeleton'/132, l='MpServer', x=-72.93, y=35.00, z=221.30], EntityEnderman['Enderman'/135, l='MpServer', x=-68.25, y=37.00, z=226.97], EntityBat['Bat'/134, l='MpServer', x=-66.25, y=30.10, z=229.50], EntitySheep['Sheep'/152, l='MpServer', x=-69.66, y=61.00, z=254.47], EntityBat['Bat'/153, l='MpServer', x=-70.25, y=24.10, z=259.41], EntitySkeleton['Skeleton'/154, l='MpServer', x=-68.25, y=29.00, z=256.63], EntityBat['Bat'/155, l='MpServer', x=-71.56, y=24.00, z=262.25], EntityZombie['Zombie'/156, l='MpServer', x=-80.45, y=46.76, z=265.07], EntityZombie['Zombie'/157, l='MpServer', x=-64.22, y=53.00, z=267.31], EntityBat['Bat'/158, l='MpServer', x=-67.23, y=53.00, z=268.33], EntitySheep['Sheep'/159, l='MpServer', x=-76.47, y=69.00, z=282.41], EntitySkeleton['Skeleton'/144, l='MpServer', x=-67.47, y=31.00, z=250.22], EntitySpider['Spider'/145, l='MpServer', x=-78.03, y=24.00, z=253.06], EntityZombie['Zombie'/146, l='MpServer', x=-66.50, y=30.00, z=241.03], EntitySkeleton['Skeleton'/147, l='MpServer', x=-67.50, y=37.00, z=252.50], EntityCreeper['Creeper'/148, l='MpServer', x=-73.13, y=41.00, z=250.63], EntityCreeper['Creeper'/149, l='MpServer', x=-72.31, y=41.00, z=250.44], EntitySkeleton['Skeleton'/150, l='MpServer', x=-73.41, y=41.00, z=253.50], EntityBat['Bat'/151, l='MpServer', x=-72.40, y=42.24, z=257.13], EntitySkeleton['Skeleton'/171, l='MpServer', x=-62.44, y=12.00, z=265.16], EntitySheep['Sheep'/170, l='MpServer', x=-54.32, y=68.00, z=255.48], EntityBat['Bat'/169, l='MpServer', x=-56.75, y=32.00, z=228.75], EntitySkeleton['Skeleton'/168, l='MpServer', x=-50.50, y=36.00, z=228.59], EntityCreeper['Creeper'/175, l='MpServer', x=-51.22, y=55.00, z=292.88], EntitySheep['Sheep'/174, l='MpServer', x=-48.97, y=70.00, z=259.94], EntitySkeleton['Skeleton'/173, l='MpServer', x=-55.03, y=51.00, z=264.50], EntityBat['Bat'/172, l='MpServer', x=-63.53, y=25.39, z=266.54], EntitySheep['Sheep'/163, l='MpServer', x=-79.78, y=71.00, z=334.22], EntityZombie['Zombie'/162, l='MpServer', x=-67.50, y=56.00, z=306.69], EntitySheep['Sheep'/161, l='MpServer', x=-73.91, y=71.00, z=299.66], EntityPig['Pig'/160, l='MpServer', x=-70.88, y=71.00, z=294.34], EntityZombie['Zombie'/167, l='MpServer', x=-62.47, y=22.00, z=234.53], EntityBat['Bat'/166, l='MpServer', x=-58.13, y=38.10, z=211.75], EntitySpider['Spider'/165, l='MpServer', x=-62.03, y=38.00, z=216.56], EntitySheep['Sheep'/164, l='MpServer', x=-56.84, y=70.00, z=197.22], EntitySkeleton['Skeleton'/186, l='MpServer', x=-30.53, y=27.12, z=236.25], EntitySheep['Sheep'/187, l='MpServer', x=-29.50, y=69.00, z=257.50], EntitySheep['Sheep'/185, l='MpServer', x=-31.50, y=67.00, z=192.47], EntitySkeleton['Skeleton'/190, l='MpServer', x=-26.50, y=51.00, z=311.50], EntitySkeleton['Skeleton'/178, l='MpServer', x=-44.91, y=38.00, z=207.44], EntitySheep['Sheep'/179, l='MpServer', x=-45.44, y=69.00, z=197.91], EntityBat['Bat'/182, l='MpServer', x=-38.90, y=38.31, z=278.49], EntitySheep['Sheep'/183, l='MpServer', x=-34.46, y=73.81, z=313.24], EntitySkeleton['Skeleton'/180, l='MpServer', x=-33.66, y=33.00, z=244.50], EntityBat['Bat'/181, l='MpServer', x=-35.53, y=51.10, z=262.25], EntityBall['entity.Ball.name'/472, l='MpServer', x=-105.41, y=70.50, z=270.44]]

Retry entities: 0 total; []

Stacktrace:

at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:441)

at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2414)

at net.minecraft.client.Minecraft.run(Minecraft.java:776)

at java.lang.Thread.run(Unknown Source)

 

-- System Details --

Details:

Minecraft Version: 1.5.2

Operating System: Windows 7 (x86) version 6.1

Java Version: 1.7.0_07, Oracle Corporation

Java VM Version: Java HotSpot Client VM (mixed mode, sharing), Oracle Corporation

Memory: 95593040 bytes (91 MB) / 259522560 bytes (247 MB) up to 259522560 bytes (247 MB)

JVM Flags: 0 total;

AABB Pool Size: 19526 (1093456 bytes; 1 MB) allocated, 2071 (115976 bytes; 0 MB) used

Suspicious classes: FML and Forge are installed

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v7.51 FML v5.2.23.737 Minecraft Forge 7.8.1.737 4 mods loaded, 4 mods active

mcp{7.51} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

FML{5.2.23.737} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Forge{7.8.1.737} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Soccer{0.0.1} [soccer Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

LWJGL: 2.4.2

OpenGL: Intel® HD Graphics 4000 GL version 4.0.0 - Build 9.17.10.2843, Intel

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Texture Pack: Default

Profiler Position: N/A (disabled)

Vec3 Pool Size: 1721 (96376 bytes; 0 MB) allocated, 335 (18760 bytes; 0 MB) used

 

java.lang.NullPointerException

at soccer.render.RenderBall.doRender(RenderBall.java:64)

at net.minecraft.client.renderer.entity.RenderManager.renderEntityWithPosYaw(RenderManager.java:310)

at net.minecraft.client.renderer.entity.RenderManager.renderEntity(RenderManager.java:279)

at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:508)

at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1150)

at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:991)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:871)

at net.minecraft.client.Minecraft.run(Minecraft.java:760)

at java.lang.Thread.run(Unknown Source)

--- END ERROR REPORT be079d1e ----------

 

 

 

Link to comment
Share on other sites

I have changed my render class to this. Upon right click it doesn't crash minecraft now and spawns snowball particles when the entity hits something but does not actually render the ball (it is invisible). Also, I get this error upon right click displayed in the console.

 

 

2014-03-06 11:23:41 [sEVERE] [Minecraft-Client] @ Post render

2014-03-06 11:23:41 [sEVERE] [Minecraft-Client] 1283: Stack overflow

2014-03-06 11:23:41 [sEVERE] [Minecraft-Client] ########## GL ERROR ##########

 

package soccer.client.render;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import org.lwjgl.opengl.GL11;
import soccer.model.ItemModelBall;
import soccer.entity.EntityBall;

public class RenderBall extends Render {
ItemModelBall model;

public RenderBall() {
	model = new ItemModelBall();
}

@Override
public void doRender(Entity entity, double x, double y, double z, float f, float f1) {
	doRender((EntityBall) entity, x, y, z, f, f1);
}

private void doRender(EntityBall ball, double x, double y, double z, float f, float f1) {
	GL11.glPushMatrix();
	GL11.glTranslated(x, y, z);
	GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
	GL11.glRotatef(180, 1, 0, 1);

	Minecraft.getMinecraft().renderEngine
	.bindTexture("/mods/soccer/textures/items/Ball3D.png");
	}


}

Link to comment
Share on other sites

This fixed the Stack overflow problem and that error doesn't show up anymore but its still invisible.

 

 


private void doRender(EntityBall ball, double x, double y, double z, float f, float f1) {
	GL11.glPushMatrix();
	Minecraft.getMinecraft().renderEngine
			.bindTexture("/mods/soccer/textures/items/Ball3D.png");
	// rotates the item
	GL11.glRotatef(90, 0, 0, 1);
	GL11.glRotatef(90, 0, 1, 0);
	GL11.glRotatef(230, 1, 0, 0);
	GL11.glTranslatef(0, 0.2f, -0.6f);

	modelBall.render(ball, f1, 0.0f, 0.0f, 0.0f, 0.0f,
				0.0225f);
	GL11.glPopMatrix();


}


}

Link to comment
Share on other sites

It is invisible because the private void doRender no longer overrides the public void doRender that is used to render objects.

 

You need to figure out what is causing the null point exception. It is probably a undefined or null variable being used. Also, make sure that the proxy.registerentities() is being called after the ball=new Ball(5000);

Link to comment
Share on other sites

ok. I don't have a workspace set up for 1.6, so you are going ot have to do this yourself.

 

1. Undo the changes to your render ball class.

2. reproduce the crash.

3. in the eclipse crash report, there shouled be a hyperlink on the RenderBall.java:64 in the

java.lang.NullPointerException

  at soccer.render.RenderBall.doRender(RenderBall.java:64)

Click it and tell me the line of code that pops up.

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.




  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I would like to setup a test that makes sure an animation completes, however this animation can be a couple of seconds long. Are there any examples of using a GameTestSequence created from GameTestHelper#startSequence to wait until a certain function in the code is reached or finished?
    • Minecraft java and forge seem to have it out for me, any ideas? I have had issues with exit code 1 while loading forge -fabric was having the same issues, but I seemed to fix it in these repairs? (tried different versions upwards from 1.19 to 1.20.2 for forge, nothing worked and I'm confident older versions wouldn't either) -The launcher itself loads fine, it will load the game within the launcher, and then crash the moment it tries to load outside of the launcher. I have tried the default launcher, legacy launcher, and the curse forge launcher, none have worked! (all have had the same problem) I think this started when I took a break and upgraded to windows 11 and wonder if that changed anything? I have tried the following: uninstalled & reinstalled java, (I have having issues where I download jdk 17 but only 8 would show up (would not show up anywhere but the control panel, not even the official uninstaller, I *think* I got that fixed) tried jarfix uninstalled & reinstalled minecraft tried alternate launchers -forge & legacy, & repaired them too. tried without mods updated game drivers uninstalled and reinstalled forge -including completely wiping it from my system changed java excutable path followed everything in the error code 1 post completely reset my pc I tried to change the launch path but couldn't seem to get it to work -the default launcher wont let me even see properties as an option, i have yet to try with the other two (i did try on legacy but it was being weird) I want to include my debug log; but its over the max size? sorry my brains gone numb from trying to fix this for the past 2 days
    • I personally create registries using DataPackRegistryEvent.NewRegistry. It's pretty powerful as long as you know how to make codecs. In some class, make a registry key like so: public static final ResourceKey<Registry<MyDataType>> MY_REGISTRY = ResourceKey.createRegistryKey(new ResourceLocation(MyMod.MOD_ID, "registry_name")); This will make a registry that holds objects of type "MyDataType". JSON files stored in data/<datapack_namespace>/modid/registryname/ will be parsed and put into this registry. Note that the directory structure has a folder named after your mod inside your datapack directory, so the actual path would look like: data/my_mod/my_mod/registry_name (or if another mod uses your registry: data/their_mod/my_mod/registry_name. To register this registry, subscribe to the DataPackRegistryEvent.NewRegistry event on the MOD event bus and call event.dataPackRegistry() for every registry you have. An example of what I'm doing for my mod (this is in the constructor for the main mod file): IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus(); bus.addListener((DataPackRegistryEvent.NewRegistry event) -> { event.dataPackRegistry(ModRegistries.INSULATOR_DATA, InsulatorData.CODEC); }); CODEC is a public static field inside the class for the custom data type I am registering. It holds a Codec<InsulatorData> that tells Minecraft how to serialize/deserialize the data. Most of my data so far can be represented by records, so I use RecordCodecBuilder.create() to do this: public static final Codec<InsulatorData> CODEC = RecordCodecBuilder.create(instance -> instance.group( // Yadda yadda ).apply(instance, InsulatorData::new)); What exactly to put here depends on what you're trying to do, so that's up to you. But basically you're just defining a list of codecs that correspond to the parameters of the record (data type). Most primitive data types have records in the Codec class (ex. Codec.INT) that you can use, and other classes like ResourceLocation have their own codecs as a static field (ex. ResourceLocation.CODEC). Hopefully this is what you're looking for, and that this helps.
    • Good days  I finnaly manage to fix and get a working gui from BlockItem and from BlockEntity the next issues i have to fix is this the block Entity model for some reason is moved to the south west  this briefcase model must be centered but is moved to a side, i have nothing weird in the code but this is happening // ########## ########## ########## ########## @Override public RenderShape getRenderShape(BlockState blkstate) {     return RenderShape.MODEL; } the block model is out of place However The hitBox of the block is right in place   ########################################################################################################### This next issue  Mi gui also adds the 5 slots from the player equipment the thing is theres no filter to determine whats can be put in an armor slot and what not      i have this method that draws the slots for the armor, the part i dont get i slike wheres the code that responds when you set an item in a item slot to do checks and allow the item to be set or not  //########## ########## ########## //Draw Player Armor private void addPlayerArmorSlots(Inventory playerInventory) { // 36 this.addSlot(new Slot(playerInventory, 39, 8, 8)); this.addSlot(new Slot(playerInventory, 38, 8, 26)); this.addSlot(new Slot(playerInventory, 37, 8, 44)); this.addSlot(new Slot(playerInventory, 36, 8, 62)); this.addSlot(new Slot(playerInventory, 40, 26, 53)); }   theres must be a method that triggers when you set a itemstack inside an slot and allows to do a check if its a valid item for that slot                                             
    • No like how do I use my new PreperableReloadListener, I know how to set it up now and register it, I just need to know how to use it in other classes.
  • Topics

×
×
  • Create New...

Important Information

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