geforkt von Mirrors/FastAsyncWorldEdit
Few fixes
Dieser Commit ist enthalten in:
Ursprung
645fd682b6
Commit
1d5e9b7d04
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
package com.sk89q.worldedit.extension.factory.parser.mask;
|
package com.sk89q.worldedit.extension.factory.parser.mask;
|
||||||
|
|
||||||
|
import com.google.common.base.Splitter;
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||||
@ -48,10 +49,9 @@ public class BiomeMaskParser extends InputParser<Mask> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Set<BaseBiome> biomes = new HashSet<>();
|
Set<BaseBiome> biomes = new HashSet<>();
|
||||||
String[] biomesList = input.substring(1).split(",");
|
|
||||||
BiomeRegistry biomeRegistry = worldEdit.getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry();
|
BiomeRegistry biomeRegistry = worldEdit.getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBiomeRegistry();
|
||||||
List<BaseBiome> knownBiomes = biomeRegistry.getBiomes();
|
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);
|
BaseBiome biome = Biomes.findBiomeByName(knownBiomes, biomeName, biomeRegistry);
|
||||||
if (biome == null) {
|
if (biome == null) {
|
||||||
throw new InputParseException("Unknown biome '" + biomeName + '\'');
|
throw new InputParseException("Unknown biome '" + biomeName + '\'');
|
||||||
|
@ -38,18 +38,18 @@ public class BlockCategoryMaskParser extends InputParser<Mask> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mask parseFromInput(String input, ParserContext context) throws InputParseException {
|
public Mask parseFromInput(String input, ParserContext context) throws InputParseException {
|
||||||
if (input.startsWith("##")) {
|
if (!input.startsWith("##")) {
|
||||||
Extent extent = Request.request().getEditSession();
|
return null;
|
||||||
|
|
||||||
// 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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,11 +19,11 @@
|
|||||||
|
|
||||||
package com.sk89q.worldedit.internal.registry;
|
package com.sk89q.worldedit.internal.registry;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -48,6 +48,6 @@ public abstract class InputParser<E> {
|
|||||||
* @return a list of suggestions
|
* @return a list of suggestions
|
||||||
*/
|
*/
|
||||||
public List<String> getSuggestions() {
|
public List<String> getSuggestions() {
|
||||||
return Lists.newArrayList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren