mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 11:05:40 +00:00
Revert block snapshots in reverse order. Fixes #3608.
This commit is contained in:
1 parent
be2d814155
commit
f7f46be8ff
2 files changed
+33
-6
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package net.minecraftforge.test;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
@Mod(modid = BlockPlaceEventTest.MOD_ID, name = "BlockPlaceEvent test mod", version = "1.0")
|
||||
@Mod.EventBusSubscriber
|
||||
public class BlockPlaceEventTest
|
||||
{
|
||||
static final String MOD_ID = "block_place_event_test";
|
||||
static final boolean ENABLED = false;
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onBlockPlaced(BlockEvent.PlaceEvent event)
|
||||
{
|
||||
if (!ENABLED) return;
|
||||
|
||||
if (event.getPlacedBlock().getBlock() == Blocks.CHEST
|
||||
&& event.getPlacedAgainst().getBlock() != Blocks.DIAMOND_BLOCK)
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user