Update buildscript & spotlessApply

This commit is contained in:
DianeXD committed 2022-07-03 12:17:51 +08:00
1 parent e4329e2b8f
commit 8683a345c3
818 files changed
+51123 -49403

No files matched your search

@@ -1,37 +1,50 @@
package binnie.extratrees.machines;
import forestry.core.render.TankRenderInfo;
import net.minecraftforge.common.util.ForgeDirection;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import net.minecraftforge.common.util.ForgeDirection;
public class MachineRendererForestry {
static Map<String, Object> instances = new HashMap<>();
static Method renderMethod;
static Map<String, Object> instances = new HashMap<>();
static Method renderMethod;
private static void loadMethod(String file, boolean waterTank, boolean productTank) {
try {
Class cls = Class.forName("forestry.core.render.RenderMachine");
Object instance = cls.getConstructor(String.class).newInstance(file);
MachineRendererForestry.renderMethod = cls.getDeclaredMethod("render", TankRenderInfo.class, TankRenderInfo.class, ForgeDirection.class, Double.TYPE, Double.TYPE, Double.TYPE);
MachineRendererForestry.renderMethod.setAccessible(true);
MachineRendererForestry.instances.put(file, instance);
} catch (Exception ex) {
// ex.printStackTrace();
}
}
private static void loadMethod(String file, boolean waterTank, boolean productTank) {
try {
Class cls = Class.forName("forestry.core.render.RenderMachine");
Object instance = cls.getConstructor(String.class).newInstance(file);
MachineRendererForestry.renderMethod = cls.getDeclaredMethod(
"render",
TankRenderInfo.class,
TankRenderInfo.class,
ForgeDirection.class,
Double.TYPE,
Double.TYPE,
Double.TYPE);
MachineRendererForestry.renderMethod.setAccessible(true);
MachineRendererForestry.instances.put(file, instance);
} catch (Exception ex) {
// ex.printStackTrace();
}
}
public static void renderMachine(String name, double x, double y, double z, float var8) {
if (!MachineRendererForestry.instances.containsKey(name)) {
loadMethod(name, false, false);
}
public static void renderMachine(String name, double x, double y, double z, float var8) {
if (!MachineRendererForestry.instances.containsKey(name)) {
loadMethod(name, false, false);
}
try {
MachineRendererForestry.renderMethod.invoke(MachineRendererForestry.instances.get(name), TankRenderInfo.EMPTY, TankRenderInfo.EMPTY, ForgeDirection.UP, x, y, z);
} catch (Exception ex) {
// ex.printStackTrace();
}
}
try {
MachineRendererForestry.renderMethod.invoke(
MachineRendererForestry.instances.get(name),
TankRenderInfo.EMPTY,
TankRenderInfo.EMPTY,
ForgeDirection.UP,
x,
y,
z);
} catch (Exception ex) {
// ex.printStackTrace();
}
}
}