Jump to content

Porting a fabric mod to forge


Paul Carlisle

Recommended Posts

Since the death of schematica, people have turned to a somewhat updated version called litematica. The problem is, if you have a forge server, you have to use forge and NOT fabric loader which the mod runs on.

I was wondering if someone with coding knowledge could port a fabric mod to forge for me, for 1.19.1. There is only one person working on litematica and the associated library mod, and they are definitely not prioritizing it.

litematica: https://www.curseforge.com/minecraft/mc-mods/litematica/files

malilib: https://www.curseforge.com/minecraft/mc-mods/malilib/files

 

The death of the schematica mod was a terrible tragedy for the community, I would really appreciate it if someone could do this.

Link to comment
Share on other sites

4 hours ago, Paul Carlisle said:

could port a fabric mod to forge

AH HAHAHAHAHA! 🤣

No seriously though, the two ecosystems are so wildly different that it wouldn't be so much a "port" as "rewritten from scratch."

Forge: make everything compatible because no one touches vanilla code directly. If Forge doesn't make what you need possible, make a PR.
Fabric: we can update to new versions quickly because we only have the basics. So if you need something special, you're going to have to patch the vanilla code yourself, have fun~!

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Quote

Forge: make everything compatible because no one touches vanilla code directly. If Forge doesn't make what you need possible, make a PR.
Fabric: we can update to new versions quickly because we only have the basics. So if you need something special, you're going to have to patch the vanilla code yourself, have fun~!

That's a misrepresentation and I think you know it. 🙂 Isn't having fun the whole point of writing mods?

I agree they are 2 different philosophies (which you prefer is a matter of taste):

 

Forge: A one-stop shop for everything you need for modding, concentrating on mod compatibility/correctness

Fabric: An a-la-carte (don't pay for what you don't need) approach where the fabric-api concentrates on common use cases and the ecosystem provides more specialised apis, and don't expect it to hold your hand when it comes to writing correct mods

 

Forge itself has something of the a-la-carte with mods like curios, "waila", jei, patchoulli, terrablender, etc. having specialised apis not provided by forge.

It's really a matter of where the 2 draw the line.

 

I agree the difference in philosophy makes porting mods more difficult.

For the original poster, Litematica are already working on it (but they have been for a while): https://github.com/maruohon/litematica/issues/234

Edited by warjort

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

6 hours ago, warjort said:

Fabric: An a-la-carte (don't pay for what you don't need) approach where the fabric-api concentrates on common use cases and the ecosystem provides more specialised apis, and don't expect it to hold your hand when it comes to writing correct mods

It also leads to everyone writing their own API addons that duplicate efforts and makes things incompatible with each other because everyone creates a patch that does what they need and only what they need. It also means that when Minecraft updates if you have a mod that relies on one of these additional specialized APIs, you have to wait on that author to update it, even though Fabric's main API is already current.

Quote

Forge itself has something of the a-la-carte with mods like curios, "waila", jei, patchoulli, terrablender, etc. having specialised apis not provided by forge.

Neither Waila nor JEI require additional source patches to work with Forge. They have their own APIs, yes, but that's not what I'm referring to when I say that Fabric requires modders create additional hooks inside vanilla code.

Forge makes sure that every mod stays well out of vanilla code so that mods don't conflict with each other and crash the game.

I'm referring to this:
https://fabricmc.net/wiki/start#mixins_asm

