diff --git a/common/src/main/java/me/shedaniel/architectury/Architectury.java b/common/src/main/java/me/shedaniel/architectury/Architectury.java index 9d19f01f..239fea5d 100644 --- a/common/src/main/java/me/shedaniel/architectury/Architectury.java +++ b/common/src/main/java/me/shedaniel/architectury/Architectury.java @@ -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 diff --git a/common/src/main/java/me/shedaniel/architectury/PlatformMethods.java b/common/src/main/java/me/shedaniel/architectury/PlatformMethods.java index 1f774330..45cae0e6 100644 --- a/common/src/main/java/me/shedaniel/architectury/PlatformMethods.java +++ b/common/src/main/java/me/shedaniel/architectury/PlatformMethods.java @@ -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) { diff --git a/common/src/main/java/me/shedaniel/architectury/event/Actor.java b/common/src/main/java/me/shedaniel/architectury/event/Actor.java index aafc670c..c5c41bee 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/Actor.java +++ b/common/src/main/java/me/shedaniel/architectury/event/Actor.java @@ -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 { InteractionResult act(T t); diff --git a/common/src/main/java/me/shedaniel/architectury/event/EventFactory.java b/common/src/main/java/me/shedaniel/architectury/event/EventFactory.java index ef291a4a..a74f0585 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/EventFactory.java +++ b/common/src/main/java/me/shedaniel/architectury/event/EventFactory.java @@ -43,7 +43,7 @@ public final class EventFactory { } @Deprecated - @ApiStatus.ScheduledForRemoval + @ApiStatus.ScheduledForRemoval(inVersion = "2.0") public static Event create(Function 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 Event createInteractionResult(T... typeGetter) { if (typeGetter.length != 0) throw new IllegalStateException("array must be empty!"); return createInteractionResult((Class) typeGetter.getClass().getComponentType()); } + @Deprecated + @ApiStatus.ScheduledForRemoval(inVersion = "2.0") @SuppressWarnings("UnstableApiUsage") public static Event createInteractionResult(Class 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 Event createInteractionResultHolder(T... typeGetter) { if (typeGetter.length != 0) throw new IllegalStateException("array must be empty!"); return createInteractionResultHolder((Class) typeGetter.getClass().getComponentType()); } + @Deprecated + @ApiStatus.ScheduledForRemoval(inVersion = "2.0") @SuppressWarnings("UnstableApiUsage") public static Event createInteractionResultHolder(Class 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 Event> createActorLoop(T... typeGetter) { if (typeGetter.length != 0) throw new IllegalStateException("array must be empty!"); return createActorLoop((Class) typeGetter.getClass().getComponentType()); } + @Deprecated + @ApiStatus.ScheduledForRemoval(inVersion = "2.0") @SuppressWarnings("UnstableApiUsage") public static Event> createActorLoop(Class clazz) { Event> event = of(listeners -> (Actor) Proxy.newProxyInstance(EventFactory.class.getClassLoader(), new Class[]{Actor.class}, new AbstractInvocationHandler() {