Refined Storage

Refined Storage

77M Downloads

GTCE rendering crash

XXxinsanityxX opened this issue ยท 19 comments

commented

Issue description:

Config option to disable the rendering that RS uses in its encoded patterns when shift is held down and when its inside a crafter, this is to serve as a workaround to some issues regarding GTCE and its way of rendering cables and pipes, and since the rendering is not necessary thanks to the tooltips that are already in place this would be a welcome change for packdevs that would like to use both of this mods together.

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

  • Minecraft: 1.12.2
  • Forge: latest compatible
  • Refined Storage: 1.6.14
commented

Can you link me the crash report?

commented
commented

This seems wrong. Can't GTCE just fix their issue?

commented

i would love for that to happen but the dev has stated that there was no real intention to fix it on his side.

commented

I second that issue and here's the crash report: https://paste.dimdev.org/osasisoxof.mccrash
It gets pretty annoying, pretty fast.

commented

If this happens, please don't forget to not render when you put it into a crafter as well, otherwise, you won't be able to open the crafter again.

commented

Just been keeping an eye on this disscussion for the exact same issue... My thoughts on adding a config option would be redundant only because of the "Crafter Manager." It would become a lot less useful only being able to see text and not the rendered item for organization purposes but again I understand its about the crash or work around for the time being.

commented

I second this suggestion as it seems like the simplest solution for now. Maybe a mod blacklist would make more sense but since this is a hotfix of sorts, it might be overkill. Anyhow, this seems like a major issue since it causes a preventable crash and a fix is overdue. I frankly don't care where the fault origins - I just want to use my favorite mod with GT which is currently impossible.

Edit: Okay, so I gave up on the lazy solution and just made a hotfix myself. Its essentially a modified version of GT that handles pattern rendering. Is this ok to share with people? @Archengius

commented

What does your modified version look like @vildaberper ?

commented

Just letting you guys know I am planning to work around this problem soon.

commented

@vildaberper What if you submit a PR of your modified version to the gregtech github? I'm curious what's changed though, because the devs over there were annoyingly adamant that it's not their fault whatsoever and to screw off.

commented

@raoulvdberge could you use setTileEntityItemStackRenderer for rendering your pattern item? That way you will solve all of the compatibility issues with other mods using similar rendering hooks (that includes most of ChickenBones mods and ProjectRed), and all items would render correctly. It's not really a big change.
I could PR it myself to RefinedStorage, but unfortunately i current don't have enough spare time to work even on my own mod.

commented

@Archengius I tried doing it as you suggested, but couldn't figure out how. I'd be happy to see a PR from your side!

commented

So, because I couldn't figure out a cleaner solution: Gregtech items are now straight up banned for rendering on patterns. I'm not entirely happy with how it works, but it's good as a temporary fix.

I tried to find a nicer fix but couldn't find one. If @Archengius feels like PR'ing a fix and removing the blacklist, that'd be great too.

commented

Okay, great to see some action on your side @raoulvdberge !
So here is the line that made an issue in gregtech:
BlockCable blockCable = (BlockCable) ((ItemBlockCable) stack.getItem()).getBlock()
Stacktrace: com.raoulvdberge.refinedstorage.item.ItemPattern cannot be cast to gregtech.common.pipelike.cable.ItemBlockCable

So I simply dug into ItemPattern a bit and fixed the renderer within gregtech:
CraftingPattern pattern = ItemPattern.getPatternFromCache(null, stack); stack = pattern.getOutputs().get(0);
... with the necessary checks obviously.

It's a hacky solution and I'm not familiar with forge or rendering within it. From what I learned it seems like the wrong itemstack is beeing sent to gregtechs renderer, meaning the patterin itself and not the result. I hope this gives you some insight:
public class CableRenderer implements IItemRenderer @Override public void renderItem(ItemStack stack, TransformType transformType) { // This is where gregtech assumes stack to be ItemBlockCable } }

It would seem like you need to forward the render to the resulting itemstack when rendering patterns, not the pattern itself. I could look further into this if you want me to make a pull request.
Thanks again for giving this issue the attention it deserves!

commented

Thanks for the explanation. I'm interested in seeing a PR from you, if you'd be interested in sending one.

commented

@raoulvdberge i implemented a workaround on my side to retrieve actual item from pattern for correct rendering in latest release. Could you revert GTCE blacklisting please?

commented

1.12 is no longer supported.