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

View File

@ -45,10 +45,6 @@ public class MusicSubcommand extends SubCommand {
@Override
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 Plot plot = MainUtil.getPlot(loc);
if (plot == null) {

View File

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

View File

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