mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
Fix #fullcopy -r (#1816)
This commit is contained in:
parent
aadd35c0c4
commit
84f6039f41
@ -38,9 +38,9 @@ public class RandomFullClipboardPatternParser extends RichParser<Pattern> {
|
||||
case 0:
|
||||
if (argumentInput.equals("#") || argumentInput.equals("#c")) {
|
||||
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");
|
||||
} else if ("#clipboard".startsWith(argumentInput.toUpperCase(Locale.ROOT))) {
|
||||
} else if ("#clipboard".startsWith(argumentInput.toLowerCase(Locale.ROOT))) {
|
||||
return Stream.of("#clipboard");
|
||||
} else {
|
||||
return Stream.empty();
|
||||
@ -62,11 +62,11 @@ public class RandomFullClipboardPatternParser extends RichParser<Pattern> {
|
||||
));
|
||||
}
|
||||
try {
|
||||
boolean rotate = arguments.length >= 2 && Boolean.getBoolean(arguments[1]);
|
||||
boolean flip = arguments.length == 3 && Boolean.getBoolean(arguments[2]);
|
||||
boolean rotate = arguments.length >= 2 && Boolean.parseBoolean(arguments[1]);
|
||||
boolean flip = arguments.length == 3 && Boolean.parseBoolean(arguments[2]);
|
||||
List<ClipboardHolder> clipboards;
|
||||
if ("#copy".startsWith(arguments[0].toUpperCase(Locale.ROOT)) ||
|
||||
"#clipboard".startsWith(arguments[0].toUpperCase(Locale.ROOT))) {
|
||||
if ("#copy".startsWith(arguments[0].toLowerCase(Locale.ROOT)) ||
|
||||
"#clipboard".startsWith(arguments[0].toLowerCase(Locale.ROOT))) {
|
||||
ClipboardHolder clipboard = context.requireSession().getExistingClipboard();
|
||||
if (clipboard == null) {
|
||||
throw new InputParseException(Caption.of("fawe.error.parse.no-clipboard", getPrefix()));
|
||||
|
@ -44,13 +44,12 @@ public class RandomFullClipboardPattern extends AbstractPattern {
|
||||
AffineTransform transform = new AffineTransform();
|
||||
if (randomRotate) {
|
||||
transform = transform.rotateY(ThreadLocalRandom.current().nextInt(4) * 90);
|
||||
holder.setTransform(new AffineTransform().rotateY(ThreadLocalRandom.current().nextInt(4) * 90));
|
||||
}
|
||||
if (randomFlip && ThreadLocalRandom.current().nextBoolean()) {
|
||||
transform = transform.scale(flipVector);
|
||||
}
|
||||
if (!transform.isIdentity()) {
|
||||
holder.setTransform(transform);
|
||||
holder.setTransform(transform.combine(holder.getTransform()));
|
||||
}
|
||||
Clipboard clipboard = holder.getClipboard();
|
||||
Transform newTransform = holder.getTransform();
|
||||
|
Loading…
Reference in New Issue
Block a user