mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-10 04:28:35 +00:00
Finish up transition to captions
This commit is contained in:
@ -63,7 +63,7 @@ public class BiomePatternParser extends RichParser<Pattern> {
|
||||
@Override
|
||||
protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException {
|
||||
if (arguments.length != 1) {
|
||||
throw new InputParseException("Invalid amount of arguments. Expected: #biome[<biome>]");
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.invalid-arguments", TextComponent.of("#biome[<biome>]")));
|
||||
}
|
||||
BiomeType biomeType = BiomeTypes.get(arguments[0]);
|
||||
if (biomeType == null) {
|
||||
|
@ -26,6 +26,8 @@ import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.function.pattern.RandomPattern;
|
||||
import com.sk89q.worldedit.internal.registry.InputParser;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.world.block.BlockCategory;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
|
||||
@ -58,13 +60,13 @@ public class BlockCategoryPatternParser extends InputParser<Pattern> {
|
||||
|
||||
BlockCategory category = BlockCategory.REGISTRY.get(tag);
|
||||
if (category == null) {
|
||||
throw new InputParseException("Unknown block tag: " + tag);
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.unknown-block-tag", TextComponent.of(tag)));
|
||||
}
|
||||
RandomPattern randomPattern = new RandomPattern();
|
||||
|
||||
Set<BlockType> blocks = category.getAll();
|
||||
if (blocks.isEmpty()) {
|
||||
throw new InputParseException("Block tag " + category.getId() + " had no blocks!");
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.block-tag-no-blocks", TextComponent.of(category.getId())));
|
||||
}
|
||||
|
||||
if (anyState) {
|
||||
|
@ -30,6 +30,8 @@ import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.internal.registry.InputParser;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.session.ClipboardHolder;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.stream.Stream;
|
||||
@ -78,11 +80,11 @@ public class ClipboardPatternParser extends InputParser<Pattern> {
|
||||
String coords = offsetParts[1];
|
||||
if (coords.length() < 7 // min length of `[x,y,z]`
|
||||
|| coords.charAt(0) != '[' || coords.charAt(coords.length() - 1) != ']') {
|
||||
throw new InputParseException("Offset specified with @ but no offset given. Use '#copy@[x,y,z]'.");
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.clipboard.missing-offset"));
|
||||
}
|
||||
String[] offsetSplit = coords.substring(1, coords.length() - 1).split(",");
|
||||
if (offsetSplit.length != 3) {
|
||||
throw new InputParseException("Clipboard offset needs x,y,z coordinates.");
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.clipboard.missing-coordinates"));
|
||||
}
|
||||
offset = BlockVector3.at(
|
||||
Integer.valueOf(offsetSplit[0]),
|
||||
@ -97,10 +99,10 @@ public class ClipboardPatternParser extends InputParser<Pattern> {
|
||||
Clipboard clipboard = holder.getClipboard();
|
||||
return new ClipboardPattern(clipboard, offset);
|
||||
} catch (EmptyClipboardException e) {
|
||||
throw new InputParseException("To use #clipboard, please first copy something to your clipboard");
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.empty-clipboard", TextComponent.of("#clipboard")));
|
||||
}
|
||||
} else {
|
||||
throw new InputParseException("No session is available, so no clipboard is available");
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.no-session"));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user