maruohon / litematica

A modern client-side schematic mod for Minecraft
GNU Lesser General Public License v3.0
720 stars 217 forks source link

Forge 1.16 #234

Open ZacSharp opened 3 years ago

ZacSharp commented 3 years ago

Risking to ask a dumb question: In your README you state that you are waiting for Forge to ship Mixin and lately I noticed that I don't need MixinBootstrap anymore. Does that mean we will get a new Forge version soon or is Mixin working without MixinBootsrap still not enough? EDIT: also I found org.spongepowered:mixin:0.8 in Forge's version.json so that means it' shipping it right?

maruohon commented 3 years ago

Yes Forge did start shipping Mixin a while back, so now it would be possible to make proper Forge ports.

However I decided that I'm not going to waste time porting the current 1.13.2+ code base to Forge, because I consider the current 1.13.2+ versions to be "trash" compared to the later 1.12.2 code. And even the current 1.12.2 version is still lacking many features and improvements that get asked about constantly, plus there are some renderer optimizations and fixes that I've wanted to do for a long time now. So I'm currently focusing (whatever little modding time I have atm) on working on those "most important" improvements and fixes on 1.12.2 first, and after I get a bunch of the most important and urgent things finished there, I'm then going to port that state of code to all the 1.13.2+ MC versions on Fabric, and then also porting that new 1.16.3 Fabric version to 1.16.3 Forge.

I can't give any kind of reliable time line, as most often stuff takes ten times longer to do than I would estimate, plus my free time and modding motivation comes and goes... but I'm kind of hoping I could do that next round of updates from 1.12.2 to all the other versions, and then also the Forge ports, towards the end of this year still (ie. somewhat unlikely to happen before December, and I won't guarantee that they actually will happen in December either).

TheSonicCry commented 3 years ago

@ZacSharp Sorry for necro'ing like this, but I can't find another way to contact you!

Maruohon mentioned a forge port you were working on in the curseforge comments of Litematica. I checked out your GitHub and found it. I downloaded Litematica and malilib, then went to build them using Gradle 4.9 as noted. Malilib builds fine, but Litematica is giving me troubles on compileJava. It's saying Deprececated features were used, making it incompatible with Gradle 5.0. Any ideas what I'm doing wrong? I've removed all other versions of Gradle from the system and path, so 4.9's the only version I have.

Sorry for posting this here!

maruohon commented 3 years ago

@TheSonicCry That warning alone should not fail the build. Did it not complete successfully? If not, then there must be some other issues as well?

Where did you put/clone the repos? Looks like the current build script expects the malilib repo to be in the same directory as the Litematica repo (not inside it, like adjacent/sibling to it) ie.

implementation fileTree(dir: "../malilib/build/libs", include: "**.jar")

So you should have the malilib repo directory named as malilib.

TheSonicCry commented 3 years ago

Hey there, thanks for the reply. I've renamed the malilib directory to malilib and placed in in the same root as the litematica so it redirects like you posted, but no luck.

Here's what the log is showing right now: https://pastebin.com/K6KhNZHc

Also, here's gradle -v: https://pastebin.com/y5wz2W8y

If it'd be more helpful to run it with --stacktrace or some such please let me know! I really appreciate the help!

ZacSharp commented 3 years ago

You are using java 14, don't know if that works with litematica. I always use java 8 for gradle. Looks like it can't open the log file, but that doesn't seem to be a problem. And for the type errors: It wants a ITextComponent for StringUtils#translate, even though that clearly takes a String. Are you sure it is using the right version of malilib? (didn't find one that contains "translate(I" or " translate([^Sa-z]" though)

    public static String translate(String translationKey, Object... args)
    {
        return net.minecraft.client.resources.I18n.format(translationKey, args);
    }
DannyParker0001 commented 3 years ago

Works with openjdk-8 and renaming malilib-forge-1.16 -> malilib Zac your a fucking legend. Here's my jars if you can't get the build from source working.

TheSonicCry commented 3 years ago

So. I'm actually stupid.

