Skip to content

Instantly share code, notes, and snippets.

View matthewprenger's full-sized avatar

Matthew Prenger matthewprenger

  • Missouri
  • 23:18 (UTC -06:00)
View GitHub Profile

Keybase proof

I hereby claim:

  • I am matthewprenger on github.
  • I am matthewprenger ( on keybase.
  • I have a public key ASCKOpzZUsvczpTYTLKsLUyDG9srEJau7rGKFwlNlgGLago

To claim this, I am signing this object:

matthewprenger / fg_j8_j9.diff
Created September 22, 2017 01:51
Diff between Minecraft decompiled with ForgeGradle on Java 8 vs Java 9
View fg_j8_j9.diff
diff -Naur forge_j8/build/tmp/decompileJar/net/minecraft/advancements/ forge_j9/build/tmp/decompileJar/net/minecraft/advancements/
--- forge_j8/build/tmp/decompileJar/net/minecraft/advancements/ 2017-09-21 20:37:00.000000000 -0500
+++ forge_j9/build/tmp/decompileJar/net/minecraft/advancements/ 2017-09-21 20:39:04.000000000 -0500
@@ -148,7 +148,7 @@
if (this.field_192061_a == null) {
return true;
} else {
- this.field_192062_b = p_192058_1_.apply(this.field_192061_a);
+ this.field_192062_b = (Advancement)p_192058_1_.apply(this.field_192061_a);
return this.field_192062_b != null;
View 1.10.2-srg-usage.txt
Reading 200 jars
Total 2434 fields used
Total 3826 methods used
| Srg | Mapped (null == unmapped) | Usages |
| field_150350_a | AIR | 14088 |
| field_77994_a | stackSize | 9572 |
matthewprenger / 01-mapping_update_instructions.txt
Last active December 18, 2019 16:16
Place the new methods.csv and fields.csv in the root of your project (TEMPORARILY, Don't commit these to git!) and add this to the end of your build.gradle and run 'gradle updateMappings`. Updated sources will be placed in src_remapped/main/java. You should do a diff to ensure that they are correct and then replace src/main/java with them.
View 01-mapping_update_instructions.txt
Important note: Your code must compile on the old mappings, and the obfSourceJar must be enabled (it is by default)
1. Download a copy of the new methods.csv and fields.csv from to the root of your project.
2. Add the following gradle script to your build.gradle.
3. Run 'gradle(w) updateMappings'.
4. Do a diff between src/main/java/ and src_remapped/main/java/ to make sure everything looks right.
5. replace src/main/java/* with src_remapped/main/java/*
matthewprenger /
Last active April 21, 2022 20:53
A simple tutorial on setting up jar signing with ForgeGradle 2

Signing Your Jar

Signing your jar can help you and your users verify that the jar they have is an authentic jar created by you. This will help a lot, but is not 100% effective. If someone really wants to get around it, they can.

Creating a keystore

Let's start off by creating a new keystore. A keystore is the private database file that holds the information needed to sign a jar. This command requires a correctly setup Java Development Kit.

keytool -genkey -alias Matthew -keyalg RSA -keysize 2048 -keystore keystore.jks
matthewprenger / changelog-auth.gradle
Last active July 5, 2016 11:12
Jenkins Gradle Changelog Init Script, place this in ~/.gradle/init.d/changelog.gradle on your Jenkins server. Projects can simply call 'project.changelog' to get the changes for the current build.
View changelog-auth.gradle
def buildUrl = System.getenv().BUILD_URL
if (buildUrl != null) {
def auth = "<USER>:<APITOKEN>".getBytes().encodeBase64().toString()
def url = new URL("$buildUrl/api/xml?depth=20").openConnection()
url.setRequestProperty("Authorization", "Basic " + auth)
String data = url.getInputStream().text
def changelog = ""
matthewprenger / build.gradle
Last active June 18, 2022 18:01
CoFH CurseForge Dependencies
View build.gradle
// The URL for each mod often changes based on the version you want.
// To find the correct URL, download the (DEOBFUSCATED!) mod from CurseForge,
// and look in your browser's download history to find the URL it came from.
// Use the numbers from that in place of the ones below
repositories {
ivy {
name "CoFHLib"
artifactPattern "[module]-[revision].[ext]"