Skip to content

Commit

Permalink
Fix registering EventValues for addons (#7291)
Browse files Browse the repository at this point in the history
init commit

Co-authored-by: Moderocky <admin@moderocky.com>
  • Loading branch information
Efnilite and Moderocky authored Dec 21, 2024
1 parent b9fbbfa commit 66bb52e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/main/java/ch/njol/skript/registrations/EventValues.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import ch.njol.skript.Skript;
import ch.njol.skript.expressions.base.EventValueExpression;
import ch.njol.skript.util.Getter;
import ch.njol.util.Kleenean;
import com.google.common.collect.ImmutableList;
import org.bukkit.event.Event;
Expand Down Expand Up @@ -124,6 +125,31 @@ public static <T, E extends Event> void registerEventValue(
eventValues.add(element);
}

/**
* @deprecated Use {@link #registerEventValue(Class, Class, Converter, int, String, Class[])} instead.
*/
@Deprecated(forRemoval = true)
@SafeVarargs
public static <T, E extends Event> void registerEventValue(
Class<E> event, Class<T> type,
Getter<T, E> getter, int time,
@Nullable String excludeErrorMessage,
@Nullable Class<? extends E>... excludes
) {
registerEventValue(event, type, (Converter<E, T>) getter, time, excludeErrorMessage, excludes);
}

/**
* @deprecated Use {@link #registerEventValue(Class, Class, Converter, int)} instead.
*/
@Deprecated(forRemoval = true)
public static <T, E extends Event> void registerEventValue(
Class<E> event, Class<T> type,
Getter<T, E> getter, int time
) {
registerEventValue(event, type, (Converter<E, T>) getter, time);
}

/**
* Gets a specific value from an event. Returns null if the event doesn't have such a value (conversions are done to try and get the desired value).
* <p>
Expand Down

0 comments on commit 66bb52e

Please sign in to comment.