mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 20:16:41 +00:00
Binding improvements
WIP towards deprecating parsers and unifying the command bindings Allow registering dynamic bindings - Supports nesting bindings
This commit is contained in:
@ -1,13 +1,12 @@
|
||||
package com.boydti.fawe.command;
|
||||
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.internal.command.WorldEditBinding;
|
||||
import com.sk89q.worldedit.util.command.parametric.BindingHelper;
|
||||
|
||||
public class FaweBinding extends WorldEditBinding {
|
||||
public class FaweBinding extends BindingHelper {
|
||||
private final WorldEdit worldEdit;
|
||||
|
||||
public FaweBinding(WorldEdit worldEdit) {
|
||||
super(worldEdit);
|
||||
this.worldEdit = worldEdit;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ import java.net.URI;
|
||||
import java.net.URL;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class FawePrimitiveBinding extends BindingHelper {
|
||||
public class FawePrimitiveBinding {
|
||||
@BindingMatch(type = {Long.class, long.class},
|
||||
behavior = BindingBehavior.CONSUMES,
|
||||
consumedCount = 1,
|
||||
|
@ -4,8 +4,6 @@ import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.util.command.parametric.ParameterData;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
@ -35,4 +35,4 @@ public class CircleBrush implements Brush {
|
||||
Vector3 random = affine.apply(normal);
|
||||
return random.cross(normal).normalize();
|
||||
}
|
||||
}
|
||||
}
|
@ -98,7 +98,6 @@ public class FaweSchematicHandler extends SchematicHandler {
|
||||
if (tag instanceof CompressedCompoundTag) {
|
||||
CompressedCompoundTag cTag = (CompressedCompoundTag) tag;
|
||||
if (cTag instanceof CompressedSchematicTag) {
|
||||
System.out.println("Write directly");
|
||||
Clipboard clipboard = (Clipboard) cTag.getSource();
|
||||
try (OutputStream stream = new FileOutputStream(tmp); NBTOutputStream output = new NBTOutputStream(new BufferedOutputStream(new PGZIPOutputStream(stream)))) {
|
||||
new SpongeSchematicWriter(output).write(clipboard);
|
||||
|
Reference in New Issue
Block a user