Jump to content

HELP WITH THROWABLE RENDERING


nickpops98

Recommended Posts

Hi everyone,

 

I was working on two new throwable entities in forge and I am trying to use the snowball and fireball rendering but I cannot see the two entities while they are in the air. However it has nothing to do with my entities as they perform as they are supposed to on impact. (Expolosion, potion effects...) Any help on how I could fix this so the entities actually render would be great.

 

Main Class

 

 

package nickpops98.modName;
// Imports required
@Mod( modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION)
public class modName {
}
@EventHandler
public void Load(FMLInitializationEvent event) {                            
// [<] Entity Settings
EntityRegistry.registerGlobalEntityID(EntityLavaball.class, "Lavaball", 4);
EntityRegistry.registerGlobalEntityID(EntityBlindshot.class, "Blindshot", 5);
                                                            
RenderingRegistry.registerEntityRenderingHandler(EntityLavaball.class, new RenderFireball(1.0F));
RenderingRegistry.registerEntityRenderingHandler(EntityBlindshot.class, new RenderSnowball(Item.enderPearl));
// [>]
}

 

 

 

Entity Lavaball

 

 

package nickpops98.modName.entity.projectile;
// Imports required
public class EntityLavaball extends EntityThrowable
{
public EntityLavaball(World par1World)
{
     super(par1World);
     this.isImmuneToFire = true;
     this.setFire(1000);
}

public EntityLavaball(World par1World, EntityLivingBase par2EntityLivingBase)
{
     super(par1World, par2EntityLivingBase);
}
public EntityLavaball(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)
{
     this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, 0.8F, true, true);
     this.setDead();
}
}

 

 

 

Entity Blindshot

 

 

package nickpops98.modName.entity.projectile;
// Imports requiredpublic class EntityBlindshot extends EntityThrowable
{
public EntityBlindshot(World par1World)
{
     super(par1World);
     this.isImmuneToFire = true;
     this.setFire(1000);
}

public EntityBlindshot(World par1World, EntityLivingBase par2EntityLivingBase)
{
     super(par1World, par2EntityLivingBase);
}
public EntityBlindshot(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)
{
     if(par1MovingObjectPosition.typeOfHit == EnumMovingObjectType.ENTITY)
     ((EntityLivingBase) par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 1));
}
}

 

 

 

Thanks in advance!

Link to comment
Share on other sites

Hi

 

I don't see an obvious problem but some thoughts...

 

I've been told it's better to use EntityRegistry.registerModEntity instead of registerGlobalEntityID.  (But I doubt this is causing your rendering problem)

 

