Update to 1.14 BentoBox API

Uses shorter table names in SQL databases.
Uses async saving methods.
This commit is contained in:
tastybento 2020-06-10 20:49:28 -07:00
parent 0a768b0648
commit f78b2c8231
6 changed files with 10 additions and 5 deletions

View File

@ -59,13 +59,13 @@
<powermock.version>2.0.2</powermock.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.15.2-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.9.0</bentobox.version>
<bentobox.version>1.14.0-SNAPSHOT</bentobox.version>
<!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision>
<!-- Do not change unless you want different name for local builds. -->
<build.number>-LOCAL</build.number>
<!-- This allows to change between versions. -->
<build.version>2.0.0</build.version>
<build.version>2.1.0</build.version>
</properties>
<!-- Profiles will allow to automatically change build version. -->

View File

@ -307,7 +307,7 @@ public class Level extends Addon {
private void save(){
// Remove any potential null values from the cache
levelsCache.values().removeIf(Objects::isNull);
levelsCache.values().forEach(handler::saveObject);
levelsCache.values().forEach(handler::saveObjectAsync);
}
/**
@ -330,7 +330,7 @@ public class Level extends Addon {
// Add to cache
levelsCache.put(targetPlayer, ld);
topTen.addEntry(world, targetPlayer, getIslandLevel(world, targetPlayer));
handler.saveObject(ld);
handler.saveObjectAsync(ld);
}
/**

View File

@ -193,7 +193,7 @@ public class TopTen implements Listener {
}
public void saveTopTen() {
topTenList.values().forEach(handler::saveObject);
topTenList.values().forEach(handler::saveObjectAsync);
}
}

View File

@ -9,7 +9,9 @@ import org.bukkit.World;
import com.google.gson.annotations.Expose;
import world.bentobox.bentobox.database.objects.DataObject;
import world.bentobox.bentobox.database.objects.Table;
@Table(name = "LevelsData")
public class LevelsData implements DataObject {
// uniqueId is the player's UUID

View File

@ -11,12 +11,14 @@ import org.eclipse.jdt.annotation.Nullable;
import com.google.gson.annotations.Expose;
import world.bentobox.bentobox.database.objects.DataObject;
import world.bentobox.bentobox.database.objects.Table;
/**
* This class stores and sorts the top ten.
* @author tastybento
*
*/
@Table(name = "TopTenData")
public class TopTenData implements DataObject {
// UniqueId is the world name

View File

@ -2,6 +2,7 @@ name: Level
main: world.bentobox.level.Level
version: ${version}${build.number}
icon: DIAMOND
api-version: 1.14
softdepend: AcidIsland, BSkyBlock, CaveBlock, AOneBlock, SkyGrid