Jump to content

entity.getShadowSize() missing


jredfox

Recommended Posts

entity get shadow size is missing I used this for rendering entities in inventory based on the item's nbt similar to nei and that's how I scaled the entity for open gl based on that shadow size. How am I suppose to do this in 1.12.2 with no IItemRender and no shadow size?

 

yes this is missing no workaround for object orientation just hard code shadowsize = ent.height / 2.0F;

Edited by jredfox
Link to comment
Share on other sites

On 4/11/2018 at 3:21 AM, diesieben07 said:

Render::shadowSize stores the value.

The renderer hashmaps even in post init appear to be empty I tried running this is my proxies post init

and it printed for the hashMaps:"[ ]"
 

public static void populateShadowSizes() 
	{
		System.out.println("Cacheing Shadow Sizes");
		RenderingRegistry rinstance = (RenderingRegistry) ReflectionUtil.getObject(null,RenderingRegistry.class, "INSTANCE");
		Map<Class<? extends Entity>, Render<? extends Entity>> entityRenderersOld = (Map<Class<? extends Entity>, Render<? extends Entity>>)ReflectionUtil.getObject(rinstance, RenderingRegistry.class, "entityRenderersOld");
		JavaUtil.printMap(entityRenderersOld);
		//populate list
		Map<Class<? extends Entity>, IRenderFactory<? extends Entity>> facRenders = (Map<Class<? extends Entity>, IRenderFactory<? extends Entity>>) ReflectionUtil.getObject(rinstance, RenderingRegistry.class, "entityRenderers");
		RenderManager rmanager = Minecraft.getMinecraft().getRenderManager();
		for(Class<? extends Entity> clazz : facRenders.keySet())
			entityRenderersOld.put(clazz, facRenders.get(clazz).createRenderFor(rmanager));
		
		for(Class clazz : entityRenderersOld.keySet())
		{
			ResourceLocation loc = EntityList.getKey(clazz);
			Render render = entityRenderersOld.get(clazz);
			Float shadowSize = (Float) ReflectionUtil.getObject(render, Render.class, MCPMappings.getField(Render.class, "shadowSize"));
			entShadows.put(loc,shadowSize);
		}
		for(ResourceLocation loc : entShadows.keySet())
			System.out.println(loc  + " shadowSize:" + entShadows.get(loc));
	}

 

Link to comment
Share on other sites

RenderingRegistry is just temporary storage for mod entity renderers/factories during the startup process, RenderManager#entityRenderMap stores the actual instances used to render entities during gameplay.

  • Thanks 1

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

15 hours ago, Choonster said:

RenderingRegistry is just temporary storage for mod entity renderers/factories during the startup process, RenderManager#entityRenderMap stores the actual instances used to render entities during gameplay.

during post init those maps are always empty then? I should be grabbing them from the render manager during post init?

Link to comment
Share on other sites

3 hours ago, jredfox said:

during post init those maps are always empty then? I should be grabbing them from the render manager during post init?

 

They won't be empty if there are mods that have used the RenderingRegistry methods, but they'll never have the Vanilla instances and the Render instances you create from the IRenderFactory instances won't be the same ones that are used to render the entities during gameplay. It's best to use the ones stored in RenderManager.

 

Mods that use the non-deprecated IRenderFactory registration method of RenderingRegistry will have their Render instances added to the RenderManager instance when it's created between preInit and init. Mods that use the deprecated Render registration method of RenderingRegistry will have their Render instances added to the RenderManager instance after postInit.

 

If you really want to support the mods that are still using the deprecated method two years after it was replaced (it was deprecated with this commit and meant to be removed in 1.9), you could lazy-load the shadow sizes for each class when they're required rather than loading them all at startup.

  • Thanks 1

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

On 4/14/2018 at 6:37 PM, Choonster said:

 

They won't be empty if there are mods that have used the RenderingRegistry methods, but they'll never have the Vanilla instances and the Render instances you create from the IRenderFactory instances won't be the same ones that are used to render the entities during gameplay. It's best to use the ones stored in RenderManager.

 

Mods that use the non-deprecated IRenderFactory registration method of RenderingRegistry will have their Render instances added to the RenderManager instance when it's created between preInit and init. Mods that use the deprecated Render registration method of RenderingRegistry will have their Render instances added to the RenderManager instance after postInit.

 

If you really want to support the mods that are still using the deprecated method two years after it was replaced (it was deprecated with this commit and meant to be removed in 1.9), you could lazy-load the shadow sizes for each class when they're required rather than loading them all at startup.

