Coder Social home page Coder Social logo

srg2source's Introduction

Forge Logo

MinecraftForge

Stable Release Latest Release Discord Support

Forge is a free, open-source modding API all of your favourite mods use!

Version Support
1.20.x Active
1.19.x Legacy

Installing Forge

Go to the Forge website and select the Minecraft version you wish to get Forge for from the list.

You can download the installer for the Recommended Build or the Latest build there. Latest builds may have newer features but may be more unstable as a result. The installer will attempt to install Forge into your vanilla launcher environment, where you can then create a new profile using that version and play the game!

For support and questions, visit the Support Forum or the Forge Discord server.

Creating Mods

See the "Getting Started" section in the Forge Documentation.

Contribute to Forge

If you wish to actually inspect Forge, submit PRs or otherwise work with Forge itself, you're in the right place!

See the guide to setting up a Forge workspace.

Pull requests

See the "Making Changes and Pull Requests" section in the Forge documentation.

Please read the contributing guidelines found here before making a pull request.

Contributor License Agreement

We require all contributors to acknowledge the Forge Contributor License Agreement. Please ensure you have a valid email address associated with your GitHub account to do this. If you have previously signed it, you should be OK.

Donate

Forge is a large project with many collaborators working on it around the clock. Forge is and will always remain free to use and modify. However, it costs money to run such a large project as this, so please consider becoming a patron.

srg2source's People

Contributors

abrarsyed avatar agaricusb avatar boq avatar coehlrich avatar cpw avatar ichttt avatar jdlogic avatar lexmanos avatar marchermans avatar mezz avatar sciwhiz12 avatar sizableshrimp avatar stephan-gh avatar thecurle avatar thewituch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

srg2source's Issues

Remapping hangs

I posted this issues at the ForgeGradle repo MinecraftForge/ForgeGradle#385

And they found out that it is this part of the process that makes problems.

Please check out the linked issue for possible information and if you need anything else, just ask.

No documentation on how to use this.

I can't find any documentation on how to use Srg2Source. Can you please maybe update the readme fill to say how to use this version that does not use python?

Crash during extractRangemapReplacedMain

I get the following error when trying to gradle build:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
full gradle.log

Tracing things down, it looked similar to issue #14 so I looked into the logs to see where it was crashing.
From the end of extractRangemapReplacedMain.log:

startProcessing "binnie\genetics\machine\indexer\ComponentApiaristIndexerInventory.java" md5: ff3f411669dde25aff450713b4898ee0
    Compile Error! Pb(883) '<>' operator is not allowed for source level below 1.7
    Compile Error! Pb(883) '<>' operator is not allowed for source level below 1.7
    Compile Error! Pb(883) '<>' operator is not allowed for source level below 1.7
    Compile Error! Pb(883) '<>' operator is not allowed for source level below 1.7
    Compile Error! Pb(883) '<>' operator is not allowed for source level below 1.7
    Compile Error! Pb(883) '<>' operator is not allowed for source level below 1.7

That file looks like this on my machine: ComponentApiaristIndexerInventory.java

This seems to be caused by the unusual SpeciesList class defined in the switch statement. I moved this class out so that it is a public static class and the build worked.

System.exit called when file declares private class inside method

When file contains this (rare, but correct) construct, Srg2Source calls System.exit(1) (from this code), killing Gradle worker without any stacktrace. This also causes logs to be cut short, making debugging difficult.

Reproducible case: https://gist.github.com/boq/e55ea64ca9e9ba06fc56f5824b2de1ee

Stacktrace - captured by replacing security manager.

Example triggering line (source code for this class)

@|openmods\calc\parsing\BasicCompilerMapFactory.java|6486|6508|ConstantEvaluatorState|method||ConstantEvaluatorState|()V

EDIT: derp, duplicate of #14.

Nullpointer

From a user in the ForgeGradle IRC channel:

Project: https://git.gildedgames.com/GildedGames/Aether-1.8
Full Stacktrace: https://gist.github.com/matthewprenger/a4b4d4c5ddc2451bd914
Relevant bits:

java.lang.NullPointerException
    at org.eclipse.jdt.core.dom.ASTParser.getClasspath(ASTParser.java:251)
    at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1184)
    at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:807)
    at net.minecraftforge.srg2source.util.Util.createUnit(Util.java:350)
    at net.minecraftforge.srg2source.ast.RangeExtractor.generateRangeMap(RangeExtractor.java:138)
    at net.minecraftforge.srg2source.ast.RangeExtractor.generateRangeMap(RangeExtractor.java:88)
    at net.minecraftforge.gradle.tasks.ExtractS2SRangeTask.generateRangeMap(ExtractS2SRangeTask.java:100)

Record Conical Constructors throw exception while extracting.

