Posted December 21, 201212 yr Hello again. I have this problem: https://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
December 21, 201212 yr Could it be that you're telling RenderSnowball to render the bullet's Icon Index, but in terrain.png instead of your own?
December 21, 201212 yr 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.
December 22, 201212 yr I may be able to help, but I will need you to post all of your code in the classes used The Korecraft Mod
December 22, 201212 yr 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)));
December 24, 201212 yr 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.
December 24, 201212 yr in your item class put public void String getTextureFile() { return ""; } The Korecraft Mod
December 25, 201212 yr 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.