Skip to content

Commit

Permalink
Removed admin commands
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Jan 17, 2021
1 parent 0397f8f commit 01a5548
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 216 deletions.
2 changes: 0 additions & 2 deletions src/main/java/world/bentobox/greenhouses/Greenhouses.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import world.bentobox.bentobox.api.flags.Flag.Type;
import world.bentobox.greenhouses.managers.GreenhouseManager;
import world.bentobox.greenhouses.managers.RecipeManager;
import world.bentobox.greenhouses.ui.admin.AdminCmd;
import world.bentobox.greenhouses.ui.user.UserCommand;

/**
Expand Down Expand Up @@ -72,7 +71,6 @@ public void onEnable() {
.forEach(gm -> {
// Register command
gm.getPlayerCommand().ifPresent(playerCmd -> new UserCommand(this, playerCmd));
gm.getAdminCommand().ifPresent(playerCmd -> new AdminCmd(this, playerCmd));
// Log
this.log("Hooking into " + gm.getDescription().getName());
// Store active world
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public CompletableFuture<Set<GreenhouseResult>> find(Location location) {
// Find the roof
Roof roof = new Roof(cache, location);
roof.findRoof().thenAccept(found -> {
if (!found) {
if (Boolean.FALSE.equals(found)) {
result.add(GreenhouseResult.FAIL_NO_ROOF);
r.complete(result);
return;
Expand All @@ -68,7 +68,7 @@ public CompletableFuture<Set<GreenhouseResult>> find(Location location) {
gh.setOriginalBiome(location.getBlock().getBiome());

// Now check to see if the floor really is the floor and the walls follow the rules
checkGreenhouse(cache, gh, roof, walls).thenAccept(c -> {
checkGreenhouse(cache, roof, walls).thenAccept(c -> {
result.addAll(c);
r.complete(result);
});
Expand All @@ -86,13 +86,13 @@ public CompletableFuture<Set<GreenhouseResult>> find(Location location) {
* @param walls - walls object
* @return future set of Greenhouse Results
*/
CompletableFuture<Set<GreenhouseResult>> checkGreenhouse(AsyncWorldCache cache, Greenhouse gh2, Roof roof, Walls walls) {
CompletableFuture<Set<GreenhouseResult>> checkGreenhouse(AsyncWorldCache cache, Roof roof, Walls walls) {
CompletableFuture<Set<GreenhouseResult>> r = new CompletableFuture<>();
Bukkit.getScheduler().runTaskAsynchronously(BentoBox.getInstance(), () -> checkGHAsync(r, cache, gh2, roof, walls));
Bukkit.getScheduler().runTaskAsynchronously(BentoBox.getInstance(), () -> checkGHAsync(r, cache, roof, walls));
return r;
}

private Set<GreenhouseResult> checkGHAsync(CompletableFuture<Set<GreenhouseResult>> r, AsyncWorldCache cache, Greenhouse gh2,
private Set<GreenhouseResult> checkGHAsync(CompletableFuture<Set<GreenhouseResult>> r, AsyncWorldCache cache,
Roof roof, Walls walls) {
Set<GreenhouseResult> result = new HashSet<>();
cc = new CounterCheck();
Expand Down
110 changes: 0 additions & 110 deletions src/main/java/world/bentobox/greenhouses/ui/admin/AdminCmd.java

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ public void setUp() throws Exception {
*/
@Test
public void testCheckGreenhouse() {
Greenhouse gh2 = new Greenhouse(world, walls, ROOF_HEIGHT);
gf.checkGreenhouse(cache, gh2, roof, walls).thenAccept(result -> {
gf.checkGreenhouse(cache, roof, walls).thenAccept(result -> {
assertTrue(result.isEmpty()); // Success
assertEquals(441, gf.getWallBlockCount());
assertEquals(0, gf.getWallDoors());
Expand Down

0 comments on commit 01a5548

Please sign in to comment.