I built malilib then removed the deobf.jar when I copied it to my mods earlier. I rebuilt malilib using Jdk 8, then was able to build litematica just fine. Thank you for the help, and sorry for the wasted brain power over my unimaginable stupidity.

rlcoldx commented 3 years ago

Works with openjdk-8 and renaming malilib-forge-1.16 -> malilib Zac your a fucking legend. Here's my jars if you can't get the build from source working.

The files loaded successfully, but the mod does not work in game. Do you have a new jar to make available?

ZacSharp commented 3 years ago

Read the description. image EDIT: that means restarting the game

onyxcherry commented 3 years ago

Read the description. image

Should I restart the game launcher or what?

TheSonicCry commented 3 years ago

Read the description. image

Should I restart the game launcher or what?

Just to check, make sure you’re unbinding everything from ‘M’ in controls, then press M in game. For me it didn’t show up in the controls list and I’d thought it didn’t install properly. The equivalent of ‘turn it on and off again’ lol.

onyxcherry commented 3 years ago

Unfortunalety, I pressed m and nothing changed :(. Default Minecraft without any mods excluding these two hasn't any additional keybindings for m... (I use jars from ↑ attached zip - I had compiled malilib, but I couldn't compile litematica because of Java errors - Java, not malilib dependency). JDK11 or Java8 - no oneworks :(

TwinkieShip commented 3 years ago

i dont know what im doing wrong but when i successfully compile and put it into mods folder and hit play it says

The game crashed whilst initializing game Error: org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError: An unexpected critical error was encountered Exit Code: -1

happens with the zip from dannyparker too

CyberDruid928 commented 3 years ago

i dont know what im doing wrong but when i successfully compile and put it into mods folder and hit play it says

The game crashed whilst initializing game Error: org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError: An unexpected critical error was encountered Exit Code: -1

happens with the zip from dannyparker too

Same thing here

Tobs3l commented 3 years ago

i dont know what im doing wrong but when i successfully compile and put it into mods folder and hit play it says

The game crashed whilst initializing game Error: org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError: An unexpected critical error was encountered Exit Code: -1

happens with the zip from dannyparker too

got the same problem

ZacSharp commented 3 years ago

I have no idea what's happening there, but maybe one of you can give me a log file so I have at least a slight chance to find it out?

Tobs3l commented 3 years ago

I have no idea what's happening there, but maybe one of you can give me a log file so I have at least a slight chance to find it out?

I hope this is what you need. (thx for the forge port btw, even if it doesnt work) crash-2021-05-20_21.43.51-client.txt

rlcoldx commented 3 years ago

I have no idea what's happening there, but maybe one of you can give me a log file so I have at least a slight chance to find it out?

I hope this is what you need. (thx for the forge port btw, even if it doesnt work) crash-2021-05-20_21.43.51-client.txt

I had the same problem, looking closely, I saw that it was a conflict problem with Optifine, when I removed Optifine from the modpack it worked perfectly.

maruohon commented 3 years ago

Btw I noticed that this Litematica port was based on the old fabric_1.16_snapshots branch, so it's missing most of the (also 1.16 specific) fixes and improvements added since then and also the few new features implemented more recently. Merging in the fabric_1.16_temp_features branch is recommended to get those, but due to the mapping differences it probably won't merge very cleanly.

rlcoldx commented 3 years ago

Btw I noticed that this Litematica port was based on the old fabric_1.16_snapshots branch, so it's missing most of the (also 1.16 specific) fixes and improvements added since then and also the few new features implemented more recently. Merging in the fabric_1.16_temp_features branch is recommended to get those, but due to the mapping differences it probably won't merge very cleanly.

Yes, especially in the build view settings. You can't see the building under the water.

Tobs3l commented 3 years ago

I have no idea what's happening there, but maybe one of you can give me a log file so I have at least a slight chance to find it out?

I hope this is what you need. (thx for the forge port btw, even if it doesnt work) crash-2021-05-20_21.43.51-client.txt

I had the same problem, looking closely, I saw that it was a conflict problem with Optifine, when I removed Optifine from the modpack it worked perfectly.

Oh yeah, your right. Thanks for the help, still would be cool if there would be a fix or sth for that.

ZacSharp commented 3 years ago

Merging more up-to-date code from litematica and malilib is on my todo list, but I first want to see if I can find out how forgegradle handles mojangs official mappings, because that could save me quite a few hours time. For the optifine bug I can only hope that merging will fix it, because I don't know how I could do that myself. Meanwhile there is an easy fix for the probably most annoying part:

[[dependencies.litematica]]
    modId="malilib"
    mandatory=true
    versionRange="[0.10.0-dev.21+beta.1,)"
-    ordering="NONE"
+    ordering="BEFORE"
    side="CLIENT"

Apply this change to the mods.toml in litematica and it should neither crash during SIDED-SETUP (this does not include the optifine crash) nor not show up in game.

Tobs3l commented 3 years ago

So i changed the NONE to BEFORE but it still crashes. However, when i remove Optifine and it works i cant see any glass blocks when displaying a hologram, it still shows them in the HUD but not visually on screen.

Just wanted to say that i really appreciate your good work, keep it up👍

maruohon commented 3 years ago

@Tobs3l Try changing the vanilla video settings from Fabulous to Fancy mode. There are still various issues with translucency and rendering order of things, so you won't be able to see either vanilla translucent blocks through the schematic or vice versa (I forget which way it is atm). Also that render issue might be one of the things fixed in the later 1.16 commits that are currently missing from this Forge port. I remember not being able to see translucent blocks through the schematic overlay being an issue at one point (ie. you would see the blocks if you toggle off the colored overlay).

ZacSharp commented 3 years ago

Was tired of reading through code I don't understand, went over to doing changes in code I don't understand and merged fabric_1.16_temp_features. I haven't played with the new jar yet, but from the few test runs I did I know that

  1. it seems to just work with the old malilib jar but I still have plans to update malilib as well, hoping to get rid of the stuck keys thing
  2. it once crashed during sided setup again, I hope that was a one-timer or I will have to make malilib/litematica initialization thread safe
  3. the coloured overlay is back
  4. translucent rendering works. You can't see translucent litematica rendering through translucent vanilla rendering and translucent schematic blocks mostly occlude the schematic overlay, but sometimes it's the other way round
  5. .schematic and .nbt can be loaded again, but exporting as *.schematic doesn't work

EDIT: just saw that I forgot to pull before merging, so the next update is already WIP done

maruohon commented 3 years ago

Exporting to *.schematic never existed/worked in any of the 1.13.2+ versions as of yet, so don't worry about that. Only exporting to the vanilla structure block template *.nbt format is "supposed to work" atm.

Better schematic format conversions between all formats only exist in 1.12.2 currently. Proper cross-MC-version schematic conversion support on the other hand is still entirely WIP and will be worked on in 1.12.2 before it gets merged to 1.13.2+.

The malilib changes during the 1.16 era have been pretty minimal, and in fact almost no actual development has been done for malilib in any of the 1.13.2+ versions, other than updating to vanilla changes and doing some small bug fixes.

Myth-1300 commented 3 years ago

Minecraft version 1.16.5 Mod Version litematica-forge-1.16.5-0.0.0-dev.jar malilib-forge-1.16.5-0.10.0-dev.21+beta.1.jar (got them from a comment by DannyParker0001 which was made 23 days ago) (Idk if this is the latest version, but building the project fails for me and I dont know how to fix that issue)

Easy Place mode prevention doesn't work, it'll place the block for the schematic, but then place an additional block as if the schematic one was already there, then pop up "Easy place mode prevented this action" when it didn't prevent it

ZacSharp commented 3 years ago

DannyParker's version is pretty outdated (it's missing commits from about a year, even though it's not even a month old) and merging the new code for litematica and malilib didn't help. However while I was updating malilib I found the reason for mouse buttons being stuck, double triggering and not being canceled, so with my latest malilib version easy place prevention now works as well and rebuilding schematics is way less annoying.

Myth-1300 commented 3 years ago

DannyParker's version is pretty outdated (it's missing commits from about a year, even though it's not even a month old) and merging the new code for litematica and malilib didn't help. However while I was updating malilib I found the reason for mouse buttons being stuck, double triggering and not being canceled, so with my latest malilib version easy place prevention now works as well and rebuilding schematics is way less annoying.

Would you be able to help me with how to compile the latest version? Whenever I try I get build failed

rlcoldx commented 3 years ago

DannyParker's version is pretty outdated (it's missing commits from about a year, even though it's not even a month old) and merging the new code for litematica and malilib didn't help. However while I was updating malilib I found the reason for mouse buttons being stuck, double triggering and not being canceled, so with my latest malilib version easy place prevention now works as well and rebuilding schematics is way less annoying.

Would you be able to help me with how to compile the latest version? Whenever I try I get build failed

I had the same problem when compiling... malilib works fine, but Litematica has a lot of errors.

src\main\java\fi\dy\masa\litematica\schematic\conversion\SchematicConversionFixers.java:57: error: cannot find symbol .with(RedstoneWireBlock.WIRE_CONNECTION_WEST, RedstoneSide.SIDE); ^ symbol: variable SIDE location: class RedstoneSide

wagnerdk commented 3 years ago

I get multiple errors. One of the errors is a missing file in the logs subfolder. I simply created the latest.log file and the logs folder (which is mentioned in the .gitignore file) but this does not fix the compilation errors. The next error is that “RedstoneSide.SIDE” does not exist but is used in SchematicConversionFixers.java:54. Maybe it depends on the wrong Minecraft version. Edit: The error is the same as rlcoldx has.

Myth-1300 commented 3 years ago

DannyParker's version is pretty outdated (it's missing commits from about a year, even though it's not even a month old) and merging the new code for litematica and malilib didn't help. However while I was updating malilib I found the reason for mouse buttons being stuck, double triggering and not being canceled, so with my latest malilib version easy place prevention now works as well and rebuilding schematics is way less annoying.

Would you be able to help me with how to compile the latest version? Whenever I try I get build failed

I had the same problem when compiling... malilib works fine, but Litematica has a lot of errors.

src\main\java\fi\dy\masa\litematica\schematic\conversion\SchematicConversionFixers.java:57: error: cannot find symbol .with(RedstoneWireBlock.WIRE_CONNECTION_WEST, RedstoneSide.SIDE); ^ symbol: variable SIDE location: class RedstoneSide

I cant even compile malilib they both fail for me Malilib gives "Could not resolve all files for configuration ':complileClasspath' Could not find net.minecraftforge:forge:1.16.5-36.1.2_mapped_snapshot_20210309-1.16.5."

ZacSharp commented 3 years ago

litematica 9f183ef0bbb726eed647e86dcc964d61e91b37da + malilib ef338f72b2e921e4a75ff30155af3206714b8707.zip Did you rename the malilib repo to malilib and put it next to the litematica repo? I still haven't changed litematicas build.gradle to search ../malilib-forge-1.16.6/build/libs as well.

Myth-1300 commented 3 years ago

litematica 9f183ef0bbb726eed647e86dcc964d61e91b37da + malilib ef338f72b2e921e4a75ff30155af3206714b8707.zip Did you rename the malilib repo to malilib and put it next to the litematica repo? I still haven't changed litematicas build.gradle to search ../malilib-forge-1.16.6/build/libs as well.

I did not i'll try that soon

wagnerdk commented 3 years ago

I did that and still get the error. I have one malilib folder (containing the content of ZacSharp/malilib-forge-1.16) and one litematica-forge-1.16 folder (containing the content of ZacSharp/litematica-forge-1.16). Additionally, I added the file latest.log in litematica-forge-1.16/logs. Then I successfully build malilib with gradlew build. After that I tried the same with libmatica but got the following errors.

Errors ``` \litematica-forge-1.16>gradlew build Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details > Configure project : [MixinGradle] Skipping eclipse integration, extension not found Java: 14.0.2 JVM: 14.0.2+12(AdoptOpenJDK) Arch: amd64 New Dep: net.minecraftforge:forge:1.16.5-36.1.2_mapped_snapshot_20210403-yarn-1.16.5 > Task :compileJava 2021-06-02 16:58:01,896 Task worker for ':' Thread 3 WARN Advanced terminal features are not available in this environment Note: SpongePowered MIXIN Annotation Processor Version=0.8.2 (MixinGradle Version=0.7) Note: ObfuscationServiceMCP supports type: "notch" Note: ObfuscationServiceFG3 supports type: "searge" Note: Loading searge mappings from \litematica-forge-1.16\build\createMcpToSrg\output.tsrg Note: Writing refmap to \litematica-forge-1.16\build\tmp\compileJava\compileJava-refmap.json Note: Writing refmap to \litematica-forge-1.16\build\tmp\compileJava\compileJava-refmap.json Note: Writing searge composite mappings to \litematica-forge-1.16\build\tmp\compileJava\compileJava-mappings.tsrg Note: Writing refmap to \litematica-forge-1.16\build\tmp\compileJava\compileJava-refmap.json Note: Writing refmap to \litematica-forge-1.16\build\tmp\compileJava\compileJava-refmap.json Note: Writing searge composite mappings to \litematica-forge-1.16\build\tmp\compileJava\compileJava-mappings.tsrg \litematica-forge-1.16\src\main\java\fi\dy\masa\litematica\schematic\conversion\SchematicConversionFixers.java:57: error: cannot find symbol .with(RedstoneWireBlock.WIRE_CONNECTION_WEST, RedstoneSide.SIDE); ^ symbol: variable SIDE location: class RedstoneSide \litematica-forge-1.16\src\main\java\fi\dy\masa\litematica\schematic\conversion\SchematicConversionFixers.java:56: error: cannot find symbol .with(RedstoneWireBlock.WIRE_CONNECTION_SOUTH, RedstoneSide.SIDE) ^ symbol: variable SIDE location: class RedstoneSide \litematica-forge-1.16\src\main\java\fi\dy\masa\litematica\schematic\conversion\SchematicConversionFixers.java:55: error: cannot find symbol .with(RedstoneWireBlock.WIRE_CONNECTION_EAST, RedstoneSide.SIDE) ^ symbol: variable SIDE location: class RedstoneSide \litematica-forge-1.16\src\main\java\fi\dy\masa\litematica\schematic\conversion\SchematicConversionFixers.java:54: error: cannot find symbol .with(RedstoneWireBlock.WIRE_CONNECTION_NORTH, RedstoneSide.SIDE) ^ symbol: variable SIDE location: class RedstoneSide Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 4 errors > Task :compileJava FAILED 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. * Get more help at https://help.gradle.org Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 13s 4 actionable tasks: 2 executed, 2 up-to-date ```
Tobs3l commented 3 years ago

DannyParker's version is pretty outdated (it's missing commits from about a year, even though it's not even a month old) and merging the new code for litematica and malilib didn't help. However while I was updating malilib I found the reason for mouse buttons being stuck, double triggering and not being canceled, so with my latest malilib version easy place prevention now works as well and rebuilding schematics is way less annoying.

ZacSharp, is there a way that you could maybe upload the finished JAR files? Idk why but i cant build any of them. Would be really nice, thx.

Myth-1300 commented 3 years ago

litematica 9f183ef0bbb726eed647e86dcc964d61e91b37da + malilib ef338f72b2e921e4a75ff30155af3206714b8707.zip Did you rename the malilib repo to malilib and put it next to the litematica repo? I still haven't changed litematicas build.gradle to search ../malilib-forge-1.16.6/build/libs as well.

Easy place mode still does not work through 1 layer of water in these files

maruohon commented 3 years ago

Easy Place mode doesn't work under fluids in any of the 1.13.2+ versions yet. I rewrote the Easy Place mode code in 1.12.2 a year ago so that it works properly with slabs and fluids, but that hasn't been ported forward yet.

maruohon commented 3 years ago

It looks like there is something weird with the mappings. Also the Litematica port seems to use Yarn mappings whereas the malilib port uses MCP, which makes it extra awkward trying to do anything for the Litematica code in the IDE (since I have it set up for MCP mappings normally, which also works for this malilib port).

But I was able to compile the mod by changing the redstone dust schematic conversion fixer to use the wrong value for the side connections... I have no idea why it doesn't find the correct SIDE value, but it does find both the UP and NONE values. So I just changed it to NONE for now and then the mod built correctly.

So the only effect this has is that if you have an old schematic (pre-1.16) that has a redstone dot, it will not be converted to the new 1.16+ "standalone" cross when loading the schematic.

I uploaded the built mods here: https://masa.dy.fi/tmp/minecraft/mods/misc_test_versions/unsupported_temporary_forge_1.16.5/

ZacSharp commented 3 years ago

which makes it extra awkward trying to do anything for the Litematica code in the IDE

uh, might well be. I don't use an IDE, so the different mappings never were a problem. I did Malilib first with pure MCP names and when I ported Litematica and came to the point where the compiler spit out errors for "missing" methods for I decided that it was too much (litematica seems to interact with mc much more) and switched to yarn2mcp to reduce the amount of changes.

I now cloned the two repos myself (instead of using my normal workspace, didn't delete the cache though), renamed the malilib one, built malilib and then litematica and the only two errors were the log file thing (didn't break the build) and (after building) Forge not knowing that +beta-1 is older than +arne.7, so to make the game load I had to change the malilib dependency in litematicas mods.toml once again. Also I don't know how the mapping difference would cause this error everyone except dannyparker and me seem to get, because the values are called SIDE, NONE and UP in both, MCP and YARN, so as long as the compiler finds the class RedstoneSide/WireConnection (which it does) it should work with either mapping.

BTW @Tobs3l, I actually did that the day before you asked. That line with two full commit hashes is actually a link to a zip containing both jars. If you want to use it it (or masas jars) you will probably have to change versionRange="[0.10.0-dev.21+beta.1,)" in litematicas mods.toml so Forge accepts malilib as new enough.

EDIT: here's a new built without the dependency problem malilib ef338f72 + litematica 6690a436.zip

ZacSharp commented 3 years ago

Found the reason for RedstoneSide.SIDE not being found: for whatever reason it was removed from the mappings (now has one of these nice field_* names) and my gradle cache kept the old version, so I compiled against the cached version while everyone else automatically downloaded the new mappings.

Victor-Noli commented 2 years ago

I don't know if you guys have actually talked about the fact that we can not paste schematics with the Forge Part but with the fabric part yes.

Is this going to be added sooner or later?

maruohon commented 2 years ago

@Victor-Noli It should work the same it does in the Fabric versions, except that the hotkey configs in the Forge port seem to not take effect unless you log out of the world and back in.

ZacSharp commented 2 years ago

@Victor-Noli when I tried it the last time (almost a year ago) it worked. I'll try it again soon though even if I find a problem I'm not sure whether and when I'll fix it. I don't use Litematica atm so it's far down on my todo list and if I work on Litematica again I'll try to get it to compile with ForgeGradle 5 so I can update the Forge version to newer mc versions.

maruohon commented 2 years ago

My current plan is to base the 1.19 ports of my mods on the newer code base from 1.12.2. If I manage to do that without it taking months to get things ready, then I may also make an "official" Forge port for 1.19 from that to-be new 1.19 Fabric version.

Felix14-v2 commented 2 years ago

base the 1.19 ports of my mods on the newer code base from 1.12.2

Does it make sense for me to start working on the new translations based on 1.12.2 branch now?

maruohon commented 2 years ago

@Felix14-v2 I think it should be in a fairly decent state atm. There may still be a bunch of unused or outdated "in-game message" translations, but I think all configs and most hover infos and such should be "done" for the current state of the mod. There will be a bunch of new features and other new things and changes at some point, but no point really worrying about those at this point yet.

I don't know which mod(s) you are going to translate, but at least don't do Tweakeroo yet. I believe it's the last mod atm in the liteloader_1.12.2 branches that hasn't received its config localization updates/clean-up/improvements/localization key renames yet.

nahoss commented 1 year ago

And it was never talked about in a version for 1.19.2

Luza35 commented 11 months ago

Sorry for asking a stupid question but how soon will there be a port to 1.18.2

noahyor commented 2 months ago

This may no longer be necessary for versions >1.20 because of the Sinytra projects.