mirror of
https://github.com/BentoBoxWorld/Level.git
synced 2024-11-22 10:36:08 +01:00
Version up.
Cleaned up JavaDoc
This commit is contained in:
parent
e8f1f07104
commit
28e6ea4377
2
pom.xml
2
pom.xml
@ -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>
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user