Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

Could it be that you're telling RenderSnowball to render the bullet's Icon Index, but in terrain.png instead of your own?

  • Author

I do not quite understand you.

My Bullet's texture is 128x128 and in items128.png

EDIT: Okay, I'm Create RenderMagicBullet.java and replace texture, but don't work.

I may be able to help, but I will need you to post all of your code in the classes used

The Korecraft Mod

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)));

  • Author

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.

in your item class put

 

public void String getTextureFile() {

    return "";

}

The Korecraft Mod

No, you still did this wrong:

 

registerEntity2(EntityMagicBullet.class, new RenderSnowball(0), "Magic Bullet", "Magic Bullet", 1, 64, 10, true);

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.