Fabric pushes modders towards ASM. ASM is dangerous, complex, and highly fragile. It can lead to code that crashes code that isn't your code with the resulting stack trace having no evidence as to which mod caused the issue! It can DO anything, but it doesn't do it safely.

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hey guys, I was playing on my mod pack (1.16.5) and recently got this error when I wanted to enter the game and I don't understand it. I updated the mod thinking that was the problem, but it didn't work either, could someone so nice help me? Thank you --- Minecraft Crash Report ---- // Don't be sad, have a hug! <3 Time: 5/12/23 9:01 Description: Mod loading error has occurred java.lang.Exception: Mod Loading has failed     at net.minecraftforge.fml.CrashReportExtender.dumpModLoadingCrashReport(CrashReportExtender.java:71) [?:?] {re:classloading}     at net.minecraftforge.fml.client.ClientModLoader.completeModLoading(ClientModLoader.java:174) [?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.lambda$null$1(Minecraft.java:508) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft$$Lambda$5349/73334840.run(Unknown Source) [?:?] {}     at net.minecraft.util.Util.func_215077_a(Util.java:430) [?:?] {re:classloading,xf:OptiFine:default}     at net.minecraft.client.Minecraft.lambda$new$2(Minecraft.java:504) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft$$Lambda$5082/1010480754.accept(Unknown Source) [?:?] {}     at net.minecraft.client.gui.ResourceLoadProgressGui.func_230430_a_(ResourceLoadProgressGui.java:172) [?:?] {re:classloading,xf:OptiFine:default}     at net.minecraft.client.renderer.GameRenderer.func_195458_a(GameRenderer.java:802) [?:?] {re:classloading,pl:accesstransformer:B,xf:OptiFine:default}     at net.minecraft.client.Minecraft.func_195542_b(Minecraft.java:977) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:607) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:184) [?:?] {re:classloading,pl:runtimedistcleaner:A}     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] {}     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] {}     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] {}     at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:37) [forge-1.16.5-36.2.39.jar:36.2] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$532/615830852.call(Unknown Source) [forge-1.16.5-36.2.39.jar:36.2] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.1.3.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details:     Minecraft Version: 1.16.5     Minecraft Version ID: 1.16.5     Operating System: Windows 10 (amd64) version 10.0     Java Version: 1.8.0_51, Oracle Corporation     Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation     Memory: 1409376656 bytes (1344 MB) / 2046820352 bytes (1952 MB) up to 2097152000 bytes (2000 MB)     CPUs: 2     JVM Flags: 9 total; -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=16M -Xmx1992m -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -XX:+IgnoreUnrecognizedVMOptions     ModLauncher: 8.1.3+8.1.3+main-8.1.x.c94d18ec     ModLauncher launch target: fmlclient     ModLauncher naming: srg     ModLauncher services:          /mixin-0.8.4.jar mixin PLUGINSERVICE          /eventbus-4.0.0.jar eventbus PLUGINSERVICE          /forge-1.16.5-36.2.39.jar object_holder_definalize PLUGINSERVICE          /forge-1.16.5-36.2.39.jar runtime_enum_extender PLUGINSERVICE          /accesstransformers-3.0.1.jar accesstransformer PLUGINSERVICE          /forge-1.16.5-36.2.39.jar capability_inject_definalize PLUGINSERVICE          /forge-1.16.5-36.2.39.jar runtimedistcleaner PLUGINSERVICE          /mixin-0.8.4.jar mixin TRANSFORMATIONSERVICE          /OptiFine_1.16.5_HD_U_G8.jar OptiFine TRANSFORMATIONSERVICE          /forge-1.16.5-36.2.39.jar fml TRANSFORMATIONSERVICE      FML: 36.2     Forge: net.minecraftforge:36.2.39     FML Language Providers:          javafml@36.2         minecraft@1     Mod List:          forge-1.16.5-36.2.39-client.jar                   |Minecraft                     |minecraft                     |1.16.5              |CREATE_REG|Manifest: NOSIGNATURE         YungsExtras-Forge-1.16.4-1.0.jar                  |YUNG's Extras                 |yungsextras                   |Forge-1.16.4-1.0    |CREATE_REG|Manifest: NOSIGNATURE         YungsApi-1.16.4-Forge-13.jar                      |YUNG's API                    |yungsapi                      |1.16.4-Forge-13     |CREATE_REG|Manifest: NOSIGNATURE         mowziesmobs-1.5.27.jar                            |Mowzie's Mobs                 |mowziesmobs                   |1.5.27              |CREATE_REG|Manifest: NOSIGNATURE         BetterDungeons-1.16.4-1.2.1.jar                   |YUNG's Better Dungeons        |betterdungeons                |1.16.4-1.2.1        |CREATE_REG|Manifest: NOSIGNATURE         BetterStrongholds-1.16.4-1.2.1.jar                |YUNG's Better Strongholds     |betterstrongholds             |1.16.4-1.2.1        |CREATE_REG|Manifest: NOSIGNATURE         sophisticatedbackpacks-1.16.5-3.15.20.755.jar     |Sophisticated Backpacks       |sophisticatedbackpacks        |1.16.5-3.15.20.755  |CREATE_REG|Manifest: NOSIGNATURE         jei-1.16.5-7.8.0.1009.jar                         |Just Enough Items             |jei                           |7.8.0.1009          |CREATE_REG|Manifest: NOSIGNATURE         byg-1.3.6.jar                                     |Oh The Biomes You'll Go       |byg                           |1.3.4               |CREATE_REG|Manifest: NOSIGNATURE         betternether_reforged-1.2.jar                     |Better Nether Reforged        |betternether                  |1.2                 |CREATE_REG|Manifest: NOSIGNATURE         forge-1.16.5-36.2.39-universal.jar                |Forge                         |forge                         |36.2.39             |CREATE_REG|Manifest: 22:af:21:d8:19:82:7f:93:94:fe:2b:ac:b7:e4:41:57:68:39:87:b1:a7:5c:c6:44:f9:25:74:21:14:f5:0d:90         twilightforest-1.16.5-4.0.546-universal.jar       |The Twilight Forest           |twilightforest                |NONE                |CREATE_REG|Manifest: NOSIGNATURE         BetterMineshafts-Forge-1.16.4-2.0.4.jar           |YUNG's Better Mineshafts      |bettermineshafts              |1.16.4-2.0.4        |CREATE_REG|Manifest: NOSIGNATURE         BetterCaves-Forge-1.16.4-1.1.2.jar                |YUNG's Better Caves           |bettercaves                   |1.16.4-1.1.2        |CREATE_REG|Manifest: NOSIGNATURE         geckolib-forge-1.16.5-3.0.106.jar                 |GeckoLib                      |geckolib3                     |3.0.106             |CREATE_REG|Manifest: NOSIGNATURE         DynamicSurroundings-1.16.5-4.0.5.0.jar            |§3Dynamic Surroundings        |dsurround                     |4.0.5.0             |CREATE_REG|Manifest: NOSIGNATURE         journeymap-1.16.5-5.8.3.jar                       |Journeymap                    |journeymap                    |5.8.3               |CREATE_REG|Manifest: NOSIGNATURE         DungeonsArise-1.16.5-2.1.49-beta.jar              |When Dungeons Arise           |dungeons_arise                |2.1.49              |CREATE_REG|Manifest: NOSIGNATURE         citadel-1.8.1-1.16.5.jar                          |Citadel                       |citadel                       |1.8.1               |CREATE_REG|Manifest: NOSIGNATURE         untamedwilds-1.16.5-1.5.8.jar                     |Untamed Wilds                 |untamedwilds                  |1.5.8               |ERROR     |Manifest: NOSIGNATURE         iceandfire-2.1.12-1.16.5-patch-1.jar              |Ice and Fire                  |iceandfire                    |2.1.12-1.16.5-patch-|CREATE_REG|Manifest: NOSIGNATURE     Crash Report UUID: 5cfb2f17-4508-427f-9ef7-055c47f08891     OptiFine Version: OptiFine_1.16.5_HD_U_G8     OptiFine Build: 20210515-161946     Render Distance Chunks: 8     Mipmaps: 4     Anisotropic Filtering: 1     Antialiasing: 0     Multitexture: false     Shaders: null     OpenGlVersion: 4.0.0 - Build 10.18.10.4358     OpenGlRenderer: Intel(R) HD Graphics     OpenGlVendor: Intel     CpuCount: 2
    • idk how to reply here but no im not coding any mod, all of them are downloaded but its only gfs computer, on mine its ok and i was looking all around the internet and never seen anything similiar atleast  
    • I changed it to public static void but I can't find anyway to get level from the event even if it isn't a listener parameter. @JimiIT92
    • I didn't yet see this happening on 1.20.2 forge, but sadly, I noticed that my mod is incompatible with this version because of this event handler: @SubscribeEvent public static void onPlayerRightClickItem(PlayerInteractEvent.RightClickItem e) { if (e.getItemStack().getItem() instanceof EggItem) { List<ThrownEgg> eggs = e.getLevel().getEntitiesOfClass(ThrownEgg.class, new AABB(e.getEntity().blockPosition().immutable() .below(5) .north(5) .west(5), e.getEntity().blockPosition().immutable() .above(10) .south(5) .east(5))); if (!eggs.isEmpty()) { eggs.forEach(ThrownEgg::discard); if (!e.getEntity().getAbilities().instabuild) e.getItemStack().grow(1); } if (!e.getEntity().level().isClientSide) { ((ServerPlayer) e.getEntity()).connection.send( new ClientboundStopSoundPacket(SoundEvents.EGG_THROW.getLocation(), SoundSource.PLAYERS)); // Minecraft Forge 1.20.2 crashes because of NoSuchMethodError here } e.setCancellationResult(InteractionResult.SUCCESS); e.setCanceled(true); } }  
    • It might just be a misleading log, if you run the command while debugging what's the outcome?  I've tried checking the item inside the RightClickBlock event and it works just fine private static final Ingredient FOOD_ITEMS = Ingredient.of(Items.WHEAT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.BEETROOT_SEEDS, Items.TORCHFLOWER_SEEDS, Items.PITCHER_POD); @SubscribeEvent public static void onRightClickBlock(final PlayerInteractEvent.RightClickBlock event) { final ItemStack itemStack = event.getItemStack(); LOGGER.info(FOOD_ITEMS.test(itemStack) + ""); } When I right click a block with an Item it checks if is one of the ingredients of FOOD_ITEMS. Clicking with an empty hand (air) logs false, as expected. Tip: please use the "spoiler" tags for long code snippets and don't merge all your classes into one code snippet EDIT: just noticed you are on 1.20.1. Maybe is just a bug with the Forge version? Try update to the latest Forge 1.20.2 and see if it still occurs
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.