This commit is contained in:
Jesse Boyd
2019-06-29 00:01:51 +10:00
parent 3b2031c22c
commit 846a1b0769
26 changed files with 192 additions and 154 deletions

View File

@ -108,7 +108,9 @@ public class WritableMCAChunk extends FaweChunk<Void> {
}
out.writeNamedTag("InhabitedTime", inhabitedTime);
out.writeNamedTag("LastUpdate", lastUpdate);
out.writeNamedTag("Biomes", biomes);
if (hasBiomes) {
out.writeNamedTag("Biomes", biomes);
}
int len = 0;
for (boolean hasSection : hasSections) {
if (hasSection) {

View File

@ -8,14 +8,17 @@ import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.command.tool.brush.Brush;
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.util.Direction;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockTypes;
import java.util.Arrays;
import java.util.function.Function;
import java.util.stream.Stream;
public class ErodeBrush implements Brush {
private static final BlockVector3[] FACES_TO_CHECK = {BlockVector3.at(0, 0, 1), BlockVector3.at(0, 0, -1), BlockVector3.at(0, 1, 0), BlockVector3.at(0, -1, 0), BlockVector3.at(1, 0, 0), BlockVector3.at(-1, 0, 0)};
private static final BlockVector3[] FACES_TO_CHECK = Direction.valuesOf(Direction.Flag.CARDINAL).stream().map(direction -> direction.toBlockVector()).toArray(size -> new BlockVector3[size]);
@Override
public void build(EditSession editSession, BlockVector3 position, Pattern pattern, double size) throws MaxChangedBlocksException {

View File

@ -77,7 +77,7 @@ public class ResizableClipboardBuilder extends MemoryOptimizedHistory {
int x = tileChange.tag.getInt("x");
int y = tileChange.tag.getInt("y");
int z = tileChange.tag.getInt("z");
clipboard.setTile(BlockVector3.at(x,y,z), tileChange.tag);
clipboard.setTile(x,y,z, tileChange.tag);
}
}
} catch (WorldEditException e) {

View File

@ -19,6 +19,7 @@ import java.util.*;
*/
public class BlockVectorSet extends AbstractCollection<BlockVector3> implements Set<BlockVector3> {
private Int2ObjectMap<LocalBlockVectorSet> localSets = new Int2ObjectOpenHashMap<>();
private MutableBlockVector3 mutable = new MutableBlockVector3();
@Override
public int size() {
@ -37,12 +38,12 @@ public class BlockVectorSet extends AbstractCollection<BlockVector3> implements
int newSize = count + size;
if (newSize > index) {
int localIndex = index - count;
MutableBlockVector3 pos = new MutableBlockVector3(set.getIndex(localIndex));
BlockVector3 pos = mutable.setComponents(set.getIndex(localIndex));
int pair = entry.getIntKey();
int cx = MathMan.unpairX(pair);
int cz = MathMan.unpairY(pair);
pos.mutX((cx << 11) + pos.getBlockX());
pos.mutZ((cz << 11) + pos.getBlockZ());
pos = pos.mutX((cx << 11) + pos.getBlockX());
pos = pos.mutZ((cz << 11) + pos.getBlockZ());
return pos;
}
count += newSize;

View File

@ -54,7 +54,7 @@ public class EditSessionBuilder {
public EditSessionBuilder(@Nonnull World world) {
checkNotNull(world);
this.world = world;
this.worldName = world.getName();
this.worldName = Fawe.imp().getWorldName(world);
}
public EditSessionBuilder(@Nonnull String worldName) {