Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-08 04:20:06 +01:00
Add switch to schem loadall to replace existing clipboard(s)
Dieser Commit ist enthalten in:
Ursprung
58f231ad12
Commit
b73db47e01
@ -153,8 +153,10 @@ public class SchematicCommands {
|
|||||||
String formatName,
|
String formatName,
|
||||||
@Arg(desc = "File name.")
|
@Arg(desc = "File name.")
|
||||||
String filename,
|
String filename,
|
||||||
@Switch(name = 'r', desc = "Apply random rotation")
|
@Switch(name = 'o', desc = "Overwrite/replace existing clipboard(s)")
|
||||||
boolean randomRotate
|
boolean overwrite
|
||||||
|
// @Switch(name = 'r', desc = "Apply random rotation") <- not implemented below.
|
||||||
|
// boolean randomRotate
|
||||||
) throws FilenameException {
|
) throws FilenameException {
|
||||||
final ClipboardFormat format = ClipboardFormats.findByAlias(formatName);
|
final ClipboardFormat format = ClipboardFormats.findByAlias(formatName);
|
||||||
if (format == null) {
|
if (format == null) {
|
||||||
@ -164,7 +166,11 @@ public class SchematicCommands {
|
|||||||
try {
|
try {
|
||||||
MultiClipboardHolder all = ClipboardFormats.loadAllFromInput(player, filename, null, true);
|
MultiClipboardHolder all = ClipboardFormats.loadAllFromInput(player, filename, null, true);
|
||||||
if (all != null) {
|
if (all != null) {
|
||||||
|
if (overwrite) {
|
||||||
|
session.setClipboard(all);
|
||||||
|
} else {
|
||||||
session.addClipboard(all);
|
session.addClipboard(all);
|
||||||
|
}
|
||||||
player.print(Caption.of("fawe.worldedit.schematic.schematic.loaded", filename));
|
player.print(Caption.of("fawe.worldedit.schematic.schematic.loaded", filename));
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren