Litematica Printer

Litematica Printer

18k Downloads

Build with gradle

MCAzertox opened this issue ยท 8 comments

commented

Hello, i'm currently trying to build the mod with gradle in order to fix #51 but i have this error:
Note: C:\Users\33640\Documents\GitHub\litematica-printer\src\main\java\me\aleksilassila\litematica\printer\printer\UpdateChecker.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 1 error 2 warnings Deprecated Loom APIs were used in this build, making it incompatible with future versions of Loom. Use Gradle warning modes to control the verbosity of the warnings.

commented

Thanks for that fast answer. I don't exactly know why it doesn't want to build, i'm kinda new with gradle...
Here is the error:
`> Configure project :
Fabric Loom: 0.10.66
Loom is applying dependency data manually to publications instead of using a software component (from(components["java"])). This is deprecated and will be removed in Loom 0.12.

Task :compileJava
C:\Users\33640\Documents\GitHub\litematica-printer\src\main\java\me\aleksilassila\litematica\printer\mixin\ClientPlayNetworkHandlerMixin.java:22: warning: @overwrite is missing javadoc comment
public void sendPacket(Packet<?> packet) {
^
C:\Users\33640\Documents\GitHub\litematica-printer\src\main\java\me\aleksilassila\litematica\printer\printer\PlacementGuide.java:261: error: missing return statement
}
^
C:\Users\33640\Documents\GitHub\litematica-printer\src\main\java\me\aleksilassila\litematica\printer\printer\ClickGuide.java:156: warning: non-varargs call of varargs method with inexact argument type for last parameter;
this(click, null);
^
cast to @org.jetbrains.annotations.Nullable Item for a varargs call
cast to @org.jetbrains.annotations.Nullable Item[] for a non-varargs call and to suppress this warning
C:\Users\33640\Documents\GitHub\litematica-printer\src\main\java\me\aleksilassila\litematica\printer\printer\ClickGuide.java:160: warning: non-varargs call of varargs method with inexact argument type for last parameter;
this(false, null);
^
cast to @org.jetbrains.annotations.Nullable Item for a varargs call
cast to @org.jetbrains.annotations.Nullable Item[] for a non-varargs call and to suppress this warning
Note: C:\Users\33640\Documents\GitHub\litematica-printer\src\main\java\me\aleksilassila\litematica\printer\printer\UpdateChecker.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
3 warnings

Task :compileJava FAILED
Deprecated Loom APIs were used in this build, making it incompatible with future versions of Loom. Use Gradle warning modes to control the verbosity of the warnings.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileJava'.

Compilation failed; see the compiler error output for details.

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 3s
1 actionable task: 1 executed`

Also i'm using eclipse, but i made de build with "gradlew build"

commented

In case you are planning on creating a pr, please base it on the branch merge-placement-and-click, although I will patch this issue too once I get the code refactored and fix couple of general issues with the printer and the readability of the code. The reason this is taking so long is that I'm in military service rn and have limited free time.

The issue you are having seems to be just a warning though, are you sure the build is actually failing? If it is, paste the full build log to have a better understanding on what's going on. Also make sure you use the correct java version for your minecraft version. Lastly, are you using intellij or eclipse?

commented

This line seems to be the issue, there's an error with my code: printer\src\main\java\me\aleksilassila\litematica\printer\printer\PlacementGuide.java:261: error: missing return statement
}
^

Which branch are you trying to compile? If it's the merge branch, try pulling the latest changes from GitHub.

commented

Thanks, its works, i tested my fork and it works perfectly ! But now i have a new issue, minecraft crashed when the mod is trying to printer "FARMLAND" material block... Here is the logs:

net.minecraft.class_148: Ticking entity at net.minecraft.class_1937.method_18472(class_1937.java:492) at net.minecraft.class_638.method_32124(class_638.java:200) at net.minecraft.class_5574.method_31791(class_5574.java:54) at net.minecraft.class_638.method_18116(class_638.java:196) at net.minecraft.class_310.method_1574(class_310.java:1761) at net.minecraft.class_310.method_1523(class_310.java:1091) at net.minecraft.class_310.method_1514(class_310.java:737) at net.minecraft.client.main.Main.main(Main.java:236) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:416) at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:77) at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) Caused by: java.lang.NoClassDefFoundError: net/fabricmc/fabric/api/tool/attribute/v1/FabricToolTags at me.aleksilassila.litematica.printer.printer.ClickGuide.shouldClickBlock(ClickGuide.java:133) at me.aleksilassila.litematica.printer.printer.Printer.onTick(Printer.java:86) at net.minecraft.class_746.handler$zji000$tick(class_746.java:2825) at net.minecraft.class_746.method_5773(class_746.java) at net.minecraft.class_638.method_18646(class_638.java:217) at net.minecraft.class_1937.method_18472(class_1937.java:485) ... 14 more Caused by: java.lang.ClassNotFoundException: net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:158) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) ... 20 more

commented

Just follow the trace in the error message, I doubt it is fully visible in the part you posted so it's hard to say what is going wrong.

commented

I followed the error and it goes to this line: return new Click(true, FabricToolTags.SHOVELS.values().toArray(Item[]::new));

commented

It might be that older versions of mc / fabric don't have that function if you are building fit something other than 1.18

commented

Reopen if issue persists