Discussion in 'Plugin Development' started by mouz_, Dec 14, 2015.
@timtower What about getting locations from strings when enabling?
@mouz_ You make a similar loop. You parse what is in the string to ints and floats and a world. Then you create a Location out of that.
I have no idea how to do it.
1. Get the string list from the config
2. Iterate it
3. Split it by "/"
4. Construct a new Location object from the split
5. Add each Location to a List
How to do it?
What part you don't understand of what @Mrs. bwfctower said?
1. Get the string list from the config - You have this, I'm sure
2. Iterate it - You probably can do this, if you know foreach loops or iterators
3. Split it by "/" - Simple split
4. Construct a new Location object from the split - location.x = strings, location.y = strings...
5. Add each Location to a List - I'm pretty sure you know this one too
What part you don't understand in "HOW to do it?"?
I don't know what "iterate it" is.
You don't need to be offensive.
@mcdorli You don't need to be offensive.
So how to use it? I don't know english very much to understand this document.
If English is not you native language, use this. This should at-least be enough for you to understand what it is and (hopefully) how to use it.
BTW: Whenever you don't fully understand something, I believe we have a site that will help.
I never was offensive. I asked something because I wanted to give you a in-depth explanation of it.
Was I offensive?
I don't know how to do it, so explanations won't help.
Then I'm basically done here.
I guess it's my turn to step in:
This is a tutorial on how to use Iterators. I found within ~10 seconds by using google. (Oh, the simple problems that site can fix)
Remember, learn what you're doing. Don't just scroll to the bottom and Copy-&-Paste.
One question here: I never understood, what iterators are good for (Don't misunderstand me, I use them), you can use a foreach loop, to go trough all elements of an arrayList, aren't you?
"Iterator enables you to cycle through a collection, obtaining or removing elements."
It's s a nice easy way to loop through a collection and offers the ability to modify while looping. While a foreach loop would through a CME if you tried to remove/add an element with it.
"ListIterator extends Iterator to allow bidirectional traversal of a list"
It also allows you to travel both directions, you can do Iterator#previous() to get the previous element rather than just going forward.
Can you tell me how to do it exactly?
@mouz_ If you don't understand how then you are doing something out of your reach.
Scale down your plugins, take a step back, get into basic serialization / deserialization before you continue, doesn't even has to be on Bukkit, plain java would do.
@mouz_ And while you're at it, just learn Java from the start, and don't jump into Bukkit. Trust me, you'll have a much, much, much better time making plugins if you truly know Java.
I'm curious why you just can't help me, when I'm asking for help.
We have helped you. In fact, we've created over 10 pages of help for you, just look at all of your other 6 threads about this.
That is because you are asking help for pretty basic things, things that you should have done already. Outside Bukkit.
You don't understand most instructions that we give you.
In other words: you are trying to so more than you can.
If you really want this plugin: try the plugin requests section, ask for the plugin there.
If you want to learn to make Bukkit plugins: please get your basic java knowledge up to a higher level, then start with a smaller and simpler plugin.
It just doesn't seem like a Mouz_ thread without this link:
You can either go to an online tutorial site through this link, or find out which books to pick up about Java.
We have been trying to help you all this time, even if you might have not seen it that way throughout these past few threads.
@Zombie_Striker I don't know why my post "@Zombie_Striker please don't write in my threads." was not accepted.
Why you can't tell me this if this is so simple and basic?
@mouz_ Because this is a free forum, he can respond if he wants to.
And because you should be able to do it yourself. Read the links that we posted.
Do what we told you many times before.
There is a border between helping somebody and writing the code for him. You crossed from asking for help to asking for code.
Why can't you write couple lines of plugin to help me?
Because we gave you over 1000+ lines to read, that solve these problems.
Because the only reason to write the code for you is that you just don't want to do it. We have told you again and again what you have to do. We provided links that tell you why you have to do those things. If you read those links and what we posted, you should understand what you need to do and how to do it.
We try not to spoonfeed on this forum because it serves no purpose but create more problems down the line.
Spoonfeeding may teach bad practices.
Spoonfeeding does not guarantee that the person receiving the code will Completely understand why it works.
Spoonfeeding does not guarantee that the person will use the code correctly.
Spoonfeeding does not always work/fix the problem.
If used incorrectly, Spoonfeeding can create more problems, and as such, more threads.
This may be my last post here, (I will be the fourth member that has stopped helping you) so keep in mind the main reason why any of us are here is because we want to help, it only up to you if you will accept it.
What part you don't understand in "@Zombie_Striker please, don't write in my threads"?
I am trying, if you can't see this you are blind. Look at the beginning of my thread. I did almost anything, and I'm asking just for code for 1 thing.
@mouz_ You asked a lot of times for the same thing. You got plenty of answers yet you aren't able to split a string.
Make a plugin that is easier, step away from this idea for now.
Separate names with a comma.