Skip to content

Commit

Permalink
Fixed detection of removal of generator rates, warp limits and more
Browse files Browse the repository at this point in the history
  • Loading branch information
OmerBenGera committed Oct 29, 2022
1 parent a18bbfa commit d96ae8e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Expand Up @@ -67,7 +67,7 @@ public void execute(SuperiorSkyblockPlugin plugin, CommandSender sender, Superio

int limit = arguments.getNumber();

if (limit < 0) {
if (limit <= 0) {
Message.INVALID_AMOUNT.send(sender);
return;
}
Expand Down
Expand Up @@ -86,7 +86,7 @@ public void execute(SuperiorSkyblockPlugin plugin, CommandSender sender, Superio
boolean anyIslandChanged = false;

for (Island island : islands) {
if (limit < 0) {
if (limit <= 0) {
if (plugin.getEventsBus().callIslandRemoveRoleLimitEvent(sender, island, playerRole)) {
anyIslandChanged = true;
island.removeRoleLimit(playerRole);
Expand Down
Expand Up @@ -68,7 +68,7 @@ public void execute(SuperiorSkyblockPlugin plugin, CommandSender sender, Superio
} catch (IllegalArgumentException ignored) {
}

if (amount.compareTo(BigDecimal.ZERO) < 0) {
if (amount.compareTo(BigDecimal.ZERO) <= 0) {
Message.INVALID_AMOUNT.send(sender, args[3]);
return;
}
Expand Down
Expand Up @@ -82,7 +82,7 @@ public void execute(SuperiorSkyblockPlugin plugin, CommandSender sender, Superio

int amount = arguments.getNumber();

if (percentage && (amount < 0 || amount > 100)) {
if (amount == 0 || (percentage && (amount < 0 || amount > 100))) {
Message.INVALID_PERCENTAGE.send(sender);
return;
}
Expand All @@ -105,7 +105,7 @@ public void execute(SuperiorSkyblockPlugin plugin, CommandSender sender, Superio
} else {
int generatorRate = island.getGeneratorAmount(material, environment) + amount;

if (generatorRate < 0) {
if (generatorRate <= 0) {
if (!plugin.getEventsBus().callIslandRemoveGeneratorRateEvent(sender, island, material, environment))
continue;

Expand Down
Expand Up @@ -102,7 +102,7 @@ public void execute(SuperiorSkyblockPlugin plugin, CommandSender sender, Superio
continue;
}
} else {
if (amount < 0) {
if (amount <= 0) {
if (!plugin.getEventsBus().callIslandRemoveGeneratorRateEvent(sender, island, material, environment))
continue;

Expand Down

0 comments on commit d96ae8e

Please sign in to comment.