Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Help with mod decompiling and BON2 mappings
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
Ciomatx

Help with mod decompiling and BON2 mappings

By Ciomatx, November 27, 2020 in Modder Support

  • Start new topic

Recommended Posts

Ciomatx    0

Ciomatx

Ciomatx    0

  • Tree Puncher
  • Ciomatx
  • Members
  • 0
  • 2 posts
Posted November 27, 2020 (edited)

Hi everyone,

I'm trying to decompile a mod (Not Enough Roofs) for 1.12.2, to do that I used BON2 first to deobfuscate and BytecodeViewer (using fernflower, / CFR) to decompile it. Sadly I'm facing issues when I try to build it, the code seems to have a lot of method errors like:

cannot find symbol
      this.setTranslationKey(unlocalizedName);
          ^
  symbol: method setTranslationKey(String)

 

and if I get rid of these by replacing setTranslationKey with setUnlocalizedName, the build occurs well but minecraft crash when loading the mod, here's the crash-report:

java.lang.ClassCastException: notenoughroofs.items.BasicItem cannot be cast to net.minecraft.block.Block
	at net.minecraftforge.registries.GameData$BlockCallbacks.onAdd(GameData.java:284)
	at net.minecraftforge.registries.ForgeRegistry.add(ForgeRegistry.java:338)
	at net.minecraftforge.registries.ForgeRegistry.add(ForgeRegistry.java:269)
	at net.minecraftforge.registries.ForgeRegistry.register(ForgeRegistry.java:113)
	at net.minecraftforge.registries.ForgeRegistry.registerAll(ForgeRegistry.java:154)
	at notenoughroofs.items.ModItems.register(ModItems.java:27)
	at notenoughroofs.NotEnoughRoofs$RegistrationHandler.registerItems(NotEnoughRoofs.java:65)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_7_RegistrationHandler_registerItems_Register.invoke(.dynamic)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
	at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:143)
	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179)
	at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:736)
	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:603)
	at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:270)
	at net.minecraft.client.Minecraft.init(Minecraft.java:513)
	at net.minecraft.client.Minecraft.run(Minecraft.java:421)
	at net.minecraft.client.main.Main.main(Main.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	at GradleStart.main(GradleStart.java:25)

 

I think it's a mapping problem, but in BON2 i can't find the 1.12.2 mappings, I used the 1.12 ones and I think that's the main problem.

What can I do about that? Are 1.12 and 1.12.2 mapping the same?

 

 

Thanks for considering my request :)

 

PS: I attached a BON2 screenshot with the mappings list.

mappings.PNG

Edited November 27, 2020 by Ciomatx

Share this post


Link to post
Share on other sites

DaemonUmbra    528

DaemonUmbra

DaemonUmbra    528

  • Reality Controller
  • DaemonUmbra
  • Forum Team
  • 528
  • 10107 posts
Posted November 27, 2020

Do you have permission from the author to do this?


This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

Spoiler

Logs (Most issues require logs to diagnose):

Spoiler

Please post logs using one of the following sites (Thank you Lumber Wizard for the list):

https://gist.github.com/: 100MB Requires member (Free)

https://paste.gg/: 15MB

https://pastebin.com/: 512KB as guest, 10MB as Pro ($$$)

https://hastebin.com/: 400KB

Do NOT use sites like Mediafire, Dropbox, OneDrive, Google Drive, or a site that has a countdown before offering downloads.

 

What to provide:

...for Crashes and Runtime issues:

Minecraft 1.14.4 and newer:

Post debug.log

Older versions:

Please update...

 

...for Installer Issues:

Post your installer log, found in the same place you ran the installer

This log will be called either installer.log or named the same as the installer but with .log on the end

Note for Windows users:

Windows hides file extensions by default so the installer may appear without the .jar extension then when the .log is added the log will appear with the .jar extension

 

Where to get it:

Mojang Launcher: When using the Mojang launcher debug.log is found in .minecraft\logs.

 

Twitch Launcher: If you are using the Twitch Launcher, their configurations break Forge's log settings, fortunately there is an easier workaround than I originally thought, this works even with Twitch's installation of the Minecraft launcher as long as it is not launched THROUGH Twitch:

