|
@@ -31,269 +31,261 @@ import com.gmail.nossr50.locale.mcLocale;
|
|
|
import com.gmail.nossr50.skills.*;
|
|
|
import com.gmail.nossr50.events.FakeBlockBreakEvent;
|
|
|
|
|
|
-public class mcBlockListener implements Listener
|
|
|
-{
|
|
|
+public class mcBlockListener implements Listener {
|
|
|
private final mcMMO plugin;
|
|
|
|
|
|
- public mcBlockListener(final mcMMO plugin)
|
|
|
- {
|
|
|
+ public mcBlockListener(final mcMMO plugin) {
|
|
|
this.plugin = plugin;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Monitor BlockPlace events.
|
|
|
+ *
|
|
|
+ * @param event The event to monitor
|
|
|
+ */
|
|
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
|
|
- public void onBlockPlace(BlockPlaceEvent event)
|
|
|
- {
|
|
|
- //Setup some basic variables
|
|
|
- Block block;
|
|
|
- Player player = event.getPlayer();
|
|
|
-
|
|
|
- //When blocks are placed on snow this event reports the wrong block.
|
|
|
- if (event.getBlockReplacedState() != null && event.getBlockReplacedState().getType().equals(Material.SNOW))
|
|
|
- block = event.getBlockAgainst();
|
|
|
- else
|
|
|
- block = event.getBlock();
|
|
|
-
|
|
|
- int id = block.getTypeId();
|
|
|
- Material mat = block.getType();
|
|
|
-
|
|
|
- //Check if the blocks placed should be monitored so they do not give out XP in the future
|
|
|
- if(BlockChecks.shouldBeWatched(mat))
|
|
|
- {
|
|
|
- //Only needed for blocks that use their block data (wood, pumpkins, etc.)
|
|
|
- boolean shouldBeChanged = true;
|
|
|
-
|
|
|
- switch(mat)
|
|
|
- {
|
|
|
- case CACTUS:
|
|
|
- case GLOWING_REDSTONE_ORE:
|
|
|
- case JACK_O_LANTERN:
|
|
|
- case LOG:
|
|
|
- case PUMPKIN:
|
|
|
- case REDSTONE_ORE:
|
|
|
- case SUGAR_CANE_BLOCK:
|
|
|
- case VINE:
|
|
|
- shouldBeChanged = false; //We don't want these added to changeQueue
|
|
|
- plugin.misc.blockWatchList.add(block);
|
|
|
- break;
|
|
|
- case BROWN_MUSHROOM:
|
|
|
- case RED_MUSHROOM:
|
|
|
- case RED_ROSE:
|
|
|
- case YELLOW_FLOWER:
|
|
|
- case WATER_LILY:
|
|
|
- plugin.fastChangeQueue.push(block);
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- if(shouldBeChanged)
|
|
|
- plugin.changeQueue.push(block);
|
|
|
- }
|
|
|
-
|
|
|
- if(id == LoadProperties.anvilID && LoadProperties.anvilmessages)
|
|
|
- {
|
|
|
- PlayerProfile PP = Users.getProfile(player);
|
|
|
- if(!PP.getPlacedAnvil())
|
|
|
- {
|
|
|
- if(LoadProperties.spoutEnabled)
|
|
|
- {
|
|
|
- SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
|
|
|
- if(sPlayer.isSpoutCraftEnabled())
|
|
|
- sPlayer.sendNotification("[mcMMO] Anvil Placed", "Right click to repair!", Material.IRON_BLOCK);
|
|
|
- }
|
|
|
- else
|
|
|
- event.getPlayer().sendMessage(mcLocale.getString("mcBlockListener.PlacedAnvil")); //$NON-NLS-1$
|
|
|
-
|
|
|
- PP.togglePlacedAnvil();
|
|
|
- }
|
|
|
- }
|
|
|
+ public void onBlockPlace(BlockPlaceEvent event) {
|
|
|
+ Block block;
|
|
|
+ Player player = event.getPlayer();
|
|
|
+
|
|
|
+ //When blocks are placed on snow this event reports the wrong block.
|
|
|
+ if (event.getBlockReplacedState() != null && event.getBlockReplacedState().getType().equals(Material.SNOW)) {
|
|
|
+ block = event.getBlockAgainst();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ block = event.getBlock();
|
|
|
+ }
|
|
|
+
|
|
|
+ int id = block.getTypeId();
|
|
|
+ Material mat = block.getType();
|
|
|
+
|
|
|
+ //Check if the blocks placed should be monitored so they do not give out XP in the future
|
|
|
+ if (BlockChecks.shouldBeWatched(mat)) {
|
|
|
+ BlockChecks.watchBlock(mat, block, plugin);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (id == LoadProperties.anvilID && LoadProperties.anvilmessages) {
|
|
|
+ PlayerProfile PP = Users.getProfile(player);
|
|
|
+
|
|
|
+ if (!PP.getPlacedAnvil()) {
|
|
|
+ if (LoadProperties.spoutEnabled) {
|
|
|
+ SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
|
|
|
+
|
|
|
+ if (sPlayer.isSpoutCraftEnabled()) {
|
|
|
+ sPlayer.sendNotification("[mcMMO] Anvil Placed", "Right click to repair!", Material.getMaterial(id));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ event.getPlayer().sendMessage(mcLocale.getString("mcBlockListener.PlacedAnvil"));
|
|
|
+ }
|
|
|
+
|
|
|
+ PP.togglePlacedAnvil();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Monitor BlockBreak events.
|
|
|
+ *
|
|
|
+ * @param event The event to monitor
|
|
|
+ */
|
|
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
|
|
- public void onBlockBreak(BlockBreakEvent event)
|
|
|
- {
|
|
|
- Player player = event.getPlayer();
|
|
|
- PlayerProfile PP = Users.getProfile(player);
|
|
|
- Block block = event.getBlock();
|
|
|
- int id = block.getTypeId();
|
|
|
- ItemStack inhand = player.getItemInHand();
|
|
|
-
|
|
|
- if(event instanceof FakeBlockBreakEvent)
|
|
|
- return;
|
|
|
-
|
|
|
- /*
|
|
|
- * HERBALISM
|
|
|
- */
|
|
|
-
|
|
|
- //Green Terra
|
|
|
- if(PP.getHoePreparationMode() && mcPermissions.getInstance().herbalismAbility(player) && ((id == 59 && block.getData() == (byte) 0x07) || Herbalism.canBeGreenTerra(block)))
|
|
|
- Skills.abilityCheck(player, SkillType.HERBALISM);
|
|
|
-
|
|
|
- //Wheat && Triple drops
|
|
|
- if(PP.getGreenTerraMode() && Herbalism.canBeGreenTerra(block))
|
|
|
- Herbalism.herbalismProcCheck(block, player, event, plugin);
|
|
|
-
|
|
|
- if(mcPermissions.getInstance().herbalism(player) && block.getData() != (byte) 5)
|
|
|
- Herbalism.herbalismProcCheck(block, player, event, plugin);
|
|
|
-
|
|
|
- /*
|
|
|
- * MINING
|
|
|
- */
|
|
|
- if(mcPermissions.getInstance().mining(player))
|
|
|
- {
|
|
|
- if(LoadProperties.miningrequirespickaxe && ItemChecks.isMiningPick(inhand))
|
|
|
- Mining.miningBlockCheck(player, block, plugin);
|
|
|
- else if(!LoadProperties.miningrequirespickaxe)
|
|
|
- Mining.miningBlockCheck(player, block, plugin);
|
|
|
- }
|
|
|
-
|
|
|
- /*
|
|
|
- * WOOD CUTTING
|
|
|
- */
|
|
|
-
|
|
|
- if(mcPermissions.getInstance().woodcutting(player) && id == 17)
|
|
|
- {
|
|
|
- if(LoadProperties.woodcuttingrequiresaxe && ItemChecks.isAxe(inhand))
|
|
|
- WoodCutting.woodcuttingBlockCheck(player, block, plugin);
|
|
|
- else if(!LoadProperties.woodcuttingrequiresaxe)
|
|
|
- WoodCutting.woodcuttingBlockCheck(player, block, plugin);
|
|
|
-
|
|
|
- if(PP.getTreeFellerMode())
|
|
|
- WoodCutting.treeFeller(event, plugin);
|
|
|
- }
|
|
|
-
|
|
|
- /*
|
|
|
- * EXCAVATION
|
|
|
- */
|
|
|
- if(Excavation.canBeGigaDrillBroken(block) && mcPermissions.getInstance().excavation(player) && block.getData() != (byte) 5)
|
|
|
- {
|
|
|
- if(LoadProperties.excavationRequiresShovel && ItemChecks.isShovel(inhand))
|
|
|
- Excavation.excavationProcCheck(block, player);
|
|
|
- else if(!LoadProperties.excavationRequiresShovel)
|
|
|
- Excavation.excavationProcCheck(block, player);
|
|
|
- }
|
|
|
-
|
|
|
- //Change the byte back when broken
|
|
|
- if(block.getData() == 5 && BlockChecks.shouldBeWatched(block.getType()))
|
|
|
- {
|
|
|
- block.setData((byte) 0);
|
|
|
- if(plugin.misc.blockWatchList.contains(block))
|
|
|
- plugin.misc.blockWatchList.remove(block);
|
|
|
- }
|
|
|
+ public void onBlockBreak(BlockBreakEvent event) {
|
|
|
+ Player player = event.getPlayer();
|
|
|
+ PlayerProfile PP = Users.getProfile(player);
|
|
|
+ Block block = event.getBlock();
|
|
|
+ Material mat = block.getType();
|
|
|
+ ItemStack inhand = player.getItemInHand();
|
|
|
+
|
|
|
+ if(event instanceof FakeBlockBreakEvent) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ * HERBALISM
|
|
|
+ */
|
|
|
+
|
|
|
+ //Green Terra
|
|
|
+ if (PP.getHoePreparationMode() && mcPermissions.getInstance().herbalismAbility(player) && ((mat.equals(Material.CROPS) && block.getData() == (byte) 0x7) || Herbalism.canBeGreenTerra(block))) {
|
|
|
+ Skills.abilityCheck(player, SkillType.HERBALISM);
|
|
|
+ }
|
|
|
+
|
|
|
+ //Wheat && Triple drops
|
|
|
+ if (PP.getGreenTerraMode() && Herbalism.canBeGreenTerra(block)) {
|
|
|
+ Herbalism.herbalismProcCheck(block, player, event, plugin);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (mcPermissions.getInstance().herbalism(player) && block.getData() != (byte) 5) {
|
|
|
+ Herbalism.herbalismProcCheck(block, player, event, plugin);
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ * MINING
|
|
|
+ */
|
|
|
+
|
|
|
+ if (mcPermissions.getInstance().mining(player) && Mining.canBeSuperBroken(block)) {
|
|
|
+ if (LoadProperties.miningrequirespickaxe && ItemChecks.isMiningPick(inhand)) {
|
|
|
+ Mining.miningBlockCheck(player, block, plugin);
|
|
|
+ }
|
|
|
+ else if (!LoadProperties.miningrequirespickaxe) {
|
|
|
+ Mining.miningBlockCheck(player, block, plugin);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ * WOOD CUTTING
|
|
|
+ */
|
|
|
+
|
|
|
+ if(mcPermissions.getInstance().woodcutting(player) && mat.equals(Material.LOG)) {
|
|
|
+ if (LoadProperties.woodcuttingrequiresaxe && ItemChecks.isAxe(inhand)) {
|
|
|
+ WoodCutting.woodcuttingBlockCheck(player, block, plugin);
|
|
|
+ }
|
|
|
+ else if (!LoadProperties.woodcuttingrequiresaxe) {
|
|
|
+ WoodCutting.woodcuttingBlockCheck(player, block, plugin);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (PP.getTreeFellerMode()) {
|
|
|
+ WoodCutting.treeFeller(event, plugin);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ * EXCAVATION
|
|
|
+ */
|
|
|
+
|
|
|
+ if (Excavation.canBeGigaDrillBroken(block) && mcPermissions.getInstance().excavation(player) && block.getData() != (byte) 0x5)
|
|
|
+ {
|
|
|
+ if(LoadProperties.excavationRequiresShovel && ItemChecks.isShovel(inhand)) {
|
|
|
+ Excavation.excavationProcCheck(block, player);
|
|
|
+ }
|
|
|
+ else if(!LoadProperties.excavationRequiresShovel) {
|
|
|
+ Excavation.excavationProcCheck(block, player);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //Change the byte back when broken
|
|
|
+ if (block.getData() == (byte) 0x5 && BlockChecks.shouldBeWatched(mat)) {
|
|
|
+ block.setData((byte) 0x0);
|
|
|
+ }
|
|
|
+ else if(plugin.misc.blockWatchList.contains(block)) {
|
|
|
+ plugin.misc.blockWatchList.remove(block);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
|
|
public void onBlockDamage(BlockDamageEvent event)
|
|
|
{
|
|
|
- Player player = event.getPlayer();
|
|
|
- PlayerProfile PP = Users.getProfile(player);
|
|
|
- ItemStack inhand = player.getItemInHand();
|
|
|
- Block block = event.getBlock();
|
|
|
- int id = block.getTypeId();
|
|
|
- Material mat = block.getType();
|
|
|
+ Player player = event.getPlayer();
|
|
|
+ PlayerProfile PP = Users.getProfile(player);
|
|
|
+ ItemStack inhand = player.getItemInHand();
|
|
|
+ Block block = event.getBlock();
|
|
|
+ int id = block.getTypeId();
|
|
|
+ Material mat = block.getType();
|
|
|
|
|
|
- /*
|
|
|
- * ABILITY PREPARATION CHECKS
|
|
|
- */
|
|
|
- if(BlockChecks.abilityBlockCheck(mat))
|
|
|
- {
|
|
|
- if(PP.getHoePreparationMode() && Herbalism.canBeGreenTerra(block))
|
|
|
- Skills.abilityCheck(player, SkillType.HERBALISM);
|
|
|
- if(PP.getAxePreparationMode() && mat.equals(Material.LOG) && mcPermissions.getInstance().woodCuttingAbility(player))
|
|
|
- Skills.abilityCheck(player, SkillType.WOODCUTTING);
|
|
|
- if(PP.getPickaxePreparationMode() && Mining.canBeSuperBroken(block))
|
|
|
- Skills.abilityCheck(player, SkillType.MINING);
|
|
|
- if(PP.getShovelPreparationMode() && Excavation.canBeGigaDrillBroken(block))
|
|
|
- Skills.abilityCheck(player, SkillType.EXCAVATION);
|
|
|
- }
|
|
|
-
|
|
|
- if(PP.getFistsPreparationMode() && (Excavation.canBeGigaDrillBroken(block) || mat.equals(Material.SNOW)))
|
|
|
- Skills.abilityCheck(player, SkillType.UNARMED);
|
|
|
-
|
|
|
- /*
|
|
|
- * TREE FELLER STUFF
|
|
|
- */
|
|
|
- if(LoadProperties.spoutEnabled && mat.equals(Material.LOG) && PP.getTreeFellerMode())
|
|
|
- SpoutStuff.playSoundForPlayer(SoundEffect.FIZZ, player, block.getLocation());
|
|
|
-
|
|
|
- /*
|
|
|
- * GREEN TERRA STUFF
|
|
|
- */
|
|
|
- if(PP.getGreenTerraMode() && mcPermissions.getInstance().herbalismAbility(player))
|
|
|
- Herbalism.greenTerra(player, block);
|
|
|
-
|
|
|
- /*
|
|
|
- * GIGA DRILL BREAKER CHECKS
|
|
|
- */
|
|
|
- if(PP.getGigaDrillBreakerMode() && Excavation.canBeGigaDrillBroken(block) && m.blockBreakSimulate(block, player, true) && mcPermissions.getInstance().excavationAbility(player))
|
|
|
- {
|
|
|
- if(LoadProperties.excavationRequiresShovel && ItemChecks.isShovel(inhand))
|
|
|
- {
|
|
|
- event.setInstaBreak(true);
|
|
|
- Excavation.gigaDrillBreaker(player, block);
|
|
|
- }
|
|
|
- else if(!LoadProperties.excavationRequiresShovel)
|
|
|
- {
|
|
|
- event.setInstaBreak(true);
|
|
|
- Excavation.gigaDrillBreaker(player, block);
|
|
|
- }
|
|
|
- }
|
|
|
- /*
|
|
|
- * BERSERK MODE CHECKS
|
|
|
- */
|
|
|
- if(PP.getBerserkMode()
|
|
|
- && m.blockBreakSimulate(block, player, true)
|
|
|
- && player.getItemInHand().getTypeId() == 0
|
|
|
- && (Excavation.canBeGigaDrillBroken(block) || id == 78)
|
|
|
- && mcPermissions.getInstance().unarmedAbility(player))
|
|
|
- {
|
|
|
- event.setInstaBreak(true);
|
|
|
-
|
|
|
- if(LoadProperties.spoutEnabled)
|
|
|
- SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
|
|
|
- }
|
|
|
-
|
|
|
- /*
|
|
|
- * SUPER BREAKER CHECKS
|
|
|
- */
|
|
|
- if(PP.getSuperBreakerMode()
|
|
|
- && Mining.canBeSuperBroken(block)
|
|
|
- && m.blockBreakSimulate(block, player, true)
|
|
|
- && mcPermissions.getInstance().miningAbility(player))
|
|
|
- {
|
|
|
- if(LoadProperties.miningrequirespickaxe)
|
|
|
- {
|
|
|
- if(ItemChecks.isMiningPick(inhand)){
|
|
|
-
|
|
|
- event.setInstaBreak(true);
|
|
|
- Mining.SuperBreakerBlockCheck(player, block, plugin);
|
|
|
- }
|
|
|
- } else {
|
|
|
- event.setInstaBreak(true);
|
|
|
- Mining.SuperBreakerBlockCheck(player, block, plugin);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /*
|
|
|
- * LEAF BLOWER CHECKS
|
|
|
- */
|
|
|
- if(id == 18
|
|
|
- && mcPermissions.getInstance().woodCuttingAbility(player)
|
|
|
- && PP.getSkillLevel(SkillType.WOODCUTTING) >= 100
|
|
|
- && m.blockBreakSimulate(block, player, true))
|
|
|
- {
|
|
|
- if(LoadProperties.woodcuttingrequiresaxe)
|
|
|
- {
|
|
|
- if(ItemChecks.isAxe(inhand)){
|
|
|
- event.setInstaBreak(true);
|
|
|
- WoodCutting.leafBlower(player, block);
|
|
|
- }
|
|
|
- }
|
|
|
- else if(inhand.getTypeId() != 359)
|
|
|
- {
|
|
|
- event.setInstaBreak(true);
|
|
|
- WoodCutting.leafBlower(player, block);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
+ /*
|
|
|
+ * ABILITY PREPARATION CHECKS
|
|
|
+ */
|
|
|
+ if(BlockChecks.abilityBlockCheck(mat))
|
|
|
+ {
|
|
|
+ if(PP.getHoePreparationMode() && Herbalism.canBeGreenTerra(block))
|
|
|
+ Skills.abilityCheck(player, SkillType.HERBALISM);
|
|
|
+ if(PP.getAxePreparationMode() && mat.equals(Material.LOG) && mcPermissions.getInstance().woodCuttingAbility(player))
|
|
|
+ Skills.abilityCheck(player, SkillType.WOODCUTTING);
|
|
|
+ if(PP.getPickaxePreparationMode() && Mining.canBeSuperBroken(block))
|
|
|
+ Skills.abilityCheck(player, SkillType.MINING);
|
|
|
+ if(PP.getShovelPreparationMode() && Excavation.canBeGigaDrillBroken(block))
|
|
|
+ Skills.abilityCheck(player, SkillType.EXCAVATION);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(PP.getFistsPreparationMode() && (Excavation.canBeGigaDrillBroken(block) || mat.equals(Material.SNOW)))
|
|
|
+ Skills.abilityCheck(player, SkillType.UNARMED);
|
|
|
+
|
|
|
+ /*
|
|
|
+ * TREE FELLER STUFF
|
|
|
+ */
|
|
|
+ if(LoadProperties.spoutEnabled && mat.equals(Material.LOG) && PP.getTreeFellerMode())
|
|
|
+ SpoutStuff.playSoundForPlayer(SoundEffect.FIZZ, player, block.getLocation());
|
|
|
+
|
|
|
+ /*
|
|
|
+ * GREEN TERRA STUFF
|
|
|
+ */
|
|
|
+ if(PP.getGreenTerraMode() && mcPermissions.getInstance().herbalismAbility(player))
|
|
|
+ Herbalism.greenTerra(player, block);
|
|
|
+
|
|
|
+ /*
|
|
|
+ * GIGA DRILL BREAKER CHECKS
|
|
|
+ */
|
|
|
+ if(PP.getGigaDrillBreakerMode() && Excavation.canBeGigaDrillBroken(block) && m.blockBreakSimulate(block, player, true) && mcPermissions.getInstance().excavationAbility(player))
|
|
|
+ {
|
|
|
+ if(LoadProperties.excavationRequiresShovel && ItemChecks.isShovel(inhand))
|
|
|
+ {
|
|
|
+ event.setInstaBreak(true);
|
|
|
+ Excavation.gigaDrillBreaker(player, block);
|
|
|
+ }
|
|
|
+ else if(!LoadProperties.excavationRequiresShovel)
|
|
|
+ {
|
|
|
+ event.setInstaBreak(true);
|
|
|
+ Excavation.gigaDrillBreaker(player, block);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /*
|
|
|
+ * BERSERK MODE CHECKS
|
|
|
+ */
|
|
|
+ if(PP.getBerserkMode()
|
|
|
+ && m.blockBreakSimulate(block, player, true)
|
|
|
+ && player.getItemInHand().getTypeId() == 0
|
|
|
+ && (Excavation.canBeGigaDrillBroken(block) || id == 78)
|
|
|
+ && mcPermissions.getInstance().unarmedAbility(player))
|
|
|
+ {
|
|
|
+ event.setInstaBreak(true);
|
|
|
+
|
|
|
+ if(LoadProperties.spoutEnabled)
|
|
|
+ SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ * SUPER BREAKER CHECKS
|
|
|
+ */
|
|
|
+ if(PP.getSuperBreakerMode()
|
|
|
+ && Mining.canBeSuperBroken(block)
|
|
|
+ && m.blockBreakSimulate(block, player, true)
|
|
|
+ && mcPermissions.getInstance().miningAbility(player))
|
|
|
+ {
|
|
|
+ if(LoadProperties.miningrequirespickaxe)
|
|
|
+ {
|
|
|
+ if(ItemChecks.isMiningPick(inhand)){
|
|
|
+
|
|
|
+ event.setInstaBreak(true);
|
|
|
+ Mining.SuperBreakerBlockCheck(player, block, plugin);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ event.setInstaBreak(true);
|
|
|
+ Mining.SuperBreakerBlockCheck(player, block, plugin);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ * LEAF BLOWER CHECKS
|
|
|
+ */
|
|
|
+ if(id == 18
|
|
|
+ && mcPermissions.getInstance().woodCuttingAbility(player)
|
|
|
+ && PP.getSkillLevel(SkillType.WOODCUTTING) >= 100
|
|
|
+ && m.blockBreakSimulate(block, player, true))
|
|
|
+ {
|
|
|
+ if(LoadProperties.woodcuttingrequiresaxe)
|
|
|
+ {
|
|
|
+ if(ItemChecks.isAxe(inhand)){
|
|
|
+ event.setInstaBreak(true);
|
|
|
+ WoodCutting.leafBlower(player, block);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(inhand.getTypeId() != 359)
|
|
|
+ {
|
|
|
+ event.setInstaBreak(true);
|
|
|
+ WoodCutting.leafBlower(player, block);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@EventHandler
|