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

Change the entity texture. You could attempt to change it using RenderSystem#setShaderColor, though you will have to be careful and make sure you set and then unset it after rendering for the specific entity is done in the RenderLivingEvent$Pre and $Post.

  • 2 weeks later...
  • Author

That would be relatively simple, but there is a little twist.
1.  It is a projectile, not a living entity.
2. The projectile holds any one of several custom fluids, the color of which is impossible to determine until runtime.

Being a projectile that is removed from the game within a few ticks of impact, I don't have to be concerned with unsetting the color change.

I do have a minimal custom renderer that extends ArrowRenderer.  Perhaps I could override the render method in EntityRenderer.
One concern is that, due to the singleton nature of items, blocks, entities, it may cause every one of these currently in the game to be tinted the same way.  It would seem to be a bit of overkill to make a custom capability just for this minor effect.  But, if that is what it takes, I'm up for it.

Reality check: am I even approaching it correctly?

On 12/30/2022 at 2:29 PM, DirtEngineer said:

It is a projectile, not a living entity.

Why would this matter? Textures get applied the same way, same as the color.

On 12/30/2022 at 2:29 PM, DirtEngineer said:

The projectile holds any one of several custom fluids, the color of which is impossible to determine until runtime.

Ok? So you can pass the color into the texture shader and tint it instead.

On 12/30/2022 at 2:29 PM, DirtEngineer said:

I do have a minimal custom renderer that extends ArrowRenderer.  Perhaps I could override the render method in EntityRenderer.
One concern is that, due to the singleton nature of items, blocks, entities, it may cause every one of these currently in the game to be tinted the same way.  It would seem to be a bit of overkill to make a custom capability just for this minor effect.  But, if that is what it takes, I'm up for it.

This is not going to do that? The only way that would happen is if you're replacing every single render call to have your color tinting it, which since you have control over what you render, is completely unnecessary.

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.