Ok it appears there is a major issue in 1.7.10 and below entity shadow size was always for vanilla mobs this.height/2. it is simply not the case here what should I be looking for in later versions? I used it in past for render like nei on mob spawners. I printed was that entity.height/2 == size it said false
 

minecraft:ender_dragon:0.5 false

 

Link to comment
Share on other sites

31 minutes ago, jredfox said:

Ok it appears there is a major issue in 1.7.10 and below entity shadow size was always for vanilla mobs this.height/2. it is simply not the case here what should I be looking for in later versions? I used it in past for render like nei on mob spawners. I printed was that entity.height/2 == size it said false
 


minecraft:ender_dragon:0.5 false

 

 

That's what Entity#getShadowSize returned, but that method no longer exists; if you compare the 1.7.10 and 1.12.2 implementations of Render#renderShadow, you'll see that they're fairly similar but the entity's shadow size is no longer used.

 

The Render#shadowSize field is 0.5 for RenderDragon in both 1.7.10 and 1.12.2.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

50 minutes ago, Choonster said:

 

That's what Entity#getShadowSize returned, but that method no longer exists; if you compare the 1.7.10 and 1.12.2 implementations of Render#renderShadow, you'll see that they're fairly similar but the entity's shadow size is no longer used.

 

The Render#shadowSize field is 0.5 for RenderDragon in both 1.7.10 and 1.12.2.

but, the entity.getShadowSize() for ender dragon was like 1.5 or something. so I can't use that data for what I need anymore I will just hardcode it for 1.12.2+ thanks anyways.

Link to comment
Share on other sites

  • 3 months later...
On 4/12/2018 at 5:56 PM, jredfox said:

Entity

 

On 4/14/2018 at 6:37 PM, Choonster said:

 

They won't be empty if there are mods that have used the RenderingRegistry methods, but they'll never have the Vanilla instances and the Render instances you create from the IRenderFactory instances won't be the same ones that are used to render the entities during gameplay. It's best to use the ones stored in RenderManager.

 

Mods that use the non-deprecated IRenderFactory registration method of RenderingRegistry will have their Render instances added to the RenderManager instance when it's created between preInit and init. Mods that use the deprecated Render registration method of RenderingRegistry will have their Render instances added to the RenderManager instance after postInit.

 

If you really want to support the mods that are still using the deprecated method two years after it was replaced (it was deprecated with this commit and meant to be removed in 1.9), you could lazy-load the shadow sizes for each class when they're required rather than loading them all at startup.

Ok first off if I cache the sizes is it the same as entity.getShadowSize() in versions <= 1.7.10? If it is how am I suppose to support the depreciated version which fires after post init on load complete then? I prefer to have everything added depreciated or not.

I need this code for rendering entities and scaling them based on their shadow size in item blocks with mob spawners

Link to comment
Share on other sites

On 8/7/2018 at 9:50 AM, jabelar said:

Why shadow size instead of the actual width of the entity?

because nei render code for mob spawners goes based upon shadow size to adjust the scale size for bigger entities without the new dynamic scaling that I don't entirely agree with or like.

Edited by jredfox
Link to comment
Share on other sites

On 4/16/2018 at 4:39 AM, Choonster said:

 

That's what Entity#getShadowSize returned, but that method no longer exists; if you compare the 1.7.10 and 1.12.2 implementations of Render#renderShadow, you'll see that they're fairly similar but the entity's shadow size is no longer used.

 

The Render#shadowSize field is 0.5 for RenderDragon in both 1.7.10 and 1.12.2.

I know the fields are not the same the dragon render is 4.0 in 1.7.10 and 0.5 in the render manager. What am I suppose to do?\


Also the entity dragon is the same size as a blaze so this is not reliable for what I needed the shadow sizes on based on 1.7.10 getShadowSize()

[17:13:42] [main/INFO] [STDOUT]: [com.EvilNotch.lib.minecraft.proxy.ClientProxy:onLoadComplete:105]: EntityBlaze,0.5
[17:13:42] [main/INFO] [STDOUT]: [com.EvilNotch.lib.minecraft.proxy.ClientProxy:onLoadComplete:105]: EntityDragon,0.5
        float scale = 0.4375F;
        if(EntityUtil.getShadowSize(entity) > 1.5)
            scale = 0.1F;

where the scale for rendering the entities in the item block mob spawner would become smaller
 

