mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-05 16:49:39 +00:00
Sample to let you place cactus anywhere
This commit is contained in:
parent
0c20593916
commit
f7fcfd22a5
1 changed files with 10 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue