2019-11-10 05:09:16 +01:00
|
|
|
package world.bentobox.level.calculators;
|
|
|
|
|
2023-12-10 19:06:33 +01:00
|
|
|
import java.text.ParseException;
|
2020-06-22 02:54:51 +02:00
|
|
|
import java.util.ArrayList;
|
2021-11-22 05:08:05 +01:00
|
|
|
import java.util.Arrays;
|
2020-06-22 02:54:51 +02:00
|
|
|
import java.util.Collection;
|
2021-08-10 05:00:55 +02:00
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.EnumMap;
|
2021-11-22 05:08:05 +01:00
|
|
|
import java.util.HashSet;
|
2020-06-22 02:54:51 +02:00
|
|
|
import java.util.Iterator;
|
|
|
|
import java.util.List;
|
2021-08-10 05:00:55 +02:00
|
|
|
import java.util.Map;
|
2020-06-22 02:54:51 +02:00
|
|
|
import java.util.Queue;
|
2021-11-22 05:08:05 +01:00
|
|
|
import java.util.Set;
|
2020-06-22 02:54:51 +02:00
|
|
|
import java.util.UUID;
|
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
|
|
|
|
|
|
|
import org.bukkit.Bukkit;
|
|
|
|
import org.bukkit.Chunk;
|
|
|
|
import org.bukkit.ChunkSnapshot;
|
2021-11-22 05:08:05 +01:00
|
|
|
import org.bukkit.Location;
|
2020-06-22 02:54:51 +02:00
|
|
|
import org.bukkit.Material;
|
|
|
|
import org.bukkit.Tag;
|
|
|
|
import org.bukkit.World;
|
|
|
|
import org.bukkit.World.Environment;
|
2023-12-10 19:06:33 +01:00
|
|
|
import org.bukkit.block.Block;
|
|
|
|
import org.bukkit.block.BlockState;
|
|
|
|
import org.bukkit.block.Container;
|
|
|
|
import org.bukkit.block.CreatureSpawner;
|
|
|
|
import org.bukkit.block.ShulkerBox;
|
2020-06-22 02:54:51 +02:00
|
|
|
import org.bukkit.block.data.BlockData;
|
|
|
|
import org.bukkit.block.data.type.Slab;
|
|
|
|
import org.bukkit.inventory.ItemStack;
|
2023-02-10 04:31:35 +01:00
|
|
|
import org.bukkit.inventory.meta.BlockStateMeta;
|
2021-11-22 05:08:05 +01:00
|
|
|
import org.bukkit.scheduler.BukkitTask;
|
2020-06-22 02:54:51 +02:00
|
|
|
|
|
|
|
import com.bgsoftware.wildstacker.api.WildStackerAPI;
|
|
|
|
import com.bgsoftware.wildstacker.api.objects.StackedBarrel;
|
|
|
|
import com.google.common.collect.Multiset;
|
|
|
|
import com.google.common.collect.Multiset.Entry;
|
|
|
|
import com.google.common.collect.Multisets;
|
|
|
|
|
2021-08-10 05:00:55 +02:00
|
|
|
import dev.rosewood.rosestacker.api.RoseStackerAPI;
|
2021-02-24 03:59:20 +01:00
|
|
|
import us.lynuxcraft.deadsilenceiv.advancedchests.AdvancedChestsAPI;
|
|
|
|
import us.lynuxcraft.deadsilenceiv.advancedchests.chest.AdvancedChest;
|
2021-04-09 01:49:18 +02:00
|
|
|
import us.lynuxcraft.deadsilenceiv.advancedchests.chest.gui.page.ChestPage;
|
2020-06-22 02:54:51 +02:00
|
|
|
import world.bentobox.bentobox.BentoBox;
|
|
|
|
import world.bentobox.bentobox.database.objects.Island;
|
|
|
|
import world.bentobox.bentobox.util.Pair;
|
|
|
|
import world.bentobox.bentobox.util.Util;
|
|
|
|
import world.bentobox.level.Level;
|
2021-11-22 05:08:05 +01:00
|
|
|
import world.bentobox.level.calculators.Results.Result;
|
2020-06-22 02:54:51 +02:00
|
|
|
|
|
|
|
public class IslandLevelCalculator {
|
|
|
|
private static final String LINE_BREAK = "==================================";
|
2023-01-17 00:00:40 +01:00
|
|
|
public static final long MAX_AMOUNT = 10000000;
|
2023-12-10 19:06:33 +01:00
|
|
|
private static final List<Material> CHESTS = Arrays.asList(Material.CHEST, Material.CHEST_MINECART,
|
2024-04-20 18:50:17 +02:00
|
|
|
Material.TRAPPED_CHEST, Material.SHULKER_BOX, Material.BLACK_SHULKER_BOX, Material.BLUE_SHULKER_BOX,
|
|
|
|
Material.BROWN_SHULKER_BOX, Material.CYAN_SHULKER_BOX, Material.GRAY_SHULKER_BOX,
|
|
|
|
Material.GREEN_SHULKER_BOX, Material.LIGHT_BLUE_SHULKER_BOX, Material.LIGHT_GRAY_SHULKER_BOX,
|
|
|
|
Material.LIME_SHULKER_BOX, Material.MAGENTA_SHULKER_BOX, Material.ORANGE_SHULKER_BOX,
|
|
|
|
Material.PINK_SHULKER_BOX, Material.PURPLE_SHULKER_BOX, Material.RED_SHULKER_BOX, Material.RED_SHULKER_BOX,
|
|
|
|
Material.WHITE_SHULKER_BOX, Material.YELLOW_SHULKER_BOX, Material.COMPOSTER, Material.BARREL,
|
|
|
|
Material.DISPENSER, Material.DROPPER, Material.SMOKER, Material.BLAST_FURNACE);
|
2021-11-22 05:08:05 +01:00
|
|
|
private static final int CHUNKS_TO_SCAN = 100;
|
2020-06-22 02:54:51 +02:00
|
|
|
private final Level addon;
|
|
|
|
private final Queue<Pair<Integer, Integer>> chunksToCheck;
|
|
|
|
private final Island island;
|
2023-02-10 04:32:13 +01:00
|
|
|
private final Map<Material, Integer> limitCount;
|
2020-06-22 02:54:51 +02:00
|
|
|
private final CompletableFuture<Results> r;
|
|
|
|
|
|
|
|
private final Results results;
|
2020-07-05 03:13:02 +02:00
|
|
|
private long duration;
|
2020-08-15 19:01:16 +02:00
|
|
|
private final boolean zeroIsland;
|
2021-08-10 05:00:55 +02:00
|
|
|
private final Map<Environment, World> worlds = new EnumMap<>(Environment.class);
|
|
|
|
private final int seaHeight;
|
2021-11-22 05:08:05 +01:00
|
|
|
private final List<Location> stackedBlocks = new ArrayList<>();
|
|
|
|
private final Set<Chunk> chestBlocks = new HashSet<>();
|
|
|
|
private BukkitTask finishTask;
|
|
|
|
|
2020-06-22 02:54:51 +02:00
|
|
|
/**
|
|
|
|
* Constructor to get the level for an island
|
2023-12-10 19:06:33 +01:00
|
|
|
*
|
|
|
|
* @param addon - Level addon
|
|
|
|
* @param island - the island to scan
|
|
|
|
* @param r - completable result that will be completed when the
|
|
|
|
* calculation is complete
|
2020-08-15 19:01:16 +02:00
|
|
|
* @param zeroIsland - true if the calculation is due to an island zeroing
|
2020-06-22 02:54:51 +02:00
|
|
|
*/
|
2020-08-15 19:01:16 +02:00
|
|
|
public IslandLevelCalculator(Level addon, Island island, CompletableFuture<Results> r, boolean zeroIsland) {
|
Release 2.12.0 (#301)
* Version 2.7.1
* Version 2.7.2
* Use Java 9's takeWhile
* Added placeholder %Level_[gamemode]_rank_value
Fixes https://github.com/BentoBoxWorld/Level/issues/228
* No save on disable (#231)
* Release 2.6.4
* Remove saving to database on disable.
https://github.com/BentoBoxWorld/Level/issues/229
First, the top ten tables are never actually used or loaded. They are
created in memory by loading the island levels. So there is no reason to
keep saving them.
Second, the island level data is saved every time it is changed, so
there is no need to save all of the cache on exit.
* Fixes tests
* Rosestacker (#232)
* Add support for RoseStacker 1.3.0
* Made plugin a Pladdon.
* Version 2.8.0
* Added new placeholders
%Level_%gamemode%_top_island_name_%rank% - lists the island name
%Level_%gamemode%_top_island_members_%rank% - a comma separated list of
team members
https://github.com/BentoBoxWorld/Level/issues/224
https://github.com/BentoBoxWorld/Level/issues/211
https://github.com/BentoBoxWorld/Level/issues/132
https://github.com/BentoBoxWorld/Level/issues/107
https://github.com/BentoBoxWorld/Level/issues/105
* Update to BentoBox API 1.18
* Open up modules for testing access.
* Back support for BentoBox 1.16.5.
* Version 2.8.1
* Speeds up level calculation by doing more chunk scans async.
If chests are scanned, then it will take longer because these have to be
done sync.
https://github.com/BentoBoxWorld/Level/issues/243
* add Vietnamese (#240)
* Raw island level placeholder (#241)
* Changed IslandLevelCalculator minHeight to world minHeight for negative blocks height support since 1.18. (#246)
* Version 2.9.0
* Chinese Translation (#249)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
* Translate id.yml via GitLocalize (#250)
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
* Translate fr.yml via GitLocalize (#251)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Korean translation (#252)
* Translate ko.yml via GitLocalize
* Translate ko.yml via GitLocalize
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
* German Translation (#253)
* Translate de.yml via GitLocalize
* Update de.yml
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: tastybento <tastybento@users.noreply.github.com>
* Translate hu.yml via GitLocalize (#254)
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
* Version 2.9.1
* Attempt to handle WildStacker spawners
* Fix error lon loading id locale
* Avoid async chunk snapshotting.
Fixes https://github.com/BentoBoxWorld/Level/issues/256
* Update to BentoBox API 1.20.
Replace plugin.yml with spigot-annotations.
Implement customizable TopLevelPanel.
* Fixes some small issues with TopLevelPanel
Add Utils class that contains some useful things.
* Implement customizable DetailsPanel.
Remove old DetailsGUITab due to new implementation.
* Fix failing test.
* Remove blank file
* Added repo for maven plugin snapshots
* Implement feature that allows to sort items in detail panel. (#259)
Apparently, because it is 2 years old request, it got in a state -> implement or drop.
Fixes #192
* Implement calculated value for blocks. (#260)
It is ~ value, as calculation formula cannot be applied per block. At least I think so.
Part of #192
* Update es.yml (#261)
* Implement customizable Values GUI. (#262)
This GUI shows value to all items in game. It also shows max limit of blocks, if it is set.
Fixes of #192
* Support for AdvancedChests was updated. (#266)
* Implements visit/warp actions in top gui
Add 2 new actions for island buttons in TOP GUI:
- Visit -> allows to visit island, but it requires Visit Addon
- Warp -> allows to warp to island, but it requires Warp Addon
Requested via Discord.
* Fixes a Level addon crash on startup.
Level addon crashed at the startup if Visit or Warps addon were not installed. It happened because Level addon main class were implementing Listener interface.
To avoid it and fix the crash, I moved migration listener to a separate class.
Fixes #2012
* Translate pl.yml via GitLocalize (#269)
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
* Translate fr.yml via GitLocalize (#272)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Update to Java 17
* Update Github workflow to Java 17
* Adds %Level_[gamemode]_island_level_max% placeholder
This records the lifetime maximum level the island has ever had.
Addresses #271
* Only shows Members or higher in the top members placeholder
Fixes #267
* Add natural log to level-calc formula parsing
Relates to #274
* feat: add island total points + placeholder (#264)
* feat: add island total points + placeholder
* Update IslandLevels.java
* Fix JavaDoc
* Translate zh-CN.yml via GitLocalize (#276)
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate nl.yml via GitLocalize (#277)
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
* Add ${argLine} to get jacoco coverage
* Updated Jacoco POM
* Add shulker to in chest count (#275)
* Sonar Cloud code smell clean up (#278)
* Refactor placeholders (#279)
* Update ReadMe
* Fix Jacoco
* Remove unused imports
* Remove placeholders from main class
Created a separate class for cleaner code and added a test class.
* Remove dependency
* Add UltimateStacker hook for stacked blocks (#281)
* Create plugin.yml (#282)
* Create plugin.yml
The annotations do not provide the option to define the version dynamically from maven. This should fix that.
* Remove Spigot Plugin Annotations
* Remove plugin-annotation repo
* Updated dependencies
* Version 2.10.1
* Add blocks that should be zero by default as they are available
on the ocean floor. https://github.com/BentoBoxWorld/Level/issues/284
* Chinese (#288)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
---------
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate id.yml via GitLocalize (#287)
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
* French (#286)
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
---------
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
* Spanish (#285)
* Translate es.yml via GitLocalize
* Translate es.yml via GitLocalize
---------
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
* Version 2.11.0
* Update Github Build script
* Added distribution required for Github Action
* Update Jacoco
* Update pom.xml
* Add config option to disable plugin hooks (#291)
* Update UltimateStacker dependency
* Add config option to disable plugin hooks
* Use 2.0.0 BentoBox API
* Version 2.12.0
* Adds an admin stats command. See #293
* Update tests
* Update to BentoBox 2.0.0 API
* Added test for Stats command
* Try lower version of jacoco
* Changed top ten internally to use islands instead of players as keys (#295)
Added %[gamemode]_top_weighted_value_x% placeholder
https://github.com/BentoBoxWorld/Level/issues/294
* Added more placeholders. #296
Refactored how the top ten maps are structured. In the future, it may be
best to have the key be the island.
* Translate uk.yml via GitLocalize (#297)
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
* Move to 1.20.4
Refactored the calculator code for clarity.
Added Jacoco line to prvent issues with the bigger Material class.
* Added comments on the panel templates.
* Add protection around unknown blockconfig.yml entries. GRASS>SHORT_GRASS
* Uses latest Visit API to avoid chat spam. Fixes #299 (#300)
* Added test class for EquationEvaluator
* Fix merge error
---------
Co-authored-by: Huynh Tien <huynhqtienvtag@gmail.com>
Co-authored-by: Rubén <44579213+Rubenicos@users.noreply.github.com>
Co-authored-by: Pierre Dedrie <Pirgosth74@gmail.com>
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
Co-authored-by: BONNe <bonne@bonne.id.lv>
Co-authored-by: KrazyxWolf <68208993+KrazyxWolf@users.noreply.github.com>
Co-authored-by: DeadSilenceIV <Barreto-h2@hotmail.com>
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
Co-authored-by: evlad <emmanuelvlad@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
Co-authored-by: DevSolaris <105156235+DevSolaris@users.noreply.github.com>
Co-authored-by: ceze88 <dev.ceze@gmail.com>
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
Co-authored-by: PapiCapi <49530141+PapiCapi@users.noreply.github.com>
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
2024-01-14 04:50:15 +01:00
|
|
|
this.addon = addon;
|
|
|
|
this.island = island;
|
|
|
|
this.r = r;
|
|
|
|
this.zeroIsland = zeroIsland;
|
|
|
|
results = new Results();
|
|
|
|
duration = System.currentTimeMillis();
|
|
|
|
chunksToCheck = getChunksToScan(island);
|
|
|
|
this.limitCount = new EnumMap<>(addon.getBlockConfig().getBlockLimits());
|
|
|
|
// Get the initial island level
|
|
|
|
results.initialLevel.set(addon.getInitialIslandLevel(island));
|
|
|
|
// Set up the worlds
|
|
|
|
worlds.put(Environment.NORMAL, Util.getWorld(island.getWorld()));
|
|
|
|
// Nether
|
|
|
|
if (addon.getSettings().isNether()) {
|
|
|
|
World nether = addon.getPlugin().getIWM().getNetherWorld(island.getWorld());
|
|
|
|
if (nether != null) {
|
|
|
|
worlds.put(Environment.NETHER, nether);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// End
|
|
|
|
if (addon.getSettings().isEnd()) {
|
|
|
|
World end = addon.getPlugin().getIWM().getEndWorld(island.getWorld());
|
|
|
|
if (end != null) {
|
|
|
|
worlds.put(Environment.THE_END, end);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Sea Height
|
|
|
|
seaHeight = addon.getPlugin().getIWM().getSeaHeight(island.getWorld());
|
2020-06-22 02:54:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Calculate the level based on the raw points
|
2023-12-10 19:06:33 +01:00
|
|
|
*
|
2020-06-22 02:54:51 +02:00
|
|
|
* @param blockAndDeathPoints - raw points counted on island
|
|
|
|
* @return level of island
|
|
|
|
*/
|
|
|
|
private long calculateLevel(long blockAndDeathPoints) {
|
2024-04-20 18:50:17 +02:00
|
|
|
String calcString = addon.getSettings().getLevelCalc();
|
|
|
|
String withValues = calcString.replace("blocks", String.valueOf(blockAndDeathPoints)).replace("level_cost",
|
|
|
|
String.valueOf(this.addon.getSettings().getLevelCost()));
|
|
|
|
long evalWithValues;
|
|
|
|
try {
|
|
|
|
evalWithValues = (long) EquationEvaluator.eval(withValues);
|
|
|
|
return evalWithValues - (addon.getSettings().isZeroNewIslandLevels() ? results.initialLevel.get() : 0);
|
|
|
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
addon.getPlugin().logStacktrace(e);
|
|
|
|
return 0L;
|
|
|
|
}
|
2020-06-22 02:54:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-12-10 19:06:33 +01:00
|
|
|
* Adds value to the results based on the material and whether the block is
|
|
|
|
* below sea level or not
|
|
|
|
*
|
|
|
|
* @param mat - material of the block
|
2020-06-22 02:54:51 +02:00
|
|
|
* @param belowSeaLevel - true if below sea level
|
|
|
|
*/
|
|
|
|
private void checkBlock(Material mat, boolean belowSeaLevel) {
|
Release 2.12.0 (#301)
* Version 2.7.1
* Version 2.7.2
* Use Java 9's takeWhile
* Added placeholder %Level_[gamemode]_rank_value
Fixes https://github.com/BentoBoxWorld/Level/issues/228
* No save on disable (#231)
* Release 2.6.4
* Remove saving to database on disable.
https://github.com/BentoBoxWorld/Level/issues/229
First, the top ten tables are never actually used or loaded. They are
created in memory by loading the island levels. So there is no reason to
keep saving them.
Second, the island level data is saved every time it is changed, so
there is no need to save all of the cache on exit.
* Fixes tests
* Rosestacker (#232)
* Add support for RoseStacker 1.3.0
* Made plugin a Pladdon.
* Version 2.8.0
* Added new placeholders
%Level_%gamemode%_top_island_name_%rank% - lists the island name
%Level_%gamemode%_top_island_members_%rank% - a comma separated list of
team members
https://github.com/BentoBoxWorld/Level/issues/224
https://github.com/BentoBoxWorld/Level/issues/211
https://github.com/BentoBoxWorld/Level/issues/132
https://github.com/BentoBoxWorld/Level/issues/107
https://github.com/BentoBoxWorld/Level/issues/105
* Update to BentoBox API 1.18
* Open up modules for testing access.
* Back support for BentoBox 1.16.5.
* Version 2.8.1
* Speeds up level calculation by doing more chunk scans async.
If chests are scanned, then it will take longer because these have to be
done sync.
https://github.com/BentoBoxWorld/Level/issues/243
* add Vietnamese (#240)
* Raw island level placeholder (#241)
* Changed IslandLevelCalculator minHeight to world minHeight for negative blocks height support since 1.18. (#246)
* Version 2.9.0
* Chinese Translation (#249)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
* Translate id.yml via GitLocalize (#250)
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
* Translate fr.yml via GitLocalize (#251)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Korean translation (#252)
* Translate ko.yml via GitLocalize
* Translate ko.yml via GitLocalize
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
* German Translation (#253)
* Translate de.yml via GitLocalize
* Update de.yml
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: tastybento <tastybento@users.noreply.github.com>
* Translate hu.yml via GitLocalize (#254)
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
* Version 2.9.1
* Attempt to handle WildStacker spawners
* Fix error lon loading id locale
* Avoid async chunk snapshotting.
Fixes https://github.com/BentoBoxWorld/Level/issues/256
* Update to BentoBox API 1.20.
Replace plugin.yml with spigot-annotations.
Implement customizable TopLevelPanel.
* Fixes some small issues with TopLevelPanel
Add Utils class that contains some useful things.
* Implement customizable DetailsPanel.
Remove old DetailsGUITab due to new implementation.
* Fix failing test.
* Remove blank file
* Added repo for maven plugin snapshots
* Implement feature that allows to sort items in detail panel. (#259)
Apparently, because it is 2 years old request, it got in a state -> implement or drop.
Fixes #192
* Implement calculated value for blocks. (#260)
It is ~ value, as calculation formula cannot be applied per block. At least I think so.
Part of #192
* Update es.yml (#261)
* Implement customizable Values GUI. (#262)
This GUI shows value to all items in game. It also shows max limit of blocks, if it is set.
Fixes of #192
* Support for AdvancedChests was updated. (#266)
* Implements visit/warp actions in top gui
Add 2 new actions for island buttons in TOP GUI:
- Visit -> allows to visit island, but it requires Visit Addon
- Warp -> allows to warp to island, but it requires Warp Addon
Requested via Discord.
* Fixes a Level addon crash on startup.
Level addon crashed at the startup if Visit or Warps addon were not installed. It happened because Level addon main class were implementing Listener interface.
To avoid it and fix the crash, I moved migration listener to a separate class.
Fixes #2012
* Translate pl.yml via GitLocalize (#269)
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
* Translate fr.yml via GitLocalize (#272)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Update to Java 17
* Update Github workflow to Java 17
* Adds %Level_[gamemode]_island_level_max% placeholder
This records the lifetime maximum level the island has ever had.
Addresses #271
* Only shows Members or higher in the top members placeholder
Fixes #267
* Add natural log to level-calc formula parsing
Relates to #274
* feat: add island total points + placeholder (#264)
* feat: add island total points + placeholder
* Update IslandLevels.java
* Fix JavaDoc
* Translate zh-CN.yml via GitLocalize (#276)
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate nl.yml via GitLocalize (#277)
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
* Add ${argLine} to get jacoco coverage
* Updated Jacoco POM
* Add shulker to in chest count (#275)
* Sonar Cloud code smell clean up (#278)
* Refactor placeholders (#279)
* Update ReadMe
* Fix Jacoco
* Remove unused imports
* Remove placeholders from main class
Created a separate class for cleaner code and added a test class.
* Remove dependency
* Add UltimateStacker hook for stacked blocks (#281)
* Create plugin.yml (#282)
* Create plugin.yml
The annotations do not provide the option to define the version dynamically from maven. This should fix that.
* Remove Spigot Plugin Annotations
* Remove plugin-annotation repo
* Updated dependencies
* Version 2.10.1
* Add blocks that should be zero by default as they are available
on the ocean floor. https://github.com/BentoBoxWorld/Level/issues/284
* Chinese (#288)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
---------
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate id.yml via GitLocalize (#287)
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
* French (#286)
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
---------
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
* Spanish (#285)
* Translate es.yml via GitLocalize
* Translate es.yml via GitLocalize
---------
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
* Version 2.11.0
* Update Github Build script
* Added distribution required for Github Action
* Update Jacoco
* Update pom.xml
* Add config option to disable plugin hooks (#291)
* Update UltimateStacker dependency
* Add config option to disable plugin hooks
* Use 2.0.0 BentoBox API
* Version 2.12.0
* Adds an admin stats command. See #293
* Update tests
* Update to BentoBox 2.0.0 API
* Added test for Stats command
* Try lower version of jacoco
* Changed top ten internally to use islands instead of players as keys (#295)
Added %[gamemode]_top_weighted_value_x% placeholder
https://github.com/BentoBoxWorld/Level/issues/294
* Added more placeholders. #296
Refactored how the top ten maps are structured. In the future, it may be
best to have the key be the island.
* Translate uk.yml via GitLocalize (#297)
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
* Move to 1.20.4
Refactored the calculator code for clarity.
Added Jacoco line to prvent issues with the bigger Material class.
* Added comments on the panel templates.
* Add protection around unknown blockconfig.yml entries. GRASS>SHORT_GRASS
* Uses latest Visit API to avoid chat spam. Fixes #299 (#300)
* Added test class for EquationEvaluator
* Fix merge error
---------
Co-authored-by: Huynh Tien <huynhqtienvtag@gmail.com>
Co-authored-by: Rubén <44579213+Rubenicos@users.noreply.github.com>
Co-authored-by: Pierre Dedrie <Pirgosth74@gmail.com>
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
Co-authored-by: BONNe <bonne@bonne.id.lv>
Co-authored-by: KrazyxWolf <68208993+KrazyxWolf@users.noreply.github.com>
Co-authored-by: DeadSilenceIV <Barreto-h2@hotmail.com>
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
Co-authored-by: evlad <emmanuelvlad@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
Co-authored-by: DevSolaris <105156235+DevSolaris@users.noreply.github.com>
Co-authored-by: ceze88 <dev.ceze@gmail.com>
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
Co-authored-by: PapiCapi <49530141+PapiCapi@users.noreply.github.com>
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
2024-01-14 04:50:15 +01:00
|
|
|
int count = limitCount(mat);
|
|
|
|
if (belowSeaLevel) {
|
|
|
|
results.underWaterBlockCount.addAndGet(count);
|
|
|
|
results.uwCount.add(mat);
|
|
|
|
} else {
|
|
|
|
results.rawBlockCount.addAndGet(count);
|
|
|
|
results.mdCount.add(mat);
|
|
|
|
}
|
2020-06-22 02:54:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a set of all the chunks in island
|
2023-12-10 19:06:33 +01:00
|
|
|
*
|
2020-06-22 02:54:51 +02:00
|
|
|
* @param island - island
|
|
|
|
* @return - set of pairs of x,z coordinates to check
|
|
|
|
*/
|
|
|
|
private Queue<Pair<Integer, Integer>> getChunksToScan(Island island) {
|
2024-04-20 18:50:17 +02:00
|
|
|
Queue<Pair<Integer, Integer>> chunkQueue = new ConcurrentLinkedQueue<>();
|
|
|
|
for (int x = island.getMinProtectedX(); x < (island.getMinProtectedX() + island.getProtectionRange() * 2
|
|
|
|
+ 16); x += 16) {
|
|
|
|
for (int z = island.getMinProtectedZ(); z < (island.getMinProtectedZ() + island.getProtectionRange() * 2
|
|
|
|
+ 16); z += 16) {
|
|
|
|
chunkQueue.add(new Pair<>(x >> 4, z >> 4));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return chunkQueue;
|
2020-06-22 02:54:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the island
|
|
|
|
*/
|
|
|
|
public Island getIsland() {
|
Release 2.12.0 (#301)
* Version 2.7.1
* Version 2.7.2
* Use Java 9's takeWhile
* Added placeholder %Level_[gamemode]_rank_value
Fixes https://github.com/BentoBoxWorld/Level/issues/228
* No save on disable (#231)
* Release 2.6.4
* Remove saving to database on disable.
https://github.com/BentoBoxWorld/Level/issues/229
First, the top ten tables are never actually used or loaded. They are
created in memory by loading the island levels. So there is no reason to
keep saving them.
Second, the island level data is saved every time it is changed, so
there is no need to save all of the cache on exit.
* Fixes tests
* Rosestacker (#232)
* Add support for RoseStacker 1.3.0
* Made plugin a Pladdon.
* Version 2.8.0
* Added new placeholders
%Level_%gamemode%_top_island_name_%rank% - lists the island name
%Level_%gamemode%_top_island_members_%rank% - a comma separated list of
team members
https://github.com/BentoBoxWorld/Level/issues/224
https://github.com/BentoBoxWorld/Level/issues/211
https://github.com/BentoBoxWorld/Level/issues/132
https://github.com/BentoBoxWorld/Level/issues/107
https://github.com/BentoBoxWorld/Level/issues/105
* Update to BentoBox API 1.18
* Open up modules for testing access.
* Back support for BentoBox 1.16.5.
* Version 2.8.1
* Speeds up level calculation by doing more chunk scans async.
If chests are scanned, then it will take longer because these have to be
done sync.
https://github.com/BentoBoxWorld/Level/issues/243
* add Vietnamese (#240)
* Raw island level placeholder (#241)
* Changed IslandLevelCalculator minHeight to world minHeight for negative blocks height support since 1.18. (#246)
* Version 2.9.0
* Chinese Translation (#249)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
* Translate id.yml via GitLocalize (#250)
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
* Translate fr.yml via GitLocalize (#251)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Korean translation (#252)
* Translate ko.yml via GitLocalize
* Translate ko.yml via GitLocalize
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
* German Translation (#253)
* Translate de.yml via GitLocalize
* Update de.yml
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: tastybento <tastybento@users.noreply.github.com>
* Translate hu.yml via GitLocalize (#254)
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
* Version 2.9.1
* Attempt to handle WildStacker spawners
* Fix error lon loading id locale
* Avoid async chunk snapshotting.
Fixes https://github.com/BentoBoxWorld/Level/issues/256
* Update to BentoBox API 1.20.
Replace plugin.yml with spigot-annotations.
Implement customizable TopLevelPanel.
* Fixes some small issues with TopLevelPanel
Add Utils class that contains some useful things.
* Implement customizable DetailsPanel.
Remove old DetailsGUITab due to new implementation.
* Fix failing test.
* Remove blank file
* Added repo for maven plugin snapshots
* Implement feature that allows to sort items in detail panel. (#259)
Apparently, because it is 2 years old request, it got in a state -> implement or drop.
Fixes #192
* Implement calculated value for blocks. (#260)
It is ~ value, as calculation formula cannot be applied per block. At least I think so.
Part of #192
* Update es.yml (#261)
* Implement customizable Values GUI. (#262)
This GUI shows value to all items in game. It also shows max limit of blocks, if it is set.
Fixes of #192
* Support for AdvancedChests was updated. (#266)
* Implements visit/warp actions in top gui
Add 2 new actions for island buttons in TOP GUI:
- Visit -> allows to visit island, but it requires Visit Addon
- Warp -> allows to warp to island, but it requires Warp Addon
Requested via Discord.
* Fixes a Level addon crash on startup.
Level addon crashed at the startup if Visit or Warps addon were not installed. It happened because Level addon main class were implementing Listener interface.
To avoid it and fix the crash, I moved migration listener to a separate class.
Fixes #2012
* Translate pl.yml via GitLocalize (#269)
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
* Translate fr.yml via GitLocalize (#272)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Update to Java 17
* Update Github workflow to Java 17
* Adds %Level_[gamemode]_island_level_max% placeholder
This records the lifetime maximum level the island has ever had.
Addresses #271
* Only shows Members or higher in the top members placeholder
Fixes #267
* Add natural log to level-calc formula parsing
Relates to #274
* feat: add island total points + placeholder (#264)
* feat: add island total points + placeholder
* Update IslandLevels.java
* Fix JavaDoc
* Translate zh-CN.yml via GitLocalize (#276)
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate nl.yml via GitLocalize (#277)
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
* Add ${argLine} to get jacoco coverage
* Updated Jacoco POM
* Add shulker to in chest count (#275)
* Sonar Cloud code smell clean up (#278)
* Refactor placeholders (#279)
* Update ReadMe
* Fix Jacoco
* Remove unused imports
* Remove placeholders from main class
Created a separate class for cleaner code and added a test class.
* Remove dependency
* Add UltimateStacker hook for stacked blocks (#281)
* Create plugin.yml (#282)
* Create plugin.yml
The annotations do not provide the option to define the version dynamically from maven. This should fix that.
* Remove Spigot Plugin Annotations
* Remove plugin-annotation repo
* Updated dependencies
* Version 2.10.1
* Add blocks that should be zero by default as they are available
on the ocean floor. https://github.com/BentoBoxWorld/Level/issues/284
* Chinese (#288)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
---------
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate id.yml via GitLocalize (#287)
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
* French (#286)
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
---------
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
* Spanish (#285)
* Translate es.yml via GitLocalize
* Translate es.yml via GitLocalize
---------
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
* Version 2.11.0
* Update Github Build script
* Added distribution required for Github Action
* Update Jacoco
* Update pom.xml
* Add config option to disable plugin hooks (#291)
* Update UltimateStacker dependency
* Add config option to disable plugin hooks
* Use 2.0.0 BentoBox API
* Version 2.12.0
* Adds an admin stats command. See #293
* Update tests
* Update to BentoBox 2.0.0 API
* Added test for Stats command
* Try lower version of jacoco
* Changed top ten internally to use islands instead of players as keys (#295)
Added %[gamemode]_top_weighted_value_x% placeholder
https://github.com/BentoBoxWorld/Level/issues/294
* Added more placeholders. #296
Refactored how the top ten maps are structured. In the future, it may be
best to have the key be the island.
* Translate uk.yml via GitLocalize (#297)
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
* Move to 1.20.4
Refactored the calculator code for clarity.
Added Jacoco line to prvent issues with the bigger Material class.
* Added comments on the panel templates.
* Add protection around unknown blockconfig.yml entries. GRASS>SHORT_GRASS
* Uses latest Visit API to avoid chat spam. Fixes #299 (#300)
* Added test class for EquationEvaluator
* Fix merge error
---------
Co-authored-by: Huynh Tien <huynhqtienvtag@gmail.com>
Co-authored-by: Rubén <44579213+Rubenicos@users.noreply.github.com>
Co-authored-by: Pierre Dedrie <Pirgosth74@gmail.com>
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
Co-authored-by: BONNe <bonne@bonne.id.lv>
Co-authored-by: KrazyxWolf <68208993+KrazyxWolf@users.noreply.github.com>
Co-authored-by: DeadSilenceIV <Barreto-h2@hotmail.com>
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
Co-authored-by: evlad <emmanuelvlad@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
Co-authored-by: DevSolaris <105156235+DevSolaris@users.noreply.github.com>
Co-authored-by: ceze88 <dev.ceze@gmail.com>
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
Co-authored-by: PapiCapi <49530141+PapiCapi@users.noreply.github.com>
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
2024-01-14 04:50:15 +01:00
|
|
|
return island;
|
2020-06-22 02:54:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the completable result for this calculation
|
2023-12-10 19:06:33 +01:00
|
|
|
*
|
2020-06-22 02:54:51 +02:00
|
|
|
* @return the r
|
|
|
|
*/
|
|
|
|
public CompletableFuture<Results> getR() {
|
Release 2.12.0 (#301)
* Version 2.7.1
* Version 2.7.2
* Use Java 9's takeWhile
* Added placeholder %Level_[gamemode]_rank_value
Fixes https://github.com/BentoBoxWorld/Level/issues/228
* No save on disable (#231)
* Release 2.6.4
* Remove saving to database on disable.
https://github.com/BentoBoxWorld/Level/issues/229
First, the top ten tables are never actually used or loaded. They are
created in memory by loading the island levels. So there is no reason to
keep saving them.
Second, the island level data is saved every time it is changed, so
there is no need to save all of the cache on exit.
* Fixes tests
* Rosestacker (#232)
* Add support for RoseStacker 1.3.0
* Made plugin a Pladdon.
* Version 2.8.0
* Added new placeholders
%Level_%gamemode%_top_island_name_%rank% - lists the island name
%Level_%gamemode%_top_island_members_%rank% - a comma separated list of
team members
https://github.com/BentoBoxWorld/Level/issues/224
https://github.com/BentoBoxWorld/Level/issues/211
https://github.com/BentoBoxWorld/Level/issues/132
https://github.com/BentoBoxWorld/Level/issues/107
https://github.com/BentoBoxWorld/Level/issues/105
* Update to BentoBox API 1.18
* Open up modules for testing access.
* Back support for BentoBox 1.16.5.
* Version 2.8.1
* Speeds up level calculation by doing more chunk scans async.
If chests are scanned, then it will take longer because these have to be
done sync.
https://github.com/BentoBoxWorld/Level/issues/243
* add Vietnamese (#240)
* Raw island level placeholder (#241)
* Changed IslandLevelCalculator minHeight to world minHeight for negative blocks height support since 1.18. (#246)
* Version 2.9.0
* Chinese Translation (#249)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
* Translate id.yml via GitLocalize (#250)
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
* Translate fr.yml via GitLocalize (#251)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Korean translation (#252)
* Translate ko.yml via GitLocalize
* Translate ko.yml via GitLocalize
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
* German Translation (#253)
* Translate de.yml via GitLocalize
* Update de.yml
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: tastybento <tastybento@users.noreply.github.com>
* Translate hu.yml via GitLocalize (#254)
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
* Version 2.9.1
* Attempt to handle WildStacker spawners
* Fix error lon loading id locale
* Avoid async chunk snapshotting.
Fixes https://github.com/BentoBoxWorld/Level/issues/256
* Update to BentoBox API 1.20.
Replace plugin.yml with spigot-annotations.
Implement customizable TopLevelPanel.
* Fixes some small issues with TopLevelPanel
Add Utils class that contains some useful things.
* Implement customizable DetailsPanel.
Remove old DetailsGUITab due to new implementation.
* Fix failing test.
* Remove blank file
* Added repo for maven plugin snapshots
* Implement feature that allows to sort items in detail panel. (#259)
Apparently, because it is 2 years old request, it got in a state -> implement or drop.
Fixes #192
* Implement calculated value for blocks. (#260)
It is ~ value, as calculation formula cannot be applied per block. At least I think so.
Part of #192
* Update es.yml (#261)
* Implement customizable Values GUI. (#262)
This GUI shows value to all items in game. It also shows max limit of blocks, if it is set.
Fixes of #192
* Support for AdvancedChests was updated. (#266)
* Implements visit/warp actions in top gui
Add 2 new actions for island buttons in TOP GUI:
- Visit -> allows to visit island, but it requires Visit Addon
- Warp -> allows to warp to island, but it requires Warp Addon
Requested via Discord.
* Fixes a Level addon crash on startup.
Level addon crashed at the startup if Visit or Warps addon were not installed. It happened because Level addon main class were implementing Listener interface.
To avoid it and fix the crash, I moved migration listener to a separate class.
Fixes #2012
* Translate pl.yml via GitLocalize (#269)
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
* Translate fr.yml via GitLocalize (#272)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Update to Java 17
* Update Github workflow to Java 17
* Adds %Level_[gamemode]_island_level_max% placeholder
This records the lifetime maximum level the island has ever had.
Addresses #271
* Only shows Members or higher in the top members placeholder
Fixes #267
* Add natural log to level-calc formula parsing
Relates to #274
* feat: add island total points + placeholder (#264)
* feat: add island total points + placeholder
* Update IslandLevels.java
* Fix JavaDoc
* Translate zh-CN.yml via GitLocalize (#276)
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate nl.yml via GitLocalize (#277)
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
* Add ${argLine} to get jacoco coverage
* Updated Jacoco POM
* Add shulker to in chest count (#275)
* Sonar Cloud code smell clean up (#278)
* Refactor placeholders (#279)
* Update ReadMe
* Fix Jacoco
* Remove unused imports
* Remove placeholders from main class
Created a separate class for cleaner code and added a test class.
* Remove dependency
* Add UltimateStacker hook for stacked blocks (#281)
* Create plugin.yml (#282)
* Create plugin.yml
The annotations do not provide the option to define the version dynamically from maven. This should fix that.
* Remove Spigot Plugin Annotations
* Remove plugin-annotation repo
* Updated dependencies
* Version 2.10.1
* Add blocks that should be zero by default as they are available
on the ocean floor. https://github.com/BentoBoxWorld/Level/issues/284
* Chinese (#288)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
---------
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate id.yml via GitLocalize (#287)
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
* French (#286)
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
---------
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
* Spanish (#285)
* Translate es.yml via GitLocalize
* Translate es.yml via GitLocalize
---------
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
* Version 2.11.0
* Update Github Build script
* Added distribution required for Github Action
* Update Jacoco
* Update pom.xml
* Add config option to disable plugin hooks (#291)
* Update UltimateStacker dependency
* Add config option to disable plugin hooks
* Use 2.0.0 BentoBox API
* Version 2.12.0
* Adds an admin stats command. See #293
* Update tests
* Update to BentoBox 2.0.0 API
* Added test for Stats command
* Try lower version of jacoco
* Changed top ten internally to use islands instead of players as keys (#295)
Added %[gamemode]_top_weighted_value_x% placeholder
https://github.com/BentoBoxWorld/Level/issues/294
* Added more placeholders. #296
Refactored how the top ten maps are structured. In the future, it may be
best to have the key be the island.
* Translate uk.yml via GitLocalize (#297)
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
* Move to 1.20.4
Refactored the calculator code for clarity.
Added Jacoco line to prvent issues with the bigger Material class.
* Added comments on the panel templates.
* Add protection around unknown blockconfig.yml entries. GRASS>SHORT_GRASS
* Uses latest Visit API to avoid chat spam. Fixes #299 (#300)
* Added test class for EquationEvaluator
* Fix merge error
---------
Co-authored-by: Huynh Tien <huynhqtienvtag@gmail.com>
Co-authored-by: Rubén <44579213+Rubenicos@users.noreply.github.com>
Co-authored-by: Pierre Dedrie <Pirgosth74@gmail.com>
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
Co-authored-by: BONNe <bonne@bonne.id.lv>
Co-authored-by: KrazyxWolf <68208993+KrazyxWolf@users.noreply.github.com>
Co-authored-by: DeadSilenceIV <Barreto-h2@hotmail.com>
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
Co-authored-by: evlad <emmanuelvlad@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
Co-authored-by: DevSolaris <105156235+DevSolaris@users.noreply.github.com>
Co-authored-by: ceze88 <dev.ceze@gmail.com>
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
Co-authored-by: PapiCapi <49530141+PapiCapi@users.noreply.github.com>
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
2024-01-14 04:50:15 +01:00
|
|
|
return r;
|
2020-06-22 02:54:51 +02:00
|
|
|
}
|
2019-11-10 05:09:16 +01:00
|
|
|
|
|
|
|
/**
|
2020-06-22 02:54:51 +02:00
|
|
|
* Get the full analysis report
|
2023-12-10 19:06:33 +01:00
|
|
|
*
|
2020-06-22 02:54:51 +02:00
|
|
|
* @return a list of lines
|
2019-11-10 05:09:16 +01:00
|
|
|
*/
|
2020-06-22 02:54:51 +02:00
|
|
|
private List<String> getReport() {
|
2024-04-20 18:50:17 +02:00
|
|
|
List<String> reportLines = new ArrayList<>();
|
|
|
|
// provide counts
|
|
|
|
reportLines.add("Level Log for island in " + addon.getPlugin().getIWM().getFriendlyName(island.getWorld())
|
|
|
|
+ " at " + Util.xyz(island.getCenter().toVector()));
|
|
|
|
reportLines.add("Island owner UUID = " + island.getOwner());
|
|
|
|
reportLines.add("Total block value count = " + String.format("%,d", results.rawBlockCount.get()));
|
|
|
|
reportLines.add("Formula to calculate island level: " + addon.getSettings().getLevelCalc());
|
|
|
|
reportLines.add("Level cost = " + addon.getSettings().getLevelCost());
|
|
|
|
reportLines.add("Deaths handicap = " + results.deathHandicap.get());
|
|
|
|
if (addon.getSettings().isZeroNewIslandLevels()) {
|
|
|
|
reportLines.add("Initial island level = " + (0L - addon.getManager().getInitialLevel(island)));
|
|
|
|
}
|
|
|
|
reportLines.add("Previous level = " + addon.getManager().getIslandLevel(island.getWorld(), island.getOwner()));
|
|
|
|
reportLines.add("New level = " + results.getLevel());
|
|
|
|
reportLines.add(LINE_BREAK);
|
|
|
|
int total = 0;
|
|
|
|
if (!results.uwCount.isEmpty()) {
|
|
|
|
reportLines.add("Underwater block count (Multiplier = x" + addon.getSettings().getUnderWaterMultiplier()
|
|
|
|
+ ") value");
|
|
|
|
reportLines.add("Total number of underwater blocks = " + String.format("%,d", results.uwCount.size()));
|
|
|
|
reportLines.addAll(sortedReport(total, results.uwCount));
|
|
|
|
}
|
|
|
|
reportLines.add("Regular block count");
|
|
|
|
reportLines.add("Total number of blocks = " + String.format("%,d", results.mdCount.size()));
|
|
|
|
reportLines.addAll(sortedReport(total, results.mdCount));
|
|
|
|
|
|
|
|
reportLines.add(
|
|
|
|
"Blocks not counted because they exceeded limits: " + String.format("%,d", results.ofCount.size()));
|
|
|
|
Iterable<Multiset.Entry<Material>> entriesSortedByCount = results.ofCount.entrySet();
|
|
|
|
Iterator<Entry<Material>> it = entriesSortedByCount.iterator();
|
|
|
|
while (it.hasNext()) {
|
|
|
|
Entry<Material> type = it.next();
|
|
|
|
Integer limit = addon.getBlockConfig().getBlockLimits().get(type.getElement());
|
|
|
|
String explain = ")";
|
|
|
|
if (limit == null) {
|
|
|
|
Material generic = type.getElement();
|
|
|
|
limit = addon.getBlockConfig().getBlockLimits().get(generic);
|
|
|
|
explain = " - All types)";
|
|
|
|
}
|
|
|
|
reportLines.add(type.getElement().toString() + ": " + String.format("%,d", type.getCount())
|
|
|
|
+ " blocks (max " + limit + explain);
|
|
|
|
}
|
|
|
|
reportLines.add(LINE_BREAK);
|
|
|
|
reportLines.add("Blocks on island that are not in config.yml");
|
|
|
|
reportLines.add("Total number = " + String.format("%,d", results.ncCount.size()));
|
|
|
|
entriesSortedByCount = results.ncCount.entrySet();
|
|
|
|
it = entriesSortedByCount.iterator();
|
|
|
|
while (it.hasNext()) {
|
|
|
|
Entry<Material> type = it.next();
|
|
|
|
reportLines.add(type.getElement().toString() + ": " + String.format("%,d", type.getCount()) + " blocks");
|
|
|
|
}
|
|
|
|
reportLines.add(LINE_BREAK);
|
|
|
|
|
|
|
|
return reportLines;
|
2020-06-22 02:54:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the results
|
|
|
|
*/
|
|
|
|
public Results getResults() {
|
Release 2.12.0 (#301)
* Version 2.7.1
* Version 2.7.2
* Use Java 9's takeWhile
* Added placeholder %Level_[gamemode]_rank_value
Fixes https://github.com/BentoBoxWorld/Level/issues/228
* No save on disable (#231)
* Release 2.6.4
* Remove saving to database on disable.
https://github.com/BentoBoxWorld/Level/issues/229
First, the top ten tables are never actually used or loaded. They are
created in memory by loading the island levels. So there is no reason to
keep saving them.
Second, the island level data is saved every time it is changed, so
there is no need to save all of the cache on exit.
* Fixes tests
* Rosestacker (#232)
* Add support for RoseStacker 1.3.0
* Made plugin a Pladdon.
* Version 2.8.0
* Added new placeholders
%Level_%gamemode%_top_island_name_%rank% - lists the island name
%Level_%gamemode%_top_island_members_%rank% - a comma separated list of
team members
https://github.com/BentoBoxWorld/Level/issues/224
https://github.com/BentoBoxWorld/Level/issues/211
https://github.com/BentoBoxWorld/Level/issues/132
https://github.com/BentoBoxWorld/Level/issues/107
https://github.com/BentoBoxWorld/Level/issues/105
* Update to BentoBox API 1.18
* Open up modules for testing access.
* Back support for BentoBox 1.16.5.
* Version 2.8.1
* Speeds up level calculation by doing more chunk scans async.
If chests are scanned, then it will take longer because these have to be
done sync.
https://github.com/BentoBoxWorld/Level/issues/243
* add Vietnamese (#240)
* Raw island level placeholder (#241)
* Changed IslandLevelCalculator minHeight to world minHeight for negative blocks height support since 1.18. (#246)
* Version 2.9.0
* Chinese Translation (#249)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
* Translate id.yml via GitLocalize (#250)
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
* Translate fr.yml via GitLocalize (#251)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Korean translation (#252)
* Translate ko.yml via GitLocalize
* Translate ko.yml via GitLocalize
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
* German Translation (#253)
* Translate de.yml via GitLocalize
* Update de.yml
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: tastybento <tastybento@users.noreply.github.com>
* Translate hu.yml via GitLocalize (#254)
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
* Version 2.9.1
* Attempt to handle WildStacker spawners
* Fix error lon loading id locale
* Avoid async chunk snapshotting.
Fixes https://github.com/BentoBoxWorld/Level/issues/256
* Update to BentoBox API 1.20.
Replace plugin.yml with spigot-annotations.
Implement customizable TopLevelPanel.
* Fixes some small issues with TopLevelPanel
Add Utils class that contains some useful things.
* Implement customizable DetailsPanel.
Remove old DetailsGUITab due to new implementation.
* Fix failing test.
* Remove blank file
* Added repo for maven plugin snapshots
* Implement feature that allows to sort items in detail panel. (#259)
Apparently, because it is 2 years old request, it got in a state -> implement or drop.
Fixes #192
* Implement calculated value for blocks. (#260)
It is ~ value, as calculation formula cannot be applied per block. At least I think so.
Part of #192
* Update es.yml (#261)
* Implement customizable Values GUI. (#262)
This GUI shows value to all items in game. It also shows max limit of blocks, if it is set.
Fixes of #192
* Support for AdvancedChests was updated. (#266)
* Implements visit/warp actions in top gui
Add 2 new actions for island buttons in TOP GUI:
- Visit -> allows to visit island, but it requires Visit Addon
- Warp -> allows to warp to island, but it requires Warp Addon
Requested via Discord.
* Fixes a Level addon crash on startup.
Level addon crashed at the startup if Visit or Warps addon were not installed. It happened because Level addon main class were implementing Listener interface.
To avoid it and fix the crash, I moved migration listener to a separate class.
Fixes #2012
* Translate pl.yml via GitLocalize (#269)
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
* Translate fr.yml via GitLocalize (#272)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Update to Java 17
* Update Github workflow to Java 17
* Adds %Level_[gamemode]_island_level_max% placeholder
This records the lifetime maximum level the island has ever had.
Addresses #271
* Only shows Members or higher in the top members placeholder
Fixes #267
* Add natural log to level-calc formula parsing
Relates to #274
* feat: add island total points + placeholder (#264)
* feat: add island total points + placeholder
* Update IslandLevels.java
* Fix JavaDoc
* Translate zh-CN.yml via GitLocalize (#276)
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate nl.yml via GitLocalize (#277)
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
* Add ${argLine} to get jacoco coverage
* Updated Jacoco POM
* Add shulker to in chest count (#275)
* Sonar Cloud code smell clean up (#278)
* Refactor placeholders (#279)
* Update ReadMe
* Fix Jacoco
* Remove unused imports
* Remove placeholders from main class
Created a separate class for cleaner code and added a test class.
* Remove dependency
* Add UltimateStacker hook for stacked blocks (#281)
* Create plugin.yml (#282)
* Create plugin.yml
The annotations do not provide the option to define the version dynamically from maven. This should fix that.
* Remove Spigot Plugin Annotations
* Remove plugin-annotation repo
* Updated dependencies
* Version 2.10.1
* Add blocks that should be zero by default as they are available
on the ocean floor. https://github.com/BentoBoxWorld/Level/issues/284
* Chinese (#288)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
---------
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate id.yml via GitLocalize (#287)
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
* French (#286)
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
---------
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
* Spanish (#285)
* Translate es.yml via GitLocalize
* Translate es.yml via GitLocalize
---------
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
* Version 2.11.0
* Update Github Build script
* Added distribution required for Github Action
* Update Jacoco
* Update pom.xml
* Add config option to disable plugin hooks (#291)
* Update UltimateStacker dependency
* Add config option to disable plugin hooks
* Use 2.0.0 BentoBox API
* Version 2.12.0
* Adds an admin stats command. See #293
* Update tests
* Update to BentoBox 2.0.0 API
* Added test for Stats command
* Try lower version of jacoco
* Changed top ten internally to use islands instead of players as keys (#295)
Added %[gamemode]_top_weighted_value_x% placeholder
https://github.com/BentoBoxWorld/Level/issues/294
* Added more placeholders. #296
Refactored how the top ten maps are structured. In the future, it may be
best to have the key be the island.
* Translate uk.yml via GitLocalize (#297)
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
* Move to 1.20.4
Refactored the calculator code for clarity.
Added Jacoco line to prvent issues with the bigger Material class.
* Added comments on the panel templates.
* Add protection around unknown blockconfig.yml entries. GRASS>SHORT_GRASS
* Uses latest Visit API to avoid chat spam. Fixes #299 (#300)
* Added test class for EquationEvaluator
* Fix merge error
---------
Co-authored-by: Huynh Tien <huynhqtienvtag@gmail.com>
Co-authored-by: Rubén <44579213+Rubenicos@users.noreply.github.com>
Co-authored-by: Pierre Dedrie <Pirgosth74@gmail.com>
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
Co-authored-by: BONNe <bonne@bonne.id.lv>
Co-authored-by: KrazyxWolf <68208993+KrazyxWolf@users.noreply.github.com>
Co-authored-by: DeadSilenceIV <Barreto-h2@hotmail.com>
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
Co-authored-by: evlad <emmanuelvlad@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
Co-authored-by: DevSolaris <105156235+DevSolaris@users.noreply.github.com>
Co-authored-by: ceze88 <dev.ceze@gmail.com>
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
Co-authored-by: PapiCapi <49530141+PapiCapi@users.noreply.github.com>
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
2024-01-14 04:50:15 +01:00
|
|
|
return results;
|
2020-06-22 02:54:51 +02:00
|
|
|
}
|
2023-12-10 19:06:33 +01:00
|
|
|
|
2020-06-22 02:54:51 +02:00
|
|
|
/**
|
2023-12-10 19:06:33 +01:00
|
|
|
* Get value of a material World blocks trump regular block values
|
|
|
|
*
|
2020-06-22 02:54:51 +02:00
|
|
|
* @param md - Material to check
|
|
|
|
* @return value of a material
|
|
|
|
*/
|
|
|
|
private int getValue(Material md) {
|
Release 2.12.0 (#301)
* Version 2.7.1
* Version 2.7.2
* Use Java 9's takeWhile
* Added placeholder %Level_[gamemode]_rank_value
Fixes https://github.com/BentoBoxWorld/Level/issues/228
* No save on disable (#231)
* Release 2.6.4
* Remove saving to database on disable.
https://github.com/BentoBoxWorld/Level/issues/229
First, the top ten tables are never actually used or loaded. They are
created in memory by loading the island levels. So there is no reason to
keep saving them.
Second, the island level data is saved every time it is changed, so
there is no need to save all of the cache on exit.
* Fixes tests
* Rosestacker (#232)
* Add support for RoseStacker 1.3.0
* Made plugin a Pladdon.
* Version 2.8.0
* Added new placeholders
%Level_%gamemode%_top_island_name_%rank% - lists the island name
%Level_%gamemode%_top_island_members_%rank% - a comma separated list of
team members
https://github.com/BentoBoxWorld/Level/issues/224
https://github.com/BentoBoxWorld/Level/issues/211
https://github.com/BentoBoxWorld/Level/issues/132
https://github.com/BentoBoxWorld/Level/issues/107
https://github.com/BentoBoxWorld/Level/issues/105
* Update to BentoBox API 1.18
* Open up modules for testing access.
* Back support for BentoBox 1.16.5.
* Version 2.8.1
* Speeds up level calculation by doing more chunk scans async.
If chests are scanned, then it will take longer because these have to be
done sync.
https://github.com/BentoBoxWorld/Level/issues/243
* add Vietnamese (#240)
* Raw island level placeholder (#241)
* Changed IslandLevelCalculator minHeight to world minHeight for negative blocks height support since 1.18. (#246)
* Version 2.9.0
* Chinese Translation (#249)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
* Translate id.yml via GitLocalize (#250)
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
* Translate fr.yml via GitLocalize (#251)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Korean translation (#252)
* Translate ko.yml via GitLocalize
* Translate ko.yml via GitLocalize
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
* German Translation (#253)
* Translate de.yml via GitLocalize
* Update de.yml
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: tastybento <tastybento@users.noreply.github.com>
* Translate hu.yml via GitLocalize (#254)
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
* Version 2.9.1
* Attempt to handle WildStacker spawners
* Fix error lon loading id locale
* Avoid async chunk snapshotting.
Fixes https://github.com/BentoBoxWorld/Level/issues/256
* Update to BentoBox API 1.20.
Replace plugin.yml with spigot-annotations.
Implement customizable TopLevelPanel.
* Fixes some small issues with TopLevelPanel
Add Utils class that contains some useful things.
* Implement customizable DetailsPanel.
Remove old DetailsGUITab due to new implementation.
* Fix failing test.
* Remove blank file
* Added repo for maven plugin snapshots
* Implement feature that allows to sort items in detail panel. (#259)
Apparently, because it is 2 years old request, it got in a state -> implement or drop.
Fixes #192
* Implement calculated value for blocks. (#260)
It is ~ value, as calculation formula cannot be applied per block. At least I think so.
Part of #192
* Update es.yml (#261)
* Implement customizable Values GUI. (#262)
This GUI shows value to all items in game. It also shows max limit of blocks, if it is set.
Fixes of #192
* Support for AdvancedChests was updated. (#266)
* Implements visit/warp actions in top gui
Add 2 new actions for island buttons in TOP GUI:
- Visit -> allows to visit island, but it requires Visit Addon
- Warp -> allows to warp to island, but it requires Warp Addon
Requested via Discord.
* Fixes a Level addon crash on startup.
Level addon crashed at the startup if Visit or Warps addon were not installed. It happened because Level addon main class were implementing Listener interface.
To avoid it and fix the crash, I moved migration listener to a separate class.
Fixes #2012
* Translate pl.yml via GitLocalize (#269)
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
* Translate fr.yml via GitLocalize (#272)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Update to Java 17
* Update Github workflow to Java 17
* Adds %Level_[gamemode]_island_level_max% placeholder
This records the lifetime maximum level the island has ever had.
Addresses #271
* Only shows Members or higher in the top members placeholder
Fixes #267
* Add natural log to level-calc formula parsing
Relates to #274
* feat: add island total points + placeholder (#264)
* feat: add island total points + placeholder
* Update IslandLevels.java
* Fix JavaDoc
* Translate zh-CN.yml via GitLocalize (#276)
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate nl.yml via GitLocalize (#277)
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
* Add ${argLine} to get jacoco coverage
* Updated Jacoco POM
* Add shulker to in chest count (#275)
* Sonar Cloud code smell clean up (#278)
* Refactor placeholders (#279)
* Update ReadMe
* Fix Jacoco
* Remove unused imports
* Remove placeholders from main class
Created a separate class for cleaner code and added a test class.
* Remove dependency
* Add UltimateStacker hook for stacked blocks (#281)
* Create plugin.yml (#282)
* Create plugin.yml
The annotations do not provide the option to define the version dynamically from maven. This should fix that.
* Remove Spigot Plugin Annotations
* Remove plugin-annotation repo
* Updated dependencies
* Version 2.10.1
* Add blocks that should be zero by default as they are available
on the ocean floor. https://github.com/BentoBoxWorld/Level/issues/284
* Chinese (#288)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
---------
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate id.yml via GitLocalize (#287)
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
* French (#286)
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
---------
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
* Spanish (#285)
* Translate es.yml via GitLocalize
* Translate es.yml via GitLocalize
---------
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
* Version 2.11.0
* Update Github Build script
* Added distribution required for Github Action
* Update Jacoco
* Update pom.xml
* Add config option to disable plugin hooks (#291)
* Update UltimateStacker dependency
* Add config option to disable plugin hooks
* Use 2.0.0 BentoBox API
* Version 2.12.0
* Adds an admin stats command. See #293
* Update tests
* Update to BentoBox 2.0.0 API
* Added test for Stats command
* Try lower version of jacoco
* Changed top ten internally to use islands instead of players as keys (#295)
Added %[gamemode]_top_weighted_value_x% placeholder
https://github.com/BentoBoxWorld/Level/issues/294
* Added more placeholders. #296
Refactored how the top ten maps are structured. In the future, it may be
best to have the key be the island.
* Translate uk.yml via GitLocalize (#297)
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
* Move to 1.20.4
Refactored the calculator code for clarity.
Added Jacoco line to prvent issues with the bigger Material class.
* Added comments on the panel templates.
* Add protection around unknown blockconfig.yml entries. GRASS>SHORT_GRASS
* Uses latest Visit API to avoid chat spam. Fixes #299 (#300)
* Added test class for EquationEvaluator
* Fix merge error
---------
Co-authored-by: Huynh Tien <huynhqtienvtag@gmail.com>
Co-authored-by: Rubén <44579213+Rubenicos@users.noreply.github.com>
Co-authored-by: Pierre Dedrie <Pirgosth74@gmail.com>
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
Co-authored-by: BONNe <bonne@bonne.id.lv>
Co-authored-by: KrazyxWolf <68208993+KrazyxWolf@users.noreply.github.com>
Co-authored-by: DeadSilenceIV <Barreto-h2@hotmail.com>
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
Co-authored-by: evlad <emmanuelvlad@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
Co-authored-by: DevSolaris <105156235+DevSolaris@users.noreply.github.com>
Co-authored-by: ceze88 <dev.ceze@gmail.com>
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
Co-authored-by: PapiCapi <49530141+PapiCapi@users.noreply.github.com>
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
2024-01-14 04:50:15 +01:00
|
|
|
Integer value = addon.getBlockConfig().getValue(island.getWorld(), md);
|
|
|
|
if (value == null) {
|
|
|
|
// Not in config
|
|
|
|
results.ncCount.add(md);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return value;
|
2020-06-22 02:54:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a chunk async
|
2023-12-10 19:06:33 +01:00
|
|
|
*
|
|
|
|
* @param env - the environment
|
2022-03-13 13:28:08 +01:00
|
|
|
* @param pairList - chunk coordinate
|
2023-12-10 19:06:33 +01:00
|
|
|
* @return a future chunk or future null if there is no chunk to load, e.g.,
|
|
|
|
* there is no island nether
|
2020-06-22 02:54:51 +02:00
|
|
|
*/
|
2021-11-22 05:08:05 +01:00
|
|
|
private CompletableFuture<List<Chunk>> getWorldChunk(Environment env, Queue<Pair<Integer, Integer>> pairList) {
|
Release 2.12.0 (#301)
* Version 2.7.1
* Version 2.7.2
* Use Java 9's takeWhile
* Added placeholder %Level_[gamemode]_rank_value
Fixes https://github.com/BentoBoxWorld/Level/issues/228
* No save on disable (#231)
* Release 2.6.4
* Remove saving to database on disable.
https://github.com/BentoBoxWorld/Level/issues/229
First, the top ten tables are never actually used or loaded. They are
created in memory by loading the island levels. So there is no reason to
keep saving them.
Second, the island level data is saved every time it is changed, so
there is no need to save all of the cache on exit.
* Fixes tests
* Rosestacker (#232)
* Add support for RoseStacker 1.3.0
* Made plugin a Pladdon.
* Version 2.8.0
* Added new placeholders
%Level_%gamemode%_top_island_name_%rank% - lists the island name
%Level_%gamemode%_top_island_members_%rank% - a comma separated list of
team members
https://github.com/BentoBoxWorld/Level/issues/224
https://github.com/BentoBoxWorld/Level/issues/211
https://github.com/BentoBoxWorld/Level/issues/132
https://github.com/BentoBoxWorld/Level/issues/107
https://github.com/BentoBoxWorld/Level/issues/105
* Update to BentoBox API 1.18
* Open up modules for testing access.
* Back support for BentoBox 1.16.5.
* Version 2.8.1
* Speeds up level calculation by doing more chunk scans async.
If chests are scanned, then it will take longer because these have to be
done sync.
https://github.com/BentoBoxWorld/Level/issues/243
* add Vietnamese (#240)
* Raw island level placeholder (#241)
* Changed IslandLevelCalculator minHeight to world minHeight for negative blocks height support since 1.18. (#246)
* Version 2.9.0
* Chinese Translation (#249)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
* Translate id.yml via GitLocalize (#250)
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
* Translate fr.yml via GitLocalize (#251)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Korean translation (#252)
* Translate ko.yml via GitLocalize
* Translate ko.yml via GitLocalize
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
* German Translation (#253)
* Translate de.yml via GitLocalize
* Update de.yml
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: tastybento <tastybento@users.noreply.github.com>
* Translate hu.yml via GitLocalize (#254)
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
* Version 2.9.1
* Attempt to handle WildStacker spawners
* Fix error lon loading id locale
* Avoid async chunk snapshotting.
Fixes https://github.com/BentoBoxWorld/Level/issues/256
* Update to BentoBox API 1.20.
Replace plugin.yml with spigot-annotations.
Implement customizable TopLevelPanel.
* Fixes some small issues with TopLevelPanel
Add Utils class that contains some useful things.
* Implement customizable DetailsPanel.
Remove old DetailsGUITab due to new implementation.
* Fix failing test.
* Remove blank file
* Added repo for maven plugin snapshots
* Implement feature that allows to sort items in detail panel. (#259)
Apparently, because it is 2 years old request, it got in a state -> implement or drop.
Fixes #192
* Implement calculated value for blocks. (#260)
It is ~ value, as calculation formula cannot be applied per block. At least I think so.
Part of #192
* Update es.yml (#261)
* Implement customizable Values GUI. (#262)
This GUI shows value to all items in game. It also shows max limit of blocks, if it is set.
Fixes of #192
* Support for AdvancedChests was updated. (#266)
* Implements visit/warp actions in top gui
Add 2 new actions for island buttons in TOP GUI:
- Visit -> allows to visit island, but it requires Visit Addon
- Warp -> allows to warp to island, but it requires Warp Addon
Requested via Discord.
* Fixes a Level addon crash on startup.
Level addon crashed at the startup if Visit or Warps addon were not installed. It happened because Level addon main class were implementing Listener interface.
To avoid it and fix the crash, I moved migration listener to a separate class.
Fixes #2012
* Translate pl.yml via GitLocalize (#269)
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
* Translate fr.yml via GitLocalize (#272)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Update to Java 17
* Update Github workflow to Java 17
* Adds %Level_[gamemode]_island_level_max% placeholder
This records the lifetime maximum level the island has ever had.
Addresses #271
* Only shows Members or higher in the top members placeholder
Fixes #267
* Add natural log to level-calc formula parsing
Relates to #274
* feat: add island total points + placeholder (#264)
* feat: add island total points + placeholder
* Update IslandLevels.java
* Fix JavaDoc
* Translate zh-CN.yml via GitLocalize (#276)
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate nl.yml via GitLocalize (#277)
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
* Add ${argLine} to get jacoco coverage
* Updated Jacoco POM
* Add shulker to in chest count (#275)
* Sonar Cloud code smell clean up (#278)
* Refactor placeholders (#279)
* Update ReadMe
* Fix Jacoco
* Remove unused imports
* Remove placeholders from main class
Created a separate class for cleaner code and added a test class.
* Remove dependency
* Add UltimateStacker hook for stacked blocks (#281)
* Create plugin.yml (#282)
* Create plugin.yml
The annotations do not provide the option to define the version dynamically from maven. This should fix that.
* Remove Spigot Plugin Annotations
* Remove plugin-annotation repo
* Updated dependencies
* Version 2.10.1
* Add blocks that should be zero by default as they are available
on the ocean floor. https://github.com/BentoBoxWorld/Level/issues/284
* Chinese (#288)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
---------
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate id.yml via GitLocalize (#287)
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
* French (#286)
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
---------
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
* Spanish (#285)
* Translate es.yml via GitLocalize
* Translate es.yml via GitLocalize
---------
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
* Version 2.11.0
* Update Github Build script
* Added distribution required for Github Action
* Update Jacoco
* Update pom.xml
* Add config option to disable plugin hooks (#291)
* Update UltimateStacker dependency
* Add config option to disable plugin hooks
* Use 2.0.0 BentoBox API
* Version 2.12.0
* Adds an admin stats command. See #293
* Update tests
* Update to BentoBox 2.0.0 API
* Added test for Stats command
* Try lower version of jacoco
* Changed top ten internally to use islands instead of players as keys (#295)
Added %[gamemode]_top_weighted_value_x% placeholder
https://github.com/BentoBoxWorld/Level/issues/294
* Added more placeholders. #296
Refactored how the top ten maps are structured. In the future, it may be
best to have the key be the island.
* Translate uk.yml via GitLocalize (#297)
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
* Move to 1.20.4
Refactored the calculator code for clarity.
Added Jacoco line to prvent issues with the bigger Material class.
* Added comments on the panel templates.
* Add protection around unknown blockconfig.yml entries. GRASS>SHORT_GRASS
* Uses latest Visit API to avoid chat spam. Fixes #299 (#300)
* Added test class for EquationEvaluator
* Fix merge error
---------
Co-authored-by: Huynh Tien <huynhqtienvtag@gmail.com>
Co-authored-by: Rubén <44579213+Rubenicos@users.noreply.github.com>
Co-authored-by: Pierre Dedrie <Pirgosth74@gmail.com>
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
Co-authored-by: BONNe <bonne@bonne.id.lv>
Co-authored-by: KrazyxWolf <68208993+KrazyxWolf@users.noreply.github.com>
Co-authored-by: DeadSilenceIV <Barreto-h2@hotmail.com>
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
Co-authored-by: evlad <emmanuelvlad@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
Co-authored-by: DevSolaris <105156235+DevSolaris@users.noreply.github.com>
Co-authored-by: ceze88 <dev.ceze@gmail.com>
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
Co-authored-by: PapiCapi <49530141+PapiCapi@users.noreply.github.com>
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
2024-01-14 04:50:15 +01:00
|
|
|
if (worlds.containsKey(env)) {
|
|
|
|
CompletableFuture<List<Chunk>> r2 = new CompletableFuture<>();
|
|
|
|
List<Chunk> chunkList = new ArrayList<>();
|
|
|
|
World world = worlds.get(env);
|
|
|
|
// Get the chunk, and then coincidentally check the RoseStacker
|
|
|
|
loadChunks(r2, world, pairList, chunkList);
|
|
|
|
return r2;
|
|
|
|
}
|
|
|
|
return CompletableFuture.completedFuture(Collections.emptyList());
|
2021-08-10 05:00:55 +02:00
|
|
|
}
|
2020-06-22 02:54:51 +02:00
|
|
|
|
2021-11-22 05:08:05 +01:00
|
|
|
private void loadChunks(CompletableFuture<List<Chunk>> r2, World world, Queue<Pair<Integer, Integer>> pairList,
|
Release 2.12.0 (#301)
* Version 2.7.1
* Version 2.7.2
* Use Java 9's takeWhile
* Added placeholder %Level_[gamemode]_rank_value
Fixes https://github.com/BentoBoxWorld/Level/issues/228
* No save on disable (#231)
* Release 2.6.4
* Remove saving to database on disable.
https://github.com/BentoBoxWorld/Level/issues/229
First, the top ten tables are never actually used or loaded. They are
created in memory by loading the island levels. So there is no reason to
keep saving them.
Second, the island level data is saved every time it is changed, so
there is no need to save all of the cache on exit.
* Fixes tests
* Rosestacker (#232)
* Add support for RoseStacker 1.3.0
* Made plugin a Pladdon.
* Version 2.8.0
* Added new placeholders
%Level_%gamemode%_top_island_name_%rank% - lists the island name
%Level_%gamemode%_top_island_members_%rank% - a comma separated list of
team members
https://github.com/BentoBoxWorld/Level/issues/224
https://github.com/BentoBoxWorld/Level/issues/211
https://github.com/BentoBoxWorld/Level/issues/132
https://github.com/BentoBoxWorld/Level/issues/107
https://github.com/BentoBoxWorld/Level/issues/105
* Update to BentoBox API 1.18
* Open up modules for testing access.
* Back support for BentoBox 1.16.5.
* Version 2.8.1
* Speeds up level calculation by doing more chunk scans async.
If chests are scanned, then it will take longer because these have to be
done sync.
https://github.com/BentoBoxWorld/Level/issues/243
* add Vietnamese (#240)
* Raw island level placeholder (#241)
* Changed IslandLevelCalculator minHeight to world minHeight for negative blocks height support since 1.18. (#246)
* Version 2.9.0
* Chinese Translation (#249)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
* Translate id.yml via GitLocalize (#250)
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
* Translate fr.yml via GitLocalize (#251)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Korean translation (#252)
* Translate ko.yml via GitLocalize
* Translate ko.yml via GitLocalize
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
* German Translation (#253)
* Translate de.yml via GitLocalize
* Update de.yml
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: tastybento <tastybento@users.noreply.github.com>
* Translate hu.yml via GitLocalize (#254)
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
* Version 2.9.1
* Attempt to handle WildStacker spawners
* Fix error lon loading id locale
* Avoid async chunk snapshotting.
Fixes https://github.com/BentoBoxWorld/Level/issues/256
* Update to BentoBox API 1.20.
Replace plugin.yml with spigot-annotations.
Implement customizable TopLevelPanel.
* Fixes some small issues with TopLevelPanel
Add Utils class that contains some useful things.
* Implement customizable DetailsPanel.
Remove old DetailsGUITab due to new implementation.
* Fix failing test.
* Remove blank file
* Added repo for maven plugin snapshots
* Implement feature that allows to sort items in detail panel. (#259)
Apparently, because it is 2 years old request, it got in a state -> implement or drop.
Fixes #192
* Implement calculated value for blocks. (#260)
It is ~ value, as calculation formula cannot be applied per block. At least I think so.
Part of #192
* Update es.yml (#261)
* Implement customizable Values GUI. (#262)
This GUI shows value to all items in game. It also shows max limit of blocks, if it is set.
Fixes of #192
* Support for AdvancedChests was updated. (#266)
* Implements visit/warp actions in top gui
Add 2 new actions for island buttons in TOP GUI:
- Visit -> allows to visit island, but it requires Visit Addon
- Warp -> allows to warp to island, but it requires Warp Addon
Requested via Discord.
* Fixes a Level addon crash on startup.
Level addon crashed at the startup if Visit or Warps addon were not installed. It happened because Level addon main class were implementing Listener interface.
To avoid it and fix the crash, I moved migration listener to a separate class.
Fixes #2012
* Translate pl.yml via GitLocalize (#269)
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
* Translate fr.yml via GitLocalize (#272)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Update to Java 17
* Update Github workflow to Java 17
* Adds %Level_[gamemode]_island_level_max% placeholder
This records the lifetime maximum level the island has ever had.
Addresses #271
* Only shows Members or higher in the top members placeholder
Fixes #267
* Add natural log to level-calc formula parsing
Relates to #274
* feat: add island total points + placeholder (#264)
* feat: add island total points + placeholder
* Update IslandLevels.java
* Fix JavaDoc
* Translate zh-CN.yml via GitLocalize (#276)
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate nl.yml via GitLocalize (#277)
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
* Add ${argLine} to get jacoco coverage
* Updated Jacoco POM
* Add shulker to in chest count (#275)
* Sonar Cloud code smell clean up (#278)
* Refactor placeholders (#279)
* Update ReadMe
* Fix Jacoco
* Remove unused imports
* Remove placeholders from main class
Created a separate class for cleaner code and added a test class.
* Remove dependency
* Add UltimateStacker hook for stacked blocks (#281)
* Create plugin.yml (#282)
* Create plugin.yml
The annotations do not provide the option to define the version dynamically from maven. This should fix that.
* Remove Spigot Plugin Annotations
* Remove plugin-annotation repo
* Updated dependencies
* Version 2.10.1
* Add blocks that should be zero by default as they are available
on the ocean floor. https://github.com/BentoBoxWorld/Level/issues/284
* Chinese (#288)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
---------
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate id.yml via GitLocalize (#287)
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
* French (#286)
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
---------
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
* Spanish (#285)
* Translate es.yml via GitLocalize
* Translate es.yml via GitLocalize
---------
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
* Version 2.11.0
* Update Github Build script
* Added distribution required for Github Action
* Update Jacoco
* Update pom.xml
* Add config option to disable plugin hooks (#291)
* Update UltimateStacker dependency
* Add config option to disable plugin hooks
* Use 2.0.0 BentoBox API
* Version 2.12.0
* Adds an admin stats command. See #293
* Update tests
* Update to BentoBox 2.0.0 API
* Added test for Stats command
* Try lower version of jacoco
* Changed top ten internally to use islands instead of players as keys (#295)
Added %[gamemode]_top_weighted_value_x% placeholder
https://github.com/BentoBoxWorld/Level/issues/294
* Added more placeholders. #296
Refactored how the top ten maps are structured. In the future, it may be
best to have the key be the island.
* Translate uk.yml via GitLocalize (#297)
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
* Move to 1.20.4
Refactored the calculator code for clarity.
Added Jacoco line to prvent issues with the bigger Material class.
* Added comments on the panel templates.
* Add protection around unknown blockconfig.yml entries. GRASS>SHORT_GRASS
* Uses latest Visit API to avoid chat spam. Fixes #299 (#300)
* Added test class for EquationEvaluator
* Fix merge error
---------
Co-authored-by: Huynh Tien <huynhqtienvtag@gmail.com>
Co-authored-by: Rubén <44579213+Rubenicos@users.noreply.github.com>
Co-authored-by: Pierre Dedrie <Pirgosth74@gmail.com>
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
Co-authored-by: BONNe <bonne@bonne.id.lv>
Co-authored-by: KrazyxWolf <68208993+KrazyxWolf@users.noreply.github.com>
Co-authored-by: DeadSilenceIV <Barreto-h2@hotmail.com>
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
Co-authored-by: evlad <emmanuelvlad@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
Co-authored-by: DevSolaris <105156235+DevSolaris@users.noreply.github.com>
Co-authored-by: ceze88 <dev.ceze@gmail.com>
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
Co-authored-by: PapiCapi <49530141+PapiCapi@users.noreply.github.com>
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
2024-01-14 04:50:15 +01:00
|
|
|
List<Chunk> chunkList) {
|
|
|
|
if (pairList.isEmpty()) {
|
|
|
|
r2.complete(chunkList);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Pair<Integer, Integer> p = pairList.poll();
|
|
|
|
Util.getChunkAtAsync(world, p.x, p.z, world.getEnvironment().equals(Environment.NETHER)).thenAccept(chunk -> {
|
|
|
|
if (chunk != null) {
|
|
|
|
chunkList.add(chunk);
|
|
|
|
roseStackerCheck(chunk);
|
|
|
|
}
|
|
|
|
loadChunks(r2, world, pairList, chunkList); // Iteration
|
|
|
|
});
|
2021-11-22 05:08:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private void roseStackerCheck(Chunk chunk) {
|
Release 2.12.0 (#301)
* Version 2.7.1
* Version 2.7.2
* Use Java 9's takeWhile
* Added placeholder %Level_[gamemode]_rank_value
Fixes https://github.com/BentoBoxWorld/Level/issues/228
* No save on disable (#231)
* Release 2.6.4
* Remove saving to database on disable.
https://github.com/BentoBoxWorld/Level/issues/229
First, the top ten tables are never actually used or loaded. They are
created in memory by loading the island levels. So there is no reason to
keep saving them.
Second, the island level data is saved every time it is changed, so
there is no need to save all of the cache on exit.
* Fixes tests
* Rosestacker (#232)
* Add support for RoseStacker 1.3.0
* Made plugin a Pladdon.
* Version 2.8.0
* Added new placeholders
%Level_%gamemode%_top_island_name_%rank% - lists the island name
%Level_%gamemode%_top_island_members_%rank% - a comma separated list of
team members
https://github.com/BentoBoxWorld/Level/issues/224
https://github.com/BentoBoxWorld/Level/issues/211
https://github.com/BentoBoxWorld/Level/issues/132
https://github.com/BentoBoxWorld/Level/issues/107
https://github.com/BentoBoxWorld/Level/issues/105
* Update to BentoBox API 1.18
* Open up modules for testing access.
* Back support for BentoBox 1.16.5.
* Version 2.8.1
* Speeds up level calculation by doing more chunk scans async.
If chests are scanned, then it will take longer because these have to be
done sync.
https://github.com/BentoBoxWorld/Level/issues/243
* add Vietnamese (#240)
* Raw island level placeholder (#241)
* Changed IslandLevelCalculator minHeight to world minHeight for negative blocks height support since 1.18. (#246)
* Version 2.9.0
* Chinese Translation (#249)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
* Translate id.yml via GitLocalize (#250)
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
* Translate fr.yml via GitLocalize (#251)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Korean translation (#252)
* Translate ko.yml via GitLocalize
* Translate ko.yml via GitLocalize
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
* German Translation (#253)
* Translate de.yml via GitLocalize
* Update de.yml
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: tastybento <tastybento@users.noreply.github.com>
* Translate hu.yml via GitLocalize (#254)
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
* Version 2.9.1
* Attempt to handle WildStacker spawners
* Fix error lon loading id locale
* Avoid async chunk snapshotting.
Fixes https://github.com/BentoBoxWorld/Level/issues/256
* Update to BentoBox API 1.20.
Replace plugin.yml with spigot-annotations.
Implement customizable TopLevelPanel.
* Fixes some small issues with TopLevelPanel
Add Utils class that contains some useful things.
* Implement customizable DetailsPanel.
Remove old DetailsGUITab due to new implementation.
* Fix failing test.
* Remove blank file
* Added repo for maven plugin snapshots
* Implement feature that allows to sort items in detail panel. (#259)
Apparently, because it is 2 years old request, it got in a state -> implement or drop.
Fixes #192
* Implement calculated value for blocks. (#260)
It is ~ value, as calculation formula cannot be applied per block. At least I think so.
Part of #192
* Update es.yml (#261)
* Implement customizable Values GUI. (#262)
This GUI shows value to all items in game. It also shows max limit of blocks, if it is set.
Fixes of #192
* Support for AdvancedChests was updated. (#266)
* Implements visit/warp actions in top gui
Add 2 new actions for island buttons in TOP GUI:
- Visit -> allows to visit island, but it requires Visit Addon
- Warp -> allows to warp to island, but it requires Warp Addon
Requested via Discord.
* Fixes a Level addon crash on startup.
Level addon crashed at the startup if Visit or Warps addon were not installed. It happened because Level addon main class were implementing Listener interface.
To avoid it and fix the crash, I moved migration listener to a separate class.
Fixes #2012
* Translate pl.yml via GitLocalize (#269)
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
* Translate fr.yml via GitLocalize (#272)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Update to Java 17
* Update Github workflow to Java 17
* Adds %Level_[gamemode]_island_level_max% placeholder
This records the lifetime maximum level the island has ever had.
Addresses #271
* Only shows Members or higher in the top members placeholder
Fixes #267
* Add natural log to level-calc formula parsing
Relates to #274
* feat: add island total points + placeholder (#264)
* feat: add island total points + placeholder
* Update IslandLevels.java
* Fix JavaDoc
* Translate zh-CN.yml via GitLocalize (#276)
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate nl.yml via GitLocalize (#277)
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
* Add ${argLine} to get jacoco coverage
* Updated Jacoco POM
* Add shulker to in chest count (#275)
* Sonar Cloud code smell clean up (#278)
* Refactor placeholders (#279)
* Update ReadMe
* Fix Jacoco
* Remove unused imports
* Remove placeholders from main class
Created a separate class for cleaner code and added a test class.
* Remove dependency
* Add UltimateStacker hook for stacked blocks (#281)
* Create plugin.yml (#282)
* Create plugin.yml
The annotations do not provide the option to define the version dynamically from maven. This should fix that.
* Remove Spigot Plugin Annotations
* Remove plugin-annotation repo
* Updated dependencies
* Version 2.10.1
* Add blocks that should be zero by default as they are available
on the ocean floor. https://github.com/BentoBoxWorld/Level/issues/284
* Chinese (#288)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
---------
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate id.yml via GitLocalize (#287)
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
* French (#286)
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
---------
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
* Spanish (#285)
* Translate es.yml via GitLocalize
* Translate es.yml via GitLocalize
---------
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
* Version 2.11.0
* Update Github Build script
* Added distribution required for Github Action
* Update Jacoco
* Update pom.xml
* Add config option to disable plugin hooks (#291)
* Update UltimateStacker dependency
* Add config option to disable plugin hooks
* Use 2.0.0 BentoBox API
* Version 2.12.0
* Adds an admin stats command. See #293
* Update tests
* Update to BentoBox 2.0.0 API
* Added test for Stats command
* Try lower version of jacoco
* Changed top ten internally to use islands instead of players as keys (#295)
Added %[gamemode]_top_weighted_value_x% placeholder
https://github.com/BentoBoxWorld/Level/issues/294
* Added more placeholders. #296
Refactored how the top ten maps are structured. In the future, it may be
best to have the key be the island.
* Translate uk.yml via GitLocalize (#297)
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
* Move to 1.20.4
Refactored the calculator code for clarity.
Added Jacoco line to prvent issues with the bigger Material class.
* Added comments on the panel templates.
* Add protection around unknown blockconfig.yml entries. GRASS>SHORT_GRASS
* Uses latest Visit API to avoid chat spam. Fixes #299 (#300)
* Added test class for EquationEvaluator
* Fix merge error
---------
Co-authored-by: Huynh Tien <huynhqtienvtag@gmail.com>
Co-authored-by: Rubén <44579213+Rubenicos@users.noreply.github.com>
Co-authored-by: Pierre Dedrie <Pirgosth74@gmail.com>
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
Co-authored-by: BONNe <bonne@bonne.id.lv>
Co-authored-by: KrazyxWolf <68208993+KrazyxWolf@users.noreply.github.com>
Co-authored-by: DeadSilenceIV <Barreto-h2@hotmail.com>
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
Co-authored-by: evlad <emmanuelvlad@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
Co-authored-by: DevSolaris <105156235+DevSolaris@users.noreply.github.com>
Co-authored-by: ceze88 <dev.ceze@gmail.com>
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
Co-authored-by: PapiCapi <49530141+PapiCapi@users.noreply.github.com>
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
2024-01-14 04:50:15 +01:00
|
|
|
if (addon.isRoseStackersEnabled()) {
|
|
|
|
RoseStackerAPI.getInstance().getStackedBlocks(Collections.singletonList(chunk)).forEach(e -> {
|
|
|
|
// Blocks below sea level can be scored differently
|
|
|
|
boolean belowSeaLevel = seaHeight > 0 && e.getLocation().getY() <= seaHeight;
|
|
|
|
// Check block once because the base block will be counted in the chunk snapshot
|
|
|
|
for (int _x = 0; _x < e.getStackSize() - 1; _x++) {
|
|
|
|
checkBlock(e.getBlock().getType(), belowSeaLevel);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2020-06-22 02:54:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-12-10 19:06:33 +01:00
|
|
|
* Checks if a block has been limited or not and whether a block has any value
|
|
|
|
* or not
|
|
|
|
*
|
2020-06-22 02:54:51 +02:00
|
|
|
* @param md Material
|
|
|
|
* @return value of the block if can be counted
|
|
|
|
*/
|
|
|
|
private int limitCount(Material md) {
|
Release 2.12.0 (#301)
* Version 2.7.1
* Version 2.7.2
* Use Java 9's takeWhile
* Added placeholder %Level_[gamemode]_rank_value
Fixes https://github.com/BentoBoxWorld/Level/issues/228
* No save on disable (#231)
* Release 2.6.4
* Remove saving to database on disable.
https://github.com/BentoBoxWorld/Level/issues/229
First, the top ten tables are never actually used or loaded. They are
created in memory by loading the island levels. So there is no reason to
keep saving them.
Second, the island level data is saved every time it is changed, so
there is no need to save all of the cache on exit.
* Fixes tests
* Rosestacker (#232)
* Add support for RoseStacker 1.3.0
* Made plugin a Pladdon.
* Version 2.8.0
* Added new placeholders
%Level_%gamemode%_top_island_name_%rank% - lists the island name
%Level_%gamemode%_top_island_members_%rank% - a comma separated list of
team members
https://github.com/BentoBoxWorld/Level/issues/224
https://github.com/BentoBoxWorld/Level/issues/211
https://github.com/BentoBoxWorld/Level/issues/132
https://github.com/BentoBoxWorld/Level/issues/107
https://github.com/BentoBoxWorld/Level/issues/105
* Update to BentoBox API 1.18
* Open up modules for testing access.
* Back support for BentoBox 1.16.5.
* Version 2.8.1
* Speeds up level calculation by doing more chunk scans async.
If chests are scanned, then it will take longer because these have to be
done sync.
https://github.com/BentoBoxWorld/Level/issues/243
* add Vietnamese (#240)
* Raw island level placeholder (#241)
* Changed IslandLevelCalculator minHeight to world minHeight for negative blocks height support since 1.18. (#246)
* Version 2.9.0
* Chinese Translation (#249)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
* Translate id.yml via GitLocalize (#250)
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
* Translate fr.yml via GitLocalize (#251)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Korean translation (#252)
* Translate ko.yml via GitLocalize
* Translate ko.yml via GitLocalize
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
* German Translation (#253)
* Translate de.yml via GitLocalize
* Update de.yml
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: tastybento <tastybento@users.noreply.github.com>
* Translate hu.yml via GitLocalize (#254)
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
* Version 2.9.1
* Attempt to handle WildStacker spawners
* Fix error lon loading id locale
* Avoid async chunk snapshotting.
Fixes https://github.com/BentoBoxWorld/Level/issues/256
* Update to BentoBox API 1.20.
Replace plugin.yml with spigot-annotations.
Implement customizable TopLevelPanel.
* Fixes some small issues with TopLevelPanel
Add Utils class that contains some useful things.
* Implement customizable DetailsPanel.
Remove old DetailsGUITab due to new implementation.
* Fix failing test.
* Remove blank file
* Added repo for maven plugin snapshots
* Implement feature that allows to sort items in detail panel. (#259)
Apparently, because it is 2 years old request, it got in a state -> implement or drop.
Fixes #192
* Implement calculated value for blocks. (#260)
It is ~ value, as calculation formula cannot be applied per block. At least I think so.
Part of #192
* Update es.yml (#261)
* Implement customizable Values GUI. (#262)
This GUI shows value to all items in game. It also shows max limit of blocks, if it is set.
Fixes of #192
* Support for AdvancedChests was updated. (#266)
* Implements visit/warp actions in top gui
Add 2 new actions for island buttons in TOP GUI:
- Visit -> allows to visit island, but it requires Visit Addon
- Warp -> allows to warp to island, but it requires Warp Addon
Requested via Discord.
* Fixes a Level addon crash on startup.
Level addon crashed at the startup if Visit or Warps addon were not installed. It happened because Level addon main class were implementing Listener interface.
To avoid it and fix the crash, I moved migration listener to a separate class.
Fixes #2012
* Translate pl.yml via GitLocalize (#269)
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
* Translate fr.yml via GitLocalize (#272)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Update to Java 17
* Update Github workflow to Java 17
* Adds %Level_[gamemode]_island_level_max% placeholder
This records the lifetime maximum level the island has ever had.
Addresses #271
* Only shows Members or higher in the top members placeholder
Fixes #267
* Add natural log to level-calc formula parsing
Relates to #274
* feat: add island total points + placeholder (#264)
* feat: add island total points + placeholder
* Update IslandLevels.java
* Fix JavaDoc
* Translate zh-CN.yml via GitLocalize (#276)
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate nl.yml via GitLocalize (#277)
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
* Add ${argLine} to get jacoco coverage
* Updated Jacoco POM
* Add shulker to in chest count (#275)
* Sonar Cloud code smell clean up (#278)
* Refactor placeholders (#279)
* Update ReadMe
* Fix Jacoco
* Remove unused imports
* Remove placeholders from main class
Created a separate class for cleaner code and added a test class.
* Remove dependency
* Add UltimateStacker hook for stacked blocks (#281)
* Create plugin.yml (#282)
* Create plugin.yml
The annotations do not provide the option to define the version dynamically from maven. This should fix that.
* Remove Spigot Plugin Annotations
* Remove plugin-annotation repo
* Updated dependencies
* Version 2.10.1
* Add blocks that should be zero by default as they are available
on the ocean floor. https://github.com/BentoBoxWorld/Level/issues/284
* Chinese (#288)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
---------
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate id.yml via GitLocalize (#287)
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
* French (#286)
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
---------
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
* Spanish (#285)
* Translate es.yml via GitLocalize
* Translate es.yml via GitLocalize
---------
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
* Version 2.11.0
* Update Github Build script
* Added distribution required for Github Action
* Update Jacoco
* Update pom.xml
* Add config option to disable plugin hooks (#291)
* Update UltimateStacker dependency
* Add config option to disable plugin hooks
* Use 2.0.0 BentoBox API
* Version 2.12.0
* Adds an admin stats command. See #293
* Update tests
* Update to BentoBox 2.0.0 API
* Added test for Stats command
* Try lower version of jacoco
* Changed top ten internally to use islands instead of players as keys (#295)
Added %[gamemode]_top_weighted_value_x% placeholder
https://github.com/BentoBoxWorld/Level/issues/294
* Added more placeholders. #296
Refactored how the top ten maps are structured. In the future, it may be
best to have the key be the island.
* Translate uk.yml via GitLocalize (#297)
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
* Move to 1.20.4
Refactored the calculator code for clarity.
Added Jacoco line to prvent issues with the bigger Material class.
* Added comments on the panel templates.
* Add protection around unknown blockconfig.yml entries. GRASS>SHORT_GRASS
* Uses latest Visit API to avoid chat spam. Fixes #299 (#300)
* Added test class for EquationEvaluator
* Fix merge error
---------
Co-authored-by: Huynh Tien <huynhqtienvtag@gmail.com>
Co-authored-by: Rubén <44579213+Rubenicos@users.noreply.github.com>
Co-authored-by: Pierre Dedrie <Pirgosth74@gmail.com>
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
Co-authored-by: BONNe <bonne@bonne.id.lv>
Co-authored-by: KrazyxWolf <68208993+KrazyxWolf@users.noreply.github.com>
Co-authored-by: DeadSilenceIV <Barreto-h2@hotmail.com>
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
Co-authored-by: evlad <emmanuelvlad@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
Co-authored-by: DevSolaris <105156235+DevSolaris@users.noreply.github.com>
Co-authored-by: ceze88 <dev.ceze@gmail.com>
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
Co-authored-by: PapiCapi <49530141+PapiCapi@users.noreply.github.com>
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
2024-01-14 04:50:15 +01:00
|
|
|
if (limitCount.containsKey(md)) {
|
|
|
|
int count = limitCount.get(md);
|
|
|
|
if (count > 0) {
|
|
|
|
limitCount.put(md, --count);
|
|
|
|
return getValue(md);
|
|
|
|
} else {
|
|
|
|
results.ofCount.add(md);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return getValue(md);
|
2020-06-22 02:54:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Scan all containers in a chunk and count their blocks
|
2023-12-10 19:06:33 +01:00
|
|
|
*
|
2020-06-22 02:54:51 +02:00
|
|
|
* @param chunk - the chunk to scan
|
|
|
|
*/
|
|
|
|
private void scanChests(Chunk chunk) {
|
2024-04-20 18:50:17 +02:00
|
|
|
// Count blocks in chests
|
|
|
|
for (BlockState bs : chunk.getTileEntities()) {
|
|
|
|
if (bs instanceof Container container) {
|
|
|
|
if (addon.isAdvChestEnabled()) {
|
|
|
|
AdvancedChest<?, ?> aChest = AdvancedChestsAPI.getChestManager().getAdvancedChest(bs.getLocation());
|
|
|
|
if (aChest != null && aChest.getChestType().getName().equals("NORMAL")) {
|
|
|
|
aChest.getPages().stream().map(ChestPage::getItems).forEach(c -> {
|
|
|
|
for (Object i : c) {
|
|
|
|
countItemStack((ItemStack) i);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Regular chest
|
|
|
|
container.getSnapshotInventory().forEach(this::countItemStack);
|
|
|
|
}
|
|
|
|
}
|
2021-02-24 03:59:20 +01:00
|
|
|
}
|
|
|
|
|
2021-02-25 02:29:29 +01:00
|
|
|
private void countItemStack(ItemStack i) {
|
2024-04-20 18:50:17 +02:00
|
|
|
if (i == null || !i.getType().isBlock())
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (int c = 0; c < i.getAmount(); c++) {
|
|
|
|
if (addon.getSettings().isIncludeShulkersInChest()
|
|
|
|
&& i.getItemMeta() instanceof BlockStateMeta blockStateMeta
|
|
|
|
&& blockStateMeta.getBlockState() instanceof ShulkerBox shulkerBox) {
|
|
|
|
shulkerBox.getSnapshotInventory().forEach(this::countItemStack);
|
|
|
|
}
|
|
|
|
|
|
|
|
checkBlock(i.getType(), false);
|
|
|
|
}
|
2020-06-22 02:54:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-12-10 19:06:33 +01:00
|
|
|
* Scan the chunk chests and count the blocks. Note that the chunks are a list
|
|
|
|
* of all the island chunks in a particular world, so the memory usage is high,
|
|
|
|
* but I think most servers can handle it.
|
|
|
|
*
|
2022-02-06 17:47:20 +01:00
|
|
|
* @param chunks - a list of chunks to scan
|
2023-12-10 19:06:33 +01:00
|
|
|
* @return future that completes when the scan is done and supplies a boolean
|
|
|
|
* that will be true if the scan was successful, false if not
|
2020-06-22 02:54:51 +02:00
|
|
|
*/
|
2021-11-22 05:08:05 +01:00
|
|
|
private CompletableFuture<Boolean> scanChunk(List<Chunk> chunks) {
|
2024-04-20 18:50:17 +02:00
|
|
|
// If the chunk hasn't been generated, return
|
|
|
|
if (chunks == null || chunks.isEmpty()) {
|
|
|
|
return CompletableFuture.completedFuture(false);
|
|
|
|
}
|
|
|
|
// Count blocks in chunk
|
|
|
|
CompletableFuture<Boolean> result = new CompletableFuture<>();
|
|
|
|
/*
|
|
|
|
* At this point, we need to grab a snapshot of each chunk and then scan it
|
|
|
|
* async. At the end, we make the CompletableFuture true to show it is done. I'm
|
|
|
|
* not sure how much lag this will cause, but as all the chunks are loaded,
|
|
|
|
* maybe not that much.
|
|
|
|
*/
|
|
|
|
List<ChunkPair> preLoad = chunks.stream().map(c -> new ChunkPair(c.getWorld(), c, c.getChunkSnapshot()))
|
|
|
|
.toList();
|
|
|
|
Bukkit.getScheduler().runTaskAsynchronously(BentoBox.getInstance(), () -> {
|
|
|
|
preLoad.forEach(this::scanAsync);
|
|
|
|
// Once they are all done, return to the main thread.
|
|
|
|
Bukkit.getScheduler().runTask(addon.getPlugin(), () -> result.complete(true));
|
|
|
|
});
|
|
|
|
return result;
|
2020-06-22 02:54:51 +02:00
|
|
|
}
|
|
|
|
|
2023-12-10 19:06:33 +01:00
|
|
|
record ChunkPair(World world, Chunk chunk, ChunkSnapshot chunkSnapshot) {
|
|
|
|
}
|
2022-02-06 17:47:20 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Count the blocks on the island
|
2023-12-10 19:06:33 +01:00
|
|
|
*
|
2022-03-13 13:28:08 +01:00
|
|
|
* @param cp chunk to scan
|
2022-02-06 17:47:20 +01:00
|
|
|
*/
|
|
|
|
private void scanAsync(ChunkPair cp) {
|
2024-04-20 18:50:17 +02:00
|
|
|
for (int x = 0; x < 16; x++) {
|
|
|
|
// Check if the block coordinate is inside the protection zone and if not, don't
|
|
|
|
// count it
|
|
|
|
if (cp.chunkSnapshot.getX() * 16 + x < island.getMinProtectedX() || cp.chunkSnapshot.getX() * 16
|
|
|
|
+ x >= island.getMinProtectedX() + island.getProtectionRange() * 2) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
for (int z = 0; z < 16; z++) {
|
|
|
|
// Check if the block coordinate is inside the protection zone and if not, don't
|
|
|
|
// count it
|
|
|
|
if (cp.chunkSnapshot.getZ() * 16 + z < island.getMinProtectedZ() || cp.chunkSnapshot.getZ() * 16
|
|
|
|
+ z >= island.getMinProtectedZ() + island.getProtectionRange() * 2) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
// Only count to the highest block in the world for some optimization
|
|
|
|
for (int y = cp.world.getMinHeight(); y < cp.world.getMaxHeight(); y++) {
|
|
|
|
BlockData blockData = cp.chunkSnapshot.getBlockData(x, y, z);
|
|
|
|
Material m = blockData.getMaterial();
|
|
|
|
boolean belowSeaLevel = seaHeight > 0 && y <= seaHeight;
|
|
|
|
// Slabs can be doubled, so check them twice
|
|
|
|
if (Tag.SLABS.isTagged(m)) {
|
|
|
|
Slab slab = (Slab) blockData;
|
|
|
|
if (slab.getType().equals(Slab.Type.DOUBLE)) {
|
|
|
|
checkBlock(m, belowSeaLevel);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Hook for Wild Stackers (Blocks and Spawners Only) - this has to use the real
|
|
|
|
// chunk
|
|
|
|
if (addon.isStackersEnabled() && (m.equals(Material.CAULDRON) || m.equals(Material.SPAWNER))) {
|
|
|
|
stackedBlocks.add(new Location(cp.world, (double) x + cp.chunkSnapshot.getX() * 16, y,
|
|
|
|
(double) z + cp.chunkSnapshot.getZ() * 16));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (addon.isUltimateStackerEnabled() && !m.isAir()) {
|
|
|
|
Location l = new Location(cp.chunk.getWorld(), x, y, z);
|
|
|
|
UltimateStackerCalc.addStackers(m, l, results, belowSeaLevel, limitCount(m));
|
|
|
|
}
|
|
|
|
|
|
|
|
// Scan chests
|
|
|
|
if (addon.getSettings().isIncludeChests() && CHESTS.contains(m)) {
|
|
|
|
chestBlocks.add(cp.chunk);
|
|
|
|
}
|
|
|
|
// Add the value of the block's material
|
|
|
|
checkBlock(m, belowSeaLevel);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-02-06 17:47:20 +01:00
|
|
|
}
|
|
|
|
|
2020-06-22 02:54:51 +02:00
|
|
|
/**
|
|
|
|
* Scan the next chunk on the island
|
2023-12-10 19:06:33 +01:00
|
|
|
*
|
|
|
|
* @return completable boolean future that will be true if more chunks are left
|
|
|
|
* to be scanned, and false if not
|
2020-06-22 02:54:51 +02:00
|
|
|
*/
|
|
|
|
public CompletableFuture<Boolean> scanNextChunk() {
|
2024-04-20 18:50:17 +02:00
|
|
|
if (chunksToCheck.isEmpty()) {
|
|
|
|
addon.logError("Unexpected: no chunks to scan!");
|
|
|
|
// This should not be needed, but just in case
|
|
|
|
return CompletableFuture.completedFuture(false);
|
|
|
|
}
|
|
|
|
// Retrieve and remove from the queue
|
|
|
|
Queue<Pair<Integer, Integer>> pairList = new ConcurrentLinkedQueue<>();
|
|
|
|
int i = 0;
|
|
|
|
while (!chunksToCheck.isEmpty() && i++ < CHUNKS_TO_SCAN) {
|
|
|
|
pairList.add(chunksToCheck.poll());
|
|
|
|
}
|
|
|
|
Queue<Pair<Integer, Integer>> endPairList = new ConcurrentLinkedQueue<>(pairList);
|
|
|
|
Queue<Pair<Integer, Integer>> netherPairList = new ConcurrentLinkedQueue<>(pairList);
|
|
|
|
// Set up the result
|
|
|
|
CompletableFuture<Boolean> result = new CompletableFuture<>();
|
|
|
|
// Get chunks and scan
|
|
|
|
// Get chunks and scan
|
|
|
|
getWorldChunk(Environment.THE_END, endPairList).thenAccept(
|
|
|
|
endChunks -> scanChunk(endChunks).thenAccept(b -> getWorldChunk(Environment.NETHER, netherPairList)
|
|
|
|
.thenAccept(netherChunks -> scanChunk(netherChunks)
|
|
|
|
.thenAccept(b2 -> getWorldChunk(Environment.NORMAL, pairList)
|
|
|
|
.thenAccept(normalChunks -> scanChunk(normalChunks).thenAccept(b3 ->
|
|
|
|
// Complete the result now that all chunks have been scanned
|
|
|
|
result.complete(!chunksToCheck.isEmpty())))))));
|
|
|
|
|
|
|
|
return result;
|
2020-06-22 02:54:51 +02:00
|
|
|
}
|
|
|
|
|
2020-07-04 00:27:05 +02:00
|
|
|
private Collection<String> sortedReport(int total, Multiset<Material> materialCount) {
|
2024-04-20 18:50:17 +02:00
|
|
|
Collection<String> result = new ArrayList<>();
|
|
|
|
Iterable<Multiset.Entry<Material>> entriesSortedByCount = Multisets.copyHighestCountFirst(materialCount)
|
|
|
|
.entrySet();
|
|
|
|
for (Entry<Material> en : entriesSortedByCount) {
|
|
|
|
Material type = en.getElement();
|
|
|
|
|
|
|
|
int value = getValue(type);
|
|
|
|
|
|
|
|
result.add(type.toString() + ":" + String.format("%,d", en.getCount()) + " blocks x " + value + " = "
|
|
|
|
+ (value * en.getCount()));
|
|
|
|
total += (value * en.getCount());
|
|
|
|
|
|
|
|
}
|
|
|
|
result.add("Subtotal = " + total);
|
|
|
|
result.add(LINE_BREAK);
|
|
|
|
return result;
|
2020-06-22 02:54:51 +02:00
|
|
|
}
|
|
|
|
|
2021-02-21 04:07:08 +01:00
|
|
|
/**
|
|
|
|
* Finalizes the calculations and makes the report
|
|
|
|
*/
|
|
|
|
public void tidyUp() {
|
2024-04-20 18:50:17 +02:00
|
|
|
// Finalize calculations
|
|
|
|
results.rawBlockCount
|
|
|
|
.addAndGet((long) (results.underWaterBlockCount.get() * addon.getSettings().getUnderWaterMultiplier()));
|
|
|
|
|
|
|
|
// Set the death penalty
|
|
|
|
if (this.addon.getSettings().isSumTeamDeaths()) {
|
|
|
|
for (UUID uuid : this.island.getMemberSet()) {
|
|
|
|
this.results.deathHandicap.addAndGet(this.addon.getPlayers().getDeaths(island.getWorld(), uuid));
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// At this point, it may be that the island has become unowned.
|
|
|
|
this.results.deathHandicap.set(this.island.getOwner() == null ? 0
|
|
|
|
: this.addon.getPlayers().getDeaths(island.getWorld(), this.island.getOwner()));
|
|
|
|
}
|
|
|
|
|
|
|
|
long blockAndDeathPoints = this.results.rawBlockCount.get();
|
|
|
|
this.results.totalPoints.set(blockAndDeathPoints);
|
|
|
|
|
|
|
|
if (this.addon.getSettings().getDeathPenalty() > 0) {
|
|
|
|
// Proper death penalty calculation.
|
|
|
|
blockAndDeathPoints -= this.results.deathHandicap.get() * this.addon.getSettings().getDeathPenalty();
|
|
|
|
}
|
|
|
|
this.results.level.set(calculateLevel(blockAndDeathPoints));
|
|
|
|
|
|
|
|
// Calculate how many points are required to get to the next level
|
|
|
|
long nextLevel = this.results.level.get();
|
|
|
|
long blocks = blockAndDeathPoints;
|
|
|
|
while (nextLevel < this.results.level.get() + 1 && blocks - blockAndDeathPoints < MAX_AMOUNT) {
|
|
|
|
nextLevel = calculateLevel(++blocks);
|
|
|
|
}
|
|
|
|
this.results.pointsToNextLevel.set(blocks - blockAndDeathPoints);
|
|
|
|
|
|
|
|
// Report
|
|
|
|
results.report = getReport();
|
|
|
|
// Set the duration
|
|
|
|
addon.getPipeliner().setTime(System.currentTimeMillis() - duration);
|
|
|
|
// All done.
|
2020-06-22 02:54:51 +02:00
|
|
|
}
|
2020-08-15 19:01:16 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the zeroIsland
|
|
|
|
*/
|
|
|
|
boolean isNotZeroIsland() {
|
Release 2.12.0 (#301)
* Version 2.7.1
* Version 2.7.2
* Use Java 9's takeWhile
* Added placeholder %Level_[gamemode]_rank_value
Fixes https://github.com/BentoBoxWorld/Level/issues/228
* No save on disable (#231)
* Release 2.6.4
* Remove saving to database on disable.
https://github.com/BentoBoxWorld/Level/issues/229
First, the top ten tables are never actually used or loaded. They are
created in memory by loading the island levels. So there is no reason to
keep saving them.
Second, the island level data is saved every time it is changed, so
there is no need to save all of the cache on exit.
* Fixes tests
* Rosestacker (#232)
* Add support for RoseStacker 1.3.0
* Made plugin a Pladdon.
* Version 2.8.0
* Added new placeholders
%Level_%gamemode%_top_island_name_%rank% - lists the island name
%Level_%gamemode%_top_island_members_%rank% - a comma separated list of
team members
https://github.com/BentoBoxWorld/Level/issues/224
https://github.com/BentoBoxWorld/Level/issues/211
https://github.com/BentoBoxWorld/Level/issues/132
https://github.com/BentoBoxWorld/Level/issues/107
https://github.com/BentoBoxWorld/Level/issues/105
* Update to BentoBox API 1.18
* Open up modules for testing access.
* Back support for BentoBox 1.16.5.
* Version 2.8.1
* Speeds up level calculation by doing more chunk scans async.
If chests are scanned, then it will take longer because these have to be
done sync.
https://github.com/BentoBoxWorld/Level/issues/243
* add Vietnamese (#240)
* Raw island level placeholder (#241)
* Changed IslandLevelCalculator minHeight to world minHeight for negative blocks height support since 1.18. (#246)
* Version 2.9.0
* Chinese Translation (#249)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
* Translate id.yml via GitLocalize (#250)
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
* Translate fr.yml via GitLocalize (#251)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Korean translation (#252)
* Translate ko.yml via GitLocalize
* Translate ko.yml via GitLocalize
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
* German Translation (#253)
* Translate de.yml via GitLocalize
* Update de.yml
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: tastybento <tastybento@users.noreply.github.com>
* Translate hu.yml via GitLocalize (#254)
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
* Version 2.9.1
* Attempt to handle WildStacker spawners
* Fix error lon loading id locale
* Avoid async chunk snapshotting.
Fixes https://github.com/BentoBoxWorld/Level/issues/256
* Update to BentoBox API 1.20.
Replace plugin.yml with spigot-annotations.
Implement customizable TopLevelPanel.
* Fixes some small issues with TopLevelPanel
Add Utils class that contains some useful things.
* Implement customizable DetailsPanel.
Remove old DetailsGUITab due to new implementation.
* Fix failing test.
* Remove blank file
* Added repo for maven plugin snapshots
* Implement feature that allows to sort items in detail panel. (#259)
Apparently, because it is 2 years old request, it got in a state -> implement or drop.
Fixes #192
* Implement calculated value for blocks. (#260)
It is ~ value, as calculation formula cannot be applied per block. At least I think so.
Part of #192
* Update es.yml (#261)
* Implement customizable Values GUI. (#262)
This GUI shows value to all items in game. It also shows max limit of blocks, if it is set.
Fixes of #192
* Support for AdvancedChests was updated. (#266)
* Implements visit/warp actions in top gui
Add 2 new actions for island buttons in TOP GUI:
- Visit -> allows to visit island, but it requires Visit Addon
- Warp -> allows to warp to island, but it requires Warp Addon
Requested via Discord.
* Fixes a Level addon crash on startup.
Level addon crashed at the startup if Visit or Warps addon were not installed. It happened because Level addon main class were implementing Listener interface.
To avoid it and fix the crash, I moved migration listener to a separate class.
Fixes #2012
* Translate pl.yml via GitLocalize (#269)
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
* Translate fr.yml via GitLocalize (#272)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Update to Java 17
* Update Github workflow to Java 17
* Adds %Level_[gamemode]_island_level_max% placeholder
This records the lifetime maximum level the island has ever had.
Addresses #271
* Only shows Members or higher in the top members placeholder
Fixes #267
* Add natural log to level-calc formula parsing
Relates to #274
* feat: add island total points + placeholder (#264)
* feat: add island total points + placeholder
* Update IslandLevels.java
* Fix JavaDoc
* Translate zh-CN.yml via GitLocalize (#276)
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate nl.yml via GitLocalize (#277)
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
* Add ${argLine} to get jacoco coverage
* Updated Jacoco POM
* Add shulker to in chest count (#275)
* Sonar Cloud code smell clean up (#278)
* Refactor placeholders (#279)
* Update ReadMe
* Fix Jacoco
* Remove unused imports
* Remove placeholders from main class
Created a separate class for cleaner code and added a test class.
* Remove dependency
* Add UltimateStacker hook for stacked blocks (#281)
* Create plugin.yml (#282)
* Create plugin.yml
The annotations do not provide the option to define the version dynamically from maven. This should fix that.
* Remove Spigot Plugin Annotations
* Remove plugin-annotation repo
* Updated dependencies
* Version 2.10.1
* Add blocks that should be zero by default as they are available
on the ocean floor. https://github.com/BentoBoxWorld/Level/issues/284
* Chinese (#288)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
---------
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate id.yml via GitLocalize (#287)
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
* French (#286)
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
---------
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
* Spanish (#285)
* Translate es.yml via GitLocalize
* Translate es.yml via GitLocalize
---------
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
* Version 2.11.0
* Update Github Build script
* Added distribution required for Github Action
* Update Jacoco
* Update pom.xml
* Add config option to disable plugin hooks (#291)
* Update UltimateStacker dependency
* Add config option to disable plugin hooks
* Use 2.0.0 BentoBox API
* Version 2.12.0
* Adds an admin stats command. See #293
* Update tests
* Update to BentoBox 2.0.0 API
* Added test for Stats command
* Try lower version of jacoco
* Changed top ten internally to use islands instead of players as keys (#295)
Added %[gamemode]_top_weighted_value_x% placeholder
https://github.com/BentoBoxWorld/Level/issues/294
* Added more placeholders. #296
Refactored how the top ten maps are structured. In the future, it may be
best to have the key be the island.
* Translate uk.yml via GitLocalize (#297)
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
* Move to 1.20.4
Refactored the calculator code for clarity.
Added Jacoco line to prvent issues with the bigger Material class.
* Added comments on the panel templates.
* Add protection around unknown blockconfig.yml entries. GRASS>SHORT_GRASS
* Uses latest Visit API to avoid chat spam. Fixes #299 (#300)
* Added test class for EquationEvaluator
* Fix merge error
---------
Co-authored-by: Huynh Tien <huynhqtienvtag@gmail.com>
Co-authored-by: Rubén <44579213+Rubenicos@users.noreply.github.com>
Co-authored-by: Pierre Dedrie <Pirgosth74@gmail.com>
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
Co-authored-by: BONNe <bonne@bonne.id.lv>
Co-authored-by: KrazyxWolf <68208993+KrazyxWolf@users.noreply.github.com>
Co-authored-by: DeadSilenceIV <Barreto-h2@hotmail.com>
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
Co-authored-by: evlad <emmanuelvlad@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
Co-authored-by: DevSolaris <105156235+DevSolaris@users.noreply.github.com>
Co-authored-by: ceze88 <dev.ceze@gmail.com>
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
Co-authored-by: PapiCapi <49530141+PapiCapi@users.noreply.github.com>
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
2024-01-14 04:50:15 +01:00
|
|
|
return !zeroIsland;
|
2020-08-15 19:01:16 +02:00
|
|
|
}
|
2021-11-22 05:08:05 +01:00
|
|
|
|
|
|
|
public void scanIsland(Pipeliner pipeliner) {
|
2024-04-20 18:50:17 +02:00
|
|
|
// Scan the next chunk
|
|
|
|
scanNextChunk().thenAccept(result -> {
|
|
|
|
if (!Bukkit.isPrimaryThread()) {
|
|
|
|
addon.getPlugin().logError("scanChunk not on Primary Thread!");
|
|
|
|
}
|
|
|
|
// Timeout check
|
|
|
|
if (System.currentTimeMillis()
|
|
|
|
- pipeliner.getInProcessQueue().get(this) > addon.getSettings().getCalculationTimeout() * 60000) {
|
|
|
|
// Done
|
|
|
|
pipeliner.getInProcessQueue().remove(this);
|
|
|
|
getR().complete(new Results(Result.TIMEOUT));
|
|
|
|
addon.logError("Level calculation timed out after " + addon.getSettings().getCalculationTimeout()
|
|
|
|
+ "m for island: " + getIsland());
|
|
|
|
if (!isNotZeroIsland()) {
|
|
|
|
addon.logError("Island level was being zeroed.");
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (Boolean.TRUE.equals(result) && !pipeliner.getTask().isCancelled()) {
|
|
|
|
// scanNextChunk returns true if there are more chunks to scan
|
|
|
|
scanIsland(pipeliner);
|
|
|
|
} else {
|
|
|
|
// Done
|
|
|
|
pipeliner.getInProcessQueue().remove(this);
|
|
|
|
// Chunk finished
|
|
|
|
// This was the last chunk
|
|
|
|
handleStackedBlocks();
|
|
|
|
handleChests();
|
|
|
|
long checkTime = System.currentTimeMillis();
|
|
|
|
finishTask = Bukkit.getScheduler().runTaskTimer(addon.getPlugin(), () -> {
|
|
|
|
// Check every half second if all the chests and stacks have been cleared
|
|
|
|
if ((chestBlocks.isEmpty() && stackedBlocks.isEmpty())
|
|
|
|
|| System.currentTimeMillis() - checkTime > MAX_AMOUNT) {
|
|
|
|
this.tidyUp();
|
|
|
|
this.getR().complete(getResults());
|
|
|
|
finishTask.cancel();
|
|
|
|
}
|
|
|
|
}, 0, 10L);
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
2021-11-22 05:08:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private void handleChests() {
|
2024-04-20 18:50:17 +02:00
|
|
|
Iterator<Chunk> it = chestBlocks.iterator();
|
|
|
|
while (it.hasNext()) {
|
|
|
|
Chunk v = it.next();
|
|
|
|
Util.getChunkAtAsync(v.getWorld(), v.getX(), v.getZ()).thenAccept(c -> {
|
|
|
|
scanChests(c);
|
|
|
|
it.remove();
|
|
|
|
});
|
|
|
|
}
|
2021-11-22 05:08:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private void handleStackedBlocks() {
|
Release 2.12.0 (#301)
* Version 2.7.1
* Version 2.7.2
* Use Java 9's takeWhile
* Added placeholder %Level_[gamemode]_rank_value
Fixes https://github.com/BentoBoxWorld/Level/issues/228
* No save on disable (#231)
* Release 2.6.4
* Remove saving to database on disable.
https://github.com/BentoBoxWorld/Level/issues/229
First, the top ten tables are never actually used or loaded. They are
created in memory by loading the island levels. So there is no reason to
keep saving them.
Second, the island level data is saved every time it is changed, so
there is no need to save all of the cache on exit.
* Fixes tests
* Rosestacker (#232)
* Add support for RoseStacker 1.3.0
* Made plugin a Pladdon.
* Version 2.8.0
* Added new placeholders
%Level_%gamemode%_top_island_name_%rank% - lists the island name
%Level_%gamemode%_top_island_members_%rank% - a comma separated list of
team members
https://github.com/BentoBoxWorld/Level/issues/224
https://github.com/BentoBoxWorld/Level/issues/211
https://github.com/BentoBoxWorld/Level/issues/132
https://github.com/BentoBoxWorld/Level/issues/107
https://github.com/BentoBoxWorld/Level/issues/105
* Update to BentoBox API 1.18
* Open up modules for testing access.
* Back support for BentoBox 1.16.5.
* Version 2.8.1
* Speeds up level calculation by doing more chunk scans async.
If chests are scanned, then it will take longer because these have to be
done sync.
https://github.com/BentoBoxWorld/Level/issues/243
* add Vietnamese (#240)
* Raw island level placeholder (#241)
* Changed IslandLevelCalculator minHeight to world minHeight for negative blocks height support since 1.18. (#246)
* Version 2.9.0
* Chinese Translation (#249)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
* Translate id.yml via GitLocalize (#250)
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
* Translate fr.yml via GitLocalize (#251)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Korean translation (#252)
* Translate ko.yml via GitLocalize
* Translate ko.yml via GitLocalize
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
* German Translation (#253)
* Translate de.yml via GitLocalize
* Update de.yml
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: tastybento <tastybento@users.noreply.github.com>
* Translate hu.yml via GitLocalize (#254)
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
* Version 2.9.1
* Attempt to handle WildStacker spawners
* Fix error lon loading id locale
* Avoid async chunk snapshotting.
Fixes https://github.com/BentoBoxWorld/Level/issues/256
* Update to BentoBox API 1.20.
Replace plugin.yml with spigot-annotations.
Implement customizable TopLevelPanel.
* Fixes some small issues with TopLevelPanel
Add Utils class that contains some useful things.
* Implement customizable DetailsPanel.
Remove old DetailsGUITab due to new implementation.
* Fix failing test.
* Remove blank file
* Added repo for maven plugin snapshots
* Implement feature that allows to sort items in detail panel. (#259)
Apparently, because it is 2 years old request, it got in a state -> implement or drop.
Fixes #192
* Implement calculated value for blocks. (#260)
It is ~ value, as calculation formula cannot be applied per block. At least I think so.
Part of #192
* Update es.yml (#261)
* Implement customizable Values GUI. (#262)
This GUI shows value to all items in game. It also shows max limit of blocks, if it is set.
Fixes of #192
* Support for AdvancedChests was updated. (#266)
* Implements visit/warp actions in top gui
Add 2 new actions for island buttons in TOP GUI:
- Visit -> allows to visit island, but it requires Visit Addon
- Warp -> allows to warp to island, but it requires Warp Addon
Requested via Discord.
* Fixes a Level addon crash on startup.
Level addon crashed at the startup if Visit or Warps addon were not installed. It happened because Level addon main class were implementing Listener interface.
To avoid it and fix the crash, I moved migration listener to a separate class.
Fixes #2012
* Translate pl.yml via GitLocalize (#269)
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
* Translate fr.yml via GitLocalize (#272)
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
* Update to Java 17
* Update Github workflow to Java 17
* Adds %Level_[gamemode]_island_level_max% placeholder
This records the lifetime maximum level the island has ever had.
Addresses #271
* Only shows Members or higher in the top members placeholder
Fixes #267
* Add natural log to level-calc formula parsing
Relates to #274
* feat: add island total points + placeholder (#264)
* feat: add island total points + placeholder
* Update IslandLevels.java
* Fix JavaDoc
* Translate zh-CN.yml via GitLocalize (#276)
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate nl.yml via GitLocalize (#277)
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
* Add ${argLine} to get jacoco coverage
* Updated Jacoco POM
* Add shulker to in chest count (#275)
* Sonar Cloud code smell clean up (#278)
* Refactor placeholders (#279)
* Update ReadMe
* Fix Jacoco
* Remove unused imports
* Remove placeholders from main class
Created a separate class for cleaner code and added a test class.
* Remove dependency
* Add UltimateStacker hook for stacked blocks (#281)
* Create plugin.yml (#282)
* Create plugin.yml
The annotations do not provide the option to define the version dynamically from maven. This should fix that.
* Remove Spigot Plugin Annotations
* Remove plugin-annotation repo
* Updated dependencies
* Version 2.10.1
* Add blocks that should be zero by default as they are available
on the ocean floor. https://github.com/BentoBoxWorld/Level/issues/284
* Chinese (#288)
* Translate zh-CN.yml via GitLocalize
* Translate zh-CN.yml via GitLocalize
---------
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
* Translate id.yml via GitLocalize (#287)
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
* French (#286)
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
* Translate fr.yml via GitLocalize
---------
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
* Spanish (#285)
* Translate es.yml via GitLocalize
* Translate es.yml via GitLocalize
---------
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
* Version 2.11.0
* Update Github Build script
* Added distribution required for Github Action
* Update Jacoco
* Update pom.xml
* Add config option to disable plugin hooks (#291)
* Update UltimateStacker dependency
* Add config option to disable plugin hooks
* Use 2.0.0 BentoBox API
* Version 2.12.0
* Adds an admin stats command. See #293
* Update tests
* Update to BentoBox 2.0.0 API
* Added test for Stats command
* Try lower version of jacoco
* Changed top ten internally to use islands instead of players as keys (#295)
Added %[gamemode]_top_weighted_value_x% placeholder
https://github.com/BentoBoxWorld/Level/issues/294
* Added more placeholders. #296
Refactored how the top ten maps are structured. In the future, it may be
best to have the key be the island.
* Translate uk.yml via GitLocalize (#297)
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
* Move to 1.20.4
Refactored the calculator code for clarity.
Added Jacoco line to prvent issues with the bigger Material class.
* Added comments on the panel templates.
* Add protection around unknown blockconfig.yml entries. GRASS>SHORT_GRASS
* Uses latest Visit API to avoid chat spam. Fixes #299 (#300)
* Added test class for EquationEvaluator
* Fix merge error
---------
Co-authored-by: Huynh Tien <huynhqtienvtag@gmail.com>
Co-authored-by: Rubén <44579213+Rubenicos@users.noreply.github.com>
Co-authored-by: Pierre Dedrie <Pirgosth74@gmail.com>
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: 织梦 <493733933@qq.com>
Co-authored-by: Nathan Adhitya <nathanadhitya@outlook.com>
Co-authored-by: organizatsiya <organizatsiya.wildguns@gmail.com>
Co-authored-by: chickiyeah <ruddls030@naver.com>
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
Co-authored-by: András Marczinkó <marczinkoandris@gmail.com>
Co-authored-by: BONNe <bonne@bonne.id.lv>
Co-authored-by: KrazyxWolf <68208993+KrazyxWolf@users.noreply.github.com>
Co-authored-by: DeadSilenceIV <Barreto-h2@hotmail.com>
Co-authored-by: wiktorm12 <wiktorm12@gmail.com>
Co-authored-by: evlad <emmanuelvlad@gmail.com>
Co-authored-by: dawnTak <lanlongxiaode@outlook.com>
Co-authored-by: DevSolaris <solaris.dev.2002@gmail.com>
Co-authored-by: DevSolaris <105156235+DevSolaris@users.noreply.github.com>
Co-authored-by: ceze88 <dev.ceze@gmail.com>
Co-authored-by: Jeansou <bettertreebot@gmail.com>
Co-authored-by: Dusty <siapa-yg-mau-diblokir.kfrxp@simplelogin.com>
Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
Co-authored-by: ChrissTM03 <criisbr193@gmail.com>
Co-authored-by: Espan <zcraftyt@gmail.com>
Co-authored-by: PapiCapi <49530141+PapiCapi@users.noreply.github.com>
Co-authored-by: GIGABAIT <freebitcoin93@gmail.com>
2024-01-14 04:50:15 +01:00
|
|
|
// Deal with any stacked blocks
|
|
|
|
Iterator<Location> it = stackedBlocks.iterator();
|
|
|
|
while (it.hasNext()) {
|
|
|
|
Location v = it.next();
|
|
|
|
Util.getChunkAtAsync(v).thenAccept(c -> {
|
|
|
|
Block stackedBlock = v.getBlock();
|
|
|
|
boolean belowSeaLevel = seaHeight > 0 && v.getBlockY() <= seaHeight;
|
|
|
|
if (WildStackerAPI.getWildStacker().getSystemManager().isStackedBarrel(stackedBlock)) {
|
|
|
|
StackedBarrel barrel = WildStackerAPI.getStackedBarrel(stackedBlock);
|
|
|
|
int barrelAmt = WildStackerAPI.getBarrelAmount(stackedBlock);
|
|
|
|
for (int _x = 0; _x < barrelAmt; _x++) {
|
|
|
|
checkBlock(barrel.getType(), belowSeaLevel);
|
|
|
|
}
|
|
|
|
} else if (WildStackerAPI.getWildStacker().getSystemManager().isStackedSpawner(stackedBlock)) {
|
|
|
|
int spawnerAmt = WildStackerAPI.getSpawnersAmount((CreatureSpawner) stackedBlock.getState());
|
|
|
|
for (int _x = 0; _x < spawnerAmt; _x++) {
|
|
|
|
checkBlock(stackedBlock.getType(), belowSeaLevel);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
it.remove();
|
|
|
|
});
|
|
|
|
}
|
2021-11-22 05:08:05 +01:00
|
|
|
}
|
2019-11-10 05:09:16 +01:00
|
|
|
}
|