diff --git a/gradle.properties b/gradle.properties index 98bb9ba..80c0c07 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ yarn_mappings=1.20.1+build.10 loader_version=0.16.7 # Mod Properties -mod_version=1.16.2 +mod_version=1.16.3 maven_group=cc.reconnected archives_base_name=rcc-server diff --git a/src/main/java/cc/reconnected/server/RccServerConfigModel.java b/src/main/java/cc/reconnected/server/RccServerConfigModel.java index fe9547b..c826280 100644 --- a/src/main/java/cc/reconnected/server/RccServerConfigModel.java +++ b/src/main/java/cc/reconnected/server/RccServerConfigModel.java @@ -20,6 +20,9 @@ public class RccServerConfigModel { @Nest public TeleportRequests teleportRequests = new TeleportRequests(); + @Nest + public Homes homes = new Homes(); + @Nest public CustomTabList customTabList = new CustomTabList(); @@ -50,6 +53,10 @@ public class RccServerConfigModel { public int teleportRequestTimeout = 120; } + public static class Homes { + public int maxHomes = -1; + } + public static class CustomTabList { public boolean enableTabList = true; public int tabListTickDelay = 5; diff --git a/src/main/java/cc/reconnected/server/commands/home/SetHomeCommand.java b/src/main/java/cc/reconnected/server/commands/home/SetHomeCommand.java index 623ca6a..9c34aba 100644 --- a/src/main/java/cc/reconnected/server/commands/home/SetHomeCommand.java +++ b/src/main/java/cc/reconnected/server/commands/home/SetHomeCommand.java @@ -61,6 +61,12 @@ public class SetHomeCommand { return 1; } + var maxHomes = RccServer.CONFIG.homes.maxHomes(); + if(homes.size() >= maxHomes) { + context.getSource().sendFeedback(() -> Text.literal("You have reached the maximum amount of homes!").formatted(Formatting.RED), false); + return 1; + } + var homePosition = new ServerPosition(player); homes.put(name, homePosition);