Merge branch 'master' into breaking

This commit is contained in:
Jesse Boyd
2019-04-05 15:47:04 +11:00
43 changed files with 985 additions and 919 deletions

View File

@ -904,8 +904,8 @@ public final class BlockTypes {
try {
BlockStateHolder block = LegacyMapper.getInstance().getBlockFromLegacy(input);
if (block != null) return block.getBlockType();
} catch (NumberFormatException e) {
} catch (IndexOutOfBoundsException e) {}
} catch (NumberFormatException | IndexOutOfBoundsException e) {
}
throw new SuggestInputParseException("Does not match a valid block type: " + inputLower, inputLower, () -> Stream.of(BlockTypes.values)
.filter(b -> b.getId().contains(inputLower))

View File

@ -147,4 +147,4 @@ public class BundledBlockData {
public SimpleBlockMaterial material = new SimpleBlockMaterial();
}
}
}

View File

@ -40,8 +40,6 @@ import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes;
import com.sk89q.worldedit.world.item.ItemType;
import com.sk89q.worldedit.world.item.ItemTypes;
import com.sk89q.worldedit.extension.input.ParserContext;
import com.sk89q.worldedit.util.gson.VectorAdapter;
import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -50,6 +48,7 @@ import javax.annotation.Nullable;
import java.io.IOException;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.Map;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -37,6 +37,7 @@ public class WeatherTypes {
private WeatherTypes() {
}
public static @Nullable WeatherType get(final String id) {
return WeatherType.REGISTRY.get(id);
}