# Getting all locations between two locations

Discussion in 'Spigot Plugin Development' started by jimbo8, May 16, 2015.

1. ### jimbo8

Hi there!

So, I am currently developing a hidden feature for me and my girlfriend; whenever we get within 5 blocks of radius, a line of hearts are going to occur between us. Now, to do this, I need to get the locations(XYZ) within the two locations, without the location being a square, because it is supposed to be a line, not a bunch of hearts in a square.

I have tried with vectors, though you cannot convert vectors to XYZ-coordinates, which is needed to spawn particles.

Any ideas? Thanks!

• Creative x 3
2. ### jimbo8

@dxdy

Oh, I didnt' know that I could retrieve the vector's actual location, and not only the vector position. How would I do this, what are the methods called? Any pseudo code?

Thanks for such an fast answer.

3. ### jimbo8

@dxdy

Well, I am atleast one step closer.

Though, the Vector#toLocation-method does not return as an array or an list; how would I then get all the locations inbetween if I don't have a list of locations to go through?

4. ### jimbo8

@dxdy

Thank you so much, works like a charm!

Now, to a bit different question; do you know if it is possible to make the hearts not go upwards like they usually do?

Because now, it looks like this:

and I want it to only be one heart, if that makes sense. Not make it look like a billion trillion hearts on top of eachother.

5. ### jimbo8

@dxdy

I want to stop all the hearts from drifting upwards. It makes it look really weird.

6. ### jimbo8

@dxdy

Yeah, that's the point; I want to have a constant line of hearts between us, but if I wait 20 ticks, then the hearts appear a way too rarely.

Eventually, sending only one heart from me to her or vice-versa could be a solution to this, that would be even nicer, actually.

Edit: Doing that would still make the heart go upwards every time we move it one location forward, though.

Sorry for the unrelated comment, but this is probably the smartest and sweetest things I've ever seen.

She's a keeper

• Agree x 2
• Like x 1
8. ### jimbo8

Thanks!

This is how it ended:

Thanks everyone! <3

• Like x 3
• Friendly x 2
9. ### greaperc4

Hey @jimbo8,

Could you post the code of how you solved this ?

Thanks !

• Like x 1
10. ### boolean

Necro much? This from May 17th 2015..

• Agree x 1
11. ### Assossa

Don't necro something this old, just PM the guy please.

12. ### greaperc4

Sorry didn't know it was such a deal if someone asked for something

13. ### Assossa

Asking questions isn't a bad thing, but this thread is a year old, posting in it brings it back to the top of the thread list.

• Agree x 1
14. ### boolean

Next time you "don't know" if something is such a big deal (Especially necro'ing something from over a YEAR ago) Check the forum rules? Bumping something from that long ago takes it RIGHT to the top of the list, rendering it useless since the OP got required assistance when it actually mattered. PM the guy next time, rather than taking a thread-spot for a question that can very easily, be done in PM.

Edit: Ninja'd by @Assossa ;-;

15. ### BillyGalbreath

Its not considered necro if the question is related to the OP....

Necro is coined for reviving things that shouldnt be revived, like a solved help thread getting necro'd a year later with an answer...

You "necro haters" cause more bumping damage than any actual necro ever does...

• Agree x 6
16. ### Assossa

Oh, never knew that, thanks. I just thought it was a question better asked via PM than bumping an old thread.

17. ### BillyGalbreath

Imagine if something like StackOverflow locked "old" threads or got mad at "necros"... We'd all be in a world of shit because all the comments and answers we're looking for would get so segregated it would be impossible to find anything useful

Thats why I am against thread locking on this forum, and why I defend "necros".

Example: The other day someone asked a question, someone else answered it with a b.s. answer. The asker accepted that as an answer, marked the thread as solved, and locked it. I spent 15 minutes writing up a great answer that covered typical use cases and issues that might arise from each, etc etc, but it was locked by the time i could answer.

Things like that happen because of the "necro is bad" mentality.

And how about the people that actually do use google or the site search feature? I cant tell you how many threads of a particular subject I've found that contain old information and deserve an updated answer to the times. Some I am able to do, but a lot I cannot because they've been locked. Locked threads means stale information means the people actually searching for answers dont get the answers. New threads need to be made, which is completely stupid because someone is going to yell at them to use the search feature... Which they did...

Just bringing awareness.

#17
Last edited: May 4, 2016
• Winner x 6