mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
Few fixes
This commit is contained in:
parent
645fd682b6
commit
1d5e9b7d04
@ -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 + '\'');
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user