mirror of
https://github.com/BentoBoxWorld/Level.git
synced 2024-12-24 18:17:41 +01:00
Updated to latest BSkyBlock
This commit is contained in:
parent
78d3999451
commit
99adc51d65
2
pom.xml
2
pom.xml
@ -43,7 +43,6 @@
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.12.2-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -55,6 +54,7 @@
|
||||
<groupId>bskyblock.addon</groupId>
|
||||
<artifactId>WelcomeWarpSigns</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<repositories>
|
||||
|
@ -18,8 +18,8 @@ import us.tastybento.bskyblock.Constants;
|
||||
import us.tastybento.bskyblock.api.addons.Addon;
|
||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
||||
import us.tastybento.bskyblock.api.commands.User;
|
||||
import us.tastybento.bskyblock.database.AbstractDatabaseHandler;
|
||||
import us.tastybento.bskyblock.database.BSBDatabase;
|
||||
import us.tastybento.bskyblock.database.managers.AbstractDatabaseHandler;
|
||||
|
||||
/**
|
||||
* Addon to BSkyBlock that enables island level scoring and top ten functionality
|
||||
|
@ -117,12 +117,12 @@ public class LevelCalcByChunk {
|
||||
private void scanChunk(ChunkSnapshot chunk) {
|
||||
for (int x = 0; x< 16; x++) {
|
||||
// Check if the block coord is inside the protection zone and if not, don't count it
|
||||
if (chunk.getX() * 16 + x < island.getMinProtectedX() || chunk.getX() * 16 + x >= island.getMinProtectedX() + island.getProtectionRange()) {
|
||||
if (chunk.getX() * 16 + x < island.getMinProtectedX() || chunk.getX() * 16 + x >= island.getMinProtectedX() + island.getProtectionRange() * 2) {
|
||||
continue;
|
||||
}
|
||||
for (int z = 0; z < 16; z++) {
|
||||
// Check if the block coord is inside the protection zone and if not, don't count it
|
||||
if (chunk.getZ() * 16 + z < island.getMinProtectedZ() || chunk.getZ() * 16 + z >= island.getMinProtectedZ() + island.getProtectionRange()) {
|
||||
if (chunk.getZ() * 16 + z < island.getMinProtectedZ() || chunk.getZ() * 16 + z >= island.getMinProtectedZ() + island.getProtectionRange() * 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -196,8 +196,8 @@ public class LevelCalcByChunk {
|
||||
*/
|
||||
private Set<Pair<Integer, Integer>> getChunksToScan(Island island) {
|
||||
Set<Pair<Integer, Integer>> chunkSnapshot = new HashSet<>();
|
||||
for (int x = island.getMinProtectedX(); x < (island.getMinProtectedX() + island.getProtectionRange() + 16); x += 16) {
|
||||
for (int z = island.getMinProtectedZ(); z < (island.getMinProtectedZ() + island.getProtectionRange() + 16); z += 16) {
|
||||
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) {
|
||||
Pair<Integer, Integer> pair = new Pair<>(world.getBlockAt(x, 0, z).getChunk().getX(), world.getBlockAt(x, 0, z).getChunk().getZ());
|
||||
chunkSnapshot.add(pair);
|
||||
}
|
||||
|
@ -24,8 +24,8 @@ import us.tastybento.bskyblock.api.panels.PanelItem;
|
||||
import us.tastybento.bskyblock.api.panels.PanelItem.ClickHandler;
|
||||
import us.tastybento.bskyblock.api.panels.builders.PanelBuilder;
|
||||
import us.tastybento.bskyblock.api.panels.builders.PanelItemBuilder;
|
||||
import us.tastybento.bskyblock.database.AbstractDatabaseHandler;
|
||||
import us.tastybento.bskyblock.database.BSBDatabase;
|
||||
import us.tastybento.bskyblock.database.managers.AbstractDatabaseHandler;
|
||||
|
||||
/**
|
||||
* Handles all Top Ten List functions
|
||||
|
@ -1,10 +1,15 @@
|
||||
package bskyblock.addon.level.database.object;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import us.tastybento.bskyblock.database.objects.DataObject;
|
||||
|
||||
public class LevelsData implements DataObject {
|
||||
|
||||
@Expose
|
||||
private String uniqueId = "";
|
||||
|
||||
@Expose
|
||||
private long level = 0;
|
||||
|
||||
public String getUniqueId() {
|
||||
|
@ -6,6 +6,8 @@ import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import us.tastybento.bskyblock.database.objects.DataObject;
|
||||
|
||||
/**
|
||||
@ -15,10 +17,12 @@ import us.tastybento.bskyblock.database.objects.DataObject;
|
||||
*/
|
||||
public class TopTenData implements DataObject {
|
||||
|
||||
@Expose
|
||||
private String uniqueId = "topten";
|
||||
private HashMap<UUID, Long> topTen = new HashMap<>();
|
||||
@Expose
|
||||
private Map<UUID, Long> topTen = new HashMap<>();
|
||||
|
||||
public HashMap<UUID, Long> getTopTen() {
|
||||
public Map<UUID, Long> getTopTen() {
|
||||
return topTen;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user