Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-02 17:40:09 +01:00
fix walls
Dieser Commit ist enthalten in:
Ursprung
ed8d1849d4
Commit
34afc03443
@ -316,10 +316,10 @@ public class ChunkHolder<T extends Future<T>> implements IQueueChunk {
|
|||||||
final IChunkGet get = getOrCreateGet();
|
final IChunkGet get = getOrCreateGet();
|
||||||
final IChunkSet set = getOrCreateSet();
|
final IChunkSet set = getOrCreateSet();
|
||||||
try {
|
try {
|
||||||
|
block = block.init(chunkX, chunkZ, get);
|
||||||
if (region != null) {
|
if (region != null) {
|
||||||
region.filter(this, filter, block, get, set, full);
|
region.filter(this, filter, block, get, set, full);
|
||||||
} else {
|
} else {
|
||||||
block = block.init(chunkX, chunkZ, get);
|
|
||||||
for (int layer = 0; layer < 16; layer++) {
|
for (int layer = 0; layer < 16; layer++) {
|
||||||
if ((!full && !get.hasSection(layer)) || !filter.appliesLayer(this, layer)) {
|
if ((!full && !get.hasSection(layer)) || !filter.appliesLayer(this, layer)) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
package com.sk89q.worldedit.regions;
|
package com.sk89q.worldedit.regions;
|
||||||
|
|
||||||
|
import com.boydti.fawe.FaweCache;
|
||||||
import com.boydti.fawe.object.collection.BlockVectorSet;
|
import com.boydti.fawe.object.collection.BlockVectorSet;
|
||||||
import com.sk89q.worldedit.math.BlockVector2;
|
import com.sk89q.worldedit.math.BlockVector2;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
@ -169,21 +170,14 @@ public abstract class AbstractRegion extends AbstractSet<BlockVector3> implement
|
|||||||
public Set<BlockVector2> getChunks() {
|
public Set<BlockVector2> getChunks() {
|
||||||
final Set<BlockVector2> chunks = new HashSet<>();
|
final Set<BlockVector2> chunks = new HashSet<>();
|
||||||
|
|
||||||
final BlockVector3 min = getMinimumPoint();
|
final BlockVector3 min = getMinimumPoint().divide(16);
|
||||||
final BlockVector3 max = getMaximumPoint();
|
final BlockVector3 max = getMaximumPoint().divide(16);
|
||||||
|
|
||||||
final int minY = min.getBlockY();
|
for (int X = min.getBlockX(); X <= max.getBlockX(); ++X) {
|
||||||
|
for (int Z = min.getBlockZ(); Z <= max.getBlockZ(); ++Z) {
|
||||||
for (int x = min.getBlockX(); x <= max.getBlockX(); ++x) {
|
if (containsChunk(X, Z)) {
|
||||||
for (int z = min.getBlockZ(); z <= max.getBlockZ(); ++z) {
|
chunks.add(BlockVector2.at(X, Z));
|
||||||
if (!contains(BlockVector3.at(x, minY, z))) {
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
chunks.add(BlockVector2.at(
|
|
||||||
x >> ChunkStore.CHUNK_SHIFTS,
|
|
||||||
z >> ChunkStore.CHUNK_SHIFTS
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
|
|||||||
*
|
*
|
||||||
* @return a new complex region
|
* @return a new complex region
|
||||||
*/
|
*/
|
||||||
public Region getFaces() {
|
public RegionIntersection getFaces() {
|
||||||
BlockVector3 min = getMinimumPoint();
|
BlockVector3 min = getMinimumPoint();
|
||||||
BlockVector3 max = getMaximumPoint();
|
BlockVector3 max = getMaximumPoint();
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
|
|||||||
*
|
*
|
||||||
* @return a new complex region
|
* @return a new complex region
|
||||||
*/
|
*/
|
||||||
public Region getWalls() {
|
public RegionIntersection getWalls() {
|
||||||
BlockVector3 min = getMinimumPoint();
|
BlockVector3 min = getMinimumPoint();
|
||||||
BlockVector3 max = getMaximumPoint();
|
BlockVector3 max = getMaximumPoint();
|
||||||
|
|
||||||
@ -182,8 +182,8 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
|
|||||||
new CuboidRegion(pos1.withX(max.getX()), pos2.withX(max.getX())),
|
new CuboidRegion(pos1.withX(max.getX()), pos2.withX(max.getX())),
|
||||||
|
|
||||||
// Project to X-Y plane
|
// Project to X-Y plane
|
||||||
new CuboidRegion(pos1.withZ(min.getZ()), pos2.withZ(min.getZ())),
|
new CuboidRegion(pos1.withZ(min.getZ()).add(BlockVector3.UNIT_X), pos2.withZ(min.getZ()).subtract(BlockVector3.UNIT_X)),
|
||||||
new CuboidRegion(pos1.withZ(max.getZ()), pos2.withZ(max.getZ())));
|
new CuboidRegion(pos1.withZ(max.getZ()).add(BlockVector3.UNIT_X), pos2.withZ(max.getZ()).subtract(BlockVector3.UNIT_X)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -23,13 +23,17 @@ import com.boydti.fawe.beta.IChunk;
|
|||||||
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.google.common.collect.Iterators;
|
import com.google.common.collect.Iterators;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
import com.sk89q.worldedit.math.BlockVector2;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkArgument;
|
import static com.google.common.base.Preconditions.checkArgument;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
@ -169,4 +173,52 @@ public class RegionIntersection extends AbstractRegion {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Region> getRegions() {
|
||||||
|
return regions;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Set<BlockVector2> getChunks() {
|
||||||
|
Set<BlockVector2> set = null;
|
||||||
|
for (Region region : regions) {
|
||||||
|
if (set == null) {
|
||||||
|
set = region.getChunks();
|
||||||
|
} else {
|
||||||
|
set = Sets.union(set, region.getChunks());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Set<BlockVector3> getChunkCubes() {
|
||||||
|
Set<BlockVector3> set = null;
|
||||||
|
for (Region region : regions) {
|
||||||
|
if (set == null) {
|
||||||
|
set = region.getChunkCubes();
|
||||||
|
} else {
|
||||||
|
set = Sets.union(set, region.getChunkCubes());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean containsChunk(int chunkX, int chunkZ) {
|
||||||
|
for (Region region : regions) if (region.containsChunk(chunkX, chunkZ)) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean contains(int x, int z) {
|
||||||
|
for (Region region : regions) if (region.contains(x, z)) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean contains(int x, int y, int z) {
|
||||||
|
for (Region region : regions) if (region.contains(x, y, z)) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren