Skip to content

Instantly share code, notes, and snippets.

View yungnickyoung's full-sized avatar

Nick Young yungnickyoung

View GitHub Profile
@GizmoTheMoonPig
GizmoTheMoonPig / Materials.md
Last active January 4, 2024 20:21
Materials: where did they go?

Starting in 1.20, the Material class has completely disappeared and has been replaced with a series of properties that are chained to BlockBehavior.Properties.of. This list exists so you can easily figure out which propeties to use to replace the old materials.

Every Material here gives its default MapColor (previously known as MaterialColor), regardless of if it had one or not. It also defines which properties to use to replicate the exact behavior used previously.

The very bottom of this file defines the more complicated replacements to certain material properties.

  • AIR - No MapColor, replaceable
  • STRUCTURAL_AIR - No MapColor, replaceable
  • PORTAL - No MapColor, PushReaction.BLOCK
  • CLOTH_DECORATION - MapColor.WOOL, ignitedByLava
@ChampionAsh5357
ChampionAsh5357 / 1194-120-primer.md
Last active April 13, 2024 15:36
Minecraft 1.19.4 -> 1.20 Mod Migration Primer

Minecraft 1.19.4 -> 1.20 Mod Migration Primer

This is a high level, non-exhaustive overview on how to migrate your mod from 1.19.4 to 1.20 using Forge.

This primer is licensed under the Creative Commons Attribution 4.0 International, so feel free to use it as a reference and leave a link so that other readers can consume the primer.

If there's any incorrect or missing information, please leave a comment below. Thanks!

Pack Changes

What are mixins?

Mixins are a way to inject code or change the minecraft source code directly and should be use with caution. If you can do a PR to Forge or use an event, try those first. If all else fails, then mixins may be a good option to look into. Here are some resources for mixins:

Now, I'll be honest, the official mixin doc is kind of terrible to learn from for most people. It's extremely dense and and really only helps people who already knows in-depth bytecode and stuff. But most modders aren't like that and just wants to do small stuff lol. But I'll give you the run-down here. There's a few kinds of mixins that you will encounter quite often.

import com.mojang.datafixers.util.Function3;
import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.minecraft.block.BlockState;
import java.util.List;
public class CodecExample {
public static final Codec<CodecExample> CODEC = RecordCodecBuilder.create(
instance -> instance.group(
@Barteks2x
Barteks2x / 1.13-Worldgen.md
Last active September 4, 2022 14:06
MC 1.13 Worldgen

Overview of changes

  • net.minecraftforge.fml.common.IWorldGenerator -> net.minecraft.world.gen.feature.Feature
    • No longer needed. I think it should be removed by forge, as it has been superseded by vanilla functionality. See below.
  • net.minecraft.world.gen.feature.WorldGenerator -> net.minecraft.world.gen.feature.Feature
    • This would also be the most common replacement of Forge's IWorldGenerator. This should be the solution for anything smaller than a chunk.
    • Except the 8 blocks offset. This is not a thing anymore. Population now works just like any normal person would expect.
    • Position of features is controlled by instances of net.minecraft.world.gen.placement.BasePlacement instead of by the feature itself.
  • net.minecraft.world.gen.MapGenBase -> net.minecraft.world.gen.carver.IWorldCarver
  • This is now finally exposed to mods in a useful way. As it was mostly hidden from modders before, not eveyone may know what it is, so it will be explained later. Generates caves a
@epixoip
epixoip / 8x1080.md
Last active March 20, 2024 17:14
8x Nvidia GTX 1080 Hashcat Benchmarks
@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