couple more compilation issues

Dieser Commit ist enthalten in:
Jesse Boyd 2019-07-23 06:58:18 +10:00
Ursprung e53fc8a7f6
Commit c05d425f64
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 59F1DE6293AF6E1F
22 geänderte Dateien mit 274 neuen und 151 gelöschten Zeilen

Datei anzeigen

@ -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);
}

Datei anzeigen

@ -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;

Datei anzeigen

@ -1,10 +1,7 @@
package com.boydti.fawe.command;
import static com.boydti.fawe.util.image.ImageUtil.load;
import com.boydti.fawe.Fawe;
import com.boydti.fawe.FaweAPI;
import com.boydti.fawe.beta.IQueueExtent;
import com.boydti.fawe.beta.SingleFilterBlock;
import com.boydti.fawe.config.BBC;
import com.boydti.fawe.config.Commands;
@ -21,23 +18,11 @@ import com.boydti.fawe.util.TaskManager;
import com.boydti.fawe.util.TextureUtil;
import com.boydti.fawe.util.chat.Message;
import com.boydti.fawe.util.image.ImageUtil;
import com.sk89q.worldedit.command.util.CommandPermissionsConditionGenerator;
import java.nio.file.Path;
import java.util.function.Consumer;
import java.util.stream.IntStream;
import com.sk89q.worldedit.extension.platform.binding.ProvideBindings;
import com.sk89q.worldedit.util.formatting.text.TextComponent;
import org.enginehub.piston.annotation.Command;
import org.enginehub.piston.exception.StopExecutionException;
import org.enginehub.piston.inject.InjectedValueAccess;
import com.sk89q.minecraft.util.commands.CommandException;
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;
@ -45,6 +30,7 @@ import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext;
import com.sk89q.worldedit.extension.platform.Capability;
import com.sk89q.worldedit.extension.platform.Platform;
import com.sk89q.worldedit.extension.platform.binding.ProvideBindings;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats;
import com.sk89q.worldedit.function.mask.Mask;
@ -55,11 +41,20 @@ import com.sk89q.worldedit.registry.state.PropertyKey;
import com.sk89q.worldedit.session.ClipboardHolder;
import com.sk89q.worldedit.session.request.Request;
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.util.formatting.text.TextComponent;
import com.sk89q.worldedit.world.World;
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;
@ -67,6 +62,7 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Path;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayDeque;
@ -74,17 +70,15 @@ import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.IntStream;
import javax.imageio.ImageIO;
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.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;
@ -104,18 +98,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"
@ -1046,7 +1028,6 @@ public class CFICommands extends MethodCommands {
.send(fp);
}
private static CFISettings assertSettings(FawePlayer fp) {
CFISettings settings = getSettings(fp);
if (!settings.hasGenerator()) {

Datei anzeigen

@ -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;

Datei anzeigen

@ -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()));

Datei anzeigen

@ -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();

Datei anzeigen

@ -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();

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;
throw reason;
}
@Override
public BiomeType getBiomeType(int x, int z) {
throw reason;
}
@Override
public BlockState getBlock(final BlockVector3 arg0) {
if(reason != null) {
throw reason;
}
return null;
throw reason;
}
@Override
public BlockState getBlock(int x, int y, int z) {
if(reason != null) {
throw reason;
}
return null;
throw reason;
}
@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;
}
return false;
throw reason;
}
@Override
public boolean setBiome(int x, int y, int z, BiomeType biome) {
throw reason;
}
@Override
public boolean setBlock(final BlockVector3 arg0, final BlockStateHolder arg1) throws WorldEditException {
if(reason != null) {
throw reason;
}
return false;
throw reason;
}
@Override
public boolean setBlock(int x, int y, int z, BlockStateHolder block) throws WorldEditException {
if(reason != null) {
throw reason;
}
return false;
throw reason;
}
@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) {
throw reason;
}
return 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;
}
@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;
throw reason;
}
@Override
public boolean contains(int x, int y, int z) {
if(reason != null) {
throw reason;
}
return false;
throw reason;
}
@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;
}
return -1;
throw reason;
}
@Override
public int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY, boolean ignoreAir) {
throw reason;
}
@Override
public int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY) {
if(reason != null) {
throw reason;
}
return -1;
throw reason;
}
@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;
}
}

Datei anzeigen

@ -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)

Datei anzeigen

@ -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;

Datei anzeigen

@ -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

Datei anzeigen

@ -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")

Datei anzeigen

@ -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"
@ -549,8 +551,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" +

Datei anzeigen

@ -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(

Datei anzeigen

@ -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();

Datei anzeigen

@ -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,

Datei anzeigen

@ -22,7 +22,6 @@ package com.sk89q.worldedit.function.visitor;
import static com.google.common.base.Preconditions.checkNotNull;
import com.boydti.fawe.config.BBC;
import com.boydti.fawe.example.MappedIQueueExtent;
import com.boydti.fawe.object.collection.BlockVectorSet;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.function.RegionFunction;
@ -37,8 +36,6 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* Performs a breadth-first search starting from points added with
* {@link #visit(BlockVector3)}. The search continues

Datei anzeigen

@ -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,

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;
}

Datei anzeigen

@ -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.