mirror of
https://github.com/BentoBoxWorld/Greenhouses.git
synced 2024-11-25 12:05:55 +01:00
Fixes reporting of success.
https://github.com/BentoBoxWorld/Greenhouses/issues/68
This commit is contained in:
parent
5c583284ff
commit
07763cafdf
@ -12,7 +12,6 @@ import org.bukkit.block.Biome;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
import world.bentobox.bentobox.BentoBox;
|
|
||||||
import world.bentobox.bentobox.api.events.BentoBoxReadyEvent;
|
import world.bentobox.bentobox.api.events.BentoBoxReadyEvent;
|
||||||
import world.bentobox.bentobox.database.Database;
|
import world.bentobox.bentobox.database.Database;
|
||||||
import world.bentobox.bentobox.database.objects.Island;
|
import world.bentobox.bentobox.database.objects.Island;
|
||||||
@ -170,9 +169,7 @@ public class GreenhouseManager implements Listener {
|
|||||||
}
|
}
|
||||||
// Check if the greenhouse meets the requested recipe
|
// Check if the greenhouse meets the requested recipe
|
||||||
if (greenhouseRecipe != null) {
|
if (greenhouseRecipe != null) {
|
||||||
checkRecipe(finder, greenhouseRecipe, resultSet).thenAccept(rs -> {
|
checkRecipe(finder, greenhouseRecipe, resultSet).thenAccept(r::complete);
|
||||||
r.complete(rs);
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Try ordered recipes
|
// Try ordered recipes
|
||||||
@ -208,9 +205,9 @@ public class GreenhouseManager implements Listener {
|
|||||||
list.remove(0);
|
list.remove(0);
|
||||||
br.checkRecipe(finder.getGh()).thenAccept(results -> {
|
br.checkRecipe(finder.getGh()).thenAccept(results -> {
|
||||||
if (results.isEmpty()) {
|
if (results.isEmpty()) {
|
||||||
findRecipe(r, list, finder);
|
r.complete(Collections.singleton(GreenhouseResult.SUCCESS));
|
||||||
} else {
|
} else {
|
||||||
r.complete(results);
|
findRecipe(r, list, finder);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -232,6 +229,7 @@ public class GreenhouseManager implements Listener {
|
|||||||
resultSet.add(map.addGreenhouse(finder.getGh()));
|
resultSet.add(map.addGreenhouse(finder.getGh()));
|
||||||
activateGreenhouse(finder.getGh());
|
activateGreenhouse(finder.getGh());
|
||||||
handler.saveObjectAsync(finder.getGh());
|
handler.saveObjectAsync(finder.getGh());
|
||||||
|
rs.addAll(resultSet);
|
||||||
}
|
}
|
||||||
GhResult recipe = new GhResult().setFinder(finder).setResults(rs);
|
GhResult recipe = new GhResult().setFinder(finder).setResults(rs);
|
||||||
r.complete(recipe);
|
r.complete(recipe);
|
||||||
|
Loading…
Reference in New Issue
Block a user