mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
Use BlockArrayClipboard for schem load
This commit is contained in:
parent
cfa147cf76
commit
ac6f4ae358
@ -60,6 +60,13 @@ public class BlockArrayClipboard extends DelegateClipboard implements Clipboard,
|
|||||||
this(region, UUID.randomUUID());
|
this(region, UUID.randomUUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BlockArrayClipboard(Clipboard clipboard, BlockVector3 offset) {
|
||||||
|
super(clipboard);
|
||||||
|
Region shifted = clipboard.getRegion();
|
||||||
|
shifted.shift(offset);
|
||||||
|
setRegion(shifted);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new instance.
|
* Create a new instance.
|
||||||
*
|
*
|
||||||
|
@ -218,10 +218,9 @@ public class SpongeSchematicReader extends NBTSchematicReader {
|
|||||||
biomes = null;
|
biomes = null;
|
||||||
|
|
||||||
BlockVector3 dimensions = BlockVector3.at(width, height, length);
|
BlockVector3 dimensions = BlockVector3.at(width, height, length);
|
||||||
BlockVector3 origin = min;
|
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);
|
||||||
origin = BlockVector3.at(offsetX, offsetY, offsetZ);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Clipboard clipboard = createOutput.apply(dimensions);
|
Clipboard clipboard = createOutput.apply(dimensions);
|
||||||
@ -341,6 +340,11 @@ public class SpongeSchematicReader extends NBTSchematicReader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
clipboard.setOrigin(origin);
|
clipboard.setOrigin(origin);
|
||||||
|
|
||||||
|
if (!min.equals(BlockVector3.ZERO)) {
|
||||||
|
new BlockArrayClipboard(clipboard, min);
|
||||||
|
}
|
||||||
|
|
||||||
return clipboard;
|
return clipboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user