Created
December 31, 2012 10:56
-
-
Save Quirkylee/4418982 to your computer and use it in GitHub Desktop.
This file contains 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 PlayerInteract(BlockDamageEvent event) { | |
Player player = event.getPlayer(); | |
boolean enabledShovel = plugin.getShovelState(player); | |
Block block = event.getBlock(); | |
ItemStack itemInHand = event.getItemInHand(); | |
if(enabledShovel == true && itemInHand.getType() == org.bukkit.Material.GOLD_SPADE) { | |
if(block.getType() == org.bukkit.Material.SNOW || block.getType() == org.bukkit.Material.SNOW_BLOCK) { | |
event.setInstaBreak(true); | |
} | |
event.setCancelled(true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment