3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-07-22 18:18:03 +02:00

GetBlocks should default to air not reserved

Dieser Commit ist enthalten in:
dordsor21 2020-07-02 18:16:15 +01:00
Ursprung b58877a57b
Commit 18c9da372c
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B
4 geänderte Dateien mit 22 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -563,10 +563,13 @@ public class BukkitGetBlocks_1_14 extends CharGetBlocks {
ChunkSection section = getSections()[layer]; ChunkSection section = getSections()[layer];
// Section is null, return empty array // Section is null, return empty array
if (section == null) { if (section == null) {
return FaweCache.IMP.EMPTY_CHAR_4096; data = new char[4096];
Arrays.fill(data, (char) 1);
return data;
} }
if (data == null || data == FaweCache.IMP.EMPTY_CHAR_4096) { if (data == null || data == FaweCache.IMP.EMPTY_CHAR_4096) {
data = new char[4096]; data = new char[4096];
Arrays.fill(data, (char) 1);
} }
DelegateLock lock = BukkitAdapter_1_14.applyLock(section); DelegateLock lock = BukkitAdapter_1_14.applyLock(section);
synchronized (lock) { synchronized (lock) {

Datei anzeigen

@ -581,10 +581,13 @@ public class BukkitGetBlocks_1_15_2 extends CharGetBlocks {
ChunkSection section = getSections()[layer]; ChunkSection section = getSections()[layer];
// Section is null, return empty array // Section is null, return empty array
if (section == null) { if (section == null) {
return FaweCache.IMP.EMPTY_CHAR_4096; data = new char[4096];
Arrays.fill(data, (char) 1);
return data;
} }
if (data == null || data == FaweCache.IMP.EMPTY_CHAR_4096) { if (data == null || data == FaweCache.IMP.EMPTY_CHAR_4096) {
data = new char[4096]; data = new char[4096];
Arrays.fill(data, (char) 1);
} }
DelegateLock lock = BukkitAdapter_1_15_2.applyLock(section); DelegateLock lock = BukkitAdapter_1_15_2.applyLock(section);
synchronized (lock) { synchronized (lock) {

Datei anzeigen

@ -552,10 +552,13 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks {
ChunkSection section = getSections()[layer]; ChunkSection section = getSections()[layer];
// Section is null, return empty array // Section is null, return empty array
if (section == null) { if (section == null) {
return FaweCache.IMP.EMPTY_CHAR_4096; data = new char[4096];
Arrays.fill(data, (char) 1);
return data;
} }
if (data == null || data == FaweCache.IMP.EMPTY_CHAR_4096) { if (data == null || data == FaweCache.IMP.EMPTY_CHAR_4096) {
data = new char[4096]; data = new char[4096];
Arrays.fill(data, (char) 1);
} }
DelegateLock lock = BukkitAdapter_1_16_1.applyLock(section); DelegateLock lock = BukkitAdapter_1_16_1.applyLock(section);
synchronized (lock) { synchronized (lock) {

Datei anzeigen

@ -2,12 +2,12 @@ package com.boydti.fawe.beta.implementation.blocks;
import com.boydti.fawe.beta.IChunkGet; import com.boydti.fawe.beta.IChunkGet;
import com.boydti.fawe.beta.IChunkSet; import com.boydti.fawe.beta.IChunkSet;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockTypes;
import com.sk89q.worldedit.world.block.BlockTypesCache; import com.sk89q.worldedit.world.block.BlockTypesCache;
import java.util.Arrays;
public abstract class CharGetBlocks extends CharBlocks implements IChunkGet { public abstract class CharGetBlocks extends CharBlocks implements IChunkGet {
@Override @Override
@ -25,6 +25,14 @@ public abstract class CharGetBlocks extends CharBlocks implements IChunkGet {
return true; return true;
} }
public char[] update(int layer, char[] data) {
if (data == null) {
return new char[4096];
}
Arrays.fill(data, (char) 1);
return data;
}
@Override @Override
public boolean trim(boolean aggressive, int layer) { public boolean trim(boolean aggressive, int layer) {
sections[layer] = EMPTY; sections[layer] = EMPTY;