[1.19.x] Added event for growing fungus (#8981)

This commit is contained in:
Jais Djurhuus-Kempel authored and GitHub committed 2022-09-08 16:11:59 +01:00
1 parent 0978a94358
commit 1c31f42dae
9 files changed
+106 -22

No files matched your search

@@ -0,0 +1,25 @@
package net.minecraftforge.debug.world;
import net.minecraft.data.worldgen.features.TreeFeatures;
import net.minecraftforge.event.level.SaplingGrowTreeEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import org.apache.logging.log4j.LogManager;
@Mod("block_grow_feature_test")
@Mod.EventBusSubscriber
public class BlockGrowFeatureTest
{
public static final boolean ENABLE = true;
@SubscribeEvent
public static void onGrowReplaceFeature(SaplingGrowTreeEvent event)
{
if (ENABLE) {
event.setFeature(TreeFeatures.BIRCH_BEES_005);
if (event.getFeature().equals(TreeFeatures.BIRCH_BEES_005)) {
LogManager.getLogger().info("BlockGrowFeatureTest replaced feature");
}
}
}
}