Skip to content

Commit

Permalink
Remove deprecations.
Browse files Browse the repository at this point in the history
  • Loading branch information
gigaherz committed Jun 2, 2021
1 parent 386b5bb commit 35a3509
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 24 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ dependencies {
implementation('org.apache.logging.log4j:log4j-api:2.11.+')
implementation('cpw.mods:modlauncher:6.1.+:api')
implementation('com.google.code.findbugs:jsr305:3.0.2')
// TODO: Remove in 1.17
api('net.jodah:typetools:0.8.+')
jmhImplementation('cpw.mods:modlauncher:6.1.+')
jmhImplementation("org.powermock:powermock-core:2.0.+")
Expand Down
9 changes: 0 additions & 9 deletions src/main/java/net/minecraftforge/eventbus/EventBus.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ private <T extends GenericEvent<? extends F>, F> Predicate<T> passGenericFilter(
return e->e.getGenericType() == type;
}

@Deprecated // TODO: Remove in 1.17
private void checkNotGeneric(final Consumer<? extends Event> consumer) {
checkNotGeneric(getEventClass(consumer));
}
Expand All @@ -169,7 +168,6 @@ private void checkNotGeneric(final Class<? extends Event> eventType) {
}
}

@Deprecated // TODO: Remove in 1.17
@Override
public <T extends Event> void addListener(final Consumer<T> consumer) {
checkNotGeneric(consumer);
Expand All @@ -182,7 +180,6 @@ public <T extends Event> void addListener(final Class<T> eventType, final Consum
addListener(EventPriority.NORMAL, eventType, consumer);
}

@Deprecated // TODO: Remove in 1.17
@Override
public <T extends Event> void addListener(final EventPriority priority, final Consumer<T> consumer) {
checkNotGeneric(consumer);
Expand All @@ -195,7 +192,6 @@ public <T extends Event> void addListener(final EventPriority priority, final Cl
addListener(priority, false, eventType, consumer);
}

@Deprecated // TODO: Remove in 1.17
@Override
public <T extends Event> void addListener(final EventPriority priority, final boolean receiveCancelled, final Consumer<T> consumer) {
checkNotGeneric(consumer);
Expand All @@ -208,7 +204,6 @@ public <T extends Event> void addListener(final EventPriority priority, final bo
addListener(priority, passCancelled(receiveCancelled), eventType, consumer);
}

@Deprecated // TODO: Remove in 1.17
@Override
public <T extends GenericEvent<? extends F>, F> void addGenericListener(final Class<F> genericClassFilter, final Consumer<T> consumer) {
addGenericListener(genericClassFilter, EventPriority.NORMAL, consumer);
Expand All @@ -219,7 +214,6 @@ public <T extends GenericEvent<? extends F>, F> void addGenericListener(final Cl
addGenericListener(genericClassFilter, EventPriority.NORMAL, eventType, consumer);
}

@Deprecated // TODO: Remove in 1.17
@Override
public <T extends GenericEvent<? extends F>, F> void addGenericListener(final Class<F> genericClassFilter, final EventPriority priority, final Consumer<T> consumer) {
addGenericListener(genericClassFilter, priority, false, consumer);
Expand All @@ -230,7 +224,6 @@ public <T extends GenericEvent<? extends F>, F> void addGenericListener(final Cl
addGenericListener(genericClassFilter, priority, false, eventType, consumer);
}

@Deprecated // TODO: Remove in 1.17
@Override
public <T extends GenericEvent<? extends F>, F> void addGenericListener(final Class<F> genericClassFilter, final EventPriority priority, final boolean receiveCancelled, final Consumer<T> consumer) {
addListener(priority, passGenericFilter(genericClassFilter).and(passCancelled(receiveCancelled)), consumer);
Expand All @@ -241,7 +234,6 @@ public <T extends GenericEvent<? extends F>, F> void addGenericListener(final Cl
addListener(priority, passGenericFilter(genericClassFilter).and(passCancelled(receiveCancelled)), eventType, consumer);
}

@Deprecated // TODO: Remove in 1.17
@SuppressWarnings("unchecked")
private <T extends Event> Class<T> getEventClass(Consumer<T> consumer) {
final Class<T> eventClass = (Class<T>) TypeResolver.resolveRawArgument(Consumer.class, consumer.getClass());
Expand All @@ -252,7 +244,6 @@ private <T extends Event> Class<T> getEventClass(Consumer<T> consumer) {
return eventClass;
}

@Deprecated // TODO: Remove in 1.17
private <T extends Event> void addListener(final EventPriority priority, final Predicate<? super T> filter, final Consumer<T> consumer) {
Class<T> eventClass = getEventClass(consumer);
if (Objects.equals(eventClass, Event.class))
Expand Down
12 changes: 0 additions & 12 deletions src/main/java/net/minecraftforge/eventbus/api/IEventBus.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ public interface IEventBus {
*
* @param consumer Callback to invoke when a matching event is received
* @param <T> The {@link Event} subclass to listen for
* @deprecated Use {@link #addListener(Class, Consumer)}
*/
@Deprecated // TODO: Remove in 1.17
<T extends Event> void addListener(Consumer<T> consumer);

/**
Expand All @@ -56,9 +54,7 @@ public interface IEventBus {
* @param priority {@link EventPriority} for this listener
* @param consumer Callback to invoke when a matching event is received
* @param <T> The {@link Event} subclass to listen for
* @deprecated Use {@link #addListener(EventPriority, Class, Consumer)}
*/
@Deprecated // TODO: Remove in 1.17
<T extends Event> void addListener(EventPriority priority, Consumer<T> consumer);

/**
Expand All @@ -78,9 +74,7 @@ public interface IEventBus {
* @param receiveCancelled Indicate if this listener should receive events that have been {@link Cancelable} cancelled
* @param consumer Callback to invoke when a matching event is received
* @param <T> The {@link Event} subclass to listen for
* @deprecated Use {@link #addListener(EventPriority, boolean, Class, Consumer)}
*/
@Deprecated // TODO: Remove in 1.17
<T extends Event> void addListener(EventPriority priority, boolean receiveCancelled, Consumer<T> consumer);

/**
Expand All @@ -105,9 +99,7 @@ public interface IEventBus {
* @param consumer Callback to invoke when a matching event is received
* @param <T> The {@link GenericEvent} subclass to listen for
* @param <F> The {@link Class} to filter the {@link GenericEvent} for
* @deprecated Use {@link #addGenericListener(Class, Class, Consumer)}
*/
@Deprecated // TODO: Remove in 1.17
<T extends GenericEvent<? extends F>, F> void addGenericListener(Class<F> genericClassFilter, Consumer<T> consumer);

/**
Expand All @@ -132,9 +124,7 @@ public interface IEventBus {
* @param consumer Callback to invoke when a matching event is received
* @param <T> The {@link GenericEvent} subclass to listen for
* @param <F> The {@link Class} to filter the {@link GenericEvent} for
* @deprecated Use {@link #addGenericListener(Class, EventPriority, Class, Consumer)}
*/
@Deprecated // TODO: Remove in 1.17
<T extends GenericEvent<? extends F>, F> void addGenericListener(Class<F> genericClassFilter, EventPriority priority, Consumer<T> consumer);

/**
Expand All @@ -161,9 +151,7 @@ public interface IEventBus {
* @param consumer Callback to invoke when a matching event is received
* @param <T> The {@link GenericEvent} subclass to listen for
* @param <F> The {@link Class} to filter the {@link GenericEvent} for
* @deprecated Use {@link #addGenericListener(Class, EventPriority, boolean, Class, Consumer)}
*/
@Deprecated // TODO: Remove in 1.17
<T extends GenericEvent<? extends F>, F> void addGenericListener(Class<F> genericClassFilter, EventPriority priority, boolean receiveCancelled, Consumer<T> consumer);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public class BenchmarkArmsLength implements Callable<Void>
{
private static IEventBus staticSubscriberBus;
private static IEventBus dynamicSubscriberBus;
@Deprecated
private static IEventBus lambdaSubscriberBus;
private static IEventBus classLambdaSubscriberBus;
private static IEventBus combinedSubscriberBus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import net.minecraftforge.eventbus.api.IEventBus;

@Deprecated
public class SubscriberLambda
{

Expand Down

0 comments on commit 35a3509

Please sign in to comment.