fix region processing

Dieser Commit ist enthalten in:
Jesse Boyd 2019-11-02 13:12:21 +01:00
Ursprung 6ed7923a1e
Commit 2aa7fc543e
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 59F1DE6293AF6E1F
4 geänderte Dateien mit 5 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -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 {

Datei anzeigen

@ -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;
} }

Datei anzeigen

@ -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);
} }
/** /**

Datei anzeigen

@ -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) {