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

Hey all,
Im currently trying to make a special armor using an Entity Layer (Long Story/Short, it uses a Tile Ent renderer and I want to display that, and I kinda dont wanna make a new BipedModel extension for all the models it uses...) and it all works super well, but the Item still displays on the head for some reason, resulting in the proper one (The Layer) and the other one (The Item in its block state) to show...
Is there a way to force stop it from rendering on the Head? Or do I have to scrap the Entity Layer idea and go with a different way?

Also, is it possible to make the Event only add the layer once? Im pretty sure with this:

Quote

private static Class<?>[] armorWearers =
    {
        ClientPlayerEntity.class,
        DrownedEntity.class,
        GiantEntity.class,
        HuskEntity.class,
        SkeletonEntity.class,
        StrayEntity.class,
        PlayerEntity.class,
        WitherSkeletonEntity.class,
        ZombieEntity.class,
        ZombiePigmanEntity.class,
        ZombieVillagerEntity.class,
    };
    
    public static void onLivingRender(final RenderLivingEvent.Post<?, ?> renderLivingEvent)
    {
        LivingEntity entity = renderLivingEvent.getEntity();
        LivingRenderer<?, ?> entityRenderer = renderLivingEvent.getRenderer();
        for (Class<?> entityClass : armorWearers)
        {
            if (entity.getClass() == entityClass)
            {
                if (entity.isAddedToWorld())
                {
                    JustAnotherHeadMod.LOGGER.info("PUSH FOR " + entity.getClass().toString());
                    entityRenderer.addLayer(new AnotherHeadLayer(entityRenderer));
                }
            }
        }
    }

It's generating more than 1 of these layers, creating lag when you wear it on your head

Edited by Fuffles

  • Author

Bump
Alright maybe more info is needed;
My Item  is a Block that you can place in the world, but also equipable on the head. It uses an ISTER (ItemStackTileEntityRegister) and as with all blocks/items it displays on your head. Due to the fact that I am using an LivingEntRenderer and a Layer, like the Elytra, Head or HeldItem it displays it twice, the actual Layer that  I want and the displayed Item/Block which is unwanted. I'd like to get rid of that display, but I dont know how to.

On the other hand, whenever I equip the item, lags seem to spike, I believe this is due to the fact that the renderEvent happens constantly which adds infinite layers. If it would be possible to get the Layer data, which its not since it has not a get() and it's protected, this wouldnt be a problem. Is there any way to add the layer otherwise or should I look into a different method? I'd prefer not to have to make 20 BipedModel extensions for all the forms the Item has and use the ModelBases

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.