mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-11 20:13:55 +00:00
Removed 1.13.2 support.
This commit is contained in:
@ -126,7 +126,6 @@ public class ErodeBrush implements Brush {
|
||||
private void erosionIteration(int brushSize, int brushSizeSquared, int erodeFaces,
|
||||
Clipboard current, Clipboard target) {
|
||||
int[] frequency = null;
|
||||
|
||||
for (int x = -brushSize, relx = 0; x <= brushSize; x++, relx++) {
|
||||
int x2 = x * x;
|
||||
for (int z = -brushSize, relz = 0; z <= brushSize; z++, relz++) {
|
||||
@ -138,7 +137,7 @@ public class ErodeBrush implements Brush {
|
||||
continue;
|
||||
}
|
||||
BaseBlock state = current.getFullBlock(relx, rely, relz);
|
||||
if (!state.getBlockType().getMaterial().isMovementBlocker()) {
|
||||
if (!state.getMaterial().isMovementBlocker()) {
|
||||
continue;
|
||||
}
|
||||
int total = 0;
|
||||
@ -151,7 +150,7 @@ public class ErodeBrush implements Brush {
|
||||
}
|
||||
for (BlockVector3 offs : FACES_TO_CHECK) {
|
||||
BaseBlock next = current.getFullBlock(relx + offs.getBlockX(), rely + offs.getBlockY(), relz + offs.getBlockZ());
|
||||
if (next.getBlockType().getMaterial().isMovementBlocker()) {
|
||||
if (next.getMaterial().isMovementBlocker()) {
|
||||
continue;
|
||||
}
|
||||
total++;
|
||||
|
@ -5,6 +5,7 @@ public class FlatScalableHeightMap extends ScalableHeightMap {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getHeight(int x, int z) {
|
||||
int dx = Math.abs(x);
|
||||
int dz = Math.abs(z);
|
||||
|
@ -13,6 +13,7 @@ import com.sk89q.worldedit.util.Location;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public interface HeightMap {
|
||||
|
||||
double getHeight(int x, int z);
|
||||
|
||||
void setSize(int size);
|
||||
|
@ -6,7 +6,7 @@ import com.sk89q.worldedit.math.transform.AffineTransform;
|
||||
|
||||
public class RotatableHeightMap extends AbstractDelegateHeightMap {
|
||||
private AffineTransform transform;
|
||||
private MutableVector3 mutable;
|
||||
private final MutableVector3 mutable;
|
||||
|
||||
public RotatableHeightMap(HeightMap parent) {
|
||||
super(parent);
|
||||
@ -25,4 +25,4 @@ public class RotatableHeightMap extends AbstractDelegateHeightMap {
|
||||
BlockVector3 pos = transform.apply(mutable.setComponents(x, 0, z)).toBlockPoint();
|
||||
return super.getHeight(pos.getBlockX(), pos.getBlockZ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -186,10 +186,10 @@ public class GenerationCommands {
|
||||
public int hcyl(Actor actor, LocalSession session, EditSession editSession,
|
||||
@Arg(desc = "The pattern of blocks to generate")
|
||||
Pattern pattern,
|
||||
@Confirm(Confirm.Processor.RADIUS) @Arg(desc = "The radii of the cylinder. 1st is N/S, 2nd is E/W")
|
||||
@Radii(2)
|
||||
List<Double> radii,
|
||||
@Arg(desc = "The height of the cylinder", def = "1")
|
||||
@Arg(desc = "The radii of the cylinder. 1st is N/S, 2nd is E/W")
|
||||
@Radii(2)
|
||||
List<Double> radii,
|
||||
@Arg(desc = "The height of the cylinder", def = "1")
|
||||
int height) throws WorldEditException {
|
||||
return cyl(actor, session, editSession, pattern, radii, height, true);
|
||||
}
|
||||
@ -203,7 +203,7 @@ public class GenerationCommands {
|
||||
public int cyl(Actor actor, LocalSession session, EditSession editSession,
|
||||
@Arg(desc = "The pattern of blocks to generate")
|
||||
Pattern pattern,
|
||||
@Confirm(Confirm.Processor.RADIUS) @Arg(desc = "The radii of the cylinder. 1st is N/S, 2nd is E/W")
|
||||
@Arg(desc = "The radii of the cylinder. 1st is N/S, 2nd is E/W")
|
||||
@Radii(2)
|
||||
List<Double> radii,
|
||||
@Arg(desc = "The height of the cylinder", def = "1")
|
||||
@ -245,7 +245,7 @@ public class GenerationCommands {
|
||||
public int hsphere(Actor actor, LocalSession session, EditSession editSession,
|
||||
@Arg(desc = "The pattern of blocks to generate")
|
||||
Pattern pattern,
|
||||
@Confirm(Confirm.Processor.RADIUS) @Arg(desc = "The radii of the sphere. Order is N/S, U/D, E/W")
|
||||
@Arg(desc = "The radii of the sphere. Order is N/S, U/D, E/W")
|
||||
@Radii(3)
|
||||
List<Double> radii,
|
||||
@Switch(name = 'r', desc = "Raise the bottom of the sphere to the placement position")
|
||||
@ -262,7 +262,7 @@ public class GenerationCommands {
|
||||
public int sphere(Actor actor, LocalSession session, EditSession editSession,
|
||||
@Arg(desc = "The pattern of blocks to generate")
|
||||
Pattern pattern,
|
||||
@Confirm(Confirm.Processor.RADIUS) @Arg(desc = "The radii of the sphere. Order is N/S, U/D, E/W")
|
||||
@Arg(desc = "The radii of the sphere. Order is N/S, U/D, E/W")
|
||||
@Radii(3)
|
||||
List<Double> radii,
|
||||
@Switch(name = 'r', desc = "Raise the bottom of the sphere to the placement position")
|
||||
|
@ -48,8 +48,8 @@ public class CavesGen extends GenBase {
|
||||
}
|
||||
|
||||
protected void generateCaveNode(long seed, BlockVector2 chunkPos, Extent chunk, double x, double y, double z, double paramdouble1, double paramdouble2, double paramdouble3, int angle, int maxAngle, double paramDouble4) throws WorldEditException {
|
||||
int bx = (chunkPos.getBlockX() << 4);
|
||||
int bz = (chunkPos.getBlockZ() << 4);
|
||||
int bx = chunkPos.getBlockX() << 4;
|
||||
int bz = chunkPos.getBlockZ() << 4;
|
||||
double real_x = bx + 7;
|
||||
double real_z = bz + 7;
|
||||
|
||||
@ -57,7 +57,7 @@ public class CavesGen extends GenBase {
|
||||
double f2 = 0.0F;
|
||||
|
||||
if (maxAngle <= 0) {
|
||||
int checkAreaSize = (this.getCheckAreaSize() * 16) - 16;
|
||||
int checkAreaSize = this.getCheckAreaSize() * 16 - 16;
|
||||
maxAngle = checkAreaSize - ThreadLocalRandom.current().nextInt(checkAreaSize / 4);
|
||||
}
|
||||
boolean isLargeCave = false;
|
||||
@ -95,14 +95,14 @@ public class CavesGen extends GenBase {
|
||||
f1 += (ThreadLocalRandom.current().nextDouble() - ThreadLocalRandom.current()
|
||||
.nextDouble()) * ThreadLocalRandom.current().nextDouble() * 4.0F;
|
||||
|
||||
if ((!isLargeCave) && (angle == j) && (paramdouble1 > 1.0F) && (maxAngle > 0)) {
|
||||
if (!isLargeCave && angle == j && paramdouble1 > 1.0F && maxAngle > 0) {
|
||||
generateCaveNode(ThreadLocalRandom.current().nextLong(), chunkPos, chunk, x, y, z, ThreadLocalRandom
|
||||
.current().nextDouble() * 0.5F + 0.5F, paramdouble2 - 1.570796F, paramdouble3 / 3.0F, angle, maxAngle, 1.0D);
|
||||
generateCaveNode(ThreadLocalRandom.current().nextLong(), chunkPos, chunk, x, y, z, ThreadLocalRandom
|
||||
.current().nextDouble() * 0.5F + 0.5F, paramdouble2 + 1.570796F, paramdouble3 / 3.0F, angle, maxAngle, 1.0D);
|
||||
return;
|
||||
}
|
||||
if ((!isLargeCave) && (ThreadLocalRandom.current().nextInt(4) == 0)) {
|
||||
if (!isLargeCave && ThreadLocalRandom.current().nextInt(4) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -116,7 +116,8 @@ public class CavesGen extends GenBase {
|
||||
}
|
||||
|
||||
//Boundaries check.
|
||||
if ((x < real_x - 16.0D - d3 * 2.0D) || (z < real_z - 16.0D - d3 * 2.0D) || (x > real_x + 16.0D + d3 * 2.0D) || (z > real_z + 16.0D + d3 * 2.0D))
|
||||
if (x < real_x - 16.0D - d3 * 2.0D || z < real_z - 16.0D - d3 * 2.0D
|
||||
|| x > real_x + 16.0D + d3 * 2.0D || z > real_z + 16.0D + d3 * 2.0D)
|
||||
continue;
|
||||
|
||||
|
||||
@ -146,15 +147,16 @@ public class CavesGen extends GenBase {
|
||||
|
||||
// Search for water
|
||||
boolean waterFound = false;
|
||||
for (int local_x = m; !waterFound && (local_x < n); local_x++) {
|
||||
for (int local_z = i3; !waterFound && (local_z < i4); local_z++) {
|
||||
for (int local_y = i2 + 1; !waterFound && (local_y >= i1 - 1); local_y--) {
|
||||
for (int local_x = m; !waterFound && local_x < n; local_x++) {
|
||||
for (int local_z = i3; !waterFound && local_z < i4; local_z++) {
|
||||
for (int local_y = i2 + 1; !waterFound && local_y >= i1 - 1; local_y--) {
|
||||
if (local_y < 255) {
|
||||
BlockState material = chunk.getBlock(bx + local_x, local_y, bz + local_z);
|
||||
if (material.getBlockType() == BlockTypes.WATER) {
|
||||
waterFound = true;
|
||||
}
|
||||
if ((local_y != i1 - 1) && (local_x != m) && (local_x != n - 1) && (local_z != i3) && (local_z != i4 - 1))
|
||||
if (local_y != i1 - 1 && local_x != m && local_x != n - 1 && local_z != i3
|
||||
&& local_z != i4 - 1)
|
||||
local_y = i1;
|
||||
}
|
||||
}
|
||||
@ -173,7 +175,7 @@ public class CavesGen extends GenBase {
|
||||
if (d9 * d9 + d10 * d10 < 1.0D) {
|
||||
for (int local_y = i2; local_y > i1; local_y--) {
|
||||
double d11 = ((local_y - 1) + 0.5D - y) / d4;
|
||||
if ((d11 > -0.7D) && (d9 * d9 + d11 * d11 + d10 * d10 < 1.0D)) {
|
||||
if (d11 > -0.7D && d9 * d9 + d11 * d11 + d10 * d10 < 1.0D) {
|
||||
BlockState material = chunk.getBlock(bx + local_x, local_y, bz + local_z);
|
||||
BlockState materialAbove = chunk.getBlock(bx + local_x, local_y + 1, bz + local_z);
|
||||
BlockType blockType = material.getBlockType();
|
||||
@ -254,8 +256,8 @@ public class CavesGen extends GenBase {
|
||||
largeCaveSpawned = true;
|
||||
}
|
||||
|
||||
if ((largeCaveSpawned) || (ThreadLocalRandom.current().nextInt(100)
|
||||
<= this.caveSystemPocketChance - 1)) {
|
||||
if (largeCaveSpawned || ThreadLocalRandom.current().nextInt(100)
|
||||
<= this.caveSystemPocketChance - 1) {
|
||||
count += ThreadLocalRandom.current()
|
||||
.nextInt(this.caveSystemPocketMinSize, this.caveSystemPocketMaxSize);
|
||||
}
|
||||
|
@ -20,9 +20,8 @@
|
||||
package com.sk89q.worldedit.function.mask;
|
||||
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class SolidBlockMask extends BlockMask {
|
||||
|
@ -19,16 +19,12 @@
|
||||
|
||||
package com.sk89q.worldedit.history.changeset;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import com.sk89q.worldedit.history.change.Change;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Tracks a set of undoable operations and allows their undo and redo. The
|
||||
|
@ -28,6 +28,9 @@ import com.google.gson.reflect.TypeToken;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@ -35,6 +38,7 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@ -45,8 +49,6 @@ import java.util.Set;
|
||||
import java.util.function.BiPredicate;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public final class ChunkDeleter {
|
||||
|
||||
|
@ -259,11 +259,11 @@ public class AnvilChunk implements Chunk {
|
||||
WorldEdit.logger.warn("Unknown legacy block " + id + ":" + data + " found when loading legacy anvil chunk.");
|
||||
return BlockTypes.AIR.getDefaultState().toBaseBlock();
|
||||
}
|
||||
CompoundTag tileEntity = getBlockTileEntity(position);
|
||||
CompoundTag tileEntity = getBlockTileEntity(position);
|
||||
|
||||
if (tileEntity != null) {
|
||||
return state.toBaseBlock(tileEntity);
|
||||
}
|
||||
if (tileEntity != null) {
|
||||
return state.toBaseBlock(tileEntity);
|
||||
}
|
||||
|
||||
return state.toBaseBlock();
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public class AnvilChunk13 implements Chunk {
|
||||
|
||||
/**
|
||||
* Construct the chunk with a compound tag.
|
||||
*
|
||||
*
|
||||
* @param tag the tag to read
|
||||
* @throws DataException on a data error
|
||||
*/
|
||||
@ -226,7 +226,7 @@ public class AnvilChunk13 implements Chunk {
|
||||
BlockState[] sectionBlocks = blocks[section];
|
||||
BlockState state = sectionBlocks != null ? sectionBlocks[(yIndex << 8) | (z << 4) | x] : BlockTypes.AIR.getDefaultState();
|
||||
|
||||
CompoundTag tileEntity = getBlockTileEntity(position);
|
||||
CompoundTag tileEntity = getBlockTileEntity(position);
|
||||
|
||||
if (tileEntity != null) {
|
||||
return state.toBaseBlock(tileEntity);
|
||||
|
@ -184,11 +184,11 @@ public class OldChunk implements Chunk {
|
||||
return BlockTypes.AIR.getDefaultState().toBaseBlock();
|
||||
}
|
||||
|
||||
CompoundTag tileEntity = getBlockTileEntity(position);
|
||||
CompoundTag tileEntity = getBlockTileEntity(position);
|
||||
|
||||
if (tileEntity != null) {
|
||||
return state.toBaseBlock(tileEntity);
|
||||
}
|
||||
if (tileEntity != null) {
|
||||
return state.toBaseBlock(tileEntity);
|
||||
}
|
||||
|
||||
return state.toBaseBlock();
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ public class McRegionReader {
|
||||
|
||||
/**
|
||||
* Construct the reader.
|
||||
*
|
||||
*
|
||||
* @param stream the stream
|
||||
* @throws DataException
|
||||
* @throws IOException
|
||||
@ -99,7 +99,7 @@ public class McRegionReader {
|
||||
|
||||
/**
|
||||
* Read the header.
|
||||
*
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
private void readHeader() throws IOException {
|
||||
@ -113,7 +113,7 @@ public class McRegionReader {
|
||||
|
||||
/**
|
||||
* Gets the uncompressed data input stream for a chunk.
|
||||
*
|
||||
*
|
||||
* @param position chunk position
|
||||
* @return an input stream
|
||||
* @throws IOException
|
||||
@ -165,7 +165,7 @@ public class McRegionReader {
|
||||
|
||||
/**
|
||||
* Get the offset for a chunk. May return 0 if it doesn't exist.
|
||||
*
|
||||
*
|
||||
* @param x the X coordinate
|
||||
* @param z the Z coordinate
|
||||
* @return the offset
|
||||
|
Reference in New Issue
Block a user