fix region processing

This commit is contained in:
Jesse Boyd 2019-11-02 13:12:21 +01:00
parent 6ed7923a1e
commit 2aa7fc543e
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
4 changed files with 5 additions and 8 deletions

View File

@ -46,7 +46,7 @@ public interface IBatchProcessor {
if (set.hasSection(layer)) {
if (layer == minLayer) {
char[] arr = set.getArray(layer);
int index = (minY & 15) << 12;
int index = (minY & 15) << 8;
for (int i = 0; i < index; i++) arr[i] = 0;
set.setBlocks(layer, arr);
} else {
@ -59,7 +59,7 @@ public interface IBatchProcessor {
if (set.hasSection(layer)) {
if (layer == minLayer) {
char[] arr = set.getArray(layer);
int index = ((maxY + 1) & 15) << 12;
int index = ((maxY + 1) & 15) << 8;
for (int i = index; i < arr.length; i++) arr[i] = 0;
set.setBlocks(layer, arr);
} else {

View File

@ -14,7 +14,7 @@ public class ChunkCache<T extends Trimable> implements IChunkCache<T> {
protected final Long2ObjectLinkedOpenHashMap<WeakReference<T>> getCache;
private final IChunkCache<T> delegate;
protected ChunkCache(IChunkCache<T> delegate) {
public ChunkCache(IChunkCache<T> delegate) {
this.getCache = new Long2ObjectLinkedOpenHashMap<>();
this.delegate = delegate;
}

View File

@ -692,11 +692,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable {
}
public Region[] getCurrentRegions(FaweMaskManager.MaskType type) {
BlockVector3 pos1 = BlockVector3.at(20, 20, 20);
BlockVector3 pos2 = BlockVector3.at(40, 40, 40);
Region[] regions = {new CuboidRegion(getWorld(), pos1, pos2)};
return regions;
// return WEManager.IMP.getMask(this, type);
return WEManager.IMP.getMask(this, type);
}
/**

View File

@ -670,6 +670,7 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
int bz = chunk.getZ() << 4;
int tx = bx + 15;
int tz = bz + 15;
if (bx >= minX && tx <= maxX && bz >= minZ && tz <= maxZ) {
// contains all X/Z
if (minY <= 0 && maxY >= 255) {