Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,6 @@ public int getHomeLimit(Player player) {
return Stream.empty();
})
.max(Integer::compareTo)
.orElse(0);
.orElse(this.homesSettings.defaultLimit());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import eu.okaeri.configs.OkaeriConfig;
import eu.okaeri.configs.annotation.Comment;
import java.time.Duration;
import java.util.LinkedHashMap;
import java.util.Map;
import lombok.Getter;
import lombok.experimental.Accessors;
Expand All @@ -27,25 +26,33 @@ public class HomesConfig extends OkaeriConfig implements HomesSettings {
public Duration delay = Duration.ofSeconds(5);

@Comment({
"# Maximum number of homes per permission group",
"# Configure how many homes players can set based on their permissions",
"# ",
"# Permission format: 'permission' -> max_homes",
"# Players with higher permissions will get the highest limit they qualify for",
"# ",
"# Default permissions:",
"# - eternalcore.home.default: Basic players (1 home)",
"# Configure how many homes a player can set depending on their permissions.",
"#",
"# Permission format: 'permission.node : max_homes'",
"# If user has multiple permissions from the list the highest number will be taken",
"#",
"# Fallback behavior:",
"# - If a player does not have any of the listed permissions,",
"# the value from 'defaultLimit' will be used.",
"#",
"# Example permissions:",
"# - eternalcore.home.vip: VIP players (2 homes)",
"# - eternalcore.home.premium: Premium players (3 homes)",
"# ",
"# You can add custom permission groups and limits as needed",
"# Example: 'eternalcore.home.admin' -> 999"
"# How it works:",
"# If a player has both 'eternalcore.home.vip' and 'eternalcore.home.premium',",
"# they will be able to set 3 homes (highest value wins).",
"# If the player does not have any permission from the list he will be able to set the limit defined by `defaultLimit`.",
"#",
Comment thread
CitralFlo marked this conversation as resolved.
"# You can define additional permissions as needed.",
"# Example: 'eternalcore.home.admin: 999'"
})
public Map<String, Integer> maxHomes = new LinkedHashMap<>() {
{
put("eternalcore.home.default", 1);
put("eternalcore.home.vip", 2);
put("eternalcore.home.premium", 3);
}
};
public Map<String, Integer> maxHomes = Map.of(
"eternalcore.home.vip", 2,
"eternalcore.home.premium", 3
);

@Comment({
"# Default limit of homes used when the player does not have any permission from the list above."
})
public Integer defaultLimit = 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ public interface HomesSettings {
Map<String, Integer> maxHomes();
Duration delay();
String defaultName();
Integer defaultLimit();
}