mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 03:04:44 +02:00
More fixes for instaBreak, moving abilities to individual skill files.
This commit is contained in:
@ -23,6 +23,7 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import com.gmail.nossr50.locale.mcLocale;
|
||||
import com.gmail.nossr50.spout.SpoutStuff;
|
||||
import com.gmail.nossr50.Users;
|
||||
import com.gmail.nossr50.m;
|
||||
import com.gmail.nossr50.config.LoadProperties;
|
||||
@ -74,7 +75,7 @@ public class Excavation
|
||||
Material t = block.getType();
|
||||
return t == Material.DIRT || t == Material.GRASS || t == Material.SAND || t == Material.GRAVEL || t == Material.CLAY || t == Material.MYCEL || t == Material.SOUL_SAND;
|
||||
}
|
||||
public static void excavationProcCheck(byte data, Material type, Location loc, Player player)
|
||||
public static void excavationProcCheck(Material type, Location loc, Player player)
|
||||
{
|
||||
if(LoadProperties.excavationRequiresShovel && !m.isShovel(player.getItemInHand()))
|
||||
return;
|
||||
@ -253,4 +254,23 @@ public class Excavation
|
||||
PP.addXP(SkillType.EXCAVATION, xp, player);
|
||||
Skills.XpCheckSkill(SkillType.EXCAVATION, player);
|
||||
}
|
||||
|
||||
public static void gigaDrillBreaker(Player player, Block block)
|
||||
{
|
||||
if(LoadProperties.toolsLoseDurabilityFromAbilities)
|
||||
{
|
||||
if(!player.getItemInHand.containsEnchantment(Enchantment.DURABILITY))
|
||||
m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss);
|
||||
}
|
||||
|
||||
if(block.getData() != (byte)5)
|
||||
{
|
||||
Excavation.excavationProcCheck(block.getType(), block.getLocation(), player);
|
||||
Excavation.excavationProcCheck(block.getType(), block.getLocation(), player);
|
||||
Excavation.excavationProcCheck(block.getType(), block.getLocation(), player);
|
||||
}
|
||||
|
||||
if(LoadProperties.spoutEnabled)
|
||||
SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
|
||||
}
|
||||
}
|
@ -17,7 +17,6 @@
|
||||
package com.gmail.nossr50.skills;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import net.minecraft.server.Enchantment;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -25,10 +24,10 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.Statistic;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import com.gmail.nossr50.Users;
|
||||
import com.gmail.nossr50.m;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.mcPermissions;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.locale.mcLocale;
|
||||
@ -203,7 +202,7 @@ public class WoodCutting
|
||||
public static void leafBlower(Player player, Block block){
|
||||
if(LoadProperties.toolsLoseDurabilityFromAbilities)
|
||||
{
|
||||
if(!player.getItemInHand().getEnchantments().containsKey(Enchantment.DURABILITY))
|
||||
if(!player.getItemInHand().containsEnchantment(Enchantment.DURABILITY))
|
||||
m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss);
|
||||
}
|
||||
|
||||
@ -213,9 +212,6 @@ public class WoodCutting
|
||||
m.mcDropItem(block.getLocation(), x);
|
||||
}
|
||||
|
||||
block.setType(Material.AIR);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
|
||||
if(LoadProperties.spoutEnabled)
|
||||
SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
|
||||
}
|
||||
|
Reference in New Issue
Block a user