diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java index 198c6df445..be649fe33d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java @@ -40,10 +40,13 @@ import com.sk89q.worldedit.function.operation.Operations; import com.sk89q.worldedit.function.visitor.RegionVisitor; import com.sk89q.worldedit.internal.annotation.Offset; +import com.sk89q.worldedit.internal.annotation.RegistryType; import com.sk89q.worldedit.internal.command.CommandRegistrationHandler; import com.sk89q.worldedit.internal.command.CommandUtil; import com.sk89q.worldedit.internal.cui.ServerCUIHandler; import com.sk89q.worldedit.math.BlockVector3; +import com.sk89q.worldedit.registry.Keyed; +import com.sk89q.worldedit.registry.Registry; import com.sk89q.worldedit.session.Placement; import com.sk89q.worldedit.session.PlacementType; import com.sk89q.worldedit.util.SideEffect; @@ -54,8 +57,11 @@ import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; +import com.sk89q.worldedit.util.formatting.text.event.HoverEvent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.biome.BiomeType; +import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.item.ItemType; import org.enginehub.piston.CommandManager; import org.enginehub.piston.CommandManagerService; @@ -546,4 +552,59 @@ public Component call() throws Exception { .create(page); } } + + @Command( + name = "/registry", + desc = "Search through the given registry" + ) + @CommandPermissions("worldedit.registry") + public void registry(Actor actor, + @RegistryType + Registry registry, + @ArgFlag(name = 'p', desc = "Page of results to return", def = "1") + int page, + @Arg(desc = "Search query", variable = true) + List query) { + String search = String.join(" ", query); + + WorldEditAsyncCommandBuilder.createAndSendMessage(actor, new RegistrySearcher(registry, search, page), + TranslatableComponent.of("worldedit.registry.searching")); + } + + private static class RegistrySearcher implements Callable { + private final Registry registry; + private final String search; + private final int page; + + RegistrySearcher(Registry registry, String search, int page) { + this.registry = registry; + this.search = search; + this.page = page; + } + + @Override + public Component call() throws Exception { + String command = "//registry " + registry.id() + "-p %page% " + search; + Map results = new TreeMap<>(); + String idMatch = search.replace(' ', '_'); + for (Keyed searchType : registry) { + final String id = searchType.id(); + if (id.contains(idMatch)) { + var builder = TextComponent.builder() + .append(searchType.id()); + switch (searchType) { + case ItemType itemType -> builder.hoverEvent(HoverEvent.showText(itemType.getRichName())); + case BlockType blockType -> builder.hoverEvent(HoverEvent.showText(blockType.getRichName())); + case BiomeType biomeType -> builder.hoverEvent(HoverEvent.showText(biomeType.getRichName())); + default -> { + } + } + results.put(id, builder.build()); + } + } + List list = new ArrayList<>(results.values()); + return PaginationBox.fromComponents("Search results for '" + search + "'", command, list) + .create(page); + } + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/RegistryConverter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/RegistryConverter.java index ed5e2cc1ae..9a80d53497 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/RegistryConverter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/RegistryConverter.java @@ -20,7 +20,9 @@ package com.sk89q.worldedit.command.argument; import com.google.common.collect.ImmutableList; +import com.google.common.reflect.TypeToken; import com.sk89q.worldedit.command.util.SuggestionHelper; +import com.sk89q.worldedit.internal.annotation.RegistryType; import com.sk89q.worldedit.registry.Keyed; import com.sk89q.worldedit.registry.Registry; import com.sk89q.worldedit.util.formatting.text.Component; @@ -48,7 +50,6 @@ import java.lang.reflect.Field; import java.util.List; import java.util.Locale; -import java.util.stream.Collectors; public final class RegistryConverter implements ArgumentConverter { @@ -73,6 +74,9 @@ public static void register(CommandManager commandManager) { .forEach(registryType -> commandManager.registerConverter(Key.of(registryType), from(registryType)) ); + + // This must be separate as it has a generic type + commandManager.registerConverter(Key.of(new TypeToken<>() {}, RegistryType.class), new RegistryConverter<>(Registry.REGISTRY)); } @SuppressWarnings("unchecked") @@ -112,6 +116,6 @@ public ConversionResult convert(String argument, InjectedValueAccess injected @Override public List getSuggestions(String input, InjectedValueAccess context) { - return SuggestionHelper.getRegistrySuggestions(registry, input).collect(Collectors.toList()); + return SuggestionHelper.getRegistrySuggestions(registry, input).toList(); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/annotation/RegistryType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/annotation/RegistryType.java new file mode 100644 index 0000000000..a001ce32cb --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/annotation/RegistryType.java @@ -0,0 +1,33 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.internal.annotation; + +import org.enginehub.piston.inject.InjectAnnotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PARAMETER) +@InjectAnnotation +public @interface RegistryType { +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/NamespacedRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/NamespacedRegistry.java index 28b673451c..4aac4a82eb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/NamespacedRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/NamespacedRegistry.java @@ -32,23 +32,36 @@ public final class NamespacedRegistry extends Registry { private final Set knownNamespaces = new HashSet<>(); private final String defaultNamespace; + @Deprecated public NamespacedRegistry(final String name) { this(name, MINECRAFT_NAMESPACE); } + @Deprecated public NamespacedRegistry(final String name, final boolean checkInitialized) { this(name, MINECRAFT_NAMESPACE, checkInitialized); } + @Deprecated public NamespacedRegistry(final String name, final String defaultNamespace) { this(name, defaultNamespace, false); } + @Deprecated public NamespacedRegistry(final String name, final String defaultNamespace, final boolean checkInitialized) { super(name, checkInitialized); this.defaultNamespace = defaultNamespace; } + public NamespacedRegistry(final String name, final String id, final String defaultNamespace) { + this(name, id, defaultNamespace, false); + } + + public NamespacedRegistry(final String name, final String id, final String defaultNamespace, final boolean checkInitialized) { + super(name, id, checkInitialized); + this.defaultNamespace = defaultNamespace; + } + @Nullable @Override public V get(final String key) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/Registries.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/Registries.java new file mode 100644 index 0000000000..6d26997c52 --- /dev/null +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/Registries.java @@ -0,0 +1,55 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.registry; + +import com.sk89q.worldedit.world.biome.BiomeCategory; +import com.sk89q.worldedit.world.biome.BiomeType; +import com.sk89q.worldedit.world.block.BlockCategory; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.entity.EntityType; +import com.sk89q.worldedit.world.fluid.FluidCategory; +import com.sk89q.worldedit.world.fluid.FluidType; +import com.sk89q.worldedit.world.gamemode.GameMode; +import com.sk89q.worldedit.world.generation.ConfiguredFeatureType; +import com.sk89q.worldedit.world.generation.StructureType; +import com.sk89q.worldedit.world.item.ItemCategory; +import com.sk89q.worldedit.world.item.ItemType; +import com.sk89q.worldedit.world.weather.WeatherType; + +public class Registries { + public static final Registry BLOCK_TYPE = addRegistry(BlockType.REGISTRY); + public static final Registry BLOCK_CATEGORY = addRegistry(BlockCategory.REGISTRY); + public static final Registry ITEM_TYPE = addRegistry(ItemType.REGISTRY); + public static final Registry ITEM_CATEGORY = addRegistry(ItemCategory.REGISTRY); + public static final Registry GAME_MODE = addRegistry(GameMode.REGISTRY); + public static final Registry WEATHER_TYPE = addRegistry(WeatherType.REGISTRY); + public static final Registry BIOME_TYPE = addRegistry(BiomeType.REGISTRY); + public static final Registry BIOME_CATEGORY = addRegistry(BiomeCategory.REGISTRY); + public static final Registry ENTITY_TYPE = addRegistry(EntityType.REGISTRY); + public static final Registry FLUID_TYPE = addRegistry(FluidType.REGISTRY); + public static final Registry FLUID_CATEGORY = addRegistry(FluidCategory.REGISTRY); + public static final Registry CONFIGURED_FEATURE_TYPE = addRegistry(ConfiguredFeatureType.REGISTRY); + public static final Registry STRUCTURE_TYPE = addRegistry(StructureType.REGISTRY); + + private static Registry addRegistry(Registry registry) { + Registry.REGISTRY.register(registry.id(), registry); + return registry; + } +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/Registry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/Registry.java index 5138be7fbf..68fb147adf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/Registry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/Registry.java @@ -33,17 +33,61 @@ import static com.google.common.base.Preconditions.checkState; import static java.util.Objects.requireNonNull; -public class Registry implements Iterable { +public class Registry implements Iterable, Keyed { + public static final Registry> REGISTRY = new Registry<>("registry", "registry"); + private final Map map = new HashMap<>(); private final String name; + private final String id; private final boolean checkInitialized; + private static String nameToId(String name) { + return name.toLowerCase(Locale.ROOT).replace(' ', '_'); + } + + /** + * Creates a new Registry. + * + * @param name The name of the registry + * @deprecated Use {@link #Registry(String, String)} instead to provide an ID + */ + @Deprecated public Registry(final String name) { this(name, false); } + /** + * Creates a new Registry. + * + * @param name The name of the registry + * @param checkInitialized Whether to check if WorldEdit is initialized + * @deprecated Use {@link #Registry(String, String, boolean)} instead to provide an ID + */ + @Deprecated public Registry(final String name, final boolean checkInitialized) { + this(name, nameToId(name), checkInitialized); + } + + /** + * Creates a new Registry. + * + * @param name The name of the registry + * @param id The ID of the registry + */ + public Registry(final String name, final String id) { + this(name, id, false); + } + + /** + * Creates a new Registry. + * + * @param name The name of the registry + * @param id The ID of the registry + * @param checkInitialized Whether to check if WorldEdit is initialized + */ + public Registry(final String name, final String id, final boolean checkInitialized) { this.name = name; + this.id = id; this.checkInitialized = checkInitialized; } @@ -51,6 +95,11 @@ public String getName() { return name; } + @Override + public String id() { + return this.id; + } + @Nullable public V get(final String key) { checkState(key.equals(key.toLowerCase(Locale.ROOT)), "key must be lowercase: %s", key); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeCategory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeCategory.java index 06b495f6a3..08f496d427 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeCategory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeCategory.java @@ -31,7 +31,7 @@ */ public class BiomeCategory extends Category implements Keyed { - public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("biome tag", true); + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("biome tag", "biome_tag", "minecraft", true); public BiomeCategory(final String id) { super(id, Set::of); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeType.java index 9ff0b312ea..15b5c4a95c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeType.java @@ -19,10 +19,13 @@ package com.sk89q.worldedit.world.biome; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.function.pattern.BiomePattern; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.registry.Keyed; import com.sk89q.worldedit.registry.NamespacedRegistry; +import com.sk89q.worldedit.util.formatting.text.Component; /** * All the types of biomes in the game. @@ -31,7 +34,7 @@ */ public record BiomeType(String id) implements Keyed, BiomePattern { - public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("biome type", true); + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("biome type", "biome_type", "minecraft", true); @Override public String toString() { @@ -42,4 +45,9 @@ public String toString() { public BiomeType applyBiome(BlockVector3 position) { return this; } + + public Component getRichName() { + return WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS) + .getRegistries().getBiomeRegistry().getRichName(this); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategory.java index 8108ac1c60..4dd9648f6f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockCategory.java @@ -31,7 +31,7 @@ */ public class BlockCategory extends Category implements Keyed { - public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("block tag", true); + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("block tag", "block_tag", "minecraft", true); public BlockCategory(final String id) { super(id, () -> WorldEdit.getInstance().getPlatformManager() diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java index 27cfe95270..4b3899f6bf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java @@ -43,7 +43,7 @@ public class BlockType implements Keyed { - public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("block type", true); + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("block type", "block_type", "minecraft", true); private final String id; private final Function values; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/entity/EntityType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/entity/EntityType.java index d576027743..0fad662651 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/entity/EntityType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/entity/EntityType.java @@ -23,7 +23,7 @@ import com.sk89q.worldedit.registry.NamespacedRegistry; public record EntityType(String id) implements Keyed { - public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("entity type", true); + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("entity type", "entity_type", "minecraft", true); public EntityType { // If it has no namespace, assume minecraft. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategory.java index 509f39000d..085d681fb8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidCategory.java @@ -31,7 +31,7 @@ */ public class FluidCategory extends Category implements Keyed { - public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("fluid tag"); + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("fluid tag", "fluid_tag", "minecraft"); public FluidCategory(final String id) { // TODO Make this work. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidType.java index e5fa1d3d40..9e8ff63731 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/fluid/FluidType.java @@ -29,7 +29,7 @@ */ public record FluidType(String id) implements Keyed { - public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("fluid type"); + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("fluid type", "fluid_type", "minecraft"); @Override public String toString() { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/gamemode/GameMode.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/gamemode/GameMode.java index 94b7b7cfe6..075820cc7d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/gamemode/GameMode.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/gamemode/GameMode.java @@ -24,7 +24,7 @@ public record GameMode(String id) implements Keyed { - public static final Registry REGISTRY = new Registry<>("game mode"); + public static final Registry REGISTRY = new Registry<>("game mode", "game_mode"); /** * Gets the name of this game mode, or the ID if the name cannot be found. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/generation/ConfiguredFeatureType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/generation/ConfiguredFeatureType.java index 57a933955e..94bae9a0d1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/generation/ConfiguredFeatureType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/generation/ConfiguredFeatureType.java @@ -23,7 +23,7 @@ import com.sk89q.worldedit.registry.NamespacedRegistry; public record ConfiguredFeatureType(String id) implements Keyed { - public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("configured feature type"); + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("configured feature type", "configured_feature_type", "minecraft"); @Override public String toString() { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/generation/StructureType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/generation/StructureType.java index 2a0c779f9c..63dff0159a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/generation/StructureType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/generation/StructureType.java @@ -23,7 +23,7 @@ import com.sk89q.worldedit.registry.NamespacedRegistry; public record StructureType(String id) implements Keyed { - public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("structure type"); + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("structure type", "structure_type", "minecraft"); @Override public String toString() { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategory.java index e35a0bca83..0309586be4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemCategory.java @@ -32,7 +32,7 @@ */ public class ItemCategory extends Category implements Keyed { - public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("item tag"); + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("item tag", "item_tag", "minecraft"); public ItemCategory(final String id) { super(id, () -> WorldEdit.getInstance().getPlatformManager() diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java index 29e44fd916..3868143742 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemType.java @@ -34,7 +34,7 @@ public class ItemType implements Keyed { - public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("item type", true); + public static final NamespacedRegistry REGISTRY = new NamespacedRegistry<>("item type", "item_type", "minecraft", true); private final String id; @SuppressWarnings({"deprecation", "this-escape"}) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/weather/WeatherType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/weather/WeatherType.java index 4a7b3cd0c9..05f3ff0846 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/weather/WeatherType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/weather/WeatherType.java @@ -23,7 +23,7 @@ import com.sk89q.worldedit.registry.Registry; public record WeatherType(String id) implements Keyed { - public static final Registry REGISTRY = new Registry<>("weather type"); + public static final Registry REGISTRY = new Registry<>("weather type", "weather_type"); /** * Gets the name of this weather, or the ID if the name cannot be found.