Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-25 02:20:07 +01:00
Fix #fullcopy -r (#1816)
Dieser Commit ist enthalten in:
Ursprung
aadd35c0c4
Commit
84f6039f41
@ -38,9 +38,9 @@ public class RandomFullClipboardPatternParser extends RichParser<Pattern> {
|
|||||||
case 0:
|
case 0:
|
||||||
if (argumentInput.equals("#") || argumentInput.equals("#c")) {
|
if (argumentInput.equals("#") || argumentInput.equals("#c")) {
|
||||||
return Stream.of("#copy", "#clipboard");
|
return Stream.of("#copy", "#clipboard");
|
||||||
} else if ("#copy".startsWith(argumentInput.toUpperCase(Locale.ROOT))) {
|
} else if ("#copy".startsWith(argumentInput.toLowerCase(Locale.ROOT))) {
|
||||||
return Stream.of("#copy");
|
return Stream.of("#copy");
|
||||||
} else if ("#clipboard".startsWith(argumentInput.toUpperCase(Locale.ROOT))) {
|
} else if ("#clipboard".startsWith(argumentInput.toLowerCase(Locale.ROOT))) {
|
||||||
return Stream.of("#clipboard");
|
return Stream.of("#clipboard");
|
||||||
} else {
|
} else {
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
@ -62,11 +62,11 @@ public class RandomFullClipboardPatternParser extends RichParser<Pattern> {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
boolean rotate = arguments.length >= 2 && Boolean.getBoolean(arguments[1]);
|
boolean rotate = arguments.length >= 2 && Boolean.parseBoolean(arguments[1]);
|
||||||
boolean flip = arguments.length == 3 && Boolean.getBoolean(arguments[2]);
|
boolean flip = arguments.length == 3 && Boolean.parseBoolean(arguments[2]);
|
||||||
List<ClipboardHolder> clipboards;
|
List<ClipboardHolder> clipboards;
|
||||||
if ("#copy".startsWith(arguments[0].toUpperCase(Locale.ROOT)) ||
|
if ("#copy".startsWith(arguments[0].toLowerCase(Locale.ROOT)) ||
|
||||||
"#clipboard".startsWith(arguments[0].toUpperCase(Locale.ROOT))) {
|
"#clipboard".startsWith(arguments[0].toLowerCase(Locale.ROOT))) {
|
||||||
ClipboardHolder clipboard = context.requireSession().getExistingClipboard();
|
ClipboardHolder clipboard = context.requireSession().getExistingClipboard();
|
||||||
if (clipboard == null) {
|
if (clipboard == null) {
|
||||||
throw new InputParseException(Caption.of("fawe.error.parse.no-clipboard", getPrefix()));
|
throw new InputParseException(Caption.of("fawe.error.parse.no-clipboard", getPrefix()));
|
||||||
|
@ -44,13 +44,12 @@ public class RandomFullClipboardPattern extends AbstractPattern {
|
|||||||
AffineTransform transform = new AffineTransform();
|
AffineTransform transform = new AffineTransform();
|
||||||
if (randomRotate) {
|
if (randomRotate) {
|
||||||
transform = transform.rotateY(ThreadLocalRandom.current().nextInt(4) * 90);
|
transform = transform.rotateY(ThreadLocalRandom.current().nextInt(4) * 90);
|
||||||
holder.setTransform(new AffineTransform().rotateY(ThreadLocalRandom.current().nextInt(4) * 90));
|
|
||||||
}
|
}
|
||||||
if (randomFlip && ThreadLocalRandom.current().nextBoolean()) {
|
if (randomFlip && ThreadLocalRandom.current().nextBoolean()) {
|
||||||
transform = transform.scale(flipVector);
|
transform = transform.scale(flipVector);
|
||||||
}
|
}
|
||||||
if (!transform.isIdentity()) {
|
if (!transform.isIdentity()) {
|
||||||
holder.setTransform(transform);
|
holder.setTransform(transform.combine(holder.getTransform()));
|
||||||
}
|
}
|
||||||
Clipboard clipboard = holder.getClipboard();
|
Clipboard clipboard = holder.getClipboard();
|
||||||
Transform newTransform = holder.getTransform();
|
Transform newTransform = holder.getTransform();
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren