How to use as a dependency?
Closed this issue · 16 comments
I would like to determine whether or not an entity is inside a cloud. How can I do this?
Temporally, you can use cursemaven https://www.cursemaven.com/, add a SFCR file link which provided by curseforge in build.gradle.
Try to use fabric.com.rimo.sfcr.xxx
or forge.com.rimo.sfcr.xxx
to access class.
Forgix addon merged two of their code into one jar by adding a platform prefix. If your project use package name without this prefix, it won't work in ordinary gameplay.
As a reference of how to transform a cloudblock pos into blockpos. (Entity pos is blockpos)
This means I would have to duplicate my logic for each platform, right? Considering I have no access to common
classes?
I don't really mind that, but I want to make sure there's not something I'm unaware of.
How do I grab the scrollX
and scrollZ
used in these calculations? And is there a way to get the existing cloud data without recalculating the samples?
This means I would have to duplicate my logic for each platform, right? Considering I have no access to
common
classes?I don't really mind that, but I want to make sure there's not something I'm unaware of.
Yes, use fabric
prefix if your project in fabric, elsewise forge
, or just make a ExpectPlatform` method if you use Architectury.
How do I grab the
scrollX
andscrollZ
used in these calculations? And is there a way to get the existing cloud data without recalculating the samples?
My sorry that you may need to calculate it by yourself for now... See in
I want to make some public method to access cloud data in future version, but it'll no soon.
Ok, thank you very much!
Hmm, the cloud data is supposed to synchronize from server to client, right? What do xScroll
and zScroll
do then, if it looks like they're per-player? (i.e. how do I do the query server-side?)
My plan depends on every player being able to see the same (or at least close enough to the same) clouds.
Ah, I see. The math cancels out between px
including scrollX
and getCloudSample
removing it.
Send whole cloud data will consume lots of network. I've only synchronized sample seed (and most config which affect to visual) and total (and partial) z-offset from server to client. Cloud data calculate by client itself based on these two values.
Yep, I have something that works well now. I've had to reimplement getDensity
and getThreshold
, but it works very well.
Is there any way I can force certain configuration values? I want to make sure
- "Biome Detect From Chunk" is forced on, so that clouds are location-based and not player based
- "Sync With Server" is forced on, so that whatever the server has set is synced to all clients
I've had to run /sfcr sync full
manually on each client, but I'm assuming I can just force that to happen by adding my own network handler that runs the command (on join?).
I think you can call .sfcr.SFCReMod.COMMON_CONFIG.setBiomeDensityUseLoadedChunk(true)
to force turn it on when player join and close config screen (to anti-editing :D
"Sync with Server"? Call .setEnableServerConfig(true)
Oh you make a mod that make player can standing on clouds? Awesome!
Not standing on, but fishing from 😄
I'm going to see if I can make the server send the client way more biome data; considering I'm forcing configuration sync, I should be able to send the full render distance of the cloud plane to the client, right? Then I shouldn't have to force UseLoadedChunk
?
Maybe.
Since players have different position, they'll have different loaded chunk. So players from different positions will get different results when looking at the same cloud. Unless you turn off biome affect, or limit cloud render distance to chunk load distance.