Last active
August 29, 2015 14:03
-
-
Save ScruffyRules/97fc5c40ed4dc1a76966 to your computer and use it in GitHub Desktop.
CACTUS!!!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@EventHandler | |
public void onBlockBreak(BlockBreakEvent event) { | |
Block block = event.getBlock(); | |
byte data = block.getData(); | |
Block blocks = block.getRelative(0, 1, 0); | |
while (block.getType().equals(blocks.getType()) && data == blocks.getData()) { | |
if (event.getPlayer().getGameMode().equals(GameMode.CREATIVE)) { | |
blocks.setType(Material.AIR); | |
} else { | |
blocks.breakNaturally(); | |
} | |
blocks = blocks.getRelative(0, 1, 0); | |
data = blocks.getData(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment