Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.14.0 #317

Closed
wants to merge 117 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
0ce89de
Version 2.7.1
tastybento Jul 3, 2021
383ede3
Version 2.7.2
tastybento Jul 11, 2021
4661bcd
Use Java 9's takeWhile
tastybento Jul 24, 2021
76a2688
Added placeholder %Level_[gamemode]_rank_value
tastybento Jul 24, 2021
d55f66f
No save on disable (#231)
tastybento Aug 8, 2021
bd6c264
Rosestacker (#232)
tastybento Aug 10, 2021
7b6f921
Made plugin a Pladdon.
tastybento Aug 15, 2021
b16d458
Version 2.8.0
tastybento Sep 6, 2021
1b29f7f
Added new placeholders
tastybento Sep 6, 2021
d212fce
Update to BentoBox API 1.18
tastybento Oct 2, 2021
9b8bbda
Open up modules for testing access.
tastybento Oct 2, 2021
4c59d4d
Back support for BentoBox 1.16.5.
tastybento Oct 5, 2021
60f2a26
Merge branch 'master' into develop
tastybento Oct 16, 2021
1161808
Version 2.8.1
tastybento Nov 21, 2021
b1d117d
Speeds up level calculation by doing more chunk scans async.
tastybento Nov 22, 2021
893d8d4
Merge branch 'develop' of https://github.com/BentoBoxWorld/Level.git …
tastybento Nov 22, 2021
4de5b80
add Vietnamese (#240)
HSGamer Nov 26, 2021
cc977d8
Raw island level placeholder (#241)
Rubenicos Nov 26, 2021
50074ac
Merge branch 'master' into develop
tastybento Nov 26, 2021
4a21e4b
Changed IslandLevelCalculator minHeight to world minHeight for negati…
Pirgosth Dec 19, 2021
5ce7179
Version 2.9.0
tastybento Dec 25, 2021
7e92a45
Merge branch 'master' into develop
tastybento Dec 25, 2021
cbaf14e
Chinese Translation (#249)
gitlocalize-app[bot] Jan 2, 2022
34da24d
Translate id.yml via GitLocalize (#250)
gitlocalize-app[bot] Jan 2, 2022
840a8c1
Translate fr.yml via GitLocalize (#251)
gitlocalize-app[bot] Jan 2, 2022
488c6ac
Korean translation (#252)
gitlocalize-app[bot] Jan 2, 2022
322ea82
German Translation (#253)
gitlocalize-app[bot] Jan 2, 2022
6f174e2
Translate hu.yml via GitLocalize (#254)
gitlocalize-app[bot] Jan 2, 2022
a3d06ee
Version 2.9.1
tastybento Jan 29, 2022
336e8d4
Attempt to handle WildStacker spawners
tastybento Jan 29, 2022
490fe6c
Merge branch 'develop' of https://github.com/BentoBoxWorld/Level.git …
tastybento Jan 29, 2022
5d9aa00
Fix error lon loading id locale
tastybento Feb 6, 2022
0a79b7f
Avoid async chunk snapshotting.
tastybento Feb 6, 2022
e16fad8
Update to BentoBox API 1.20.
BONNe Mar 12, 2022
43fcde5
Fixes some small issues with TopLevelPanel
BONNe Mar 13, 2022
15ff515
Implement customizable DetailsPanel.
BONNe Mar 13, 2022
eb8c105
Fix failing test.
BONNe Mar 13, 2022
d9288c7
Remove blank file
tastybento Mar 19, 2022
fcf6e76
Added repo for maven plugin snapshots
tastybento Mar 19, 2022
4948689
Implement feature that allows to sort items in detail panel. (#259)
BONNe Jun 16, 2022
1914fc1
Implement calculated value for blocks. (#260)
BONNe Jun 16, 2022
cc90579
Update es.yml (#261)
KrazyxWolf Jun 16, 2022
47053fd
Implement customizable Values GUI. (#262)
BONNe Jun 17, 2022
90ae98e
Support for AdvancedChests was updated. (#266)
DeadSilenceIV Jul 14, 2022
dae3db6
Implements visit/warp actions in top gui
BONNe Aug 21, 2022
2ca4e0a
Fixes a Level addon crash on startup.
BONNe Aug 21, 2022
3269063
Translate pl.yml via GitLocalize (#269)
gitlocalize-app[bot] Aug 27, 2022
97d9522
Translate fr.yml via GitLocalize (#272)
gitlocalize-app[bot] Oct 31, 2022
51338d2
Update to Java 17
tastybento Nov 27, 2022
3988659
Update Github workflow to Java 17
tastybento Nov 27, 2022
f3ee8a3
Adds %Level_[gamemode]_island_level_max% placeholder
tastybento Nov 27, 2022
93869cb
Only shows Members or higher in the top members placeholder
tastybento Nov 27, 2022
ac6bead
Add natural log to level-calc formula parsing
tastybento Jan 16, 2023
fba7394
feat: add island total points + placeholder (#264)
emmanuelvlad Jan 16, 2023
dc9d460
Fix JavaDoc
tastybento Jan 16, 2023
f1db2a9
Translate zh-CN.yml via GitLocalize (#276)
gitlocalize-app[bot] Jan 23, 2023
29b1480
Translate nl.yml via GitLocalize (#277)
gitlocalize-app[bot] Jan 24, 2023
f469e37
Add ${argLine} to get jacoco coverage
tastybento Feb 9, 2023
42249a8
Updated Jacoco POM
tastybento Feb 10, 2023
a493c12
Add shulker to in chest count (#275)
DevSolaris Feb 10, 2023
0cdb154
Sonar Cloud code smell clean up (#278)
tastybento Feb 10, 2023
713a409
Refactor placeholders (#279)
tastybento Feb 25, 2023
c093796
Remove dependency
tastybento Mar 25, 2023
9c42a8d
Add UltimateStacker hook for stacked blocks (#281)
ceze88 Apr 5, 2023
78c67b6
Create plugin.yml (#282)
BONNe Apr 8, 2023
3c79c68
Updated dependencies
tastybento Apr 15, 2023
34b2b52
Merge remote-tracking branch 'origin/master' into develop
tastybento Apr 15, 2023
ad3d02c
Version 2.10.1
tastybento Apr 15, 2023
5a66bf1
Add blocks that should be zero by default as they are available
tastybento May 17, 2023
dfd30d1
Chinese (#288)
gitlocalize-app[bot] May 29, 2023
f8d50a4
Translate id.yml via GitLocalize (#287)
gitlocalize-app[bot] May 29, 2023
30217ba
French (#286)
gitlocalize-app[bot] May 29, 2023
951b0f5
Spanish (#285)
gitlocalize-app[bot] May 29, 2023
1b20605
Version 2.11.0
tastybento Jun 3, 2023
deb0999
Update Github Build script
tastybento Jun 24, 2023
0c42ad8
Merge branch 'develop' of https://github.com/BentoBoxWorld/Level.git …
tastybento Jun 24, 2023
1b02f11
Added distribution required for Github Action
tastybento Jun 24, 2023
a3537f5
Update Jacoco
tastybento Jul 11, 2023
2b0a6d8
Update pom.xml
tastybento Jul 11, 2023
913eed9
Add config option to disable plugin hooks (#291)
PapiCapi Oct 6, 2023
8f567cc
Use 2.0.0 BentoBox API
tastybento Nov 12, 2023
cdd4366
Merge branch 'develop' of https://github.com/BentoBoxWorld/Level.git
tastybento Nov 12, 2023
eb71b35
Version 2.12.0
tastybento Nov 18, 2023
3a3c8a3
Adds an admin stats command. See #293
tastybento Nov 18, 2023
1a4077b
Update tests
tastybento Nov 18, 2023
77884f0
Update to BentoBox 2.0.0 API
tastybento Nov 18, 2023
43c898e
Added test for Stats command
tastybento Nov 18, 2023
26d4839
Try lower version of jacoco
tastybento Nov 18, 2023
9d1a5c7
Changed top ten internally to use islands instead of players as keys …
tastybento Nov 20, 2023
117d15f
Added more placeholders. #296
tastybento Nov 24, 2023
cfb3590
Translate uk.yml via GitLocalize (#297)
gitlocalize-app[bot] Nov 26, 2023
cec6201
Move to 1.20.4
tastybento Dec 10, 2023
8217464
Added comments on the panel templates.
tastybento Dec 19, 2023
5f83a81
Add protection around unknown blockconfig.yml entries. GRASS>SHORT_GRASS
tastybento Jan 2, 2024
2b373f6
Uses latest Visit API to avoid chat spam. Fixes #299 (#300)
tastybento Jan 2, 2024
76e0bad
Added test class for EquationEvaluator
tastybento Jan 13, 2024
ae030eb
Merge branch 'master' into develop
tastybento Jan 14, 2024
79f988f
Fix merge error
tastybento Jan 14, 2024
952a2a6
Version 2.12.1
tastybento Jan 21, 2024
02a19d1
Update tipped arrows in GUI Panel
tastybento Jan 21, 2024
774bbd0
Version 2.13.0
tastybento Feb 3, 2024
2d1f618
Add more string replacements for /is level output (#303)
addstar Apr 17, 2024
1bd6219
Update hooks and fix UltimateStacker API (#305)
HSGamer Apr 19, 2024
a4f8d12
Isolate UltimateStacker imports so no errors if US is not installed (…
tastybento Apr 20, 2024
4d16e9c
Implement a cache for top tens (#309)
tastybento May 4, 2024
e2cbd18
Merge branch 'master' into develop
tastybento May 5, 2024
1369ffb
Remove unused imports.
tastybento May 5, 2024
5dee0d2
Fix space in locale file
tastybento May 5, 2024
0bb6eac
Update IslandLevelCalculator.java (#314)
tastybento May 31, 2024
d37f9dd
Version 2.14.0
tastybento May 31, 2024
7a241f8
Fix tests to run with latest BentoBox
tastybento Jun 1, 2024
c3e03a4
Uses better approach #313
tastybento Jun 1, 2024
f2da5ba
Use new BentoBox API to avoid loading islands into cache on startup
tastybento Jun 1, 2024
00f6fee
Remove unneeded import and reference to MultiLib
tastybento Jun 1, 2024
7e8392d
Update zh-CN.yml (#315)
huguyt Jun 8, 2024
e374dbd
Merge branch 'master' into merge-resolutions
tastybento Jun 30, 2024
c065379
Test fixes
tastybento Jun 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<powermock.version>2.0.9</powermock.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.20.4-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>2.0.0-SNAPSHOT</bentobox.version>
<bentobox.version>2.4.0-SNAPSHOT</bentobox.version>
<!-- Warps addon version -->
<warps.version>1.12.0</warps.version>
<!-- Visit addon version -->
Expand All @@ -71,7 +71,7 @@
<!-- 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.13.0</build.version>
<build.version>2.14.0</build.version>
<sonar.projectKey>BentoBoxWorld_Level</sonar.projectKey>
<sonar.organization>bentobox-world</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
Expand Down
77 changes: 39 additions & 38 deletions src/main/java/world/bentobox/level/LevelsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ public class LevelsManager {
private static final TreeMap<BigInteger, String> LEVELS;
private static final BigInteger THOUSAND = BigInteger.valueOf(1000);
static {
LEVELS = new TreeMap<>();
LEVELS = new TreeMap<>();

LEVELS.put(THOUSAND, "k");
LEVELS.put(THOUSAND.pow(2), "M");
LEVELS.put(THOUSAND.pow(3), "G");
LEVELS.put(THOUSAND.pow(4), "T");
LEVELS.put(THOUSAND, "k");
LEVELS.put(THOUSAND.pow(2), "M");
LEVELS.put(THOUSAND.pow(3), "G");
LEVELS.put(THOUSAND.pow(4), "T");
}
private final Level addon;

Expand All @@ -58,15 +58,15 @@ public class LevelsManager {
private Map<World, CachedData> cache = new HashMap<>();

public LevelsManager(Level addon) {
this.addon = addon;
// Get the BentoBox database
// Set up the database handler to store and retrieve data
// Note that these are saved by the BentoBox database
handler = new Database<>(addon, IslandLevels.class);
// Initialize the cache
levelsCache = new HashMap<>();
// Initialize top ten lists
topTenLists = new ConcurrentHashMap<>();
this.addon = addon;
// Get the BentoBox database
// Set up the database handler to store and retrieve data
// Note that these are saved by the BentoBox database
handler = new Database<>(addon, IslandLevels.class);
// Initialize the cache
levelsCache = new HashMap<>();
// Initialize top ten lists
topTenLists = new ConcurrentHashMap<>();
}

public void migrate() {
Expand Down Expand Up @@ -208,7 +208,7 @@ public String formatLevel(@Nullable Long lvl) {
* @return initial level of island
*/
public long getInitialLevel(Island island) {
return getLevelsData(island).getInitialLevel();
return getLevelsData(island).getInitialLevel();
}

/**
Expand Down Expand Up @@ -252,7 +252,7 @@ public long getIslandMaxLevel(@NonNull World world, @Nullable UUID targetPlayer)
* null
*/
public String getIslandLevelString(@NonNull World world, @Nullable UUID targetPlayer) {
return formatLevel(getIslandLevel(world, targetPlayer));
return formatLevel(getIslandLevel(world, targetPlayer));
}

/**
Expand All @@ -263,24 +263,24 @@ public String getIslandLevelString(@NonNull World world, @Nullable UUID targetPl
*/
@NonNull
public IslandLevels getLevelsData(@NonNull Island island) {
String id = island.getUniqueId();
if (levelsCache.containsKey(id)) {
return levelsCache.get(id);
}
// Get from database if not in cache
if (handler.objectExists(id)) {
IslandLevels ld = handler.loadObject(id);
if (ld != null) {
levelsCache.put(id, ld);
} else {
handler.deleteID(id);
levelsCache.put(id, new IslandLevels(id));
}
} else {
levelsCache.put(id, new IslandLevels(id));
}
// Return cached value
return levelsCache.get(id);
String id = island.getUniqueId();
if (levelsCache.containsKey(id)) {
return levelsCache.get(id);
}
// Get from database if not in cache
if (handler.objectExists(id)) {
IslandLevels ld = handler.loadObject(id);
if (ld != null) {
levelsCache.put(id, ld);
} else {
handler.deleteID(id);
levelsCache.put(id, new IslandLevels(id));
}
} else {
levelsCache.put(id, new IslandLevels(id));
}
// Return cached value
return levelsCache.get(id);
}

/**
Expand Down Expand Up @@ -414,7 +414,8 @@ public void loadTopTens() {
addon.log("Generating rankings");
handler.loadObjects().forEach(il -> {
if (il.getLevel() > 0) {
addon.getIslands().getIslandById(il.getUniqueId())
// Load islands, but don't cache them
addon.getIslands().getIslandById(il.getUniqueId(), false)
.ifPresent(i -> this.addToTopTen(i, il.getLevel()));
}
});
Expand All @@ -429,7 +430,7 @@ public void loadTopTens() {
* @param uuid - the island's uuid
*/
public void removeEntry(World world, String uuid) {
if (topTenLists.containsKey(world)) {
if (topTenLists.containsKey(world)) {
topTenLists.get(world).getTopTen().remove(uuid);
// Invalidate the cache because of this deletion
cache.remove(world);
Expand Down Expand Up @@ -504,8 +505,8 @@ private void setIslandResults(Island island, Results r) {
* @param uniqueId - id of island
*/
public void deleteIsland(String uniqueId) {
levelsCache.remove(uniqueId);
handler.deleteID(uniqueId);
levelsCache.remove(uniqueId);
handler.deleteID(uniqueId);
}

}
Loading
Loading