Skip to content

Commit

Permalink
more details for the statistic error
Browse files Browse the repository at this point in the history
  • Loading branch information
HSGamer committed Oct 30, 2024
1 parent 20142f4 commit 0df8a57
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ public CompletableFuture<Optional<Double>> getValue(UUID uuid) {
switch (statistic.getType()) {
case BLOCK:
if (material == null || !material.isBlock()) {
throw new IllegalArgumentException("Invalid material for BLOCK statistic");
throw new IllegalArgumentException("Invalid material for BLOCK statistic. You must check if you set a block material for the statistic.");
}
return Optional.of((double) player.getStatistic(statistic, material));
case ITEM:
if (material == null) {
throw new IllegalArgumentException("Invalid material for ITEM statistic");
throw new IllegalArgumentException("Invalid material for ITEM statistic. You must check if you set a material for the statistic.");
}
return Optional.of((double) player.getStatistic(statistic, material));
case ENTITY:
if (entityType == null) {
throw new IllegalArgumentException("Invalid entity for ENTITY statistic");
throw new IllegalArgumentException("Invalid entity for ENTITY statistic. You must check if you set an entity for the statistic.");
}
return Optional.of((double) player.getStatistic(statistic, entityType));
default:
Expand Down

0 comments on commit 0df8a57

Please sign in to comment.