#Pretty good why
1 messages · Page 1 of 1 (latest)
Ok
thinking about creative way retrive a radius of blocks
i dont want to loop thru box radius
i was thinking to use BETWEEN do you think it would work?
That's the best way though
Spatial partitioning
i would better do a single request
What's the use case
i basically on block place event want to get the blocks in 1 radius
now using x y z
which y should be between + - (1 )
Get blocks?
and x z capture corners i guess
no not blocks
i store data using x y z
as a key
I have a library for that
It lets you attach arbitrary data to any block and retrieve data
The readme has instructions for how to install it
This wiki page has usage instructions
i think we have miss understand here but wait ill check it
Let me know if you have any questions
int radius = 3;
int minX = loc.getBlockX() - radius;
int minY = loc.getBlockY() - radius;
int minZ = loc.getBlockZ() - radius;
int maxX = loc.getBlockX() + radius;
int maxY = loc.getBlockY() + radius;
int maxZ = loc.getBlockZ() + radius;
for (int x = minX; x <= maxX; ++x) {
for (int y = minY; y <= maxY; ++y) {
for (int z = minZ; z <= maxZ; ++z) {
its just what i meant
to do
using betweens lol
Yeah but you shouldn't
Not without creating an index, at least
But not with MySQL regardless
MySQL is best for cross server data
This seems like it's tied to the world
So, not cross server
oh i saw your library it looks dope
nah i return data i stored in the sql server
like do you think using betweens
i would be able to get both corners each time?
I know
That doesn't change what I said
Yes you could do it using between
I hope you're not doing it on the main thread, though?
Ok
I don't know about between
its only reason i dont stick to SQLite just because the locks if it begin used
But you can just use <= >=
Then you probably weren't using it right
i closed and opened
i just sometimes had many requests at the same time
which caused problems
and didnt use cache to put queires
Right that's why you keep a queue in another thread
And use transactions
They make it much much faster
I'm suggesting using my library because all that logic is already implemented there
If you don't want to, I understand
But it will make things easier