Update configuration file paths and enum usage

The configuration files for the VillagerShopUI have been relocated from the home directory to a mounted volume at "/mnt/configs/VillagerShopUI". Also, an outdated way of accessing enums in the 'CommandCreateVillager' class has been updated to use 'OldEnum' instead of 'Enum'.
This commit is contained in:
Teriuihi 2024-07-19 23:33:33 +02:00
parent dc4b618a80
commit 30a7d85f3d
4 changed files with 5 additions and 4 deletions

View File

@ -17,6 +17,7 @@ import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.entity.Villager;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.util.OldEnum;
import java.util.*;
import java.util.stream.Collectors;
@ -81,7 +82,7 @@ public class CommandCreateVillager extends SubCommand {
case 2 -> res.addAll(VillagerTypeManager.getVillagerTypes().stream()
.map(VillagerType::getName)
.collect(Collectors.toList()));
case 3 -> res.addAll(Arrays.stream(Villager.Type.values()).map(Enum::name).collect(Collectors.toList()));
case 3 -> res.addAll(Arrays.stream(Villager.Type.values()).map(OldEnum::name).collect(Collectors.toList()));
case 4 -> {
if (commandSender instanceof Player player) {
res.add(String.valueOf(Utilities.round(player.getLocation().getX(), 2)));

View File

@ -18,7 +18,7 @@ public final class Config extends AbstractConfig {
static Config config;
static int version;
public Config() {
super(new File(System.getProperty("user.home") + File.separator + "share" + File.separator + "configs" + File.separator + "VillagerShopUI"), "config.yml");
super(new File(File.separator + "mnt" + File.separator + "configs" + File.separator + "VillagerShopUI"), "config.yml");
}
public static void reload() {

View File

@ -14,7 +14,7 @@ public class VillagerMessagesConfig extends AbstractConfig {
static int version;
protected VillagerMessagesConfig() {
super(new File(System.getProperty("user.home") + File.separator + "share" + File.separator + "configs" + File.separator + "VillagerShopUI"), "villager-messages.yml");
super(new File(File.separator + "mnt" + File.separator + "configs" + File.separator + "VillagerShopUI"), "villager-messages.yml");
}
protected static void reload() {

View File

@ -17,7 +17,7 @@ public class WorthConfig extends AbstractConfig {
static int version;
public WorthConfig() {
super(new File(System.getProperty("user.home") + File.separator + "share" + File.separator + "configs" + File.separator + "VillagerShopUI"), "worth.yml");
super(new File(File.separator + "mnt" + File.separator + "configs" + File.separator + "VillagerShopUI"), "worth.yml");
}
public static void reload() {