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.
|
* Represents a Refined Storage API implementation.
|
||||||
* Delivered by the {@link RSAPI} annotation
|
* Delivered by the {@link RSAPIInject} annotation.
|
||||||
*/
|
*/
|
||||||
public interface IRSAPI {
|
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;
|
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)
|
@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.fluids.FluidStack;
|
||||||
import net.minecraftforge.fml.common.discovery.ASMDataTable;
|
import net.minecraftforge.fml.common.discovery.ASMDataTable;
|
||||||
import refinedstorage.api.IRSAPI;
|
import refinedstorage.api.IRSAPI;
|
||||||
import refinedstorage.api.RSAPI;
|
import refinedstorage.api.RSAPIInject;
|
||||||
import refinedstorage.api.autocrafting.craftingmonitor.ICraftingMonitorElementRegistry;
|
import refinedstorage.api.autocrafting.craftingmonitor.ICraftingMonitorElementRegistry;
|
||||||
import refinedstorage.api.autocrafting.registry.ICraftingTaskRegistry;
|
import refinedstorage.api.autocrafting.registry.ICraftingTaskRegistry;
|
||||||
import refinedstorage.api.solderer.ISoldererRegistry;
|
import refinedstorage.api.solderer.ISoldererRegistry;
|
||||||
@@ -73,14 +73,18 @@ public class API implements IRSAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void deliver(ASMDataTable asmDataTable) {
|
public static void deliver(ASMDataTable asmDataTable) {
|
||||||
String annotationClassName = RSAPI.class.getCanonicalName();
|
String annotationClassName = RSAPIInject.class.getCanonicalName();
|
||||||
|
|
||||||
Set<ASMDataTable.ASMData> asmDataSet = asmDataTable.getAll(annotationClassName);
|
Set<ASMDataTable.ASMData> asmDataSet = asmDataTable.getAll(annotationClassName);
|
||||||
|
|
||||||
for (ASMDataTable.ASMData asmData : asmDataSet) {
|
for (ASMDataTable.ASMData asmData : asmDataSet) {
|
||||||
try {
|
try {
|
||||||
Class clazz = Class.forName(asmData.getClassName());
|
Class clazz = Class.forName(asmData.getClassName());
|
||||||
Field field = clazz.getField(asmData.getObjectName());
|
Field field = clazz.getField(asmData.getObjectName());
|
||||||
if (field.getType() == IRSAPI.class)
|
|
||||||
|
if (field.getType() == IRSAPI.class) {
|
||||||
field.set(null, INSTANCE);
|
field.set(null, INSTANCE);
|
||||||
|
}
|
||||||
} catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) {
|
} catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) {
|
||||||
throw new RuntimeException("Failed to set: {}" + asmData.getClassName() + "." + asmData.getObjectName(), e);
|
throw new RuntimeException("Failed to set: {}" + asmData.getClassName() + "." + asmData.getObjectName(), e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package refinedstorage.tile;
|
package refinedstorage.tile;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import refinedstorage.api.RSAPI;
|
|
||||||
import refinedstorage.apiimpl.API;
|
import refinedstorage.apiimpl.API;
|
||||||
|
|
||||||
public class ClientNode {
|
public class ClientNode {
|
||||||
|
|||||||
Reference in New Issue
Block a user