From b5cbcfbcdb0d0fec3e7d2cec8afb1363fb538c20 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 1 Jan 2011 01:40:02 -0500 Subject: [PATCH] Sample to let you place cactus anywhere By: durron597 --- .../dinnerbone/bukkit/sample/SampleBlockListener.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/paper-api/sample/src/com/dinnerbone/bukkit/sample/SampleBlockListener.java b/paper-api/sample/src/com/dinnerbone/bukkit/sample/SampleBlockListener.java index 11a418ade5..85f93402d8 100644 --- a/paper-api/sample/src/com/dinnerbone/bukkit/sample/SampleBlockListener.java +++ b/paper-api/sample/src/com/dinnerbone/bukkit/sample/SampleBlockListener.java @@ -3,6 +3,7 @@ package com.dinnerbone.bukkit.sample; import org.bukkit.Block; import org.bukkit.BlockFace; +import org.bukkit.event.block.BlockCanBuildEvent; import org.bukkit.event.block.BlockListener; import org.bukkit.event.block.BlockPhysicsEvent; @@ -28,4 +29,13 @@ public class SampleBlockListener extends BlockListener { } } } + + @Override + public void onBlockCanBuild(BlockCanBuildEvent event) { + Block block = event.getBlock(); + + if (block.getType() == 81) { + event.setCancelled(true); + } + } }