Spoiler
  1. Make sure you have the correct version of Forge installed (some packs are heavily dependent on one specific build of Forge)
  2. Make a launcher profile targeting this version of Forge.
  3. Set the launcher profile's GameDir property to the pack's instance folder (not the instances folder, the folder that has the pack's name on it).
  4. Now launch the pack through that profile and follow the "Mojang Launcher" instructions above.

Video:

Spoiler

 

 

 

or alternately, 

 

Fallback ("No logs are generated"):

If you don't see logs generated in the usual place, provide the launcher_log.txt from .minecraft

 

Server Not Starting:

Spoiler

If your server does not start or a command window appears and immediately goes away, run the jar manually and provide the output.

 

Reporting Illegal/Inappropriate Adfocus Ads:

Spoiler

Get a screenshot of the URL bar or copy/paste the whole URL into a thread on the General Discussion board with a description of the Ad.

Lex will need the Ad ID contained in that URL to report it to Adfocus' support team.

 

Posting your mod as a GitHub Repo:

Spoiler

When you have an issue with your mod the most helpful thing you can do when asking for help is to provide your code to those helping you. The most convenient way to do this is via GitHub or another source control hub.

When setting up a GitHub Repo it might seem easy to just upload everything, however this method has the potential for mistakes that could lead to trouble later on, it is recommended to use a Git client or to get comfortable with the Git command line. The following instructions will use the Git Command Line and as such they assume you already have it installed and that you have created a repository.

 

  1. Open a command prompt (CMD, Powershell, Terminal, etc).
  2. Navigate to the folder you extracted Forge’s MDK to (the one that had all the licenses in).
  3. Run the following commands:
    1. git init
    2. git remote add origin [Your Repository's URL]
      • In the case of GitHub it should look like: https://GitHub.com/[Your Username]/[Repo Name].git
    3. git fetch
    4. git checkout --track origin/master
    5. git stage *
    6. git commit -m "[Your commit message]"
    7. git push
  4. Navigate to GitHub and you should now see most of the files.
    • note that it is intentional that some are not synced with GitHub and this is done with the (hidden) .gitignore file that Forge’s MDK has provided (hence the strictness on which folder git init is run from)
  5. Now you can share your GitHub link with those who you are asking for help.

[Workaround line, please ignore]

 

Share this post


Link to post
Share on other sites

Ciomatx    0

Ciomatx

Ciomatx    0

  • Tree Puncher
  • Ciomatx
  • Members
  • 0
  • 2 posts
Posted November 27, 2020
12 hours ago, DaemonUmbra said:

Do you have permission from the author to do this?

From what I've seen on the curseforge website, It's under MIT Licence, so I think I can

The MIT License Copyright (c) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

 

I also tried to get in touch with the mod author, and I didn't receive any answers yet.

By the way, if the author don't want me to use/modify his code, I will ofc respect his wishes! 

 

Thank you for your prompt reply though :)

Share this post


Link to post
Share on other sites

DaemonUmbra    528

DaemonUmbra

DaemonUmbra    528

  • Reality Controller
  • DaemonUmbra
  • Forum Team
  • 528
  • 10107 posts
Posted November 27, 2020

I should have brought this up first...

We don't support 1.12 anymore, if you want support you'll need to update to a modern version of Minecraft.


This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

Spoiler

Logs (Most issues require logs to diagnose):

Spoiler

Please post logs using one of the following sites (Thank you Lumber Wizard for the list):

https://gist.github.com/: 100MB Requires member (Free)

https://paste.gg/: 15MB

https://pastebin.com/: 512KB as guest, 10MB as Pro ($$$)

https://hastebin.com/: 400KB

Do NOT use sites like Mediafire, Dropbox, OneDrive, Google Drive, or a site that has a countdown before offering downloads.

 

What to provide:

...for Crashes and Runtime issues:

Minecraft 1.14.4 and newer:

Post debug.log

Older versions:

Please update...

 

...for Installer Issues:

Post your installer log, found in the same place you ran the installer

This log will be called either installer.log or named the same as the installer but with .log on the end

Note for Windows users:

Windows hides file extensions by default so the installer may appear without the .jar extension then when the .log is added the log will appear with the .jar extension

 

Where to get it:

Mojang Launcher: When using the Mojang launcher debug.log is found in .minecraft\logs.

 

Twitch Launcher: If you are using the Twitch Launcher, their configurations break Forge's log settings, fortunately there is an easier workaround than I originally thought, this works even with Twitch's installation of the Minecraft launcher as long as it is not launched THROUGH Twitch:

Spoiler
  1. Make sure you have the correct version of Forge installed (some packs are heavily dependent on one specific build of Forge)
  2. Make a launcher profile targeting this version of Forge.
  3. Set the launcher profile's GameDir property to the pack's instance folder (not the instances folder, the folder that has the pack's name on it).
  4. Now launch the pack through that profile and follow the "Mojang Launcher" instructions above.

Video:

Spoiler

 

 

 

or alternately, 

 

Fallback ("No logs are generated"):

If you don't see logs generated in the usual place, provide the launcher_log.txt from .minecraft

 

Server Not Starting:

Spoiler

If your server does not start or a command window appears and immediately goes away, run the jar manually and provide the output.

 

Reporting Illegal/Inappropriate Adfocus Ads:

Spoiler

Get a screenshot of the URL bar or copy/paste the whole URL into a thread on the General Discussion board with a description of the Ad.

Lex will need the Ad ID contained in that URL to report it to Adfocus' support team.

 

Posting your mod as a GitHub Repo:

Spoiler

When you have an issue with your mod the most helpful thing you can do when asking for help is to provide your code to those helping you. The most convenient way to do this is via GitHub or another source control hub.

When setting up a GitHub Repo it might seem easy to just upload everything, however this method has the potential for mistakes that could lead to trouble later on, it is recommended to use a Git client or to get comfortable with the Git command line. The following instructions will use the Git Command Line and as such they assume you already have it installed and that you have created a repository.

 

  1. Open a command prompt (CMD, Powershell, Terminal, etc).
  2. Navigate to the folder you extracted Forge’s MDK to (the one that had all the licenses in).
  3. Run the following commands:
    1. git init
    2. git remote add origin [Your Repository's URL]
      • In the case of GitHub it should look like: https://GitHub.com/[Your Username]/[Repo Name].git
    3. git fetch
    4. git checkout --track origin/master
    5. git stage *
    6. git commit -m "[Your commit message]"
    7. git push
  4. Navigate to GitHub and you should now see most of the files.
    • note that it is intentional that some are not synced with GitHub and this is done with the (hidden) .gitignore file that Forge’s MDK has provided (hence the strictness on which folder git init is run from)
  5. Now you can share your GitHub link with those who you are asking for help.

[Workaround line, please ignore]

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      Minecraft modpack when loading world and it crash in 1.16.4

      By diesieben07 · Posted just now

      You can use https://gist.github.com/ for large text files.
    • diesieben07
      [1.15.2] Display text in the upper right

      By diesieben07 · Posted 1 minute ago

      The drawText you posted is not even valid Java...
    • Firstzcz
      Minecraft modpack when loading world and it crash in 1.16.4

      By Firstzcz · Posted 2 minutes ago

      It too large file  
    • diesieben07
      Minecraft modpack when loading world and it crash in 1.16.4

      By diesieben07 · Posted 3 minutes ago

      What?
    • Klarks
      [1.16.4] How i can put my strucnures in to FlatGenerationSettings.STRUCTURES

      By Klarks · Posted 6 minutes ago

      Is STRUCTURES a mapped name? forge-bot gave me this  MC 1.16.3: net/minecraft/world/gen/FlatGenerationSettings.STRUCTURES Name: c => field_202247_j => STRUCTURES Comment: None Side: BOTH AT: public net.minecraft.world.gen.FlatGenerationSettings field_202247_j # STRUCTURES
  • Topics

    • Firstzcz
      7
      Minecraft modpack when loading world and it crash in 1.16.4

      By Firstzcz
      Started 35 minutes ago

    • Peyang
      3
      [1.15.2] Display text in the upper right

      By Peyang
      Started 34 minutes ago

    • Klarks
      8
      [1.16.4] How i can put my strucnures in to FlatGenerationSettings.STRUCTURES

      By Klarks
      Started 15 hours ago

    • Av3ng3r5
      1
      Getting The EntityPlayer List

      By Av3ng3r5
      Started 28 minutes ago

    • Gina5064
      6
      Forge is a "blank file" after installing

      By Gina5064
      Started 1 hour ago

  • Who's Online (See full list)

    • diesieben07
    • Peyang
    • Firstzcz
    • basicsid
    • Th1Minecraft
    • Godis_apan
    • Klarks
    • Dragrise96
    • squidlex
    • Trigonaut
    • Angercraft
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Help with mod decompiling and BON2 mappings
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community