diff --git a/common/src/main/java/net/blay09/mods/waystones/api/WaystoneVisibility.java b/common/src/main/java/net/blay09/mods/waystones/api/WaystoneVisibility.java index 372530a0..d14115e0 100644 --- a/common/src/main/java/net/blay09/mods/waystones/api/WaystoneVisibility.java +++ b/common/src/main/java/net/blay09/mods/waystones/api/WaystoneVisibility.java @@ -1,6 +1,5 @@ package net.blay09.mods.waystones.api; -import net.blay09.mods.waystones.config.WaystonesConfig; import net.minecraft.resources.ResourceLocation; public enum WaystoneVisibility { @@ -41,12 +40,12 @@ public static WaystoneVisibility fromWaystoneType(ResourceLocation waystoneType) case "green_sharestone" -> WaystoneVisibility.GREEN_SHARESTONE; case "red_sharestone" -> WaystoneVisibility.RED_SHARESTONE; case "black_sharestone" -> WaystoneVisibility.BLACK_SHARESTONE; - default -> WaystonesConfig.getActive().general.defaultVisibility; + default -> WaystoneVisibility.ACTIVATION; }; } else if (waystoneType.equals(WaystoneTypes.WARP_PLATE)) { return WaystoneVisibility.SHARD_ONLY; } else { - return WaystonesConfig.getActive().general.defaultVisibility; + return WaystoneVisibility.ACTIVATION; } } } diff --git a/common/src/main/java/net/blay09/mods/waystones/core/WaystoneVisibilities.java b/common/src/main/java/net/blay09/mods/waystones/core/WaystoneVisibilities.java index 265f814a..34d0012a 100644 --- a/common/src/main/java/net/blay09/mods/waystones/core/WaystoneVisibilities.java +++ b/common/src/main/java/net/blay09/mods/waystones/core/WaystoneVisibilities.java @@ -2,6 +2,7 @@ import net.blay09.mods.waystones.api.Waystone; import net.blay09.mods.waystones.api.WaystoneVisibility; +import net.blay09.mods.waystones.config.WaystonesConfig; import net.minecraft.world.entity.player.Player; import java.util.ArrayList; @@ -10,11 +11,17 @@ public class WaystoneVisibilities { public static List getVisibilityOptions(Player player, Waystone waystone) { final var result = new ArrayList(); + final var defaultVisibility = WaystonesConfig.getActive().general.defaultVisibility; + result.add(defaultVisibility); final var baseVisibility = WaystoneVisibility.fromWaystoneType(waystone.getWaystoneType()); - result.add(baseVisibility); + if (!result.contains(baseVisibility)) { + result.add(baseVisibility); + } if (baseVisibility == WaystoneVisibility.ACTIVATION) { if (WaystonePermissionManager.isAllowedVisibility(WaystoneVisibility.GLOBAL) || WaystonePermissionManager.skipsPermissions(player)) { - result.add(WaystoneVisibility.GLOBAL); + if (!result.contains(WaystoneVisibility.GLOBAL)) { + result.add(WaystoneVisibility.GLOBAL); + } } } return result;