Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-24 18:10:08 +01:00
Merge branch 'commanding' of https://github.com/IntellectualSites/FastAsyncWorldEdit-1.13 into commanding
# Conflicts: # worldedit-core/src/main/java/com/boydti/fawe/command/CFICommands.java # worldedit-core/src/main/java/com/boydti/fawe/object/extent/NullExtent.java
Dieser Commit ist enthalten in:
Commit
478c330c1e
@ -88,7 +88,7 @@ subprojects {
|
||||
ivy {
|
||||
url 'https://ci.athion.net/job'
|
||||
layout 'pattern', {
|
||||
artifact '/[organisation]/[module]/artifact/[revision].[ext]'
|
||||
artifact '/[organisation]/[revision]/artifact/[module].[ext]'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -126,5 +126,5 @@ public interface IQueueExtent extends Flushable, Trimable, Extent {
|
||||
|
||||
boolean isEmpty();
|
||||
|
||||
void sendChunk(int chunkX, int chunkZ);
|
||||
void sendChunk(int chunkX, int chunkZ, int bitMask);
|
||||
}
|
@ -5,7 +5,6 @@ import com.boydti.fawe.object.FawePlayer;
|
||||
import com.boydti.fawe.object.brush.visualization.cfi.HeightMapMCAGenerator;
|
||||
import com.boydti.fawe.object.changeset.CFIChangeSet;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import org.enginehub.piston.CommandManager;
|
||||
import org.enginehub.piston.exception.StopExecutionException;
|
||||
|
@ -25,7 +25,6 @@ import com.sk89q.worldedit.EmptyClipboardException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.command.MethodCommands;
|
||||
import com.sk89q.worldedit.command.util.CommandPermissions;
|
||||
import com.sk89q.worldedit.command.util.CommandPermissionsConditionGenerator;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
@ -50,6 +49,14 @@ import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import org.enginehub.piston.annotation.Command;
|
||||
import org.enginehub.piston.annotation.CommandContainer;
|
||||
import org.enginehub.piston.annotation.param.Arg;
|
||||
import org.enginehub.piston.annotation.param.Switch;
|
||||
import org.enginehub.piston.exception.StopExecutionException;
|
||||
import org.enginehub.piston.inject.InjectedValueAccess;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.DataBufferInt;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
@ -76,8 +83,11 @@ import org.enginehub.piston.annotation.param.Switch;
|
||||
import org.enginehub.piston.exception.StopExecutionException;
|
||||
import org.enginehub.piston.inject.InjectedValueAccess;
|
||||
|
||||
import static com.boydti.fawe.util.image.ImageUtil.load;
|
||||
import static com.sk89q.worldedit.command.MethodCommands.*;
|
||||
|
||||
@CommandContainer(superTypes = CommandPermissionsConditionGenerator.Registration.class)
|
||||
public class CFICommands extends MethodCommands {
|
||||
public class CFICommands {
|
||||
|
||||
private final WorldEdit worldEdit;
|
||||
|
||||
@ -97,18 +107,6 @@ public class CFICommands extends MethodCommands {
|
||||
return new File(path.toFile().getParentFile().getParentFile(), worldName + File.separator + "region");
|
||||
}
|
||||
|
||||
@Command(
|
||||
name = "",
|
||||
desc = "CFI command"
|
||||
)
|
||||
@CommandPermissions("worldedit.anvil.cfi")
|
||||
public void cfi(FawePlayer fp, List<String> args) {
|
||||
CFISettings settings = getSettings(fp);
|
||||
if (!settings.hasGenerator()) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Command(
|
||||
name = "heightmap",
|
||||
desc = "Start CFI with a height map as a base"
|
||||
@ -1039,7 +1037,6 @@ public class CFICommands extends MethodCommands {
|
||||
.send(fp);
|
||||
}
|
||||
|
||||
|
||||
private static CFISettings assertSettings(FawePlayer fp) {
|
||||
CFISettings settings = getSettings(fp);
|
||||
if (!settings.hasGenerator()) {
|
||||
|
@ -70,7 +70,7 @@ public abstract class CommandProcessor<I, O> implements CommandManager {
|
||||
public final O /* Need to recompile with FAWE-piston */ execute(InjectedValueAccess context, List<String> args) {
|
||||
args = preprocess(context, args);
|
||||
if (args != null) {
|
||||
I result = (I) (Object) parent.execute(context, args);
|
||||
I result = (I) parent.execute(context, args);
|
||||
return process(context, args, result); // TODO NOT IMPLEMENTED (recompile piston)
|
||||
} else {
|
||||
return null;
|
||||
|
@ -63,7 +63,7 @@ public class BrushSettings {
|
||||
if (constructor == null) {
|
||||
return new BrushSettings();
|
||||
}
|
||||
BrushSettings bs = (BrushSettings) manager.parseArgs(constructor);
|
||||
BrushSettings bs = (BrushSettings) manager.parse(BrushSettings.class, constructor, player);
|
||||
bs.constructor.put(SettingType.BRUSH, constructor);
|
||||
if (settings.containsKey(SettingType.PERMISSIONS.name())) {
|
||||
bs.permissions.addAll((Collection<? extends String>) settings.get(SettingType.PERMISSIONS.name()));
|
||||
|
@ -11,6 +11,7 @@ import com.boydti.fawe.util.MathMan;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.command.tool.brush.Brush;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.function.mask.Masks;
|
||||
@ -75,7 +76,7 @@ public class HeightBrush implements Brush {
|
||||
HeightMap map = getHeightMap();
|
||||
map.setSize(size);
|
||||
|
||||
IQueueExtent queue = editSession.getQueue();
|
||||
Extent queue = editSession.getExtent();
|
||||
// Optimized application of height map
|
||||
if (queue instanceof HeightMapMCAGenerator) {
|
||||
HeightMapMCAGenerator hmmg = (HeightMapMCAGenerator) queue;
|
||||
@ -85,8 +86,6 @@ public class HeightBrush implements Brush {
|
||||
hmmg.getMetaData().setMeta("PRECISION_HEIGHT", metaHeight = new byte[hmmg.getArea()]);
|
||||
}
|
||||
|
||||
Vector3 origin = hmmg.getOrigin();
|
||||
|
||||
int bx = position.getBlockX();
|
||||
int bz = position.getBlockZ();
|
||||
|
||||
|
@ -32,7 +32,7 @@ public class ScatterCommand extends ScatterBrush {
|
||||
String replaced = command.replace("{x}", position.getBlockX() + "")
|
||||
.replace("{y}", Integer.toString(position.getBlockY()))
|
||||
.replace("{z}", Integer.toString(position.getBlockZ()))
|
||||
.replace("{world}", editSession.getQueue().getWorldName())
|
||||
.replace("{world}", editSession.getWorld().getName())
|
||||
.replace("{size}", Integer.toString(radius));
|
||||
|
||||
FawePlayer fp = editSession.getPlayer();
|
||||
|
@ -2,7 +2,6 @@ package com.boydti.fawe.object.change;
|
||||
|
||||
import com.boydti.fawe.Fawe;
|
||||
import com.boydti.fawe.beta.IQueueExtent;
|
||||
import com.boydti.fawe.object.HasIQueueExtent;
|
||||
import com.boydti.fawe.util.ExtentTraverser;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.jnbt.IntTag;
|
||||
|
@ -3,26 +3,34 @@ package com.boydti.fawe.object.extent;
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.object.FaweLimit;
|
||||
import com.boydti.fawe.object.exception.FaweException;
|
||||
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.entity.BaseEntity;
|
||||
import com.sk89q.worldedit.entity.Entity;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
|
||||
import com.sk89q.worldedit.function.generator.GenBase;
|
||||
import com.sk89q.worldedit.function.generator.Resource;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.function.operation.Operation;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
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;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class NullExtent extends FaweRegionExtent {
|
||||
|
||||
@ -53,26 +61,27 @@ public class NullExtent extends FaweRegionExtent {
|
||||
|
||||
@Override
|
||||
public BiomeType getBiome(final BlockVector2 arg0) {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
}
|
||||
return null;
|
||||
|
||||
@Override
|
||||
public BiomeType getBiomeType(int x, int z) {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getBlock(final BlockVector3 arg0) {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getBlock(int x, int y, int z) {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
}
|
||||
return null;
|
||||
|
||||
@Override
|
||||
public BaseBlock getFullBlock(BlockVector3 position) {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -85,44 +94,73 @@ public class NullExtent extends FaweRegionExtent {
|
||||
|
||||
@Override
|
||||
public boolean setBiome(final BlockVector2 arg0, final BiomeType arg1) {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBiome(int x, int y, int z, BiomeType biome) {
|
||||
throw reason;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBlock(final BlockVector3 arg0, final BlockStateHolder arg1) throws WorldEditException {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBlock(int x, int y, int z, BlockStateHolder block) throws WorldEditException {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
}
|
||||
return false;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Entity createEntity(final Location arg0, final BaseEntity arg1) {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity createEntity(final Location arg0, final BaseEntity arg1) {
|
||||
if(reason != null) {
|
||||
public boolean isQueueEnabled() {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableQueue() {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableQueue() {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWorld() {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean regenerateChunk(int x, int z, @Nullable BiomeType type, @Nullable Long seed) {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHighestTerrainBlock(int x, int z, int minY, int maxY) {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHighestTerrainBlock(int x, int z, int minY, int maxY, Mask filter) {
|
||||
throw reason;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Entity> getEntities() {
|
||||
return new ArrayList<>();
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Entity> getEntities(final Region arg0) {
|
||||
return new ArrayList<>();
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -137,57 +175,157 @@ public class NullExtent extends FaweRegionExtent {
|
||||
|
||||
@Override
|
||||
public boolean contains(int x, int z) {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(int x, int y, int z) {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Region> getRegions() {
|
||||
return Collections.emptyList();
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Operation commit() {
|
||||
return null;
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean cancel() {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxY() {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockArrayClipboard lazyCopy(Region region) {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int countBlocks(Region region, Set<BaseBlock> searchBlocks) {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int countBlocks(Region region, Mask searchMask) {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <B extends BlockStateHolder<B>> int setBlocks(Region region, B block) throws MaxChangedBlocksException {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int setBlocks(Region region, Pattern pattern) throws MaxChangedBlocksException {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <B extends BlockStateHolder<B>> int replaceBlocks(Region region, Set<BaseBlock> filter, B replacement) throws MaxChangedBlocksException {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int replaceBlocks(Region region, Set<BaseBlock> filter, Pattern pattern) throws MaxChangedBlocksException {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int replaceBlocks(Region region, Mask mask, Pattern pattern) throws MaxChangedBlocksException {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int center(Region region, Pattern pattern) throws MaxChangedBlocksException {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int setBlocks(Set<BlockVector3> vset, Pattern pattern) {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorld() {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNearestSurfaceLayer(int x, int z, int y, int minY, int maxY) {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY, boolean ignoreAir) {
|
||||
throw reason;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY) {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY, int failedMin, int failedMax) {
|
||||
if(reason != null) {
|
||||
throw reason;
|
||||
}
|
||||
return -1;
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Extent getExtent() {
|
||||
return this;
|
||||
public int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY, int failedMin, int failedMax, Mask mask) {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY, int failedMin, int failedMax, boolean ignoreAir) {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCaves(Region region) throws WorldEditException {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate(Region region, GenBase gen) throws WorldEditException {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSchems(Region region, Mask mask, List<ClipboardHolder> clipboards, int rarity, boolean rotate) throws WorldEditException {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnResource(Region region, Resource gen, int rarity, int frequency) throws WorldEditException {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addOre(Region region, Mask mask, Pattern material, int size, int frequency, int rarity, int minY, int maxY) throws WorldEditException {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addOres(Region region, Mask mask) throws WorldEditException {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Countable<BlockType>> getBlockDistribution(Region region) {
|
||||
throw reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Countable<BlockState>> getBlockDistributionWithData(Region region) {
|
||||
throw reason;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.boydti.fawe.object.schematic;
|
||||
|
||||
import com.boydti.fawe.object.HasIQueueExtent;
|
||||
import com.boydti.fawe.object.clipboard.FaweClipboard;
|
||||
import com.boydti.fawe.object.clipboard.ReadOnlyClipboard;
|
||||
import com.boydti.fawe.util.EditSessionBuilder;
|
||||
@ -266,7 +265,7 @@ public class Schematic {
|
||||
extent.setBlock(xx, mutable.getBlockY() + rely, zz, block);
|
||||
return false;
|
||||
}
|
||||
}, (HasIQueueExtent) (null));
|
||||
});
|
||||
Operations.completeBlindly(visitor);
|
||||
}
|
||||
// Entity offset is the paste location subtract the clipboard origin (entity's location is already relative to the world origin)
|
||||
|
@ -1,14 +1,10 @@
|
||||
package com.boydti.fawe.object.visitor;
|
||||
|
||||
import com.boydti.fawe.object.HasIQueueExtent;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.function.visitor.RecursiveVisitor;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
@ -31,11 +27,11 @@ public class AboveVisitor extends RecursiveVisitor {
|
||||
* @param baseY the base Y
|
||||
*/
|
||||
public AboveVisitor(Mask mask, RegionFunction function, int baseY) {
|
||||
this(mask, function, baseY, Integer.MAX_VALUE, null);
|
||||
this(mask, function, baseY, Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
public AboveVisitor(Mask mask, RegionFunction function, int baseY, int depth, HasIQueueExtent hasIQueueExtent) {
|
||||
super(mask, function, depth, hasIQueueExtent);
|
||||
public AboveVisitor(Mask mask, RegionFunction function, int baseY, int depth) {
|
||||
super(mask, function, depth);
|
||||
checkNotNull(mask);
|
||||
|
||||
this.baseY = baseY;
|
||||
|
@ -121,7 +121,7 @@ public class FaweLocalBlockQueue extends LocalBlockQueue {
|
||||
|
||||
@Override
|
||||
public void refreshChunk(int x, int z) {
|
||||
IMP.sendChunk(x, z);
|
||||
IMP.sendChunk(x, z, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -59,7 +59,6 @@ import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Parameter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings("UseOfSystemOutOrSystemErr")
|
||||
|
@ -124,11 +124,13 @@ import org.enginehub.piston.annotation.param.Switch;
|
||||
import org.enginehub.piston.inject.InjectedValueAccess;
|
||||
import org.enginehub.piston.inject.Key;
|
||||
|
||||
import static com.sk89q.worldedit.command.MethodCommands.*;
|
||||
|
||||
/**
|
||||
* Commands to set brush shape.
|
||||
*/
|
||||
@CommandContainer(superTypes = CommandPermissionsConditionGenerator.Registration.class)
|
||||
public class BrushCommands extends MethodCommands {
|
||||
public class BrushCommands {
|
||||
|
||||
private final WorldEdit worldEdit;
|
||||
|
||||
@ -298,8 +300,8 @@ public class BrushCommands extends MethodCommands {
|
||||
}
|
||||
|
||||
@Command(
|
||||
name = "sspl",
|
||||
aliases = {"sspline", "surfacespline"},
|
||||
name = "surfacespline",
|
||||
aliases = {"sspline", "sspl"},
|
||||
desc = "Draws a spline (curved line) on the surface",
|
||||
descFooter = "Create a spline on the surface\n" +
|
||||
"Video: https://www.youtube.com/watch?v=zSN-2jJxXlM"
|
||||
@ -546,8 +548,8 @@ public class BrushCommands extends MethodCommands {
|
||||
}
|
||||
|
||||
@Command(
|
||||
name = "scmd",
|
||||
aliases = {"scattercmd", "scattercommand", "scommand"},
|
||||
name = "scattercommand",
|
||||
aliases = {"scattercmd", "scmd", "scommand"},
|
||||
desc = "Run commands at random points on a surface",
|
||||
descFooter =
|
||||
"Run commands at random points on a surface\n" +
|
||||
|
@ -48,18 +48,20 @@ import org.enginehub.piston.annotation.Command;
|
||||
import org.enginehub.piston.annotation.param.Arg;
|
||||
import org.enginehub.piston.annotation.param.Switch;
|
||||
|
||||
@Command(aliases = {"masks"},
|
||||
desc = "Help for the various masks. [More Info](https://git.io/v9r4K)",
|
||||
descFooter = "Masks determine if a block can be placed\n" +
|
||||
" - Use [brackets] for arguments\n" +
|
||||
" - Use , to OR multiple\n" +
|
||||
" - Use & to AND multiple\n" +
|
||||
"e.g. >[stone,dirt],#light[0][5],$jungle\n" +
|
||||
"More Info: https://git.io/v9r4K"
|
||||
)
|
||||
//@Command(aliases = {"masks"},
|
||||
// desc = "Help for the various masks. [More Info](https://git.io/v9r4K)",
|
||||
// descFooter = "Masks determine if a block can be placed\n" +
|
||||
// " - Use [brackets] for arguments\n" +
|
||||
// " - Use , to OR multiple\n" +
|
||||
// " - Use & to AND multiple\n" +
|
||||
// "e.g. >[stone,dirt],#light[0][5],$jungle\n" +
|
||||
// "More Info: https://git.io/v9r4K"
|
||||
//)
|
||||
public class MaskCommands extends MethodCommands {
|
||||
private final WorldEdit worldEdit;
|
||||
|
||||
public MaskCommands(WorldEdit worldEdit) {
|
||||
super(worldEdit);
|
||||
this.worldEdit = worldEdit;
|
||||
}
|
||||
|
||||
@Command(
|
||||
|
@ -15,7 +15,7 @@ import java.util.Optional;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class MethodCommands {
|
||||
public Command getCommand() {
|
||||
public static Command getCommand() {
|
||||
try {
|
||||
StackTraceElement[] stack = new Exception().getStackTrace();
|
||||
for (StackTraceElement elem : stack) {
|
||||
@ -33,7 +33,7 @@ public class MethodCommands {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getArguments(InjectedValueAccess context) {
|
||||
public static String getArguments(InjectedValueAccess context) {
|
||||
if (context == null) return null;
|
||||
Optional<Arguments> arguments = context.injectedValue(Key.of(Arguments.class));
|
||||
if (arguments.isPresent()) {
|
||||
@ -42,7 +42,7 @@ public class MethodCommands {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String[] getPermissions(InjectedValueAccess context) {
|
||||
public static String[] getPermissions(InjectedValueAccess context) {
|
||||
CommandPermissions cmdPerms = context.injectedValue(Key.of(CommandPermissions.class)).orElse(null);
|
||||
if (cmdPerms != null) {
|
||||
return cmdPerms.value();
|
||||
|
@ -23,6 +23,9 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.boydti.fawe.Fawe;
|
||||
import com.boydti.fawe.command.AnvilCommands;
|
||||
import com.boydti.fawe.command.AnvilCommandsRegistration;
|
||||
import com.boydti.fawe.command.CFICommand;
|
||||
import com.boydti.fawe.command.CFICommands;
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.object.FawePlayer;
|
||||
@ -33,7 +36,6 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.reflect.TypeToken;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
@ -105,7 +107,6 @@ import com.sk89q.worldedit.extension.platform.binding.CommandBindings;
|
||||
import com.sk89q.worldedit.extension.platform.binding.ConsumeBindings;
|
||||
import com.sk89q.worldedit.extension.platform.binding.ProvideBindings;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.internal.annotation.Selection;
|
||||
import com.sk89q.worldedit.internal.command.CommandArgParser;
|
||||
import com.sk89q.worldedit.internal.command.CommandLoggingHandler;
|
||||
import com.sk89q.worldedit.internal.command.CommandRegistrationHandler;
|
||||
@ -161,7 +162,6 @@ import org.enginehub.piston.part.SubCommandPart;
|
||||
import org.enginehub.piston.suggestion.Suggestion;
|
||||
import org.enginehub.piston.util.HelpGenerator;
|
||||
import org.enginehub.piston.util.ValueProvider;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -250,9 +250,8 @@ public final class PlatformCommandManager {
|
||||
RegionFactoryConverter.register(commandManager);
|
||||
}
|
||||
|
||||
public void register(Object classWithMethods) {
|
||||
public void registerAlwaysInjectedValues() {
|
||||
globalInjectedValues.injectValue(Key.of(InjectedValueAccess.class), Optional::of);
|
||||
// TODO NOT IMPLEMENTED - register the following using a custom processor / annotations
|
||||
register(new AnnotatedBindings(worldEdit));
|
||||
register(new CommandBindings(worldEdit));
|
||||
register(new ConsumeBindings(worldEdit));
|
||||
@ -260,6 +259,10 @@ public final class PlatformCommandManager {
|
||||
register(new ProvideBindings(worldEdit));
|
||||
}
|
||||
|
||||
public void register(Object classWithMethods) {
|
||||
// TODO NOT IMPLEMENTED - register the following using a custom processor / annotations
|
||||
}
|
||||
|
||||
private <CI> void registerSubCommands(String name, List<String> aliases, String desc,
|
||||
CommandRegistration<CI> registration, CI instance) {
|
||||
registerSubCommands(name, aliases, desc, registration, instance, m -> {});
|
||||
@ -380,9 +383,14 @@ public final class PlatformCommandManager {
|
||||
new GeneralCommands(worldEdit)
|
||||
);
|
||||
this.registration.register(
|
||||
commandManager,
|
||||
GenerationCommandsRegistration.builder(),
|
||||
new GenerationCommands(worldEdit)
|
||||
commandManager,
|
||||
GenerationCommandsRegistration.builder(),
|
||||
new GenerationCommands(worldEdit)
|
||||
);
|
||||
this.registration.register(
|
||||
new CFICommand(commandManager),
|
||||
CFICommands.builder(),
|
||||
new CFICommands(worldEdit)
|
||||
);
|
||||
this.registration.register(
|
||||
commandManager,
|
||||
|
@ -19,8 +19,6 @@
|
||||
|
||||
package com.sk89q.worldedit.function.visitor;
|
||||
|
||||
import com.boydti.fawe.object.HasIQueueExtent;
|
||||
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
@ -39,11 +37,11 @@ public class NonRisingVisitor extends RecursiveVisitor {
|
||||
* @param function the function
|
||||
*/
|
||||
public NonRisingVisitor(Mask mask, RegionFunction function) {
|
||||
this(mask, function, Integer.MAX_VALUE, null);
|
||||
this(mask, function, Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
public NonRisingVisitor(Mask mask, RegionFunction function, int depth, HasIQueueExtent hasIQueueExtent) {
|
||||
super(mask, function, depth, hasIQueueExtent);
|
||||
public NonRisingVisitor(Mask mask, RegionFunction function, int depth) {
|
||||
super(mask, function, depth);
|
||||
setDirections(
|
||||
BlockVector3.UNIT_X,
|
||||
BlockVector3.UNIT_MINUS_X,
|
||||
|
@ -19,8 +19,6 @@
|
||||
|
||||
package com.sk89q.worldedit.internal.annotation;
|
||||
|
||||
import com.sk89q.worldedit.util.command.binding.PrimitiveBindings;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
@ -41,6 +41,7 @@ import com.sk89q.worldedit.world.weather.WeatherType;
|
||||
import com.sk89q.worldedit.world.weather.WeatherTypes;
|
||||
import javax.annotation.Nullable;
|
||||
import java.nio.file.Path;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* An abstract implementation of {@link World}.
|
||||
@ -105,7 +106,7 @@ public interface SimpleWorld extends World {
|
||||
|
||||
@Override
|
||||
default boolean queueBlockBreakEffect(Platform server, BlockVector3 position, BlockType blockType, double priority) {
|
||||
Fawe.get().getQueueHandler().sync(() -> playEffect(position, 2001, blockType.getLegacyCombinedId() >> 4));
|
||||
Fawe.get().getQueueHandler().sync((Supplier<Boolean>) () -> playEffect(position, 2001, blockType.getLegacyCombinedId() >> 4));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.world;
|
||||
|
||||
import com.boydti.fawe.object.extent.LightingExtent;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
@ -127,7 +128,13 @@ public interface World extends Extent {
|
||||
* @param position the position
|
||||
* @return the light level (0-15)
|
||||
*/
|
||||
int getBlockLightLevel(BlockVector3 position);
|
||||
default int getBlockLightLevel(BlockVector3 position) {
|
||||
if (this instanceof LightingExtent) {
|
||||
LightingExtent extent = (LightingExtent) this;
|
||||
return extent.getBlockLight(position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
return getBlock(position).getMaterial().getLightValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear a chest's contents.
|
||||
|
@ -91,7 +91,7 @@ configure(subprojects + project("core:ap")) {
|
||||
def textExtrasVersion = "3.0.2"
|
||||
project("core") {
|
||||
def textVersion = "3.0.2"
|
||||
def pistonVersion = '0.4.3-SNAPSHOT'
|
||||
def pistonVersion = '0.4.4-SNAPSHOT'
|
||||
|
||||
dependencies {
|
||||
shade "net.kyori:text-api:$textVersion"
|
||||
@ -104,15 +104,21 @@ project("core") {
|
||||
}
|
||||
shade 'com.thoughtworks.paranamer:paranamer:2.6'
|
||||
shade 'com.sk89q.lib:jlibnoise:1.0.0'
|
||||
shade "FAWE-Piston:lastSuccessfulBuild:core/build/libs/core-$pistonVersion@jar"
|
||||
shade "org.enginehub.piston.core-ap:runtime:$pistonVersion"
|
||||
shade "org.enginehub.piston:default-impl:$pistonVersion"
|
||||
shade "FAWE-Piston:core/build/libs/core-$pistonVersion:lastSuccessfulBuild@jar"
|
||||
shade "FAWE-Piston:core-ap/runtime/build/libs/runtime-$pistonVersion:lastSuccessfulBuild@jar"
|
||||
shade "FAWE-Piston:default-impl/build/libs/default-impl-$pistonVersion:lastSuccessfulBuild@jar"
|
||||
}
|
||||
|
||||
project("ap") {
|
||||
dependencies {
|
||||
shade "org.enginehub.piston.core-ap:annotations:$pistonVersion"
|
||||
shade "org.enginehub.piston.core-ap:processor:$pistonVersion"
|
||||
// def avVersion = "1.6.5"
|
||||
// shade "com.google.auto.value:auto-value-annotations:$avVersion"
|
||||
shade "FAWE-Piston:core/build/libs/core-$pistonVersion:lastSuccessfulBuild@jar"
|
||||
shade "FAWE-Piston:core-ap/annotations/build/libs/annotations-$pistonVersion:lastSuccessfulBuild@jar"
|
||||
shade "FAWE-Piston:core-ap/processor/build/libs/processor-$pistonVersion:lastSuccessfulBuild@jar"
|
||||
|
||||
shade "org.enginehub.piston.core-ap:annotations:0.4.3"
|
||||
shade "org.enginehub.piston.core-ap:processor:0.4.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren