Coder Social home page Coder Social logo

minecraftforge / installertools Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 10.0 317 KB

A collection of command line tools that are useful for the Forge installer, that are not worth being their own standalone projects.

License: GNU Lesser General Public License v2.1

Java 100.00%

installertools'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.

installertools's People

Contributors

daemonumbra avatar lexmanos avatar marchermans avatar sizableshrimp avatar thesilkminer avatar

Stargazers

 avatar  avatar  avatar

Watchers

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

installertools's Issues

SrgToMcpRenamer uses hardcoded path for nested jars

The Issue

Currently, only nested jars under the META-INF/jarjar/ directory are deobfuscated by SrgToMcpRenamer.

processors.add(new ZipEntryProcessor(ein -> ein.getName().startsWith("META-INF/jarjar/") && ein.getName().endsWith(".jar"),

While this is the most common folder for nested jars, JarJar metadata defines nested jar paths as paths relative to the outer jar's root, and therefore nested jars can be located anywhere in the jar. This breaks mods that place their nested jars in other paths than the mentioned folder.

Expected behavior

SrgToMcpRenamer is able to deobfuscate any nested jars regardless of their location, as specified by JarJar metadata. Rather than assuming all nested jars are in the META-INF/jarjar/ directory, we should open the jar's JarJar metadata file and read nested jar paths from it.

SrgMcpRenamer may throw "ZipException: invalid entry compressed size"

In SrgMcpRenamer, it is possible for the last case in the zip copying function to throw a ZipException: invalid entry compressed size:

zout.putNextEntry(ein);
Utils.copy(zin, zout);

The stack trace might look like this, which is what I get when I try to use the dependency curse.maven:tinkers-tool-leveling-250957:2630860:

Exception in thread "main" java.util.zip.ZipException: invalid entry compressed size (expected 256 but got 257 bytes)
	at java.util.zip.ZipOutputStream.closeEntry(ZipOutputStream.java:267)
	at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:192)
	at net.minecraftforge.installertools.SrgMcpRenamer.process(SrgMcpRenamer.java:155)
	at net.minecraftforge.installertools.ConsoleTool.main(ConsoleTool.java:55)
	Suppressed: java.util.zip.ZipException: invalid entry compressed size (expected 256 but got 257 bytes)
		at java.util.zip.ZipOutputStream.closeEntry(ZipOutputStream.java:267)
		at java.util.zip.ZipOutputStream.finish(ZipOutputStream.java:360)
		at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:238)
		at java.util.zip.ZipOutputStream.close(ZipOutputStream.java:377)
		at net.minecraftforge.installertools.SrgMcpRenamer.process(SrgMcpRenamer.java:159)
		... 1 more

This happens because it's possible for slight discrepancies to arise between the compressed size of a file in the original archive and the mapped one, but since the code just straight up copies over the exact same ZipEntry instance, the discrepancy is noticed by ZipOutputStream, which assumes it's an error and raises this exception. A fix might be simply to create a new ZipEntry (as is done in the other cases) and to populate all the fields manually, so the new compressed size is computed automatically.

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.