Jump to content

Suggestions for PR


Recommended Posts

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:



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)



IBakedModel theModel : The itemstack's baked model



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







I think its my java of the variables.

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.

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.


  • Create New...

Important Information

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