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.
- This would also be the most common replacement of Forge's
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
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!
- 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
Product: Sagitta Brutalis 1080 (PN S3480-GTX-1080-2697-128)
Software: Hashcat v3.00-beta-145-g069634a, Nvidia driver 367.18
Accelerator: 8x Nvidia GTX 1080 Founders Edition
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:
- Mixin Official Docs: https://github.com/SpongePowered/Mixin/wiki
- Mixin Javadocs: https://jenkins.liteloader.com/view/Other/job/Mixin/javadoc/index.html
- Mixin Cheatsheet: https://github.com/2xsaiko/mixin-cheatsheet
- MixinExtras (Adds some powerful compatiable mixin options!): https://github.com/LlamaLad7/MixinExtras
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.
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!
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
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( |