Link to comment
Share on other sites

1 hour ago, jredfox said:

because nei render code for mob spawners goes based upon shadow size to adjust the scale size for bigger entities without the new dynamic scaling that I don't entirely agree with or like.

This is a ridiculous statement. Why not just make your own way of scaling the entities that is possible in the recent versions of Minecraft and is more stable. What if there was a modded entity that was bigger than the Ender Dragon and the shadow size represented that, and a scale size of .1 did not successfully shrink the entity enough.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

4 hours ago, Animefan8888 said:

This is a ridiculous statement. Why not just make your own way of scaling the entities that is possible in the recent versions of Minecraft and is more stable. What if there was a modded entity that was bigger than the Ender Dragon and the shadow size represented that, and a scale size of .1 did not successfully shrink the entity enough.

I like nei and older render I am porting older render code. Dynamic scaling will be an option eventually but, till everything else is done I am not even going to consider it especially since in the items it would be barley see able unless I increased the scale and developed my own dynamic scaling.

99% of entities didn't override the method anyways for the shadow size meaning it's going to work most of the time entity.height/2 to get it's size. The code is ported from nei and older versions using their equations so I am confident that it won't break and if a giant massive mob shows up I like to see it render.

Anyways looking at the Render.class I don't see why they removed it the entire part when rendering shadows is gone seems stupid to not have that anymore since it was part of the equation for rendering and now it's completely gone.

Edited by jredfox
Link to comment
Share on other sites

Just add the old method in through a core mod or something. Your core modding everything else I don’t see how this is different

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

Honestly fox - If you're already porting code, then you could do it completly. And evaluating a scale isn't hard math... 

 

float scale = desiredSize/Math.max(height,width);

 

