mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-24 18:09:41 -05:00
Sample to let you place cactus anywhere
By: durron597 <martin.jared@gmail.com>
This commit is contained in:
1 parent
29bd4853cb
commit
b5cbcfbcdb
1 file changed
+10
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user