-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Per-World Home Limits #5601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.x
Are you sure you want to change the base?
Per-World Home Limits #5601
Changes from all commits
f13bf2c
a85aadb
98f1dfe
756fb99
40111f5
3da872b
a57a1d6
8813210
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.Locale; | ||
import java.util.Objects; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
public class Commandsethome extends EssentialsCommand { | ||
|
@@ -89,7 +90,10 @@ public void run(final Server server, final User user, final String commandLabel, | |
private boolean checkHomeLimit(final User user, final User usersHome, final String name) throws Exception { | ||
if (!user.isAuthorized("essentials.sethome.multiple.unlimited")) { | ||
final int limit = ess.getSettings().getHomeLimit(user); | ||
if (usersHome.getHomes().size() >= limit) { | ||
final List<String> homes = usersHome.isReachable() ? | ||
usersHome.getHomesPerWorld(Objects.requireNonNull(usersHome.getLocation().getWorld()).getName()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't we get the limit for |
||
: usersHome.getHomes(); | ||
if (homes.size() >= limit) { | ||
if (usersHome.getHomes().contains(name)) { | ||
return false; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -826,6 +826,38 @@ spawn-if-no-home: true | |
# Should players be asked to provide confirmation for homes they attempt to overwrite? | ||
confirm-home-overwrite: false | ||
|
||
# This setting enables to have for each world limit of homes | ||
# e.g. when enabled, user can have 3 homes in world, 3 in world_nether and 3 in world_the_end. | ||
home-limit-per-world: false | ||
|
||
# When home-limit-per-world is enabled, with configuration sethome-multiple whichever setting has a number higher, | ||
# it then will be used | ||
# e.g. if sethome-multiple.vip is 5 and user has permission for this, and user is in world named world_the_end which | ||
# limit for home is 2, then user will have limit of higher number, therefore 5 homes in that world. | ||
# To not follow this logic, please remove user permission for that 'home rank'. | ||
# If world is not present in this configuration, configuration sethome-multiple.default | ||
# will be used as a home limit for that world. | ||
homes-per-world: | ||
world: 5 | ||
world_the_end: 2 | ||
|
||
# For this configuration, previous configuration home-limit-per-world needs to be enabled. | ||
# This allows you to create 'world groups' which can consist of how many worlds you want | ||
# and set limit for these worlds, then they will act as one world with their limit. | ||
# e.g. 'world group' named player-worlds which has worlds 'world' and 'world_nether' | ||
# which home limit is set to 4. User will have maximum of 4 homes in these worlds total. | ||
# If world is not present in this configuration, configuration sethome-multiple.default | ||
# will be used as a home limit for that world. | ||
home-limit-per-world-group: false | ||
|
||
# Name of the world group can be any english letter with spaces that are - | ||
# Worlds are split by a colon without spaces, as shown in the example: world,world_nether . | ||
# Worlds in a 'world group' act as one world. | ||
homes-per-world-group: | ||
player-worlds: | ||
worlds: world,world_nether | ||
home-limit: 4 | ||
Comment on lines
+833
to
+859
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think these config options should instead be: home-limit-per-world: false
sethome-world-multiple:
default:
world: 5
world_the_nether: 10
vip:
world: 10
world_the_nether: 20 this way we can minimize confusion and let people configure it all under one setting, people who don't want to do by group can just use |
||
|
||
############################################################ | ||
# +------------------------------------------------------+ # | ||
# | Economy | # | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets use TranslatableException here: