Minor changes for readability

This commit is contained in:
MattBDev 2019-10-23 22:33:51 -04:00
parent 1b28dcda40
commit ca843f1b90
8 changed files with 18 additions and 42 deletions

View File

@ -516,7 +516,7 @@ public class BukkitWorld extends AbstractWorld {
} }
@Override @Override
public void sendChunk(int X, int Z, int mask) { public void sendChunk(int chunkX, int chunkZ, int bitMask) {
} }
@Override @Override

View File

@ -320,7 +320,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
} }
@Override @Override
public void sendChunk(int X, int Z, int mask) { public void sendChunk(int chunkX, int chunkZ, int bitMask) {
throw new UnsupportedOperationException("TODO NOT IMPLEMENTED"); // add method to adapter to send custom chunk throw new UnsupportedOperationException("TODO NOT IMPLEMENTED"); // add method to adapter to send custom chunk
} }

View File

@ -80,34 +80,15 @@ public abstract class MCAWriter implements Extent {
final ForkJoinPool pool = new ForkJoinPool(); final ForkJoinPool pool = new ForkJoinPool();
int tcx = (width - 1) >> 4; int tcx = (width - 1) >> 4;
int tcz = (length - 1) >> 4; int tcz = (length - 1) >> 4;
final ThreadLocal<WritableMCAChunk> chunkStore = new ThreadLocal<WritableMCAChunk>() { final ThreadLocal<WritableMCAChunk> chunkStore = ThreadLocal.withInitial(() -> {
@Override
protected WritableMCAChunk initialValue() {
WritableMCAChunk chunk = new WritableMCAChunk(); WritableMCAChunk chunk = new WritableMCAChunk();
Arrays.fill(chunk.blocks, BlockID.AIR); Arrays.fill(chunk.blocks, BlockID.AIR);
// Arrays.fill(chunk.skyLight, (byte) 255);
return chunk; return chunk;
} });
}; final ThreadLocal<byte[]> byteStore1 = ThreadLocal.withInitial(() -> new byte[500000]);
final ThreadLocal<byte[]> byteStore1 = new ThreadLocal<byte[]>() { final ThreadLocal<byte[]> byteStore2 = ThreadLocal.withInitial(() -> new byte[500000]);
@Override final ThreadLocal<Deflater> deflateStore = ThreadLocal
protected byte[] initialValue() { .withInitial(() -> new Deflater(Deflater.BEST_SPEED, false));
return new byte[500000];
}
};
final ThreadLocal<byte[]> byteStore2 = new ThreadLocal<byte[]>() {
@Override
protected byte[] initialValue() {
return new byte[500000];
}
};
final ThreadLocal<Deflater> deflateStore = new ThreadLocal<Deflater>() {
@Override
protected Deflater initialValue() {
Deflater deflater = new Deflater(Deflater.BEST_SPEED, false);
return deflater;
}
};
byte[] fileBuf = new byte[1 << 16]; byte[] fileBuf = new byte[1 << 16];
int mcaXMin = 0; int mcaXMin = 0;
int mcaZMin = 0; int mcaZMin = 0;

View File

@ -2,12 +2,9 @@ package com.boydti.fawe.object.extent;
import com.boydti.fawe.FaweCache; import com.boydti.fawe.FaweCache;
import com.boydti.fawe.beta.IBatchProcessor; import com.boydti.fawe.beta.IBatchProcessor;
import com.boydti.fawe.beta.IChunkSet;
import com.boydti.fawe.object.FaweLimit; import com.boydti.fawe.object.FaweLimit;
import com.boydti.fawe.object.exception.FaweException;
import com.boydti.fawe.util.ExtentTraverser; import com.boydti.fawe.util.ExtentTraverser;
import com.boydti.fawe.util.WEManager; import com.boydti.fawe.util.WEManager;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.entity.Entity;
@ -22,9 +19,6 @@ import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;
import java.util.Collection; import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import javax.annotation.Nullable; import javax.annotation.Nullable;
public abstract class FaweRegionExtent extends ResettableExtent implements IBatchProcessor { public abstract class FaweRegionExtent extends ResettableExtent implements IBatchProcessor {
@ -56,6 +50,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc
} }
@Override @Override
public Extent construct(Extent child) { public Extent construct(Extent child) {
if (getExtent() != child) { if (getExtent() != child) {
new ExtentTraverser<Extent>(this).setNext(child); new ExtentTraverser<Extent>(this).setNext(child);

View File

@ -235,8 +235,8 @@ public class WorldWrapper extends AbstractWorld {
} }
@Override @Override
public void sendChunk(int X, int Z, int mask) { public void sendChunk(int chunkX, int chunkZ, int bitMask) {
parent.sendChunk(X, Z, mask); parent.sendChunk(chunkX, chunkZ, bitMask);
} }
@Override @Override

View File

@ -31,8 +31,8 @@ import java.util.List;
/** /**
* A Kochanek-Bartels interpolation; continuous in the 2nd derivative. * A Kochanek-Bartels interpolation; continuous in the 2nd derivative.
* *
* <p>Supports {@link Node#tension tension}, {@link Node#bias bias} and * <p>Supports {@link Node#getTension() tension}, {@link Node#getBias() bias} and
* {@link Node#continuity continuity} parameters per {@link Node}.</p> * {@link Node#getContinuity() continuity} parameters per {@link Node}.</p>
*/ */
public class KochanekBartelsInterpolation implements Interpolation { public class KochanekBartelsInterpolation implements Interpolation {

View File

@ -148,7 +148,7 @@ public class NullWorld extends AbstractWorld {
} }
@Override @Override
public void sendChunk(int X, int Z, int mask) { public void sendChunk(int chunkX, int chunkZ, int bitMask) {
} }

View File

@ -300,7 +300,7 @@ public interface World extends Extent, Keyed, IChunkCache<IChunkGet> {
* @param chunkZ * @param chunkZ
* @param bitMask * @param bitMask
*/ */
void sendChunk(final int X, final int Z, final int mask); void sendChunk(final int chunkX, final int chunkZ, final int bitMask);
@Override @Override
IChunkGet get(int x, int z); IChunkGet get(int x, int z);