spotless apply

This commit is contained in:
asdflj committed 2022-12-05 14:41:36 +08:00
1 parent 6acf2bace1
commit 5e31096c7e
191 files changed
+5046 -5165

No files matched your search

@@ -16,11 +16,10 @@ import appeng.me.storage.MEPassThrough;
import appeng.parts.p2p.PartP2PLiquids;
import appeng.util.inv.ItemSlot;
import appeng.util.prioitylist.IPartitionList;
import net.minecraftforge.fluids.IFluidHandler;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Arrays;
import net.minecraftforge.fluids.IFluidHandler;
public class Ae2Reflect {
@@ -54,7 +53,8 @@ public class Ae2Reflect {
fContainerUpgradeable_upgradeable = Ae2Reflect.reflectField(ContainerUpgradeable.class, "upgradeable");
mItemSlot_setExtractable = reflectMethod(ItemSlot.class, "setExtractable", boolean.class);
mCPU_getGrid = reflectMethod(CraftingCPUCluster.class, "getGrid");
mCPU_postChange = reflectMethod(CraftingCPUCluster.class, "postChange", IAEItemStack.class, BaseActionSource.class);
mCPU_postChange =
reflectMethod(CraftingCPUCluster.class, "postChange", IAEItemStack.class, BaseActionSource.class);
mCPU_markDirty = reflectMethod(CraftingCPUCluster.class, "markDirty");
mP2PLiquids_getTarget = reflectMethod(PartP2PLiquids.class, "getTarget");
} catch (Exception e) {
@@ -62,20 +62,20 @@ public class Ae2Reflect {
}
}
public static Method reflectMethod(Class<?> owner, String name, Class<?>... paramTypes) throws NoSuchMethodException {
public static Method reflectMethod(Class<?> owner, String name, Class<?>... paramTypes)
throws NoSuchMethodException {
Method m = owner.getDeclaredMethod(name, paramTypes);
m.setAccessible(true);
return m;
}
public static Field reflectField(Class<?> owner, String ...names) throws NoSuchFieldException {
public static Field reflectField(Class<?> owner, String... names) throws NoSuchFieldException {
Field f = null;
for (String name : names) {
try {
f = owner.getDeclaredField(name);
if (f != null) break;
}
catch (NoSuchFieldException ignore) {
} catch (NoSuchFieldException ignore) {
}
}
if (f == null) throw new NoSuchFieldException("Can't find field from " + Arrays.toString(names));
@@ -86,7 +86,7 @@ public class Ae2Reflect {
@SuppressWarnings("unchecked")
public static <T> T readField(Object owner, Field field) {
try {
return (T)field.get(owner);
return (T) field.get(owner);
} catch (Exception e) {
throw new IllegalStateException("Failed to read field: " + field);
}
@@ -183,5 +183,4 @@ public class Ae2Reflect {
throw new IllegalStateException("Failed to invoke method: " + mP2PLiquids_getTarget, e);
}
}
}