EssentialsX

EssentialsX

2M Downloads

Important issue with homes amount

Sikatsu opened this issue · 4 comments

commented

Information

Full output of /ess version:

[15:35:47 INFO]: Server version: 1.13.2-R0.1-SNAPSHOT git-Paper-624 (MC: 1.13.2)
[15:35:47 INFO]: EssentialsX version: 2.16.1.0
[15:35:47 INFO]: LuckPerms version: 4.4.1
[15:35:47 INFO]: Vault version: 1.7.2-b107
[15:35:47 INFO]: EssentialsXGeoIP version: 2.16.1.0
[15:35:47 INFO]: EssentialsXSpawn version: 2.16.1.0

Details

Description
If you give a certain rank the ''unlimited'' homes permission and the player(s) have set for example 60 homes and then you change the limit to 50 homes, the limit will only apply for users below 50 homes, anyone who has already above the limit of 50 will stay being able to place unlimited homes. This causes an unfair gameplay element.

Steps to reproduce

  • Set the unlimited homes permission
  • Place 11 homes
  • Set the limit to 10 homes
  • Players who have already more then 10 homes are still unlimited

Expected behavior
Players who have reached the limit should not be able to place more homes until they start removing homes till they are beneath the limit.

commented

private boolean checkHomeLimit(final User user, final User usersHome, String name) throws Exception {
if (!user.isAuthorized("essentials.sethome.multiple.unlimited")) {
int limit = ess.getSettings().getHomeLimit(user);
if (usersHome.getHomes().size() == limit && usersHome.getHomes().contains(name)) {
return false;
}
if (usersHome.getHomes().size() >= limit) {
throw new Exception(tl("maxHomes", ess.getSettings().getHomeLimit(user)));
}
if (limit == 1) {
return true;
}
}
return false;
}

I can't see any obvious issues in /sethome. Can you replicate this with /ess debug enabled and include a list of the user's homes both before and after they set their home?

commented

I have this issue as well. /homes doesnt list and /home {any text} takes me to a random one it seems.

commented

@DecemAdUnum That has nothing to do with the bug reported above. Please open a separate issue, filling out the relevant template.

@Sikatsu Were you able to replicate this with /ess debug enabled?

commented

Cannot replicate this.

[12:44:41 INFO]: CONSOLE issued server command: /ess version
[12:44:41 INFO]: Server version: 1.14.1-R0.1-SNAPSHOT git-Paper-43 (MC: 1.14.1)
[12:44:41 INFO]: EssentialsX version: 2.16.1.182-mc114-b97
[12:44:41 INFO]: Vault is not installed. Chat and permissions may not work.

Debug log:

