Conflicts:
	src/main/java/bskyblock/addon/level/Level.java
	src/main/java/bskyblock/addon/level/TopTen.java
This commit is contained in:
Tastybento 2018-03-11 17:37:54 -07:00
commit c31c2bcbf5
5 changed files with 16 additions and 8 deletions

View File

@ -43,7 +43,6 @@
<dependency> <dependency>
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId> <artifactId>bukkit</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -55,6 +54,7 @@
<groupId>bskyblock.addon</groupId> <groupId>bskyblock.addon</groupId>
<artifactId>WelcomeWarpSigns</artifactId> <artifactId>WelcomeWarpSigns</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<repositories> <repositories>

View File

@ -117,12 +117,12 @@ public class LevelCalcByChunk {
private void scanChunk(ChunkSnapshot chunk) { private void scanChunk(ChunkSnapshot chunk) {
for (int x = 0; x< 16; x++) { for (int x = 0; x< 16; x++) {
// Check if the block coord is inside the protection zone and if not, don't count it // 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; continue;
} }
for (int z = 0; z < 16; z++) { for (int z = 0; z < 16; z++) {
// Check if the block coord is inside the protection zone and if not, don't count it // 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; continue;
} }
@ -196,8 +196,8 @@ public class LevelCalcByChunk {
*/ */
private Set<Pair<Integer, Integer>> getChunksToScan(Island island) { private Set<Pair<Integer, Integer>> getChunksToScan(Island island) {
Set<Pair<Integer, Integer>> chunkSnapshot = new HashSet<>(); Set<Pair<Integer, Integer>> chunkSnapshot = new HashSet<>();
for (int x = island.getMinProtectedX(); x < (island.getMinProtectedX() + island.getProtectionRange() + 16); x += 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() + 16); z += 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()); Pair<Integer, Integer> pair = new Pair<>(world.getBlockAt(x, 0, z).getChunk().getX(), world.getBlockAt(x, 0, z).getChunk().getZ());
chunkSnapshot.add(pair); chunkSnapshot.add(pair);
} }

View File

@ -2,7 +2,6 @@ package bskyblock.addon.level;
import java.beans.IntrospectionException; import java.beans.IntrospectionException;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;

View File

@ -1,10 +1,15 @@
package bskyblock.addon.level.database.object; package bskyblock.addon.level.database.object;
import com.google.gson.annotations.Expose;
import us.tastybento.bskyblock.database.objects.DataObject; import us.tastybento.bskyblock.database.objects.DataObject;
public class LevelsData implements DataObject { public class LevelsData implements DataObject {
@Expose
private String uniqueId = ""; private String uniqueId = "";
@Expose
private long level = 0; private long level = 0;
public String getUniqueId() { public String getUniqueId() {

View File

@ -6,6 +6,8 @@ import java.util.Map;
import java.util.UUID; import java.util.UUID;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.google.gson.annotations.Expose;
import us.tastybento.bskyblock.database.objects.DataObject; import us.tastybento.bskyblock.database.objects.DataObject;
/** /**
@ -15,10 +17,12 @@ import us.tastybento.bskyblock.database.objects.DataObject;
*/ */
public class TopTenData implements DataObject { public class TopTenData implements DataObject {
@Expose
private String uniqueId = "topten"; 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; return topTen;
} }