Skip to content

Instantly share code, notes, and snippets.

View williewillus's full-sized avatar

Vincent Lee williewillus

View GitHub Profile
@williewillus
williewillus / foo.txt
Last active August 9, 2017 17:30
botania 1.12 progress
Botania 1.12 plans!
General
- Push major version to r1.10
Art Changes
- Merge in wiiv's new block and item textures and pylon models
- Update armor models to wiiv's new ones for the 1.8+ player model
+ Replace lexica botania landing page sprites with more vanilla-like 16x16 ones
+ Replace lexica botania landing page button animation stencil one I'll provide
@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 / 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 / blargh.js
Last active June 13, 2017 08:00
animation api grokking
/*
- Properties.StaticProperty (PropertyBool)
- when true, show the static parts of the model (the non animated ones)
- when false, show the animated parts
- Properties.AnimationProperty (IUnlistedProperty<IModelState>)
- The model is animated by rebaking it using the value of this property
What is a joint?
- basically, part of a model that you'd like to treat as 1 single unit for animation purposes

Git - Quick Primer

A fast-paced introduction to version control and git.

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 / breakdown.txt
Last active June 20, 2016 20:22
Fluid Cap breakdown
Personal notes for fluid cap and general fluid grokking since this seems really unintuitive to me.
I have not worked with fluids before and the fluid cap seems very baggage-laden to me.
It feels held back by the previous implementation of Fluids,
and is not consistent with the interface of `IItemHandler`, the inventory cap.
Oh well. Here goes.
Classes:
- `IFluidHandler`: The Capability Interface for the fluid cap.
@williewillus
williewillus / foo.md
Last active April 20, 2019 20:46
1.9.4 te syncing

1.9.4 TE Syncing

Only accurate for 1922+

When the chunk/block data is sent (client receiving chunks from server):

  • getUpdateTag() called serverside to get compound to sync
  • handleUpdateTag() called to handle it clientside
  • what vanilla does
  • Writes ALL data into this tag by calling writeToNBT
@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
@williewillus
williewillus / grammar.js
Last active November 4, 2017 15:08
loot table grammar
{
"pools": [ <lootpool> ... ] // Every pool is queried by the table the number of times specified in "rolls"
}
-------------
<lootpool> == {
"name": <autogenerated for vanilla pools | table-unique name for this pool>
"conditions": [ <lootcondition> ... ],
"rolls": <randomvaluerange>
@williewillus
williewillus / primer.md
Last active December 20, 2020 08:13
1.8.9 to 1.9 quick primer