Will scale it down to desired size (I'm unsure which one's your problem, or if you're maybe rotating it, so it supports both height and width (cause it's 3 dimensional you propably want to take z-axis in account to... I haven't put much thought into it) ) . 

Edited by Major Tuvok
A scaling method
Link to comment
Share on other sites

On 8/11/2018 at 1:36 AM, Cadiboo said:

Just add the old method in through a core mod or something. Your core modding everything else I don’t see how this is different

the point of adding the method back has to be done with forge since mods have to override it when necessary that's the only part I was worried about.

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

    • OLXTOTO: Platform Maxwin dan Gacor Terbesar Sepanjang Masa OLXTOTO telah menetapkan standar baru dalam dunia perjudian dengan menjadi platform terbesar untuk pengalaman gaming yang penuh kemenangan dan kegacoran, sepanjang masa. Dengan fokus yang kuat pada menyediakan permainan yang menghadirkan kesenangan tanpa batas dan peluang kemenangan besar, OLXTOTO telah menjadi pilihan utama bagi para pencinta judi berani di Indonesia. Maxwin: Mengejar Kemenangan Terbesar Maxwin bukan sekadar kata-kata kosong di OLXTOTO. Ini adalah konsep yang ditanamkan dalam setiap aspek permainan yang mereka tawarkan. Dari permainan slot yang menghadirkan jackpot besar hingga berbagai opsi permainan togel dengan hadiah fantastis, para pemain dapat memperoleh peluang nyata untuk mencapai kemenangan terbesar dalam setiap taruhan yang mereka lakukan. OLXTOTO tidak hanya menawarkan kesempatan untuk menang, tetapi juga menjadi wadah bagi para pemain untuk meraih impian mereka dalam perjudian yang berani. Gacor: Keberuntungan yang Tak Tertandingi Keberuntungan seringkali menjadi faktor penting dalam perjudian, dan OLXTOTO memahami betul akan hal ini. Dengan berbagai strategi dan analisis yang disediakan, pemain dapat menemukan peluang gacor yang tidak tertandingi dalam setiap taruhan. Dari hasil togel yang tepat hingga putaran slot yang menguntungkan, OLXTOTO memastikan bahwa setiap taruhan memiliki potensi untuk menjadi momen yang mengubah hidup. Inovasi dan Kualitas Tanpa Batas Tidak puas dengan prestasi masa lalu, OLXTOTO terus berinovasi untuk memberikan pengalaman gaming terbaik kepada para pengguna. Dengan menggabungkan teknologi terbaru dengan desain yang ramah pengguna, platform ini menyajikan antarmuka yang mudah digunakan tanpa mengorbankan kualitas. Setiap pembaruan dan peningkatan dilakukan dengan tujuan tunggal: memberikan pengalaman gaming yang tanpa kompromi kepada setiap pengguna. Komitmen Terhadap Kepuasan Pelanggan Di balik kesuksesan OLXTOTO adalah komitmen mereka terhadap kepuasan pelanggan. Tim dukungan pelanggan yang profesional siap membantu para pemain dalam setiap langkah perjalanan gaming mereka. Dari pertanyaan teknis hingga bantuan dengan transaksi keuangan, OLXTOTO selalu siap memberikan pelayanan terbaik kepada para pengguna mereka. Penutup: Mengukir Sejarah dalam Dunia Perjudian Daring OLXTOTO bukan sekadar platform perjudian berani biasa. Ini adalah ikon dalam dunia perjudian daring Indonesia, sebuah destinasi yang menyatukan kemenangan dan keberuntungan dalam satu tempat yang mengasyikkan. Dengan komitmen mereka terhadap kualitas, inovasi, dan kepuasan pelanggan, OLXTOTO terus mengukir sejarah dalam dunia perjudian berani, menjadi nama yang tak terpisahkan dari pengalaman gaming terbaik. Bersiaplah untuk mengalami sensasi kemenangan terbesar dan keberuntungan tak terduga di OLXTOTO - platform maxwin dan gacor terbesar sepanjang masa.
    • OLXTOTO - Bandar Togel Online Dan Slot Terbesar Di Indonesia OLXTOTO telah lama dikenal sebagai salah satu bandar online terkemuka di Indonesia, terutama dalam pasar togel dan slot. Dengan reputasi yang solid dan pengalaman bertahun-tahun, OLXTOTO menawarkan platform yang aman dan andal bagi para penggemar perjudian daring. DAFTAR OLXTOTO DISINI DAFTAR OLXTOTO DISINI DAFTAR OLXTOTO DISINI Beragam Permainan Togel Sebagai bandar online terbesar di Indonesia, OLXTOTO menawarkan berbagai macam permainan togel. Mulai dari togel Singapura, togel Hongkong, hingga togel Sidney, pemain memiliki banyak pilihan untuk mencoba keberuntungan mereka. Dengan sistem yang transparan dan hasil yang adil, OLXTOTO memastikan bahwa setiap taruhan diproses dengan cepat dan tanpa keadaan. Slot Online Berkualitas Selain togel, OLXTOTO juga menawarkan berbagai permainan slot online yang menarik. Dari slot klasik hingga slot video modern, pemain dapat menemukan berbagai opsi permainan yang sesuai dengan preferensi mereka. Dengan grafis yang memukau dan fitur bonus yang menggiurkan, pengalaman bermain slot di OLXTOTO tidak akan pernah membosankan. Keamanan dan Kepuasan Pelanggan Terjamin Keamanan dan kepuasan pelanggan merupakan prioritas utama di OLXTOTO. Mereka menggunakan teknologi enkripsi terbaru untuk melindungi data pribadi dan keuangan para pemain. Tim dukungan pelanggan yang ramah dan responsif siap membantu pemain dengan setiap pertanyaan atau masalah yang mereka hadapi. Promosi dan Bonus Menarik OLXTOTO sering menawarkan promosi dan bonus menarik kepada para pemainnya. Mulai dari bonus selamat datang hingga bonus deposit, pemain memiliki kesempatan untuk meningkatkan kemenangan mereka dengan memanfaatkan berbagai penawaran yang tersedia. Penutup Dengan reputasi yang solid, beragam permainan berkualitas, dan komitmen terhadap keamanan dan kepuasan pelanggan, OLXTOTO tetap menjadi salah satu pilihan utama bagi para pecinta judi online di Indonesia. Jika Anda mencari pengalaman berjudi yang menyenangkan dan terpercaya, OLXTOTO layak dipertimbangkan.
    • I have been having a problem with minecraft forge. Any version. Everytime I try to launch it it always comes back with error code 1. I have tried launching from curseforge, from the minecraft launcher. I have also tried resetting my computer to see if that would help. It works on my other computer but that one is too old to run it properly. I have tried with and without mods aswell. Fabric works, optifine works, and MultiMC works aswell but i want to use forge. If you can help with this issue please DM on discord my # is Haole_Dawg#6676
    • Add the latest.log (logs-folder) with sites like https://paste.ee/ and paste the link to it here  
    • I have no idea how a UI mod crashed a whole world but HUGE props to you man, just saved me +2 months of progress!  
  • Topics

×
×
  • Create New...

Important Information

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