Skip to content

Commit

Permalink
style: use precondition
Browse files Browse the repository at this point in the history
  • Loading branch information
StarWishsama committed Aug 10, 2023
1 parent f241c80 commit 80a48e0
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.thebusybiscuit.slimefun4.integrations;

import com.google.common.base.Preconditions;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
import java.util.Objects;
import javax.annotation.Nonnull;
Expand All @@ -22,15 +23,15 @@ static void register(@Nonnull Plugin plugin) {
}

public static double getPlayerBalance(@Nonnull OfflinePlayer p) {
Objects.requireNonNull(p, "Player cannot be null!");
Objects.requireNonNull(economy, "Vault instance cannot be null!");
Preconditions.checkNotNull(p, "Player cannot be null!");
Preconditions.checkNotNull(economy, "Vault instance cannot be null!");

return economy.getBalance(p);
}

public static void withdrawPlayer(@Nonnull OfflinePlayer p, double withdraw) {
Objects.requireNonNull(p, "Player cannot be null!");
Objects.requireNonNull(economy, "Vault instance cannot be null!");
Preconditions.checkNotNull(p, "Player cannot be null!");
Preconditions.checkNotNull(economy, "Vault instance cannot be null!");

economy.withdrawPlayer(p, withdraw);
}
Expand Down

0 comments on commit 80a48e0

Please sign in to comment.