mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
Merge branch 'commanding-pipeline' of https://github.com/IntellectualSites/FastAsyncWorldEdit-1.13 into commanding-pipeline
This commit is contained in:
@ -103,9 +103,9 @@ public interface ClipboardFormat {
|
||||
Set<String> getFileExtensions();
|
||||
|
||||
/**
|
||||
* Set the actor's clipboard
|
||||
* Sets the actor's clipboard.
|
||||
* @param actor
|
||||
* @param uri
|
||||
* @param uri the URI of the schematic to hold
|
||||
* @param inputStream the input stream
|
||||
* @throws IOException thrown on I/O error
|
||||
*/
|
||||
|
@ -20,11 +20,8 @@
|
||||
package com.sk89q.worldedit.extent.clipboard.io;
|
||||
|
||||
import com.boydti.fawe.object.clipboard.DiskOptimizedClipboard;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
@ -48,12 +45,7 @@ public interface ClipboardReader extends Closeable {
|
||||
}
|
||||
|
||||
default Clipboard read(UUID uuid) throws IOException {
|
||||
return read(uuid, new Function<BlockVector3, Clipboard>() {
|
||||
@Override
|
||||
public Clipboard apply(BlockVector3 dimensions) {
|
||||
return new DiskOptimizedClipboard(dimensions);
|
||||
}
|
||||
});
|
||||
return read(uuid, DiskOptimizedClipboard::new);
|
||||
}
|
||||
|
||||
default Clipboard read(UUID uuid, Function<BlockVector3, Clipboard> createOutput) throws IOException {
|
||||
|
@ -19,7 +19,9 @@
|
||||
|
||||
package com.sk89q.worldedit.extent.clipboard.io;
|
||||
|
||||
import com.boydti.fawe.Fawe;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
|
||||
import com.boydti.fawe.FaweCache;
|
||||
import com.boydti.fawe.jnbt.streamer.InfoReader;
|
||||
import com.boydti.fawe.jnbt.streamer.IntValueReader;
|
||||
@ -51,7 +53,6 @@ import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockCategories;
|
||||
import com.sk89q.worldedit.world.block.BlockID;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypeSwitch;
|
||||
import com.sk89q.worldedit.world.block.BlockTypeSwitchBuilder;
|
||||
@ -59,9 +60,6 @@ import com.sk89q.worldedit.world.entity.EntityType;
|
||||
import com.sk89q.worldedit.world.entity.EntityTypes;
|
||||
import com.sk89q.worldedit.world.registry.BlockMaterial;
|
||||
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||
import net.jpountz.lz4.LZ4BlockInputStream;
|
||||
import net.jpountz.lz4.LZ4BlockOutputStream;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
@ -69,8 +67,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Function;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import net.jpountz.lz4.LZ4BlockInputStream;
|
||||
import net.jpountz.lz4.LZ4BlockOutputStream;
|
||||
|
||||
/**
|
||||
* Reads schematic files based that are compatible with MCEdit and other editors.
|
||||
@ -180,21 +178,12 @@ public class SchematicReader implements ClipboardReader {
|
||||
|
||||
StreamDelegate tilesDelegate = schematic.add("TileEntities");
|
||||
tilesDelegate.withInfo((length, type) -> tiles = new ArrayList<>(length));
|
||||
tilesDelegate.withElem(new ValueReader<Map<String, Object>>() {
|
||||
@Override
|
||||
public void apply(int index, Map<String, Object> tile) {
|
||||
tiles.add(tile);
|
||||
}
|
||||
});
|
||||
tilesDelegate.withElem((ValueReader<Map<String, Object>>) (index, tile) -> tiles.add(tile));
|
||||
|
||||
StreamDelegate entitiesDelegate = schematic.add("Entities");
|
||||
entitiesDelegate.withInfo((length, type) -> entities = new ArrayList<>(length));
|
||||
entitiesDelegate.withElem(new ValueReader<Map<String, Object>>() {
|
||||
@Override
|
||||
public void apply(int index, Map<String, Object> entity) {
|
||||
entities.add(entity);
|
||||
}
|
||||
});
|
||||
entitiesDelegate.withElem(
|
||||
(ValueReader<Map<String, Object>>) (index, entity) -> entities.add(entity));
|
||||
return root;
|
||||
}
|
||||
|
||||
@ -370,7 +359,7 @@ public class SchematicReader implements ClipboardReader {
|
||||
Location loc = ent.getEntityLocation(clipboard);
|
||||
clipboard.createEntity(loc, state);
|
||||
} else {
|
||||
Fawe.debug("Invalid entity: " + id);
|
||||
getLogger(SchematicReader.class).debug("Invalid entity: " + id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -396,10 +385,10 @@ public class SchematicReader implements ClipboardReader {
|
||||
Direction left = facing.getLeft();
|
||||
Direction right = facing.getRight();
|
||||
|
||||
BlockStateHolder forwardBlock = fc.getBlock(x + forward.getBlockX(), y + forward.getBlockY(), z + forward.getBlockZ());
|
||||
BlockState forwardBlock = fc.getBlock(x + forward.getBlockX(), y + forward.getBlockY(), z + forward.getBlockZ());
|
||||
BlockType forwardType = forwardBlock.getBlockType();
|
||||
if (forwardType.hasProperty(PropertyKey.SHAPE) && forwardType.hasProperty(PropertyKey.FACING)) {
|
||||
Direction forwardFacing = (Direction) forwardBlock.getState(PropertyKey.FACING);
|
||||
Direction forwardFacing = forwardBlock.getState(PropertyKey.FACING);
|
||||
if (forwardFacing == left) {
|
||||
BlockState rightBlock = fc.getBlock(x + right.toBlockVector().getBlockX(), y + right.toBlockVector().getBlockY(), z + right.toBlockVector().getBlockZ());
|
||||
BlockType rightType = rightBlock.getBlockType();
|
||||
|
@ -336,7 +336,7 @@ public class SpongeSchematicReader extends NBTSchematicReader {
|
||||
Location loc = ent.getEntityLocation(clipboard);
|
||||
clipboard.createEntity(loc, state);
|
||||
} else {
|
||||
Fawe.debug("Invalid entity: " + id);
|
||||
log.debug("Invalid entity: " + id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user