3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-05 19:10:07 +01:00

actually delegate in AbstractDelegateExtent

fixes #843
Dieser Commit ist enthalten in:
dordsor21 2021-01-14 14:38:37 +00:00
Ursprung af34bd4e57
Commit 761d05ac19
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.extent;
import com.boydti.fawe.beta.Filter;
import com.boydti.fawe.beta.IBatchProcessor;
import com.boydti.fawe.config.Settings;
import com.boydti.fawe.object.HistoryExtent;
@ -30,8 +31,10 @@ import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.entity.Entity;
import com.sk89q.worldedit.extent.buffer.ForgetfulExtentBuffer;
import com.sk89q.worldedit.function.mask.Mask;
import com.sk89q.worldedit.function.operation.Operation;
import com.sk89q.worldedit.function.operation.OperationQueue;
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.util.Location;
@ -44,6 +47,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import javax.annotation.Nullable;
@ -275,6 +279,46 @@ public class AbstractDelegateExtent implements Extent {
}
}
@Override
public <B extends BlockStateHolder<B>> int setBlocks(Region region, B block) {
checkNotNull(region);
checkNotNull(block);
boolean hasNbt = block instanceof BaseBlock && block.hasNbtData();
int changes = 0;
for (BlockVector3 pos : region) {
if (setBlock(pos, block)) {
changes++;
}
}
return changes;
}
@Override
public int setBlocks(Region region, Pattern pattern) {
return getExtent().setBlocks(region, pattern);
}
@Override
public <B extends BlockStateHolder<B>> int replaceBlocks(Region region, Set<BaseBlock> filter, B replacement) {
return getExtent().replaceBlocks(region, filter, replacement);
}
@Override
public int replaceBlocks(Region region, Set<BaseBlock> filter, Pattern pattern) {
return getExtent().replaceBlocks(region, filter, pattern);
}
@Override
public int replaceBlocks(Region region, Mask mask, Pattern pattern) {
return getExtent().replaceBlocks(region, mask, pattern);
}
@Override
public int setBlocks(final Set<BlockVector3> vset, final Pattern pattern) {
return getExtent().setBlocks(vset, pattern);
}
@Override
public int getMaxY() {
return extent.getMaxY();
@ -343,4 +387,14 @@ public class AbstractDelegateExtent implements Extent {
protected Operation commitBefore() {
return null;
}
@Override
public <T extends Filter> T apply(Region region, T filter, boolean full) {
return getExtent().apply(region, filter, full);
}
@Override
public <T extends Filter> T apply(Iterable<BlockVector3> positions, T filter) {
return getExtent().apply(positions, filter);
}
}