Skip to content

Commit 1eea7e5

Browse files
authored
Merge pull request #345 from BentoBoxWorld/develop
Release 2.18.0
2 parents 7a8df69 + 8390800 commit 1eea7e5

File tree

16 files changed

+749
-583
lines changed

16 files changed

+749
-583
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ jobs:
1111
name: Build
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515
with:
1616
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
17-
- name: Set up JDK 17
18-
uses: actions/setup-java@v3
17+
- name: Set up JDK 21
18+
uses: actions/setup-java@v4
1919
with:
2020
distribution: 'adopt'
21-
java-version: 17
21+
java-version: '21'
2222
- name: Cache SonarCloud packages
23-
uses: actions/cache@v3
23+
uses: actions/cache@v4
2424
with:
2525
path: ~/.sonar/cache
2626
key: ${{ runner.os }}-sonar
2727
restore-keys: ${{ runner.os }}-sonar
2828
- name: Cache Maven packages
29-
uses: actions/cache@v3
29+
uses: actions/cache@v4
3030
with:
3131
path: ~/.m2
3232
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@
5050
<properties>
5151
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
5252
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
53-
<java.version>17</java.version>
53+
<java.version>21</java.version>
5454
<!-- Non-minecraft related dependencies -->
5555
<powermock.version>2.0.9</powermock.version>
5656
<!-- More visible way how to change dependency versions -->
5757
<spigot.version>1.21.3-R0.1-SNAPSHOT</spigot.version>
58-
<bentobox.version>2.7.1-SNAPSHOT</bentobox.version>
58+
<bentobox.version>3.2.4-SNAPSHOT</bentobox.version>
5959
<!-- Warps addon version -->
6060
<warps.version>1.12.0</warps.version>
6161
<!-- Visit addon version -->
@@ -67,7 +67,7 @@
6767
<!-- Do not change unless you want different name for local builds. -->
6868
<build.number>-LOCAL</build.number>
6969
<!-- This allows to change between versions. -->
70-
<build.version>2.17.1</build.version>
70+
<build.version>2.18.0</build.version>
7171
<sonar.projectKey>BentoBoxWorld_Level</sonar.projectKey>
7272
<sonar.organization>bentobox-world</sonar.organization>
7373
<sonar.host.url>https://sonarcloud.io</sonar.host.url>

src/main/java/world/bentobox/level/Level.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public void onEnable() {
106106
// Register listeners
107107
this.registerListener(new IslandActivitiesListeners(this));
108108
this.registerListener(new JoinLeaveListener(this));
109-
this.registerListener(new MigrationListener(this));
109+
this.registerListener(new MigrationListener(this));
110110

111111
// Register commands for GameModes
112112
registeredGameModes.clear();

src/main/java/world/bentobox/level/LevelsManager.java

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import world.bentobox.level.events.IslandLevelCalculatedEvent;
3131
import world.bentobox.level.events.IslandPreLevelEvent;
3232
import world.bentobox.level.objects.IslandLevels;
33-
import world.bentobox.level.objects.LevelsData;
3433
import world.bentobox.level.objects.TopTenData;
3534
import world.bentobox.level.util.CachedData;
3635

@@ -67,38 +66,6 @@ public LevelsManager(Level addon) {
6766

6867
}
6968

70-
public void migrate() {
71-
Database<LevelsData> oldDb = new Database<>(addon, LevelsData.class);
72-
oldDb.loadObjects().forEach(ld -> {
73-
try {
74-
UUID owner = UUID.fromString(ld.getUniqueId());
75-
// Step through each world
76-
ld.getLevels().keySet().stream()
77-
// World
78-
.map(Bukkit::getWorld).filter(Objects::nonNull)
79-
// Island
80-
.map(w -> addon.getIslands().getIsland(w, owner)).filter(Objects::nonNull).forEach(i -> {
81-
// Make new database entry
82-
World w = i.getWorld();
83-
IslandLevels il = new IslandLevels(i.getUniqueId());
84-
il.setInitialLevel(ld.getInitialLevel(w));
85-
il.setLevel(ld.getLevel(w));
86-
il.setMdCount(ld.getMdCount(w));
87-
il.setPointsToNextLevel(ld.getPointsToNextLevel(w));
88-
il.setUwCount(ld.getUwCount(w));
89-
// Save it
90-
handler.saveObjectAsync(il);
91-
});
92-
// Now delete the old database entry
93-
oldDb.deleteID(ld.getUniqueId());
94-
} catch (Exception e) {
95-
addon.logError("Could not migrate level data database! " + e.getMessage());
96-
e.printStackTrace();
97-
return;
98-
}
99-
});
100-
}
101-
10269
/**
10370
* Add an island to a top ten
10471
*
@@ -289,6 +256,7 @@ public IslandLevels getLevelsData(@NonNull Island island) {
289256
if (ld != null) {
290257
levelsCache.put(id, ld);
291258
} else {
259+
// Clean up just in case
292260
handler.deleteID(id);
293261
levelsCache.put(id, new IslandLevels(id));
294262
}

0 commit comments

Comments
 (0)