Version up.

Cleaned up JavaDoc
This commit is contained in:
tastybento 2019-01-03 10:27:20 -08:00
parent e8f1f07104
commit 28e6ea4377
4 changed files with 21 additions and 33 deletions

View File

@ -6,7 +6,7 @@
<groupId>world.bentobox</groupId>
<artifactId>level</artifactId>
<version>0.3.0-SNAPSHOT</version>
<version>0.4.0-SNAPSHOT</version>
<name>Level</name>
<description>Level is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like SkyBlock or AcidIsland.</description>

View File

@ -6,19 +6,19 @@ import java.util.UUID;
import org.bukkit.World;
import world.bentobox.level.commands.admin.AdminLevelCommand;
import world.bentobox.level.commands.admin.AdminTopCommand;
import world.bentobox.level.commands.island.IslandLevelCommand;
import world.bentobox.level.commands.island.IslandTopCommand;
import world.bentobox.level.config.Settings;
import world.bentobox.level.objects.LevelsData;
import world.bentobox.level.listeners.JoinLeaveListener;
import world.bentobox.level.listeners.NewIslandListener;
import world.bentobox.bentobox.api.addons.Addon;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.database.Database;
import world.bentobox.bentobox.database.objects.Island;
import world.bentobox.level.commands.admin.AdminLevelCommand;
import world.bentobox.level.commands.admin.AdminTopCommand;
import world.bentobox.level.commands.island.IslandLevelCommand;
import world.bentobox.level.commands.island.IslandTopCommand;
import world.bentobox.level.config.Settings;
import world.bentobox.level.listeners.JoinLeaveListener;
import world.bentobox.level.listeners.NewIslandListener;
import world.bentobox.level.objects.LevelsData;
import world.bentobox.level.requests.LevelRequestHandler;
/**
@ -185,7 +185,6 @@ public class Level extends Addon {
levelsCache.get(island.getOwner()).setInitialIslandLevel(level);
}
public Database<LevelsData> getHandler() {
return handler;
}

View File

@ -148,11 +148,7 @@ public class CalcIslandLevel {
/**
* Checks if a block has been limited or not and whether a block has any value or not
<<<<<<< HEAD
* @param md Material
=======
* @param md - Material to check
>>>>>>> branch 'develop' of https://github.com/BentoBoxWorld/addon-level.git
* @return value of the block if can be counted
*/
private int limitCount(Material md) {
@ -176,11 +172,7 @@ public class CalcIslandLevel {
/**
* Get value of a material
* World blocks trump regular block values
<<<<<<< HEAD
* @param md Material
=======
* @param md - Material to check
>>>>>>> branch 'develop' of https://github.com/BentoBoxWorld/addon-level.git
* @return value of a material
*/
private int getValue(Material md) {
@ -193,11 +185,7 @@ public class CalcIslandLevel {
/**
* Get a set of all the chunks in island
* @param island - island
<<<<<<< HEAD
* @return - set of all the chunks in the island to scan
=======
* @return - set of pairs of x,z coordinates to check
>>>>>>> branch 'develop' of https://github.com/BentoBoxWorld/addon-level.git
*/
private Set<Pair<Integer, Integer>> getChunksToScan(Island island) {
Set<Pair<Integer, Integer>> chunkSnapshot = new HashSet<>();
@ -227,25 +215,26 @@ public class CalcIslandLevel {
else
{
this.result.deathHandicap =
this.addon.getPlayers().getDeaths(this.world, this.island.getOwner());
this.addon.getPlayers().getDeaths(this.world, this.island.getOwner());
}
// Just lazy check for min death count.
this.result.deathHandicap = Math.min(this.result.deathHandicap, this.addon.getSettings().getMaxDeaths());
this.result.deathHandicap = Math.min(this.result.deathHandicap, this.addon.getSettings().getMaxDeaths());
long blockAndDeathPoints = this.result.rawBlockCount;
long blockAndDeathPoints = this.result.rawBlockCount;
if (this.addon.getSettings().getDeathPenalty() > 0)
{
// Proper death penalty calculation.
blockAndDeathPoints -= this.result.deathHandicap * this.addon.getSettings().getDeathPenalty();
}
{
// Proper death penalty calculation.
blockAndDeathPoints -= this.result.deathHandicap * this.addon.getSettings().getDeathPenalty();
}
this.result.level = blockAndDeathPoints / this.addon.getSettings().getLevelCost() - this.island.getLevelHandicap();
this.result.level = blockAndDeathPoints / this.addon.getSettings().getLevelCost() - this.island.getLevelHandicap();
// Calculate how many points are required to get to the next level
this.result.pointsToNextLevel = this.addon.getSettings().getLevelCost() -
(blockAndDeathPoints % this.addon.getSettings().getLevelCost());
(blockAndDeathPoints % this.addon.getSettings().getLevelCost());
// Report
result.report = getReport();

View File

@ -7,11 +7,11 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import world.bentobox.level.Level;
import world.bentobox.level.calculators.CalcIslandLevel;
import world.bentobox.bentobox.api.events.island.IslandEvent.IslandCreatedEvent;
import world.bentobox.bentobox.api.events.island.IslandEvent.IslandResettedEvent;
import world.bentobox.bentobox.database.objects.Island;
import world.bentobox.level.Level;
import world.bentobox.level.calculators.CalcIslandLevel;
/**
* Listens for new islands and sets the level to zero automatically