[12:43:55 INFO]: MD678685 issued server command: /sethome one
[12:43:55 INFO]: [Essentials] checking if MD678685 has essentials.mail - true
[12:43:55 INFO]: [Essentials] checking if MD678685 has essentials.sethome - true
[12:43:55 INFO]: [Essentials] checking if MD678685 can afford charge.
[12:43:55 INFO]: [Essentials] calculated command (sethome) cost for MD678685 as 0
[12:43:55 INFO]: [Essentials] checking if MD678685 has essentials.sethome.multiple.unlimited - false
[12:43:55 INFO]: [Essentials] checking if MD678685 has essentials.sethome.multiple - false
[12:43:55 INFO]: [Essentials] checking if MD678685 has essentials.sethome.multiple.default - true
[12:43:55 INFO]: [Essentials] checking if MD678685 has essentials.sethome.multiple.vip - false
[12:43:55 INFO]: [Essentials] checking if MD678685 has essentials.sethome.multiple.staff - false
[12:43:55 INFO]: [Essentials] checking if MD678685 has essentials.sethome.multiple - false
[12:43:55 INFO]: [Essentials] checking if MD678685 has essentials.sethome.multiple.default - true
[12:43:55 INFO]: [Essentials] checking if MD678685 has essentials.sethome.multiple.vip - false
[12:43:55 INFO]: [Essentials] checking if MD678685 has essentials.sethome.multiple.staff - false
[12:43:55 INFO]: [Essentials] Error calling the command /sethome
java.lang.Exception: §4You cannot set more than§c 3 §4homes.
        at com.earth2me.essentials.commands.Commandsethome.checkHomeLimit(Commandsethome.java:67) ~[?:?]
        at com.earth2me.essentials.commands.Commandsethome.run(Commandsethome.java:44) ~[?:?]
        at com.earth2me.essentials.commands.EssentialsCommand.run(EssentialsCommand.java:161) ~[?:?]
        at com.earth2me.essentials.Essentials.onCommandEssentials(Essentials.java:545) ~[?:?]
        at com.earth2me.essentials.Essentials.onCommand(Essentials.java:458) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.14.1.jar:git-Paper-43]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.14.1.jar:git-Paper-43]
        at org.bukkit.craftbukkit.v1_14_R1.CraftServer.dispatchCommand(CraftServer.java:736) ~[patched_1.14.1.jar:git-Paper-43]
        at net.minecraft.server.v1_14_R1.PlayerConnection.handleCommand(PlayerConnection.java:1826) ~[patched_1.14.1.jar:git-Paper-43]
        at net.minecraft.server.v1_14_R1.PlayerConnection.a(PlayerConnection.java:1634) ~[patched_1.14.1.jar:git-Paper-43]
        at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:47) ~[patched_1.14.1.jar:git-Paper-43]
        at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.14.1.jar:git-Paper-43]
        at net.minecraft.server.v1_14_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:18) ~[patched_1.14.1.jar:git-Paper-43]
        at net.minecraft.server.v1_14_R1.TickTask.run(SourceFile:18) ~[patched_1.14.1.jar:git-Paper-43]
        at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:127) ~[patched_1.14.1.jar:git-Paper-43]
        at net.minecraft.server.v1_14_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.14.1.jar:git-Paper-43]
        at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:105) ~[patched_1.14.1.jar:git-Paper-43]
        at net.minecraft.server.v1_14_R1.MinecraftServer.aW(MinecraftServer.java:998) ~[patched_1.14.1.jar:git-Paper-43]
        at net.minecraft.server.v1_14_R1.MinecraftServer.executeNext(MinecraftServer.java:991) ~[patched_1.14.1.jar:git-Paper-43]
        at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeAll(IAsyncTaskHandler.java:91) ~[patched_1.14.1.jar:git-Paper-43]
        at net.minecraft.server.v1_14_R1.MinecraftServer.sleepForTick(MinecraftServer.java:974) ~[patched_1.14.1.jar:git-Paper-43]
        at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:908) ~[patched_1.14.1.jar:git-Paper-43]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_181]
[12:43:55 WARN]: java.lang.Exception: You cannot set more than 3 homes.
[12:43:55 WARN]:        at com.earth2me.essentials.commands.Commandsethome.checkHomeLimit(Commandsethome.java:67)
[12:43:55 WARN]:        at com.earth2me.essentials.commands.Commandsethome.run(Commandsethome.java:44)
[12:43:55 WARN]:        at com.earth2me.essentials.commands.EssentialsCommand.run(EssentialsCommand.java:161)
[12:43:55 WARN]:        at com.earth2me.essentials.Essentials.onCommandEssentials(Essentials.java:545)
[12:43:55 WARN]:        at com.earth2me.essentials.Essentials.onCommand(Essentials.java:458)
[12:43:55 WARN]:        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)
[12:43:55 WARN]:        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159)
[12:43:55 WARN]:        at org.bukkit.craftbukkit.v1_14_R1.CraftServer.dispatchCommand(CraftServer.java:736)
[12:43:55 WARN]:        at net.minecraft.server.v1_14_R1.PlayerConnection.handleCommand(PlayerConnection.java:1826)
[12:43:55 WARN]:        at net.minecraft.server.v1_14_R1.PlayerConnection.a(PlayerConnection.java:1634)
[12:43:55 WARN]:        at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:47)
[12:43:55 WARN]:        at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:5)
[12:43:55 WARN]:        at net.minecraft.server.v1_14_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:18)
[12:43:55 WARN]:        at net.minecraft.server.v1_14_R1.TickTask.run(SourceFile:18)
[12:43:55 WARN]:        at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:127)
[12:43:55 WARN]:        at net.minecraft.server.v1_14_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23)
[12:43:55 WARN]:        at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:105)
[12:43:55 WARN]:        at net.minecraft.server.v1_14_R1.MinecraftServer.aW(MinecraftServer.java:998)
[12:43:55 WARN]:        at net.minecraft.server.v1_14_R1.MinecraftServer.executeNext(MinecraftServer.java:991)
[12:43:55 WARN]:        at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeAll(IAsyncTaskHandler.java:91)
[12:43:55 WARN]:        at net.minecraft.server.v1_14_R1.MinecraftServer.sleepForTick(MinecraftServer.java:974)
[12:43:55 WARN]:        at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:908)
[12:43:55 WARN]:        at java.lang.Thread.run(Unknown Source)

If you can replicate this with a debug log, please respond and I'll reopen this issue.