Changed BlockCanBuild event to pass the material

This commit is contained in:
durron597
2011-01-01 03:12:39 -05:00
parent c4e37dcf2a
commit 1f295df2ae
2 changed files with 22 additions and 14 deletions

View File

@@ -33,10 +33,10 @@ public class SampleBlockListener extends BlockListener {
@Override
public void onBlockCanBuild(BlockCanBuildEvent event) {
Block block = event.getBlock();
Material mat = event.getMaterial();
if (block.getType() == Material.Cactus) {
event.setCancelled(false);
if (mat.equals(Material.Cactus)) {
event.setBuildable(true);
}
}
}