Skip to content

Commit

Permalink
Fix nullability issue (fixes #23)
Browse files Browse the repository at this point in the history
  • Loading branch information
acrylic-style committed Jun 10, 2022
1 parent 93ff56e commit d7d45b1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ public class ModReloadEvent extends CancellableEvent {
private final BlueberryMod mod;

public ModReloadEvent(@Nullable ServerPlayer player, @NotNull BlueberryMod mod) {
Objects.requireNonNull(player, "player cannot be null");
Objects.requireNonNull(mod, "mod cannot be null");
this.player = player;
this.mod = mod;
}

/**
* Checks if player has initiated the mod reload.
* Checks if player has initiated the mod reload. This method is applicable only when running on a server, and
* always returns null when running on a client.
* @return true if player is defined, false otherwise.
*/
public boolean isFromPlayer() {
Expand All @@ -33,7 +33,7 @@ public boolean isFromPlayer() {

/**
* Get the actor who initiated the mod reload.
* @return the player, null if not a player (e.g. console) or done via ModListScreen
* @return the player, null if not a player (e.g. console) or done via ModListScreen on a client.
*/
@Nullable
public ServerPlayer getPlayer() {
Expand Down

0 comments on commit d7d45b1

Please sign in to comment.