mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 11:05:40 +00:00
AlterGroundEvent for modifying block placement performed by AlterGroundDecorator (#9637)
This commit is contained in:
1 parent
2f229c5bb1
commit
2c965fac90
5 files changed
+128
No files matched your search
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) Forge Development LLC and contributors
|
||||
* SPDX-License-Identifier: LGPL-2.1-only
|
||||
*/
|
||||
|
||||
package net.minecraftforge.debug;
|
||||
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraftforge.event.level.AlterGroundEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
@Mod("alter_ground_event_test")
|
||||
@Mod.EventBusSubscriber
|
||||
public class AlterGroundEventTest {
|
||||
public static final boolean ENABLE = true;
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onAlterGround(AlterGroundEvent event)
|
||||
{
|
||||
if (ENABLE) {
|
||||
if (event.getOriginalAlteredState().is(Blocks.PODZOL)) {
|
||||
event.setNewAlteredState(Blocks.REDSTONE_BLOCK.defaultBlockState());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user