Use kyori Key.MINECRAFT_NAMESPACE in block id safety resolution

This commit is contained in:
William278 committed 2022-11-24 14:16:47 +00:00
1 parent 107d654cd5
commit b7631e8065
1 file changed
+3 -2
@@ -1,5 +1,6 @@
package net.william278.huskhomes.util; package net.william278.huskhomes.util;
import net.kyori.adventure.key.Key;
import net.william278.annotaml.YamlFile; import net.william278.annotaml.YamlFile;
import net.william278.annotaml.YamlKey; import net.william278.annotaml.YamlKey;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@@ -23,8 +24,8 @@ public class UnsafeBlocks {
* @return {@code true} if the block is on the unsafe blocks list, {@code false} otherwise * @return {@code true} if the block is on the unsafe blocks list, {@code false} otherwise
*/ */
public boolean isUnsafe(@NotNull String blockId) { public boolean isUnsafe(@NotNull String blockId) {
if (!blockId.startsWith("minecraft:")) { if (!blockId.startsWith(Key.MINECRAFT_NAMESPACE + ":")) {
blockId = "minecraft:" + blockId; blockId = Key.MINECRAFT_NAMESPACE + ":" + blockId;
} }
return unsafeBlocks.contains(blockId); return unsafeBlocks.contains(blockId);
} }