Rename RSAPI to RSAPIInject
This commit is contained in:
2
src/main/java/refinedstorage/api/IRSAPI.java
Normal file → Executable file
2
src/main/java/refinedstorage/api/IRSAPI.java
Normal file → Executable file
@@ -12,7 +12,7 @@ import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* Represents a Refined Storage API implementation.
|
||||
* Delivered by the {@link RSAPI} annotation
|
||||
* Delivered by the {@link RSAPIInject} annotation.
|
||||
*/
|
||||
public interface IRSAPI {
|
||||
/**
|
||||
|
||||
4
src/main/java/refinedstorage/api/RSAPI.java → src/main/java/refinedstorage/api/RSAPIInject.java
Normal file → Executable file
4
src/main/java/refinedstorage/api/RSAPI.java → src/main/java/refinedstorage/api/RSAPIInject.java
Normal file → Executable file
@@ -4,8 +4,8 @@ import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Needs to implemented on a public static {@link IRSAPI} field
|
||||
* Needs to be implemented on a public static {@link IRSAPI} field.
|
||||
*/
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface RSAPI {
|
||||
public @interface RSAPIInject {
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.common.discovery.ASMDataTable;
|
||||
import refinedstorage.api.IRSAPI;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.api.RSAPIInject;
|
||||
import refinedstorage.api.autocrafting.craftingmonitor.ICraftingMonitorElementRegistry;
|
||||
import refinedstorage.api.autocrafting.registry.ICraftingTaskRegistry;
|
||||
import refinedstorage.api.solderer.ISoldererRegistry;
|
||||
@@ -73,14 +73,18 @@ public class API implements IRSAPI {
|
||||
}
|
||||
|
||||
public static void deliver(ASMDataTable asmDataTable) {
|
||||
String annotationClassName = RSAPI.class.getCanonicalName();
|
||||
String annotationClassName = RSAPIInject.class.getCanonicalName();
|
||||
|
||||
Set<ASMDataTable.ASMData> asmDataSet = asmDataTable.getAll(annotationClassName);
|
||||
|
||||
for (ASMDataTable.ASMData asmData : asmDataSet) {
|
||||
try {
|
||||
Class clazz = Class.forName(asmData.getClassName());
|
||||
Field field = clazz.getField(asmData.getObjectName());
|
||||
if (field.getType() == IRSAPI.class)
|
||||
|
||||
if (field.getType() == IRSAPI.class) {
|
||||
field.set(null, INSTANCE);
|
||||
}
|
||||
} catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) {
|
||||
throw new RuntimeException("Failed to set: {}" + asmData.getClassName() + "." + asmData.getObjectName(), e);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package refinedstorage.tile;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import refinedstorage.api.RSAPI;
|
||||
import refinedstorage.apiimpl.API;
|
||||
|
||||
public class ClientNode {
|
||||
|
||||
Reference in New Issue
Block a user