I'm currently doing a job plugin, but something has happened that has never happened to me… If I restart the server or the plugin with / plugman reload jobs reload, this query no longer works:
if (Main.cfg. Get (p.getUniqueId (). ToString () + ". Ancillary")! = "Farmer") {
if (Main.cfg. Get (p.getUniqueId (). ToString () + ". Main job")! = "Farmer") {
What do I do now? Does somebody has any idea? Everything is saved in the config.
Farmer is inside for main job AND side job, but somehow these queries are ignored…
Have you ever tried to send messages to test whether it is really skipped or what the plugin says there?
Endivie04 you can send me your DC name because my main account TImeCode has been blocked
You don't compare strings with ==, but with .equals (). So in your case it would be:
if (! Main.cfg. Get (p.getUniqueId (). ToString () + ". Main job"). Equals ("Farmer")) {
// Do Something
}
OK
But it still doesn't work
And you are sure that "Main.cfg.get" really returns "Farmer"?
It doesn't matter what you have somewhere in the config, but what the get method actually returns. Look at this.
If the correct "farmer" comes back, the negation in the If is wanted and an equals does not bring any improvement, then the error will probably be somewhere else.
Yes, 100%
That means you had the result of the get method written to a variable and output or checked by debugging? Before you do that, you are not 100% sure.
And no, that's not supposed to be smart, that's experience. The "best" mistakes are usually where you were 100% sure that everything was working correctly.
Entity303 # 5908
How do you manage to have your account blocked? XD