I'd suggest that you put a breakpoint into RenderManager.renderEntityWithPosYaw

 

            render = this.getEntityRenderObject(par1Entity);  // breakpoint here

            if (render != null && this.renderEngine != null)
            {

or alternatively

 

  if (par1Entity instanceof EntityLavaball) {
     System.out.println("rendering EntityLavaball"); // breakpoint here
  }
            render = this.getEntityRenderObject(par1Entity);

            if (render != null && this.renderEngine != null)
            {

 

then trace into it to see why your desired renderer isn't being retrieved.  Or alternatively, if it's being retrieved, why the render code isn't working.

 

-TGG

Link to comment
Share on other sites

Hi

 

I did as you said and I can now see that for some reason my entities are not being passed through to RenderManager.

 

I'm not sure what you mean by that.

 

do you mean that when you got to the line

            render = this.getEntityRenderObject(par1Entity);

your par1Entity is the EntityLavaball, render was set to null?

 

or do you mean that renderEntityWithPosYaw was never called for your EntityLavaball at all?

 

-TGG

 

 

 

 

 

Link to comment
Share on other sites

Hi

 

Hmmm ok

 

In RenderGlobal.renderEntities, add the following line

 

            this.theWorld.theProfiler.endStartSection("entities");

            for (i = 0; i < list.size(); ++i)
            {
                entity = (Entity)list.get(i);
                if (entity instanceof EntityLavaball) {
     System.out.println("rendering EntityLavaball"); // breakpoint here
  }

when it breaks, see if you can trace through and see why it isn't getting to

                    RenderManager.instance.renderEntity(entity, par3);

 

-TGG

 

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

    • MPO1121: Temukan daftar situs judi slot dengan layanan pembayaran melalui Bank Danamon. Bergabunglah dengan MPO1121 untuk pengalaman taruhan slot online yang menarik dan aman. Nikmati berbagai permainan slot terbaik sambil memanfaatkan kemudahan pembayaran melalui Bank Danamon. Daftar sekarang dan rasakan sensasi taruhan yang tak terlupakan dengan MPO1121!" ❱❱❱❱❱ DAFTAR DI SINI ❰❰❰❰❰ ❱❱❱❱❱ DAFTAR DI SINI ❰❰❰❰❰
    • Salah satu jenis permainan yang populer adalah slot 0nline. Dalam dunia slot online, terdapat beberapa server yang dikenal memiliki tingkat kemenangan yang tinggi, salah satunya adalah server Kamboja. Di server ini, terdapat seorang pemain yang dikenal dengan sebutan "Abang Gac0r", yang memiliki reputasi sebagai pemain yang sering menang besar. >> DAFTAR LANGSUNG DISINI << Slot Server THAILAND - Abang Gacor dikenal sebagai pemain slot online yang sangat berpengalaman dan memiliki keberuntungan yang luar biasa. Dia sering kali berhasil memenangkan jackpot dan hadiah besar dalam permainan slot online. Banyak pemain lain yang mengagumi kemampuannya dalam bermain slot online di server Kamboja ini. Slot Gacor Maxwln - Salah satu alasan mengapa Abang Gacor sering menang adalah karena dia memiliki strategi bermain yang baik. Dia tidak hanya mengandalkan keberuntungan semata, tetapi juga memperhatikan faktor-faktor lain seperti memilih mesin slot yang tepat, mengatur taruhan dengan bijak, dan mengetahui kapan harus berhenti bermain. Slot Gac0r Resmi - Selain itu, Abang Gacor juga sering memanfaatkan promo dan bonus yang ditawarkan oleh situs slot online. Dengan memanfaatkan promo dan bonus ini, dia dapat meningkatkan peluangnya untuk menang tanpa harus mengeluarkan banyak modal.
    • RAJA328 💯 Daftar Link Slot Gacor Hari Ini Bisa Judi Slot Online KLIK DISINI >>>   DAFTAR AKUN GACOR KLIK DISINI >>> DAFTAR AKUN VVIP KLIK DISINI >>>  LINK ALTERNATIF KLIK DISINI >>> AKUN GACOR SCATTER HITAM RAJA328 adalah slot gacor winrate 100% dengan server thailand dan akun pro. Dapatkan akses menuju kemenangan ke puluhan sampai ratusan juta rupiah hanya dalam hitungan menit. 3 web yang kami hadirkan ini adalah yang terbaik dengan histori kemenangan tertinggi di satu Asia Tenggara. Member-member dari web ini selalu kembali karena tim admin dan CS yang profesional serta kemenangan berapapun pasti akan dibayar. RTP slot gacor juga sudah disiapkan agar kalian tidak bingung lagi mau main apa dan di jam berapa. Semua fasilitas seperti deposit dana dan pulsa sudah disiapkan juga untuk kemudahan para slotters. Jadi tunggu apalagi? Raih kemenangan kalian disini sekarang juga!
    • Dengan bonus 100% untuk pemain baru, pilihan permainan yang luas, keamanan dan keandalan yang tak tertandingi, layanan pelanggan yang ramah dan responsif, serta kemudahan akses dan kompatibilitas, tidak ada alasan untuk tidak memilih Pasarbaris sebagai tempat Anda bermain slot online. Bergabunglah sekarang dan rasakan sensasi keseruan dan kegembiraan yang ditawarkan oleh Pasarbaris!    
    • Cendana88: Temukan situs resmi terpercaya untuk tahun 2024 dengan Cendana88! Bergabunglah dengan kami untuk pengalaman taruhan yang terjamin keamanannya dan layanan terbaik. Nikmati berbagai permainan judi online yang menarik dengan jaminan keamanan dan kenyamanan di Cendana88. Daftar sekarang dan rasakan sensasi taruhan yang tak terlupakan bersama kami ❱❱❱❱❱ DAFTAR DI SINI ❰❰❰❰❰ ❱❱❱❱❱ DAFTAR DI SINI ❰❰❰❰❰
  • Topics

×
×
  • Create New...

Important Information

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