Hi, I'm working on a mod for deep underground survival, and am hitting a snag trying to convince underground blocks that they can see the sky and daylight when this block is any height above them. Any advice would be fantastic!
Rollback Post to RevisionRollBack
"What is done out of love always takes place beyond good and evil."
well, I could simulate the effects with vanilla blocks and entities, but that wouldn't be compatible with anything from other mods :/ got to be a way to override weather a block thinks it's in sunlight... I'll keep at it for now. Don't want to go the way of core mods...
Rollback Post to RevisionRollBack
"What is done out of love always takes place beyond good and evil."
Got it working. Turns out you need to override both isAgainstSky and canBlockSeeSky for the position of the block. I've successfuly made a sunshine block that can replace the air under my subterainian natural lightsource now.
Rollback Post to RevisionRollBack
"What is done out of love always takes place beyond good and evil."
Got it working. Turns out you need to override both isAgainstSky and canBlockSeeSky for the position of the block. I've successfuly made a sunshine block that can replace the air under my subterainian natural lightsource now.
Interesting, and that works to allow other blocks to act as though they were above-ground?
Btw, neither of those methods exists anymore in 1.8 Block class, and I didn't see any equivalent methods. Still, nice work.
The Meaning of Life, the Universe, and Everything.
Join Date:
10/20/2012
Posts:
50
Member Details
Still for mods like ic2 you won't be able to use the solar panel at night, has it looks for the word time .... Good work bro, i´m just pointing it out.
That's right, and fully intentional. I wanted a normal day/night cycle in underground pockets for balanced mechanics, like power, villages, etc.
Blocks will think they are outside as they check one block up for light information. At the moment it's a bit costly though since i'm using chunk data event to replace the values from the normal check in World. and it seems to be making ALL the lighting update more often than normal. May end up using asm after all if I can't optimize this a bit.
FYI, some modders might also use getTopSolidOrLiquidBlock in very special cases (e.g. blocks that behave differently depending on if they're above or below ground).
I've noticed many mods do weird things with crops in particular, for things like preventing/enforcing above/under ground growth with varying degrees or denying bonemeal-like items or "random tick-forcers" (e.g. XU Watering Can, OpenBlocks sprinkler), but I digress. My point is; as soon as you get into the unmanaged realm of ASM, expect to dedicate a lot more time to making your mod compatible with other mods. Forge sucks in that way, since it and Minecraft itself are undocumented and have so many different ways to do the one thing.
That should still work since the sunlight level diffuses properly. And I'm looking to avoid ASM as much as possible. If I were to use it, it would only be to insert my own hook.
Rollback Post to RevisionRollBack
"What is done out of love always takes place beyond good and evil."
That should still work since the sunlight level diffuses properly. And I'm looking to avoid ASM as much as possible. If I were to use it, it would only be to insert my own hook.
If you do go that route, consider submitting a request to Forge for the hook official. Though don't be surprised if you're ignored, flamed, or otherwise rejected.
I have higher hopes for better options in M3l than getting the hooks I need into forge. This mode is inspired by tall worlds anyway, since with infinitely deep worlds you need to be able to survive without getting back to the surface. I will rewrite it for M3l when it's out. Just trying to do it on forge with dimensions for expanded depth for the time being.
"What is done out of love always takes place beyond good and evil."
"What is done out of love always takes place beyond good and evil."
"What is done out of love always takes place beyond good and evil."
1.7.10
See World#canBlockSeeTheSky and Chunk#canBlockSeeTheSky.
1.8
See World#canBlockSeeSky and Chunk#canSeeSky
"What is done out of love always takes place beyond good and evil."
"What is done out of love always takes place beyond good and evil."
Interesting, and that works to allow other blocks to act as though they were above-ground?
Btw, neither of those methods exists anymore in 1.8 Block class, and I didn't see any equivalent methods. Still, nice work.
Blocks will think they are outside as they check one block up for light information. At the moment it's a bit costly though since i'm using chunk data event to replace the values from the normal check in World. and it seems to be making ALL the lighting update more often than normal. May end up using asm after all if I can't optimize this a bit.
"What is done out of love always takes place beyond good and evil."
I've noticed many mods do weird things with crops in particular, for things like preventing/enforcing above/under ground growth with varying degrees or denying bonemeal-like items or "random tick-forcers" (e.g. XU Watering Can, OpenBlocks sprinkler), but I digress. My point is; as soon as you get into the unmanaged realm of ASM, expect to dedicate a lot more time to making your mod compatible with other mods. Forge sucks in that way, since it and Minecraft itself are undocumented and have so many different ways to do the one thing.
"What is done out of love always takes place beyond good and evil."
If you do go that route, consider submitting a request to Forge for the hook official. Though don't be surprised if you're ignored, flamed, or otherwise rejected.
"What is done out of love always takes place beyond good and evil."