> Task :forge:extractRangeMap
# ERROR: net/minecraft/world/ticks/ScheduledTick.java @ 1846: Illegal Argument: Lnet/minecraft/world/ticks/net\minecraft\world\ticks\ScheduledTick~ScheduledTick;.(TT;Lnet/minecraft/core/BlockPos;JLnet/minecraft/world/ticks/TickPriority;J)V#pos#0#1
java.lang.IllegalStateException: ERROR: net/minecraft/world/ticks/ScheduledTick.java @ 1846: Illegal Argument: Lnet/minecraft/world/ticks/net\minecraft\world\ticks\ScheduledTick~ScheduledTick;.(TT;Lnet/minecraft/core/BlockPos;JLnet/minecraft/world/ticks/TickPriority;J)V#pos#0#1
        at net.minecraftforge.srg2source.extract.SymbolReferenceWalker.error(SymbolReferenceWalker.java:156)
        at net.minecraftforge.srg2source.extract.SymbolReferenceWalker.process(SymbolReferenceWalker.java:425)
        at net.minecraftforge.srg2source.extract.SymbolReferenceWalker$1.visit(SymbolReferenceWalker.java:753)
        at org.eclipse.jdt.core.dom.SimpleName.accept0(SimpleName.java:198)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3129)
        at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:3177)
        at org.eclipse.jdt.core.dom.Assignment.accept0(Assignment.java:302)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3129)
        at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:3177)
        at org.eclipse.jdt.core.dom.ExpressionStatement.accept0(ExpressionStatement.java:136)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3129)
        at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:3200)
        at org.eclipse.jdt.core.dom.Block.accept0(Block.java:128)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3129)
        at net.minecraftforge.srg2source.extract.SymbolReferenceWalker.acceptChild(SymbolReferenceWalker.java:93)
        at net.minecraftforge.srg2source.extract.SymbolReferenceWalker.process(SymbolReferenceWalker.java:372)
        at net.minecraftforge.srg2source.extract.SymbolReferenceWalker$1.visit(SymbolReferenceWalker.java:725)
        at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:653)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3129)
        at net.minecraftforge.srg2source.extract.SymbolReferenceWalker.acceptChild(SymbolReferenceWalker.java:93)
        at net.minecraftforge.srg2source.extract.SymbolReferenceWalker.acceptChildren(SymbolReferenceWalker.java:101)
        at net.minecraftforge.srg2source.extract.SymbolReferenceWalker.process(SymbolReferenceWalker.java:266)
        at net.minecraftforge.srg2source.extract.SymbolReferenceWalker$1.visit(SymbolReferenceWalker.java:751)
        at org.eclipse.jdt.core.dom.RecordDeclaration.accept0(RecordDeclaration.java:303)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3129)
        at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:3200)
        at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:258)
        at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3129)
        at net.minecraftforge.srg2source.extract.SymbolReferenceWalker.safeWalk(SymbolReferenceWalker.java:81)
        at net.minecraftforge.srg2source.extract.RangeExtractor$1.acceptAST(RangeExtractor.java:234)
        at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:1065)
        at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:661)
        at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:1049)
        at net.minecraftforge.srg2source.extract.RangeExtractor.batchGenerate(RangeExtractor.java:250)
        at net.minecraftforge.srg2source.extract.RangeExtractor.run(RangeExtractor.java:149)
        at net.minecraftforge.srg2source.RangeExtractMain.main(RangeExtractMain.java:116)
        at net.minecraftforge.srg2source.ConsoleTool$Redefined.main(ConsoleTool.java:115)
        at net.minecraftforge.srg2source.ConsoleTool.main(ConsoleTool.java:48)

Doesn't handle remapping lambdas or method refs

ForgeGradle uses Srg2Source to create srg named source jars, and later remap those jars to the target mcp snapshot version. Method refs and lambdas aren't getting remapped with the rest of the methods/fields.

unicode charactor issue

before apply:

public enum BagEquipPart {
    BAG_I("魂器位: I"), //`
    BAG_II("魂器位: II"), //
    BAG_III("魂器位: III"), //
    BAG_IV("魂器位: IV"), //
    BAG_V("魂器位: V"), //
    BAG_VI("魂器位: VI"), //
    BAG_VII("魂器位: VII"), //
    BAG_VIII("魂器位: VIII"), //
    BAG_IX("魂器位: IX"); //
}

after apply:

public enum BagEquipPart {
    BAG_I("魂器�\ufffd: I"),  //
    BAG_II("魂器�\ufffd: II"),  //
    BAG_III("魂器�\ufffd: III"),  //
    BAG_IV("魂器�\ufffd: IV"),  //
    BAG_V("魂器�\ufffd: V"),  //
    BAG_VI("魂器�\ufffd: VI"),  //
    BAG_VII("魂器�\ufffd: VII"),  //
    BAG_VIII("魂器�\ufffd: VIII"),  //
    BAG_IX("魂器�\ufffd: IX");
}

