Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look into fixing Pattern item rendering #3110

Closed
Raidobw2 opened this issue Oct 20, 2021 · 3 comments
Closed

Look into fixing Pattern item rendering #3110

Raidobw2 opened this issue Oct 20, 2021 · 3 comments
Labels
bug Something isn't working crossmod rs2-considered Things that are going into Refined Storage 2

Comments

@Raidobw2
Copy link

Issue description:

Some of the ProjectRed Integration item icons when rendered by a refined storage pattern seem to crash the game.
Modpack: FTB OceanBlock 1.3.0.

What happens:

Game crashes due to a scala match error.

What you expected to happen:

No crash.

Steps to reproduce:

Using a refined storage pattern grid, make a pattern of a ProjectRed Integration Timer and make the item icon appear such as by holding shift or putting the pattern into a crafter.

Version (make sure you are on the latest version before reporting):

  • Minecraft: 1.16.5
  • Forge: Forge 36.2.8
  • Refined Storage: refinedstorage-1.9.15.jar (latest as of right now)

Does this issue occur on a server? [yes/no]
no, render error.

If a (crash)log is relevant for this issue, link it here:

https://paste.feed-the-beast.com/view/d31fd56e
Had the user remove Optifine after the first crash, that file is the definitive one without Optifine.

Additional info

Here a quick link to the line that crashed after pressing Shift to see the item in the pattern:
https://github.com/MrTJP/ProjectRed/blob/e222759924530a83c808642384bf525eb319652d/src/integration/scala/mrtjp/projectred/integration/GateItemRenderer.scala#L36
Please let me know if that's on your side or on Project Red Integration's side. Close without notice in that case, and let me know in the closing message. I won't be making an issue on Project Red Integration's tracker until then, since the error shows: scala.MatchError: pattern (of class com.refinedmods.refinedstorage.item.PatternItem) which leads me to believe perhaps PRI could not predict that com.refinedmods.refinedstorage.item.PatternItem was going to be matched in that function, hence me coming here instead.

@Darkere
Copy link
Collaborator

Darkere commented Oct 20, 2021

Bug in project red. It assumes everything that will render it is a gate item

@covers1624
Copy link

Yes, correct. ProjectRed makes this assumption. This is a valid assumption to make.

The model is a TESR model which requires access to the ItemStack. Your pattern model is simply returning the wrapped item's model (see here). This is incorrect and breaks all contracts the ItemRenderer system gives, namely that the item being rendered is bound to the Model, this is how the system was designed.

The proper way to handle this is to make your Pattern item a proper TESR model which hands off to ItemRenderer properly to render the wrapped item. I imagine this would also probably fix other cases where TESR item models are used.

We could add some handling PR side to prevent a crash, and probably will. However, that will never resolve the issue of the Item failing to render, the user will simply see nothing.

@Darkere Darkere reopened this Oct 21, 2021
@Darkere Darkere changed the title [Bug] 1.16.5 Crash with Project Red Integration item in pattern, Scala match error Look into fixing Pattern item rendering Oct 21, 2021
@Darkere Darkere added bug Something isn't working crossmod labels Oct 21, 2021
@raoulvdberge
Copy link
Collaborator

We are going to track this for RS 2. Closing here.

@raoulvdberge raoulvdberge added the rs2-considered Things that are going into Refined Storage 2 label Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crossmod rs2-considered Things that are going into Refined Storage 2
Projects
None yet
Development

No branches or pull requests

4 participants