mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
Legacy schem reader offset
This commit is contained in:
parent
601890fe64
commit
3dde61cee6
@ -35,6 +35,7 @@ import com.boydti.fawe.object.io.FastByteArraysInputStream;
|
|||||||
import com.sk89q.jnbt.CompoundTag;
|
import com.sk89q.jnbt.CompoundTag;
|
||||||
import com.sk89q.jnbt.NBTInputStream;
|
import com.sk89q.jnbt.NBTInputStream;
|
||||||
import com.sk89q.worldedit.entity.BaseEntity;
|
import com.sk89q.worldedit.entity.BaseEntity;
|
||||||
|
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
|
||||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||||
import com.sk89q.worldedit.extent.clipboard.io.legacycompat.EntityNBTCompatibilityHandler;
|
import com.sk89q.worldedit.extent.clipboard.io.legacycompat.EntityNBTCompatibilityHandler;
|
||||||
import com.sk89q.worldedit.extent.clipboard.io.legacycompat.FlowerPotCompatibilityHandler;
|
import com.sk89q.worldedit.extent.clipboard.io.legacycompat.FlowerPotCompatibilityHandler;
|
||||||
@ -247,9 +248,9 @@ public class SchematicReader implements ClipboardReader {
|
|||||||
biomes = null;
|
biomes = null;
|
||||||
|
|
||||||
BlockVector3 dimensions = BlockVector3.at(width, height, length);
|
BlockVector3 dimensions = BlockVector3.at(width, height, length);
|
||||||
BlockVector3 origin = BlockVector3.at(originX, originY, originZ);
|
BlockVector3 origin = BlockVector3.ZERO;
|
||||||
if (offsetX != Integer.MIN_VALUE && offsetY != Integer.MIN_VALUE && offsetZ != Integer.MIN_VALUE) {
|
if (offsetX != Integer.MIN_VALUE && offsetY != Integer.MIN_VALUE && offsetZ != Integer.MIN_VALUE) {
|
||||||
origin = origin.subtract(BlockVector3.at(offsetX, offsetY, offsetZ));
|
origin = BlockVector3.at(-offsetX, -offsetY, -offsetZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
Clipboard clipboard = createOutput.apply(dimensions);
|
Clipboard clipboard = createOutput.apply(dimensions);
|
||||||
@ -365,6 +366,11 @@ public class SchematicReader implements ClipboardReader {
|
|||||||
}
|
}
|
||||||
fixStates(clipboard);
|
fixStates(clipboard);
|
||||||
clipboard.setOrigin(origin);
|
clipboard.setOrigin(origin);
|
||||||
|
|
||||||
|
BlockVector3 min = BlockVector3.at(originX, originY, originZ);
|
||||||
|
if (!min.equals(BlockVector3.ZERO)) {
|
||||||
|
new BlockArrayClipboard(clipboard, min);
|
||||||
|
}
|
||||||
return clipboard;
|
return clipboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user