Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Burbulinis committed Feb 1, 2025
1 parent 4ea1da2 commit cfee4e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class EvtPlayerStatisticIncrease extends SkriptEvent {
"player statistic increase [of %*-strings%]")
.description(
"Called when a player's statistic increases. Some statistics like 'play one minute' do not call this event, "
+ "because it simply gets called too much.")
+ "because they get called too often.")
.examples(
"on player statistic increase:",
"\tbroadcast \"%player%'s statistic '%event-string%' increased! It is now %future statistic value%!\"",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ public Class<? extends Event>[] supportedEvents() {

@Override
protected Number @Nullable [] get(Event event) {
PlayerStatisticIncrementEvent statisticEvent = ((PlayerStatisticIncrementEvent) event);
if (!(event instanceof PlayerStatisticIncrementEvent statisticEvent))
return null;

if (future)
return new Number[] {statisticEvent.getNewValue()};
return new Number[] {statisticEvent.getPreviousValue()};
Expand Down

0 comments on commit cfee4e2

Please sign in to comment.