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 all, I've been writing up a PR for 2 @Cancelable Events that are fired when the glint effect is rendered onto an ItemStack/ over the armor layer, respectively, and I'm looking for some suggestions for adding things to the events before finalizing and submitting.

 

Currently it passes:

 

Both

int glintValue : The integer that represents the color. This is formatted in aaaarrrrggggbbbb in the RenderItem#renderEffect, and I've translated this to the LayerArmorBase's equivalent function
ItemStack theStack : The ItemStack getting rendered (ItemArmor for the armor)

 

ItemStacks

IBakedModel theModel : The itemstack's baked model

 

Armor

ModelBase theModel : The armor's ModelBase
int armorSlot : The slot that  the armor is in

 

I've also added methods into Forge section of the Item class

public int getItemGlintColor(ItemStack stack): returns int value for the itemstack glint

public int getArmorGlintColor(ItemStack stack, int armorSlot): returns int value for the armor glint

 

Being cancelable you can cancel rendering the vanilla effect entirely, and with the models past to you, you can render your own overlays onto the model (ie instead have a fire effect on fire enchanted weapons). The glintValue in the event is also used so that you can manipulate the colors in the event if you desire.

 

 

Working example of using event to change potion item & boot armor to a red glint:

width=800 height=450https://www.dropbox.com/s/24tenlcwhmqsgyd/Screenshot%202016-02-08%2020.33.53.png?dl=1[/img]

 

 

Patched Classes

 

RenderItem

LayerArmorBase

Item

 

 

I think its my java of the variables.

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.