Remove debug

This commit is contained in:
boy0001 2015-08-07 02:41:07 +10:00
parent 46e48857bf
commit 845aab5937
4 changed files with 19 additions and 12 deletions

View File

@ -536,10 +536,19 @@ public class PS {
hardmax = Math.min(hardmax, max); hardmax = Math.min(hardmax, max);
Plot[] cache = new Plot[hardmax + 1]; Plot[] cache = new Plot[hardmax + 1];
List<Plot> overflow = new ArrayList<Plot>(overflowSize); List<Plot> overflow = new ArrayList<Plot>(overflowSize);
ArrayList<Plot> extra = new ArrayList<>();
for (Plot plot : plots) { for (Plot plot : plots) {
int hash = MathMan.getPositiveId(plot.hashCode()); int hash = MathMan.getPositiveId(plot.hashCode());
if (hash < hardmax && hash > -1) { if (hash < hardmax) {
cache[hash] = plot; if (hash >= 0) {
cache[hash] = plot;
}
else {
extra.add(plot);
}
}
else if (Math.abs(plot.id.x) > 15446 || Math.abs(plot.id.y) > 15446) {
extra.add(plot);
} }
else { else {
overflow.add(plot); overflow.add(plot);
@ -556,6 +565,9 @@ public class PS {
for (Plot plot : overflowArray) { for (Plot plot : overflowArray) {
result.add(plot); result.add(plot);
} }
for (Plot plot : extra) {
result.add(plot);
}
return result; return result;
} }
@ -746,8 +758,7 @@ public class PS {
* @param input * @param input
*/ */
public static void sortPlotsByHash(Plot[] input) { public static void sortPlotsByHash(Plot[] input) {
final int SIZE = 100; List<Plot>[] bucket = new ArrayList[64];
List<Plot>[] bucket = new ArrayList[SIZE];
for (int i = 0; i < bucket.length; i++) { for (int i = 0; i < bucket.length; i++) {
bucket[i] = new ArrayList<Plot>(); bucket[i] = new ArrayList<Plot>();
} }
@ -757,19 +768,19 @@ public class PS {
maxLength = true; maxLength = true;
for (Plot i : input) { for (Plot i : input) {
tmp = MathMan.getPositiveId(i.hashCode()) / placement; tmp = MathMan.getPositiveId(i.hashCode()) / placement;
bucket[tmp % SIZE].add(i); bucket[tmp & 63].add(i);
if (maxLength && tmp > 0) { if (maxLength && tmp > 0) {
maxLength = false; maxLength = false;
} }
} }
int a = 0; int a = 0;
for (int b = 0; b < SIZE; b++) { for (int b = 0; b < 64; b++) {
for (Plot i : bucket[b]) { for (Plot i : bucket[b]) {
input[a++] = i; input[a++] = i;
} }
bucket[b].clear(); bucket[b].clear();
} }
placement *= SIZE; placement *= 64;
} }
} }

View File

@ -45,10 +45,6 @@ public class MusicSubcommand extends SubCommand {
@Override @Override
public boolean onCommand(final PlotPlayer player, final String[] args) { public boolean onCommand(final PlotPlayer player, final String[] args) {
// TODO FIX PLOT MUSIC AS NPE FROM PLAYER.PLAYEFFECT
System.out.print("TODO MUSIC");
final Location loc = player.getLocation(); final Location loc = player.getLocation();
final Plot plot = MainUtil.getPlot(loc); final Plot plot = MainUtil.getPlot(loc);
if (plot == null) { if (plot == null) {

View File

@ -2378,6 +2378,7 @@ public class SQLManager implements AbstractDB {
// TODO comments // TODO comments
// TODO ratings // TODO ratings
// TODO alias // TODO alias
// TODO unconnected entries from helpers, trusted, denied, comments, settings, rating
} }
for (Entry<String, ConcurrentHashMap<PlotId, Plot>> entry : database.entrySet()) { for (Entry<String, ConcurrentHashMap<PlotId, Plot>> entry : database.entrySet()) {

View File

@ -222,7 +222,6 @@ public class BukkitPlayer extends PlotPlayer {
@Override @Override
public void playMusic(Location loc, int id) { public void playMusic(Location loc, int id) {
System.out.print("RECORD: " + id);
player.playEffect(BukkitUtil.getLocation(loc), Effect.RECORD_PLAY, id); player.playEffect(BukkitUtil.getLocation(loc), Effect.RECORD_PLAY, id);
} }