mirror of
https://github.com/BentoBoxWorld/Level.git
synced 2025-03-12 22:49:03 +01:00
Update to 1.14 BentoBox API
Uses shorter table names in SQL databases. Uses async saving methods.
This commit is contained in:
parent
0a768b0648
commit
f78b2c8231
4
pom.xml
4
pom.xml
@ -59,13 +59,13 @@
|
|||||||
<powermock.version>2.0.2</powermock.version>
|
<powermock.version>2.0.2</powermock.version>
|
||||||
<!-- More visible way how to change dependency versions -->
|
<!-- More visible way how to change dependency versions -->
|
||||||
<spigot.version>1.15.2-R0.1-SNAPSHOT</spigot.version>
|
<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 variable removes warning about dynamic version -->
|
||||||
<revision>${build.version}-SNAPSHOT</revision>
|
<revision>${build.version}-SNAPSHOT</revision>
|
||||||
<!-- Do not change unless you want different name for local builds. -->
|
<!-- Do not change unless you want different name for local builds. -->
|
||||||
<build.number>-LOCAL</build.number>
|
<build.number>-LOCAL</build.number>
|
||||||
<!-- This allows to change between versions. -->
|
<!-- This allows to change between versions. -->
|
||||||
<build.version>2.0.0</build.version>
|
<build.version>2.1.0</build.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- Profiles will allow to automatically change build version. -->
|
<!-- Profiles will allow to automatically change build version. -->
|
||||||
|
@ -307,7 +307,7 @@ public class Level extends Addon {
|
|||||||
private void save(){
|
private void save(){
|
||||||
// Remove any potential null values from the cache
|
// Remove any potential null values from the cache
|
||||||
levelsCache.values().removeIf(Objects::isNull);
|
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
|
// Add to cache
|
||||||
levelsCache.put(targetPlayer, ld);
|
levelsCache.put(targetPlayer, ld);
|
||||||
topTen.addEntry(world, targetPlayer, getIslandLevel(world, targetPlayer));
|
topTen.addEntry(world, targetPlayer, getIslandLevel(world, targetPlayer));
|
||||||
handler.saveObject(ld);
|
handler.saveObjectAsync(ld);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -193,7 +193,7 @@ public class TopTen implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void saveTopTen() {
|
public void saveTopTen() {
|
||||||
topTenList.values().forEach(handler::saveObject);
|
topTenList.values().forEach(handler::saveObjectAsync);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,9 @@ import org.bukkit.World;
|
|||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
import world.bentobox.bentobox.database.objects.DataObject;
|
import world.bentobox.bentobox.database.objects.DataObject;
|
||||||
|
import world.bentobox.bentobox.database.objects.Table;
|
||||||
|
|
||||||
|
@Table(name = "LevelsData")
|
||||||
public class LevelsData implements DataObject {
|
public class LevelsData implements DataObject {
|
||||||
|
|
||||||
// uniqueId is the player's UUID
|
// uniqueId is the player's UUID
|
||||||
|
@ -11,12 +11,14 @@ import org.eclipse.jdt.annotation.Nullable;
|
|||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
import world.bentobox.bentobox.database.objects.DataObject;
|
import world.bentobox.bentobox.database.objects.DataObject;
|
||||||
|
import world.bentobox.bentobox.database.objects.Table;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class stores and sorts the top ten.
|
* This class stores and sorts the top ten.
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@Table(name = "TopTenData")
|
||||||
public class TopTenData implements DataObject {
|
public class TopTenData implements DataObject {
|
||||||
|
|
||||||
// UniqueId is the world name
|
// UniqueId is the world name
|
||||||
|
@ -2,6 +2,7 @@ name: Level
|
|||||||
main: world.bentobox.level.Level
|
main: world.bentobox.level.Level
|
||||||
version: ${version}${build.number}
|
version: ${version}${build.number}
|
||||||
icon: DIAMOND
|
icon: DIAMOND
|
||||||
|
api-version: 1.14
|
||||||
|
|
||||||
softdepend: AcidIsland, BSkyBlock, CaveBlock, AOneBlock, SkyGrid
|
softdepend: AcidIsland, BSkyBlock, CaveBlock, AOneBlock, SkyGrid
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user