some more namespace thing

This commit is contained in:
alexcrea 2025-07-27 11:52:33 +02:00
parent e235fa07ef
commit 96c60a9733
Signed by: alexcrea
GPG key ID: E346CD16413450E3
2 changed files with 4 additions and 2 deletions

View file

@ -168,7 +168,7 @@ public class MaterialGroupApi {
} }
public static List<String> itemTypesSetToStringList(@NotNull Set<ItemType> types) { public static List<String> itemTypesSetToStringList(@NotNull Set<ItemType> types) {
return types.stream().map(item -> item.getKey().getKey().toLowerCase()).toList(); return types.stream().map(item -> item.getKey().toString()).toList();
} }
public static List<String> materialGroupSetToStringList(@NotNull Set<AbstractItemTypeGroup> groups) { public static List<String> materialGroupSetToStringList(@NotNull Set<AbstractItemTypeGroup> groups) {

View file

@ -2,12 +2,14 @@ package xyz.alexcrea.cuanvil.update;
import io.delilaheve.CustomAnvil; import io.delilaheve.CustomAnvil;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.inventory.ItemType;
import xyz.alexcrea.cuanvil.config.ConfigHolder; import xyz.alexcrea.cuanvil.config.ConfigHolder;
import static xyz.alexcrea.cuanvil.update.UpdateUtils.addAbsentToList; import static xyz.alexcrea.cuanvil.update.UpdateUtils.addAbsentToList;
// This is a temporary class that aim to handle 1.21 update. // This is a temporary class that aim to handle 1.21 update.
// It will be replaced by a better system later. // It will be replaced by a better system later.
@SuppressWarnings("UnstableApiUsage")
public class Update_1_21 { public class Update_1_21 {
private static final Version V1_21 = new Version(1, 21); private static final Version V1_21 = new Version(1, 21);
@ -40,7 +42,7 @@ public class Update_1_21 {
// Add mace to groups // Add mace to groups
groupConfig.set("mace.type", "include"); groupConfig.set("mace.type", "include");
addAbsentToList(groupConfig, "mace.items", "mace"); addAbsentToList(groupConfig, "mace.items", ItemType.MACE.getKey().toString());
addAbsentToList(groupConfig, "can_unbreak.groups", "mace"); addAbsentToList(groupConfig, "can_unbreak.groups", "mace");