AbrarSyed / SecretRoomsMod-forge

The official SecretRoomsMod repo
GNU Lesser General Public License v3.0
39 stars 35 forks source link

Block rendering is broken #237

Open darthvader45 opened 6 years ago

darthvader45 commented 6 years ago

Optifine?: Yes If so what version: 1.12.2 hd c6 Does adding/removing Optifine affect the issue?: Yes, especially after updating and trying without other mods besides this and malisisdoors.

Block rendering for the doors/trapdoors and one-way glass are completely broken. One-way glass only works properly if there is no block underneath it, which defeats the purpose. Doors and trapdoors render as full blocks when camouflaged and only render normally when they cannot camouflage or attempt to camouflage as a barrier. All other blocks work as intended.

Wyn-Price commented 6 years ago

Does removing optifine solve this?

Wyn-Price commented 6 years ago

What resource pack are you using?

darthvader45 commented 6 years ago

Removing Optifine, after testing with other mods did not fix this, no idea. I was using John Smith Legacy 1.12.2.

Wyn-Price commented 6 years ago

Are you using other mods?

Wyn-Price commented 6 years ago

Im trying it with John Smith Legacy 1.12.2, and i cant see an issue with the grass. Secret trap doors will render as full blocks with malisisdoors installed because I havent finished the compatability

darthvader45 commented 6 years ago

Huh, I tried it with both that and vanilla and one-way glass renders as the block underneath on all six sides. Not only that, but it seems it caused a crash as well. Seems to be a problem with Better Foliage. No idea why that mod causes problems with this.

Wyn-Price commented 6 years ago

are you using other mods?

Wyn-Price commented 6 years ago

also can you send the fml-client-latest.log

darthvader45 commented 6 years ago

I am, but it seems better foliage does it.

darthvader45 commented 6 years ago

fml-client-latest.log Here's the latest fml client log.

Here's the mods: https://www.dropbox.com/s/pimyzcirqshtsc4/Other%20Mods.zip?dl=1

And the save: https://www.dropbox.com/s/4dtp9q1avgowkdb/Secret%20Rooms%20Test.zip?dl=1

Wyn-Price commented 6 years ago

If its better foliage, I dont think im gonna add support, for many reasons

Better Foliage does some weird stuff during the rendering. Ill add making it work with secretrooms to my long todo list but i cant promise anything

darthvader45 commented 6 years ago

Okay. That's fine with me, though why it is written in a different language is beyond me, it looks like a java mod, plays like a java mod, it should be.

darthvader45 commented 6 years ago

Yep, it is definitely Better Foliage. Maybe I'll talk with octarine_noise and see if I can get them to work this out.

Wyn-Price commented 6 years ago

Its written in kotlin, which can be compiled into java bytecode. The source code is in a diffrent language, but when compiled, it runs the same

darthvader45 commented 6 years ago

Huh. Well then.

Wyn-Price commented 6 years ago

If you want to make an issue to octarine_noise, its because SecretRoosmMod depends on stuff being rendered the vanilla way, as it introduces its own transformers and asm. He redirects some of the rendering traffic here.

This is where I think its going wrong, but again, i do not know kotlin, so i might be wrong

Wyn-Price commented 6 years ago

Being more specific, SRM does stuff like this:

  1. In RenderChunk#rebuildChunk, SRM makes the blockstate used for rendering be taken from here, as this means i can add aditional infomation to the SRM model, and it means that I can make the ChunkCache (IBlockAccess) used in the whole rendering thing return the mirrored state for each SRM block, as to make them blend in more

  2. In BlockRendererDispatcher#renderBlock, at the very start of the method, SRM sets the input state to be gotten through here, which, if the block is a SecretRoomsMod block, returns the mirrored state of the block.

  3. In BlockModelRenderer#renderModel, at the very start of the method, SRM sets the input model to be gotten through here, which will return the SecretRoomsMod IBakedModel if a SecretBlock is at that position.

Things need to happen this way for secretroomsmod blocks to be rendered correctly. As i said before, I think BF redirects the rendering stuff here, which could be causing the issues youre having - 2 and 3 arnt being called (afaik)

Basically, the input blockstate and model are not the ones to use. The model and states need to be passed through SecretRoomsHooks#getActualModel and SecretRoomsHooks#getActualState respectively. Im in the process right now of removing the asm for RenderChunk#rebuildChunk, as i dont think its needed

darthvader45 commented 6 years ago

Perhaps routing it through his and then routing it back to your mod would have some effect on fixing it.

Wyn-Price commented 6 years ago

@darthvader45 one thing you should notice, is that one way glass works on some blocks, but not others. This supports my theory that BF redirects rendering stuff. 2018-03-20_22 32 29 image

darthvader45 commented 6 years ago

Agreed, I noticed this immediately. I think redirecting it from his mod to yours might have some effect on it, but as you said, might break more than it fixes.

On Tue, Mar 20, 2018 at 6:33 PM, Wyn Price notifications@github.com wrote:

@darthvader45 https://github.com/darthvader45 one thing you should notice, is that one way glass works on some blocks, but not others. This supports my theory that BF redirects rendering stuff. [image: 2018-03-20_22 32 29] https://user-images.githubusercontent.com/15876682/37686299-bda9c70e-2c8e-11e8-8aea-84d4cbb40eb3.png [image: image] https://user-images.githubusercontent.com/15876682/37686290-b612ee08-2c8e-11e8-919a-a7fa95cb2f95.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AbrarSyed/SecretRoomsMod-forge/issues/237#issuecomment-374780224, or mute the thread https://github.com/notifications/unsubscribe-auth/ACr5pEAi--f8vEK11cwYG7M4PAXjNrdrks5tgYPSgaJpZM4SydiJ .

-- Golden rule in Minecraft: Never dig straight down.