jabelar / MovingLightSource-1.12

Jabelar's Moving Light Sources Mod
https://minecraft.curseforge.com/projects/jabelars-moving-light-sources
4 stars 2 forks source link

Held light sources trigger block updates. #21

Open Rimevel opened 6 years ago

Rimevel commented 6 years ago

Not sure if this is intended or not. But when I walk under a sand/gravel overhang it collapses by simply holding a torch or similar light source in my hand.

jabelar commented 6 years ago

Thanks for reporting this. Not intended. Let me see what it is about the block triggers it.

jabelar commented 6 years ago

Okay, I looked into it. Basically my mod creates blocks that act as air (due to having Material.AIR) which mostly makes it not affect anything like fluids flowing in, suffocation, ray-tracing and so forth. However, it is still a block which triggers a "block update" which can trigger gravity-affected blocks to fall.

I have a couple ideas on how to fix this, but might be pretty hard. The whole "sand overhang" thing is a precarious business as you know -- anything that constitutes a block update can trigger an avalanche. I can pretty easily prevent the block from falling immediately, but when the light goes away and is replaced with actual air that might be tricky.

Rimevel commented 6 years ago

Maybe if the block adjacent to the space you place it in is sand or similar, place the "light block" one block down?

CREEATION commented 5 years ago

Maybe if the block adjacent to the space you place it in is sand or similar, place the "light block" one block down?

This wouldn't solve the root problem. Mushrooms also just "pop" out off the ground if you walk near them in caves, for example. There are too many special cases you would have to consider. (I guess?)

Laike-Endaril commented 5 years ago

Maybe if the block adjacent to the space you place it in is sand or similar, place the "light block" one block down?

This wouldn't solve the root problem. Mushrooms also just "pop" out off the ground if you walk near them in caves, for example. There are too many special cases you would have to consider. (I guess?)

Yes, there are far too many special cases to just use an offset, especially if you want cross-mod compatibility. Preventing the block update from happening is the best approach, which is probably going to involve either a custom method for swapping the blocks out, or an approach that doesn't use a block replacement at all

Good luck, Jabelar!

Edit: Oh spoot. Looks like Jabelar's been inactive since October of 2018. Here's to hoping he comes back to it at some point, then

GeminiMarshdevil commented 5 years ago

a possible fix for this is making a follower entity, like an invisible creeper that simply follows you around that happens to be emitting light? not sure if this is possible....

Laike-Endaril commented 5 years ago

I think the main issue is that the lighting engine itself uses light levels attached to blocks. I haven't delved into altering light levels yet, so I can't really say much more than that. I don't know if you can alter light levels without changing the block itself or not (but if you can, then you can probably do it without adding an extra entity for it)