Skip to content

Commit

Permalink
Bentobox 1.14 api
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Jun 11, 2020
1 parent 3f92772 commit 6266ffe
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 20 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
<java.version>1.8</java.version>
<powermock.version>2.0.2</powermock.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.14.4-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.12.0</bentobox.version>
<spigot.version>1.15.2-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.14.0-SNAPSHOT</bentobox.version>
<!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision>
<!-- This allows to change between versions and snapshots. -->
<build.version>1.0.2</build.version>
<build.version>1.1.0</build.version>
<build.number>-LOCAL</build.number>
</properties>

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/world/bentobox/greenhouses/data/Greenhouse.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.google.gson.annotations.Expose;

import world.bentobox.bentobox.database.objects.DataObject;
import world.bentobox.bentobox.database.objects.Table;
import world.bentobox.greenhouses.greenhouse.BiomeRecipe;
import world.bentobox.greenhouses.greenhouse.Walls;
import world.bentobox.greenhouses.managers.RecipeManager;
Expand All @@ -21,6 +22,7 @@
* @author tastybento
*
*/
@Table(name = "Greenhouses")
public class Greenhouse implements DataObject {

@Expose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private void loadGreenhouses() {
*/
public void saveGreenhouses() {
addon.log("Saving greenhouses...");
map.getGreenhouses().forEach(handler::saveObject);
map.getGreenhouses().forEach(handler::saveObjectAsync);
}

/**
Expand Down Expand Up @@ -175,7 +175,7 @@ public GhResult tryToMakeGreenhouse(Location location, BiomeRecipe greenhouseRec
finder.getGh().setBiomeRecipe(greenhouseRecipe);
resultSet.add(map.addGreenhouse(finder.getGh()));
activateGreenhouse(finder.getGh());
handler.saveObject(finder.getGh());
handler.saveObjectAsync(finder.getGh());
}
return new GhResult().setFinder(finder).setResults(resultSet);
}
Expand All @@ -187,7 +187,7 @@ public GhResult tryToMakeGreenhouse(Location location, BiomeRecipe greenhouseRec
// Success - set recipe and add to map
finder.getGh().setBiomeRecipe(r);
activateGreenhouse(finder.getGh());
handler.saveObject(finder.getGh());
handler.saveObjectAsync(finder.getGh());
return map.addGreenhouse(finder.getGh());
}).orElse(GreenhouseResult.FAIL_NO_RECIPE_FOUND));
return new GhResult().setFinder(finder).setResults(resultSet);
Expand Down
17 changes: 3 additions & 14 deletions src/main/resources/addon.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
name: Greenhouses
main: world.bentobox.greenhouses.Greenhouses
version: ${version}${build.number}
api-version: 1.14

authors: tastybento

softdepend: AcidIsland, BSkyBlock, SkyGrid

permissions:
bskyblock.greenhouses.player:
'[gamemode].greenhouses.player':
description: Gives access to player commands
default: true
bskyblock.greenhouses.admin:
description: Gives access to admin commands
default: op
acidisland.greenhouses.player:
description: Gives access to player commands
default: true
acidisland.greenhouses.admin:
description: Gives access to admin commands
default: op
skygrid.greenhouses.player:
description: Gives access to player commands
default: true
skygrid.greenhouses.admin:
'[gamemode].greenhouses.admin':
description: Gives access to admin commands
default: op

0 comments on commit 6266ffe

Please sign in to comment.