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 (set.hasSection(layer)) {
if (layer == minLayer) { if (layer == minLayer) {
char[] arr = set.getArray(layer); 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; for (int i = 0; i < index; i++) arr[i] = 0;
set.setBlocks(layer, arr); set.setBlocks(layer, arr);
} else { } else {
@ -59,7 +59,7 @@ public interface IBatchProcessor {
if (set.hasSection(layer)) { if (set.hasSection(layer)) {
if (layer == minLayer) { if (layer == minLayer) {
char[] arr = set.getArray(layer); 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; for (int i = index; i < arr.length; i++) arr[i] = 0;
set.setBlocks(layer, arr); set.setBlocks(layer, arr);
} else { } else {

View File

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

View File

@ -692,11 +692,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable {
} }
public Region[] getCurrentRegions(FaweMaskManager.MaskType type) { public Region[] getCurrentRegions(FaweMaskManager.MaskType type) {
BlockVector3 pos1 = BlockVector3.at(20, 20, 20); return WEManager.IMP.getMask(this, type);
BlockVector3 pos2 = BlockVector3.at(40, 40, 40);
Region[] regions = {new CuboidRegion(getWorld(), pos1, pos2)};
return regions;
// 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 bz = chunk.getZ() << 4;
int tx = bx + 15; int tx = bx + 15;
int tz = bz + 15; int tz = bz + 15;
if (bx >= minX && tx <= maxX && bz >= minZ && tz <= maxZ) { if (bx >= minX && tx <= maxX && bz >= minZ && tz <= maxZ) {
// contains all X/Z // contains all X/Z
if (minY <= 0 && maxY >= 255) { if (minY <= 0 && maxY >= 255) {