Dieser Commit ist enthalten in:
Matthew Miller 2018-12-23 21:24:58 +10:00
Ursprung 645fd682b6
Commit 1d5e9b7d04
3 geänderte Dateien mit 15 neuen und 15 gelöschten Zeilen

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.extension.factory.parser.mask;
import com.google.common.base.Splitter;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext;
@ -48,10 +49,9 @@ public class BiomeMaskParser extends InputParser<Mask> {
}
Set<BaseBiome> biomes = new HashSet<>();
String[] biomesList = input.substring(1).split(",");
BiomeRegistry biomeRegistry = worldEdit.getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry();
List<BaseBiome> knownBiomes = biomeRegistry.getBiomes();
for (String biomeName : biomesList) {
for (String biomeName : Splitter.on(",").split(input.substring(1))) {
BaseBiome biome = Biomes.findBiomeByName(knownBiomes, biomeName, biomeRegistry);
if (biome == null) {
throw new InputParseException("Unknown biome '" + biomeName + '\'');

Datei anzeigen

@ -38,18 +38,18 @@ public class BlockCategoryMaskParser extends InputParser<Mask> {
@Override
public Mask parseFromInput(String input, ParserContext context) throws InputParseException {
if (input.startsWith("##")) {
Extent extent = Request.request().getEditSession();
// This means it's a tag mask.
BlockCategory category = BlockCategories.get(input.substring(2).toLowerCase());
if (category == null) {
throw new InputParseException("Unrecognised tag '" + input.substring(2) + '\'');
} else {
return new BlockCategoryMask(extent, category);
}
if (!input.startsWith("##")) {
return null;
}
return null;
Extent extent = Request.request().getEditSession();
// This means it's a tag mask.
BlockCategory category = BlockCategories.get(input.substring(2).toLowerCase());
if (category == null) {
throw new InputParseException("Unrecognised tag '" + input.substring(2) + '\'');
} else {
return new BlockCategoryMask(extent, category);
}
}
}

Datei anzeigen

@ -19,11 +19,11 @@
package com.sk89q.worldedit.internal.registry;
import com.google.common.collect.Lists;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext;
import java.util.Collections;
import java.util.List;
/**
@ -48,6 +48,6 @@ public abstract class InputParser<E> {
* @return a list of suggestions
*/
public List<String> getSuggestions() {
return Lists.newArrayList();
return Collections.emptyList();
}
}