From d75b776536cce5d38c55532647514b77553708d3 Mon Sep 17 00:00:00 2001 From: TelepathicGrunt <40846040+TelepathicGrunt@users.noreply.github.com> Date: Wed, 26 Jun 2024 18:47:20 -0400 Subject: [PATCH] Add PlantType replacement work (#45) --- content/news/21.0release.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/content/news/21.0release.md b/content/news/21.0release.md index 3afc55e..0bd1b92 100644 --- a/content/news/21.0release.md +++ b/content/news/21.0release.md @@ -124,6 +124,16 @@ This method has been added to living entities in order to allow them to react to We would like to thank [Caltinor](https://github.com/Caltinor) for their work on the [Pull Request](https://github.com/neoforged/NeoForge/pull/792), which you can consult for more information. +## PlantType system is now replaced (introduced in NeoForge 21.0.39-beta) + +The original PlantType system was buggy and quite confusing to deal with. Instead, we deleted that system and added `SpecialPlantable` item interface, patched in a `canSustainPlant` block method, and added a `neoforge:villager_farmlands` block tag. + +The `SpecialPlantable` interface allows mods to more easily tell if a modded item can spawn a plant and exposes methods for easy checking if a spot is valid for the item and to spawn the plant itself. + +The patched-in `canSustainPlant` method allows blocks to forcibly sustain many plants and now works with all vanilla plants. Modded plants would need to call this method if the plant block override canSurvive without calling super. + +And the `SpecialPlantable` block tag now lets Farmer Villagers detect and plant on modded blocks more easier. This can also be used by mods to know if a modded block is farmland-like. + ## 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).