Null method binding exception on processing my code

https://pastebin.com/TCwf14RT

Steps to reproduce:
clone https://github.com/cabaletta/baritone
./gradlew setupDecompWorkspace
./gradlew build

The two functions in question are here
https://github.com/cabaletta/baritone/blob/master/src/main/java/baritone/cache/WaypointCollection.java#L63

and here
https://github.com/cabaletta/baritone/blob/master/src/main/java/baritone/cache/WaypointCollection.java#L93

The exception is created here at net.minecraftforge.srg2source.ast.SymbolRangeEmitter.getMethodSignature(SymbolRangeEmitter.java:235)

Remapping failes because of missing localisation.

I am running a win 10 (1903) and the system lang is german. I tried to update the mapping of a 1.12 project (to 1.13 mappings). But it did not change any file so I checked the logs (by running it froim cmd)

Version: 0.1 (fatjar)

Error:

Missing resource : org/eclipse/jdt/internal/compiler/batch/messages.properties for locale de_DE
java.util.MissingResourceException: Can't find bundle for base name org.eclipse.jdt.internal.compiler.batch.messages, locale de_DE
        at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
        at java.util.ResourceBundle.getBundleImpl(Unknown Source)
        at java.util.ResourceBundle.getBundle(Unknown Source)
        at org.eclipse.jdt.internal.compiler.batch.Main$ResourceBundleFactory.getBundle(Main.java:1294)
        at org.eclipse.jdt.internal.compiler.batch.Main.relocalize(Main.java:4556)
        at org.eclipse.jdt.internal.compiler.batch.Main.relocalize(Main.java:4550)
        at org.eclipse.jdt.internal.compiler.batch.Main.<init>(Main.java:1499)
        at org.eclipse.jdt.core.dom.ASTParser.getClasspath(ASTParser.java:238)
        at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1193)
        at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:812)
        at net.minecraftforge.srg2source.util.Util.createUnit(Util.java:361)
        at net.minecraftforge.srg2source.ast.RangeExtractor.generateRangeMap(RangeExtractor.java:165)
        at net.minecraftforge.remapper.RemapperTask.extractRange(RemapperTask.java:128)
        at net.minecraftforge.remapper.RemapperTask.runRemapMod_Thread(RemapperTask.java:46)
        at net.minecraftforge.remapper.RemapperTask$1.run(RemapperTask.java:39)
        at java.lang.Thread.run(Unknown Source)

Also log is full of these:

Warning: NLS missing message: WM_errors in: org.eclipse.core.internal.utils.messages
Warning: NLS missing message: WM_jobName in: org.eclipse.core.internal.utils.messages
Warning: NLS missing message: WM_nativeErr in: org.eclipse.core.internal.utils.messages

New lines at end of file

New lines are added at the end of files when the original had none.
Not major issue, but should be a simple fix.

StringIndexOutOfBoundsException from RangeApplier.updateImports

Forestry for Minecraft 1.9.4 will not build with gradle due to this error.

Here is the gradle log
--stacktrace: https://gist.github.com/mezz/882ce4c023d8b6fbbe99fcb66d03ac71
--stacktrace --info: https://gist.github.com/mezz/973ff1d26cf00ee45d4ceb20cc8d3601
--stacktrace --debug: https://gist.github.com/mezz/e02199d79a7e573fde8eb3788d846435

It boils down to

Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -280
    at net.minecraftforge.srg2source.rangeapplier.RangeApplier.updateImports(RangeApplier.java:423)

ApplyRangeMap is stripping the last newline.

I've been having an issue with forgegradle where ./gradlew genPatches will add +\ No newline at end of file in the middle of every .patch file. (Specifically, the last diff hunk of every patch file).

image

After running ./gradlew genPatches, the files in /forge/build/applyRangeMapBase/output.zip are all missing new lines at the end of the file, when the originals in /clean/build/applyPatches/output.zip all have newline characters at the end.
image

ForgeGradle uses diff4j to generate patch files. When diff4j encounters no newline at the last diff hunk it encounters, it will add +\ No newline at end of file, and then print the bottom context lines. If the last hunk isn't at the end of the file, it will cause the no newline comment to appear in the middle of the patch file.

https://github.com/cloudbees/diff4j/blob/87d621ea70bc8d014d8da11f78b4293142fa8099/src/main/java/com/cloudbees/diff/UnifiedDiff.java#L142-L166

I'd normally submit a PR to fix the issue, but I am unable to build Srg2Source, so I'm unable to debug the issue any further.

My operating system is Ubuntu 18.04.5 LTS

Possibly relates to #34?

Static imports

Static imports are not properly remapped.
The referenced method/fields in code are remapped, but the import itself isnt.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.