Skip to content

Commit

Permalink
The 1.21 release blog post (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt authored Jun 13, 2024
1 parent b26d79f commit 7f74168
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 0 deletions.
1 change: 1 addition & 0 deletions content/news/20.2release.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: "NeoForge 20.2 for Minecraft 1.20.2"
date: 2023-10-30T19:50:00+01:00
categories:
- News
- Releases
author: neoforgedteam
summary: |
All you need to know about NeoForge 20.2, now released for Minecraft 1.20.2.
Expand Down
1 change: 1 addition & 0 deletions content/news/20.3release.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: "NeoForge 20.3 for Minecraft 1.20.3 and 1.20.4"
date: 2023-12-05T20:25:00+01:00
categories:
- News
- Releases
author: neoforgedteam
summary: |
All you need to know about NeoForge 20.3, now released for Minecraft 1.20.3.
Expand Down
1 change: 1 addition & 0 deletions content/news/20.5release.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: "NeoForge 20.5 for Minecraft 1.20.5"
date: 2024-04-23T22:50:00+02:00
categories:
- News
- Releases
author: neoforgedteam
summary: |
All you need to know about NeoForge 20.5, now released for Minecraft 1.20.5.
Expand Down
87 changes: 87 additions & 0 deletions content/news/21.0release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
title: "NeoForge 21.0 for Minecraft 1.21"
date: 2024-06-13T19:28:00+03:00
draft: false
categories:
- News
- Releases
author: neoforgedteam
summary: "All you need to know about NeoForge 21.0, now released for Minecraft 1.21."
description: "All you need to know about NeoForge 21.0, now released for Minecraft 1.21."
---

It's that time of the year again! Mojang has just released a new Minecraft major version: 1.21, followed by the first beta release of NeoForge 21.0: `21.0.0-beta`.

## Previous changes
Before diving into the changes brought by 1.21, we would like to quickly go through the changes made to NeoForge since 1.20.1, for those that haven't updated all the way to 1.20.6. You will also find the respective blog posts for each version, outlining important Vanilla changes:

- [1.20.2](20.2release.md):
- The package renames
- The [EventBus changes](20.2eventbus-changes.md)
- The [Registry Rework](20.2registry-rework.md)
- [1.20.3](20.3release.md):
- The [Capability Rework](20.3capability-rework.md)
- 1.20.4:
- The introduction of [Data Maps](https://github.com/neoforged/NeoForge/pull/519)
- The [Networking Refactor](20.4networking-refactor.md)
- The [switch to Fabric Mixin](https://github.com/neoforged/FancyModLoader/pull/94)
- [1.20.5](20.5release.md):
- The `mods.toml` file was renamed to `neoforge.mods.toml`
- The [Second Networking Rework](20.5release/#network-api-rework)
- The [Tick Event Refactor](https://github.com/neoforged/NeoForge/pull/542)
- 1.20.6:
- The [removal of `Event.Result`](https://github.com/neoforged/NeoForge/pull/588)

## The Vanilla 1.21 changes
Now, let's get into the most important changes in Vanilla.

First of all, the `ResourceLocation` constructors were made private, and replaced with static factory methods:
- `ResourceLocation#fromNamespaceAndPath`: takes in the namespace and the path of the resource location. This is functionally equivalent to the `ResourceLocation(String, String)` constructor in 1.20.6 and below. Accompanied by `#tryBuild` which returns `null` instead of throwing if the parameters aren't valid.
- `ResourceLocation#parse`: takes in a resource location string composed of a namespace and path, separated by `:`. This method is functionally equivalent to the `ResourceLocation(String)` constructor in 1.20.6 and below. Accompanied by `#tryParse` which returns `null` instead of throwing if the parameters aren't valid.
- `ResourceLocation#withDefaultNamespace`: takes in the path of the resource location, and always uses `minecraft` as its namespace.

### Depluralisation
Several data folder names that were plural have been renamed:
- tag folders:
- `tags/blocks` -> `tags/block`
- `tags/entity_types` -> `tags/entity_type`
- `tags/fluids` -> `tags/fluid`
- `tags/items` -> `tags/item`
- `tags/game_events` -> `tags/game_event`
- `recipes` -> `recipe`
- `advancements` -> `advancement`

### Data-driven enchantments
Enchantments are no longer a static, built-in registry, and are instead a datapack registry.
With this change, methods that previously took an `Enchantment` will now take a `Holder<Enchantment>` (which can be grabbed from a registry obtained through a level's `RegistryAccess`), and all fields in the `Enchantments` class are `ResourceKey<Enchantment>`s.
Additionally, your code should now use `EnchantmentEffectComponents` to determine whether an enchantment should affect something, instead of relying on direct level checks.

For more information, we encourage you to consult [ChampionAsh](https://github.com/ChampionAsh5357)'s [1.21 primer](https://gist.github.com/ChampionAsh5357/d895a7b1a34341e19c80870720f9880f).
## The NeoForge changes
The first NeoForge beta release for 1.21 comes with some changes too.

### Deprecations
Members deprecated for removal have been mostly removed:
- `IItemExtension#onArmorTick`: use `Item#inventory` tick instead, with the armor slot indices being 36, 37, 38 and 39.
- `ItemHandlerHelper#copyStackWithSize` -> `ItemStack#copyWithCount`
- `ItemHandlerHelper#canItemStacksStack` -> `ItemStack#isSameItemSameComponents`
- the `ComposterBlock#COMPOSTABLES` map is now ignored. Use the data map instead.
- the `VibrationSystem#VIBRATION_FREQUENCY_FOR_EVENT` map is now ignored. Use the data map instead.
- the `Parrot#MOB_SOUND_MAP` map is now ignored. Use the data map instead.

FML also had its deprecated members removed:
- the `ModLoadingContext#registerConfig` methods are replaced by `ModContainer#registerConfig`
- `FMLJavaModLoadingContext#get` was removed. The direct replacement is `ModLoadingContext#get`, however use of it is discouraged. You should use direct references to your container where possible, and consider that the mod's event bus is provided as a mod class constructor argument.
- `DistExecutor` was removed without replacement. You should either use `if (FMLLoader.dist == <dist>)` checks, or separate entrypoints for client and common code.

## Experimental Gradle Plugin
We're currently developing a new experimental Gradle Plugin, focused on simpler buildscripts and improved caching. You can find information on its usage [here](https://github.com/NeoForged/ModDevGradle), and support is provided in the [thread](https://discord.com/channels/313125603924639766/1239579489617580072) on our [Discord server](https://discord.neoforged.net).

NeoGradle will **continue** to be supported.

## A note on stability
As was the case with the 1.20 lifecycle, we expect 1.21 (or 1.21.1) to be the stable version packs will focus on during the 1.21 lifecycle.
This means that 1.21 may have a longer beta period so that we can make sure that the version packs will use for the year to come is as good as it gets.
However, we will, as always, refrain from making useless breaking changes, and will make sure to announce them in the [Dev Announcements channel](https://discord.com/channels/313125603924639766/1187738270386372740) of our [Discord server](https://discord.neoforged.net). Make sure to select the `Dev Announcement Pings` role if you want to be kept up to date with the most important changes!

As always, we want to thank everyone for their contributions during the 1.20 lifecycle, and we hope to see more mods be developed for NeoForge in the coming months.

0 comments on commit 7f74168

Please sign in to comment.