Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-05 02:50:05 +01:00
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockType getBlockType(BlockVector3 position) {
|
||||
return parent.getBlockType(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBlock getFullBlock(BlockVector3 position) {
|
||||
return parent.getFullBlock(position);
|
||||
|
@ -265,18 +265,18 @@ public abstract class FawePlayer<T> extends Metadatable {
|
||||
|
||||
// Queue for async tasks
|
||||
private AtomicInteger runningCount = new AtomicInteger();
|
||||
private SimpleAsyncNotifyQueue asyncNotifyQueue = new SimpleAsyncNotifyQueue((t, e) -> {
|
||||
while (e.getCause() != null) {
|
||||
e = e.getCause();
|
||||
private SimpleAsyncNotifyQueue asyncNotifyQueue = new SimpleAsyncNotifyQueue((thread, throwable) -> {
|
||||
while (throwable.getCause() != null) {
|
||||
throwable = throwable.getCause();
|
||||
}
|
||||
if (e instanceof WorldEditException) {
|
||||
sendMessage(e.getLocalizedMessage());
|
||||
if (throwable instanceof WorldEditException) {
|
||||
sendMessage(throwable.getLocalizedMessage());
|
||||
} else {
|
||||
FaweException fe = FaweException.get(e);
|
||||
FaweException fe = FaweException.get(throwable);
|
||||
if (fe != null) {
|
||||
sendMessage(fe.getMessage());
|
||||
} 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.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MathUtils;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector2;
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector2;
|
||||
@ -1403,6 +1404,29 @@ public class EditSession extends AbstractDelegateExtent implements SimpleWorld,
|
||||
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}.
|
||||
*
|
||||
|
@ -126,7 +126,8 @@ public class ClipboardCommands {
|
||||
BlockVector3 min = region.getMinimumPoint();
|
||||
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();
|
||||
if (volume >= limit.MAX_CHECKS) {
|
||||
throw FaweException.MAX_CHECKS;
|
||||
|
@ -88,8 +88,7 @@ public class MaskCommands {
|
||||
}
|
||||
|
||||
@Command(
|
||||
name = "false",
|
||||
aliases = {"#false"},
|
||||
name = "#false",
|
||||
desc = "Always false"
|
||||
)
|
||||
public Mask falseMask(Extent extent) {
|
||||
@ -97,8 +96,7 @@ public class MaskCommands {
|
||||
}
|
||||
|
||||
@Command(
|
||||
name = "true",
|
||||
aliases = {"#true"},
|
||||
name = "#true",
|
||||
desc = "Always true"
|
||||
)
|
||||
public Mask trueMask(Extent extent) {
|
||||
|
@ -547,7 +547,7 @@ public class RegionCommands {
|
||||
boolean skipEntities,
|
||||
@Switch(name = 'a', desc = "Ignore air blocks")
|
||||
boolean ignoreAirBlocks,
|
||||
@Switch(name = 'm', desc = "Source mask")
|
||||
@ArgFlag(name = "m", desc = "Source mask")
|
||||
Mask sourceMask,
|
||||
InjectedValueAccess context) throws WorldEditException {
|
||||
player.checkConfirmationStack(() -> {
|
||||
@ -677,7 +677,7 @@ public class RegionCommands {
|
||||
int thickness,
|
||||
@Arg(desc = "The pattern of blocks to replace the hollowed area with", def = "air")
|
||||
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 {
|
||||
checkCommandArgument(thickness >= 0, "Thickness must be >= 0");
|
||||
Mask finalMask = mask == null ? new SolidBlockMask(editSession) : mask;
|
||||
|
@ -577,7 +577,7 @@ public class SchematicCommands {
|
||||
boolean oldFirst,
|
||||
@Switch(name = 'n', desc = "Sort by date, newest first")
|
||||
boolean newFirst,
|
||||
@Switch(name = 'f', desc = "Restricts by format.")
|
||||
@ArgFlag(name = 'f', desc = "Restricts by format.")
|
||||
String formatName,
|
||||
@Arg(name = "filter", desc = "Filter for schematics", def = "all")
|
||||
String filter) throws WorldEditException {
|
||||
|
@ -83,7 +83,7 @@ public interface Actor extends Identifiable, SessionOwner, Subject {
|
||||
*/
|
||||
void print(Component component);
|
||||
|
||||
/**
|
||||
/**F
|
||||
* Returns true if the actor can destroy bedrock.
|
||||
*
|
||||
* @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.util.Countable;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
@ -620,8 +619,4 @@ public interface Extent extends InputExtent, OutputExtent {
|
||||
return count;
|
||||
}
|
||||
|
||||
default World getWorld() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren