Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Bullet = Leather Helmet


StealerSlain
 Share

Recommended Posts

Hello again. I have this problem:

width=800 height=449https://dl.dropbox.com/u/100634244/2012-12-21_16.09.21.png[/img]

 

My Codes:

 

RENDER AS SNOWBALL

 

NO MODEL

 

ENTITY

 

package ***;

 

import net.minecraft.src.*;

 

public class EntityMagicBullet extends EntityThrowable

{

        public EntityMagicBullet(World world)

        {

                super(world);

        }      public EntityMagicBullet(World world, EntityLiving entityliving)

        {

                super(world, entityliving);

        }

        public EntityMagicBullet(World world, double d, double d1, double d2)

        {

                super(world, d, d1, d2);

        }      protected void onImpact(MovingObjectPosition movingobjectposition)

        {

                if (movingobjectposition.entityHit != null)

                {

                        if (!movingobjectposition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, thrower), 4));

                }

                for (int i = 0; i < 1; i++)

                {

                        worldObj.spawnParticle("portal", posX, posY, posZ, 0.0D, 0.0D, 0.0D);

                }

                {

                        setDead();

                }

        }

}

 

 

BASE MOD FILE

A lot of information, but I cut out only the main

	public void addRenderer(Map map)
  {
   map.put(net.smcrafting.src.EntityMagicBullet.class, new RenderSnowball(this.MagicBullet.getIconFromDamage(0)));
  }

	private void registerEntity2(Class <? extends Entity> entityClass, Render renderer, String entityName, String description, int id, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates) {
	  RenderingRegistry.registerEntityRenderingHandler(entityClass, renderer);
	  EntityRegistry.registerModEntity(EntityMummy.class, "Magic Bullet", 8002, this, 250, 5, false);
	  LanguageRegistry.instance().addStringLocalization("entity.Bullet" + entityName + ".name", description);
	 }

@Init
public void load(FMLInitializationEvent event){
registerEntity2(EntityMagicBullet.class, new RenderSnowball(0), "Magic Bullet", "Magic Bullet", 1, 64, 10, true);

 

CLIENT PROXY

  RenderingRegistry.registerEntityRenderingHandler(EntityMagicBullet.class, new RenderSnowball(BaseMod.MagicBullet.getIconFromDamage(0)));

 

Thank you for help

Link to comment
Share on other sites

Well, this one is easy to fix:

 

map.put(net.smcrafting.src.EntityMagicBullet.class, new RenderSnowball(this.MagicBullet.getIconFromDamage(0)));

 

You said it to get icon index 0. If you go into RenderSnowBall, you can see that in doRender it uses: this.loadTexture("/gui/items.png");

And  icon index 0 in items.png is, you guessed it, a leather helmet.

 

So there's no other way then to create a custom render class (like RenderMagicBullet) and do this.loadTexture("your path here"); in the doRender method. (You can copy the RenderSnowBall class for this I guess...)

 

When you're done, don't forget to change

map.put(net.smcrafting.src.EntityMagicBullet.class, new RenderSnowball(this.MagicBullet.getIconFromDamage(0)));

to:

map.put(net.smcrafting.src.EntityMagicBullet.class, new RenderMagicBullet(this.MagicBullet.getIconFromDamage(0)));

Link to comment
Share on other sites

Nothing has changed.

this.loadTexture("/SMCrafting/stealerslain/smcrafting/client/items.png");

+

public void addRenderer(Map map)
  {
   map.put(net.smcrafting.src.EntityMagicBullet.class, new RenderMagicBullet(this.MagicBullet.getIconFromDamage(0)));
  }

=

White Leather Helmet.

And yes, I create RenderMagicBullet class.

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

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.