geforkt von Mirrors/FastAsyncWorldEdit
fix more compile errors
Dieser Commit ist enthalten in:
Ursprung
12114ec987
Commit
198427dc3d
@ -650,6 +650,11 @@ public class DelegateFilterBlock extends FilterBlock {
|
|||||||
return parent.getBlock(position);
|
return parent.getBlock(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockType getBlockType(BlockVector3 position) {
|
||||||
|
return parent.getBlockType(position);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBlock getFullBlock(BlockVector3 position) {
|
public BaseBlock getFullBlock(BlockVector3 position) {
|
||||||
return parent.getFullBlock(position);
|
return parent.getFullBlock(position);
|
||||||
|
@ -265,18 +265,18 @@ public abstract class FawePlayer<T> extends Metadatable {
|
|||||||
|
|
||||||
// Queue for async tasks
|
// Queue for async tasks
|
||||||
private AtomicInteger runningCount = new AtomicInteger();
|
private AtomicInteger runningCount = new AtomicInteger();
|
||||||
private SimpleAsyncNotifyQueue asyncNotifyQueue = new SimpleAsyncNotifyQueue((t, e) -> {
|
private SimpleAsyncNotifyQueue asyncNotifyQueue = new SimpleAsyncNotifyQueue((thread, throwable) -> {
|
||||||
while (e.getCause() != null) {
|
while (throwable.getCause() != null) {
|
||||||
e = e.getCause();
|
throwable = throwable.getCause();
|
||||||
}
|
}
|
||||||
if (e instanceof WorldEditException) {
|
if (throwable instanceof WorldEditException) {
|
||||||
sendMessage(e.getLocalizedMessage());
|
sendMessage(throwable.getLocalizedMessage());
|
||||||
} else {
|
} else {
|
||||||
FaweException fe = FaweException.get(e);
|
FaweException fe = FaweException.get(throwable);
|
||||||
if (fe != null) {
|
if (fe != null) {
|
||||||
sendMessage(fe.getMessage());
|
sendMessage(fe.getMessage());
|
||||||
} else {
|
} else {
|
||||||
e.printStackTrace();
|
throwable.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -103,6 +103,7 @@ import com.sk89q.worldedit.internal.expression.runtime.ExpressionTimeoutExceptio
|
|||||||
import com.sk89q.worldedit.internal.expression.runtime.RValue;
|
import com.sk89q.worldedit.internal.expression.runtime.RValue;
|
||||||
import com.sk89q.worldedit.math.BlockVector2;
|
import com.sk89q.worldedit.math.BlockVector2;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
|
import com.sk89q.worldedit.math.MathUtils;
|
||||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||||
import com.sk89q.worldedit.math.Vector2;
|
import com.sk89q.worldedit.math.Vector2;
|
||||||
@ -1403,6 +1404,29 @@ public class EditSession extends AbstractDelegateExtent implements SimpleWorld,
|
|||||||
return replaceBlocks(region, mask, pattern);
|
return replaceBlocks(region, mask, pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the blocks at the center of the given region to the given pattern.
|
||||||
|
* If the center sits between two blocks on a certain axis, then two blocks
|
||||||
|
* will be placed to mark the center.
|
||||||
|
*
|
||||||
|
* @param region the region to find the center of
|
||||||
|
* @param pattern the replacement pattern
|
||||||
|
* @return the number of blocks placed
|
||||||
|
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||||
|
*/
|
||||||
|
public int center(Region region, Pattern pattern) throws MaxChangedBlocksException {
|
||||||
|
checkNotNull(region);
|
||||||
|
checkNotNull(pattern);
|
||||||
|
|
||||||
|
Vector3 center = region.getCenter();
|
||||||
|
Region centerRegion = new CuboidRegion(
|
||||||
|
getWorld(), // Causes clamping of Y range
|
||||||
|
BlockVector3.at(((int) center.getX()), ((int) center.getY()), ((int) center.getZ())),
|
||||||
|
BlockVector3.at(MathUtils.roundHalfUp(center.getX()),
|
||||||
|
center.getY(), MathUtils.roundHalfUp(center.getZ())));
|
||||||
|
return setBlocks(centerRegion, pattern);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make the faces of the given region as if it was a {@link CuboidRegion}.
|
* Make the faces of the given region as if it was a {@link CuboidRegion}.
|
||||||
*
|
*
|
||||||
|
@ -126,7 +126,8 @@ public class ClipboardCommands {
|
|||||||
BlockVector3 min = region.getMinimumPoint();
|
BlockVector3 min = region.getMinimumPoint();
|
||||||
BlockVector3 max = region.getMaximumPoint();
|
BlockVector3 max = region.getMaximumPoint();
|
||||||
|
|
||||||
long volume = (((long) max.getX() - (long) min.getX() + 1) * ((long) max.getY() - (long) min.getY() + 1) * ((long) max.getZ() - (long) min.getZ() + 1));
|
long volume =
|
||||||
|
((long) max.getX() - (long) min.getX() + 1) * ((long) max.getY() - (long) min.getY() + 1) * ((long) max.getZ() - (long) min.getZ() + 1);
|
||||||
FaweLimit limit = FawePlayer.wrap(player).getLimit();
|
FaweLimit limit = FawePlayer.wrap(player).getLimit();
|
||||||
if (volume >= limit.MAX_CHECKS) {
|
if (volume >= limit.MAX_CHECKS) {
|
||||||
throw FaweException.MAX_CHECKS;
|
throw FaweException.MAX_CHECKS;
|
||||||
|
@ -88,8 +88,7 @@ public class MaskCommands {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
name = "false",
|
name = "#false",
|
||||||
aliases = {"#false"},
|
|
||||||
desc = "Always false"
|
desc = "Always false"
|
||||||
)
|
)
|
||||||
public Mask falseMask(Extent extent) {
|
public Mask falseMask(Extent extent) {
|
||||||
@ -97,8 +96,7 @@ public class MaskCommands {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
name = "true",
|
name = "#true",
|
||||||
aliases = {"#true"},
|
|
||||||
desc = "Always true"
|
desc = "Always true"
|
||||||
)
|
)
|
||||||
public Mask trueMask(Extent extent) {
|
public Mask trueMask(Extent extent) {
|
||||||
|
@ -547,7 +547,7 @@ public class RegionCommands {
|
|||||||
boolean skipEntities,
|
boolean skipEntities,
|
||||||
@Switch(name = 'a', desc = "Ignore air blocks")
|
@Switch(name = 'a', desc = "Ignore air blocks")
|
||||||
boolean ignoreAirBlocks,
|
boolean ignoreAirBlocks,
|
||||||
@Switch(name = 'm', desc = "Source mask")
|
@ArgFlag(name = "m", desc = "Source mask")
|
||||||
Mask sourceMask,
|
Mask sourceMask,
|
||||||
InjectedValueAccess context) throws WorldEditException {
|
InjectedValueAccess context) throws WorldEditException {
|
||||||
player.checkConfirmationStack(() -> {
|
player.checkConfirmationStack(() -> {
|
||||||
@ -677,7 +677,7 @@ public class RegionCommands {
|
|||||||
int thickness,
|
int thickness,
|
||||||
@Arg(desc = "The pattern of blocks to replace the hollowed area with", def = "air")
|
@Arg(desc = "The pattern of blocks to replace the hollowed area with", def = "air")
|
||||||
Pattern pattern,
|
Pattern pattern,
|
||||||
@Switch(name = 'm', desc = "Mask to hollow with") Mask mask,
|
@ArgFlag(name = "m", desc = "Mask to hollow with") Mask mask,
|
||||||
InjectedValueAccess context) throws WorldEditException {
|
InjectedValueAccess context) throws WorldEditException {
|
||||||
checkCommandArgument(thickness >= 0, "Thickness must be >= 0");
|
checkCommandArgument(thickness >= 0, "Thickness must be >= 0");
|
||||||
Mask finalMask = mask == null ? new SolidBlockMask(editSession) : mask;
|
Mask finalMask = mask == null ? new SolidBlockMask(editSession) : mask;
|
||||||
|
@ -577,7 +577,7 @@ public class SchematicCommands {
|
|||||||
boolean oldFirst,
|
boolean oldFirst,
|
||||||
@Switch(name = 'n', desc = "Sort by date, newest first")
|
@Switch(name = 'n', desc = "Sort by date, newest first")
|
||||||
boolean newFirst,
|
boolean newFirst,
|
||||||
@Switch(name = 'f', desc = "Restricts by format.")
|
@ArgFlag(name = 'f', desc = "Restricts by format.")
|
||||||
String formatName,
|
String formatName,
|
||||||
@Arg(name = "filter", desc = "Filter for schematics", def = "all")
|
@Arg(name = "filter", desc = "Filter for schematics", def = "all")
|
||||||
String filter) throws WorldEditException {
|
String filter) throws WorldEditException {
|
||||||
|
@ -83,7 +83,7 @@ public interface Actor extends Identifiable, SessionOwner, Subject {
|
|||||||
*/
|
*/
|
||||||
void print(Component component);
|
void print(Component component);
|
||||||
|
|
||||||
/**
|
/**F
|
||||||
* Returns true if the actor can destroy bedrock.
|
* Returns true if the actor can destroy bedrock.
|
||||||
*
|
*
|
||||||
* @return true if bedrock can be broken by the actor
|
* @return true if bedrock can be broken by the actor
|
||||||
|
@ -52,7 +52,6 @@ import com.sk89q.worldedit.registry.state.PropertyGroup;
|
|||||||
import com.sk89q.worldedit.session.ClipboardHolder;
|
import com.sk89q.worldedit.session.ClipboardHolder;
|
||||||
import com.sk89q.worldedit.util.Countable;
|
import com.sk89q.worldedit.util.Countable;
|
||||||
import com.sk89q.worldedit.util.Location;
|
import com.sk89q.worldedit.util.Location;
|
||||||
import com.sk89q.worldedit.world.World;
|
|
||||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||||
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;
|
||||||
@ -620,8 +619,4 @@ public interface Extent extends InputExtent, OutputExtent {
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
default World getWorld() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren