Add homes limit
This commit is contained in:
parent
cc6fd0edb8
commit
9805179093
3 changed files with 14 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue