Skip to content

Instantly share code, notes, and snippets.

View williewillus's full-sized avatar

Vincent Lee williewillus

View GitHub Profile
@williewillus
williewillus / primer.md
Last active April 22, 2024 15:29
1.13/1.14 update primer

This primer is licensed under CC0, do whatever you want.

BUT do note that this can be updated, so leave a link here so readers can see the updated information themselves.

1.13 and 1.14 are lumped together in this doc, you're on your own if you just want to go to 1.13 and not 1.14, for some reason.

1.15 stuff: https://gist.github.com/williewillus/30d7e3f775fe93c503bddf054ef3f93e

Things in Advance

  • ResourceLocation now throw on non-snake-case names instead of silently lowercasing for you, so you probably should go and change all those string constants now. More precisely, domains must only contain alphanumeric lowercase, underscore (_), dash (-), or dot (.). Paths have the same restrictions, but can also contain forward slashes (/).
@williewillus
williewillus / grammar.js
Last active January 13, 2024 20:09
ProjectE Custom Conversion JSON Grammar
NOTE: For 1.20.4 and above, see the new grammar: https://gist.github.com/pupnewfster/7b5c411635e16227c1dea9af5e20e4c3
{
"comment": <Optional comment describing the file>,
"groups": {
"<name>": <group>, ...
},
"values": {
"before": <valuemap>,
LoadTexture('bullet1', 'THlib\\bullet\\bullet1.png', true)
LoadImageGroup('preimg', 'bullet1', 80, 0, 32, 32, 1, 8)
LoadImageGroup('arrow_big', 'bullet1', 0, 0, 16, 16, 1, 16, 2.5, 2.5)
LoadImageGroup('gun_bullet', 'bullet1', 24, 0, 16, 16, 1, 16, 2.5, 2.5)
LoadImageGroup('gun_bullet_void', 'bullet1', 56, 0, 16, 16, 1, 16, 2.5, 2.5)
LoadImageGroup('butterfly', 'bullet1', 112, 0, 32, 32, 1, 8, 4, 4)
LoadImageGroup('square', 'bullet1', 152, 0, 16, 16, 1, 16, 3, 3)
LoadImageGroup('ball_mid', 'bullet1', 176, 0, 32, 32, 1, 8, 4, 4)
LoadImageGroup('mildew', 'bullet1', 208, 0, 16, 16, 1, 16, 2, 2)
LoadImageGroup('ellipse', 'bullet1', 224, 0, 32, 32, 1, 8, 4.5, 4.5)
@williewillus
williewillus / porting.md
Created January 22, 2017 04:57
how to port a mod

Only half-serious, as opposed to 3/4 serious. Take of it what you will.

  1. Update your gradle and mappings. Get it wrong because you forgot to add the branch name.
  2. Commit so you feel good about taking the first step
  3. Rerun setupDecompWorkspace, refresh Gradle project in your IDE.
  4. Try to compile the mod and cry after seeing the error count
  5. Easy renaming time. If a class (or method/field with distinct name) has been renamed, just do a global find/replace. Congrats, you just added 10000 lines to the diff. Commit.
  6. Easy method signature time. If a method has changed arguments, say to add a hand parameter, just do a global find/replace. You DID name your parameters properly, not p_10101101010_xxx, right? ... Oho, you're going to have fun. Commit.
  7. Easy semantic stuff. This is stuff like changing x y z args to BlockPos, ForgeDirection to EnumFacing, etc. Commit per change.
  8. Missing methods. If something you override from vanilla is no longer there, first check the bot to see if it got renamed (!mh
@williewillus
williewillus / Primer.md
Last active July 16, 2023 03:18
1.8 rendering primer

1.8 Rendering Primer by williewillus (formatted to markdown by gigaherz)

Note: This primer assumes you are using MinecraftForge 1.8.9 build 1670 or above. Correctness not guaranteed otherwise. Note 2: This primer is for 1.8.x. Changes in 1.9 are on another gist: https://gist.github.com/williewillus/e37edde85dc78d2e138c

This guide is intended for those with a clear knowledge of general modding and want a quick up to speed on how new things work. If you are confused, please hop on IRC and ask for help!

Blocks and Items

  • 1.7: EVERY BLOCK SHAPE EVER was hardcoded into RenderBlocks or your ISBRH. Oh God, just look at that class. Actually don’t, if you value your sanity.
@williewillus
williewillus / foo.java
Last active July 4, 2023 01:01
recipe to json dumper
// You can include this in your mod/a pack/whatever you want, as long as that work follows the Mojang EULA.
// The original source is viewable at https://gist.github.com/williewillus/a1a899ce5b0f0ba099078d46ae3dae6e
// This is a janky JSON generator, for porting from below 1.12 to 1.12.
// Simply replace calls to GameRegistry.addShapeless/ShapedRecipe with these methods, which will dump it to a json in RECIPE_DIR
// Also works with OD, replace GameRegistry.addRecipe(new ShapedOreRecipe/ShapelessOreRecipe with the same calls
// After you are done, call generateConstants()
// Note that in many cases, you can combine multiple old recipes into one, since you can now specify multiple possibilities for an ingredient without using the OD. See vanilla for examples.
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
@williewillus
williewillus / primer.md
Last active June 15, 2023 03:33
Capabilities: A Primer (tm)

Capabilities

Another award-winning primer by williewillus

Capabilities...a wondrous new system. That you've probably been forced into using. But let's not talk about that and get straight into the learning!

Terms and definitions

  • Capability System - This entire system; what this primer is about. This system is named very literally for what it does.
    • Capability - the quality of being capable; capacity; ability
  • Capable - having power and ability
inet <public-ip-1> 255.255.254.0 NONE
inet alias <public-ip-2> 255.255.255.255
@williewillus
williewillus / gitprimer.md
Last active October 6, 2022 20:48
Git Primer

Git - Quick Primer

A fast-paced introduction to version control and git. If you want the full blown experience, see the git scm book: https://git-scm.com/book/en/v2

What is version control

Version control is maintaining a detailed report of changes that happen to your codebase. Good version control practice allows you to roll back mistakes, work on features in parallel, and combine them into a final product.

How does Git record history?

@williewillus
williewillus / 1132_to_114.xml
Last active July 16, 2022 02:14
1.13.2 -> 1.14 migration mappings
<?xml version="1.0" encoding="UTF-8"?>
<migrationMap>
<name value="1.13.2 to 1.14" />
<description value="1.13.2 to 1.14 MCP changes" />
<entry oldName="net.minecraft.GameVersion" newName="net.minecraft.util.MinecraftVersion" type="class" />
<entry oldName="net.minecraft.advancements.AdvancementList.Listener" newName="net.minecraft.advancements.AdvancementList.IListener" type="class" />
<entry oldName="net.minecraft.advancements.RequirementsStrategy" newName="net.minecraft.advancements.IRequirementsStrategy" type="class" />
<entry oldName="net.minecraft.advancements.criterion.AbstractCriterionInstance" newName="net.minecraft.advancements.criterion.CriterionInstance" type="class" />
<entry oldName="net.minecraft.block.Block.EnumOffsetType" newName="net.minecraft.block.Block.OffsetType" type="class" />
<entry oldName="net.minecraft.block.BlockAbstractBanner" newName="net.minecraft.block.AbstractBannerBlock" type="class" />