mirror of
https://github.com/architectury/architectury-api.git
synced 2026-04-02 13:37:43 -05:00
Add Deprecated and ScheduledForRemoval while appropriate
Signed-off-by: shedaniel <daniel@shedaniel.me>
This commit is contained in:
@@ -22,6 +22,8 @@ package me.shedaniel.architectury;
|
||||
import me.shedaniel.architectury.targets.ArchitecturyTarget;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.0")
|
||||
@ApiStatus.Internal
|
||||
public class Architectury {
|
||||
@Deprecated
|
||||
|
||||
@@ -25,6 +25,8 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
import java.lang.invoke.*;
|
||||
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.0")
|
||||
@ApiStatus.Internal
|
||||
public class PlatformMethods {
|
||||
public static CallSite platform(MethodHandles.Lookup lookup, String name, MethodType type) {
|
||||
|
||||
@@ -21,6 +21,8 @@ package me.shedaniel.architectury.event;
|
||||
|
||||
import net.minecraft.world.InteractionResult;
|
||||
|
||||
// Not ScheduledForRemoval for avoiding compile errors for listeners
|
||||
@Deprecated
|
||||
@FunctionalInterface
|
||||
public interface Actor<T> {
|
||||
InteractionResult act(T t);
|
||||
|
||||
@@ -43,7 +43,7 @@ public final class EventFactory {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.0")
|
||||
public static <T> Event<T> create(Function<T[], T> function) {
|
||||
Class<?>[] arguments = TypeResolver.resolveRawArguments(Function.class, function.getClass());
|
||||
T[] array;
|
||||
@@ -78,12 +78,16 @@ public final class EventFactory {
|
||||
}));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.0")
|
||||
@SafeVarargs
|
||||
public static <T> Event<T> createInteractionResult(T... typeGetter) {
|
||||
if (typeGetter.length != 0) throw new IllegalStateException("array must be empty!");
|
||||
return createInteractionResult((Class<T>) typeGetter.getClass().getComponentType());
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.0")
|
||||
@SuppressWarnings("UnstableApiUsage")
|
||||
public static <T> Event<T> createInteractionResult(Class<T> clazz) {
|
||||
return of(listeners -> (T) Proxy.newProxyInstance(EventFactory.class.getClassLoader(), new Class[]{clazz}, new AbstractInvocationHandler() {
|
||||
@@ -122,12 +126,16 @@ public final class EventFactory {
|
||||
}));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.0")
|
||||
@SafeVarargs
|
||||
public static <T> Event<T> createInteractionResultHolder(T... typeGetter) {
|
||||
if (typeGetter.length != 0) throw new IllegalStateException("array must be empty!");
|
||||
return createInteractionResultHolder((Class<T>) typeGetter.getClass().getComponentType());
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.0")
|
||||
@SuppressWarnings("UnstableApiUsage")
|
||||
public static <T> Event<T> createInteractionResultHolder(Class<T> clazz) {
|
||||
return of(listeners -> (T) Proxy.newProxyInstance(EventFactory.class.getClassLoader(), new Class[]{clazz}, new AbstractInvocationHandler() {
|
||||
@@ -193,12 +201,16 @@ public final class EventFactory {
|
||||
return event;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.0")
|
||||
@SafeVarargs
|
||||
public static <T> Event<Actor<T>> createActorLoop(T... typeGetter) {
|
||||
if (typeGetter.length != 0) throw new IllegalStateException("array must be empty!");
|
||||
return createActorLoop((Class<T>) typeGetter.getClass().getComponentType());
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.0")
|
||||
@SuppressWarnings("UnstableApiUsage")
|
||||
public static <T> Event<Actor<T>> createActorLoop(Class<T> clazz) {
|
||||
Event<Actor<T>> event = of(listeners -> (Actor<T>) Proxy.newProxyInstance(EventFactory.class.getClassLoader(), new Class[]{Actor.class}, new AbstractInvocationHandler() {
|
||||
|
||||
Reference in New Issue
Block a user