mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 03:04:44 +02:00
Moved more stuff into skill files.
This commit is contained in:
@ -25,7 +25,9 @@ import com.gmail.nossr50.m;
|
||||
import com.gmail.nossr50.config.LoadProperties;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.listeners.Material;
|
||||
import com.gmail.nossr50.locale.mcLocale;
|
||||
import com.gmail.nossr50.spout.SpoutStuff;
|
||||
|
||||
public class Unarmed {
|
||||
public static void berserkActivationCheck(Player player)
|
||||
@ -108,4 +110,36 @@ public class Unarmed {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void berserk(Player player, Block block){
|
||||
|
||||
Material mat = Material.getMaterial(block.getTypeId());
|
||||
byte damage = 0;
|
||||
|
||||
if(block.getTypeId() == 2 || block.getTypeId() == 110)
|
||||
mat = Material.DIRT;
|
||||
if(block.getTypeId() == 78)
|
||||
mat = Material.SNOW_BALL;
|
||||
if(block.getTypeId() == 82)
|
||||
mat = Material.CLAY_BALL;
|
||||
|
||||
ItemStack item = new ItemStack(mat, 1, (byte)0, damage);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, event.getBlock().getType());
|
||||
|
||||
// block.setType(Material.AIR);
|
||||
|
||||
if(item.getType() == Material.CLAY_BALL)
|
||||
{
|
||||
m.mcDropItem(block.getLocation(), item);
|
||||
m.mcDropItem(block.getLocation(), item);
|
||||
m.mcDropItem(block.getLocation(), item);
|
||||
m.mcDropItem(block.getLocation(), item);
|
||||
} else
|
||||
{
|
||||
m.mcDropItem(block.getLocation(), item);
|
||||
}
|
||||
|
||||
if(LoadProperties.spoutEnabled)
|
||||
SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
|
||||
}
|
||||
}
|
||||
|
@ -27,9 +27,11 @@ import org.bukkit.inventory.ItemStack;
|
||||
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;
|
||||
import com.gmail.nossr50.spout.SpoutStuff;
|
||||
import com.gmail.nossr50.config.*;
|
||||
|
||||
|
||||
@ -195,4 +197,24 @@ public class WoodCutting
|
||||
PP.addXP(SkillType.WOODCUTTING, xp, player);
|
||||
Skills.XpCheckSkill(SkillType.WOODCUTTING, player);
|
||||
}
|
||||
|
||||
public static void leafBlower(Player player, Block block){
|
||||
if(LoadProperties.toolsLoseDurabilityFromAbilities)
|
||||
{
|
||||
if(!player.getItemInHand().getEnchantments().containsKey(Enchantment.DURABILITY))
|
||||
m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss);
|
||||
}
|
||||
|
||||
if(Math.random() * 10 > 9)
|
||||
{
|
||||
ItemStack x = new ItemStack(Material.SAPLING, 1, (short)0, (byte)(block.getData()-8));
|
||||
m.mcDropItem(block.getLocation(), x);
|
||||
}
|
||||
|
||||
block.setType(Material.AIR);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, event.getBlock().getType());
|
||||
|
||||
if(LoadProperties.spoutEnabled)
|
||||
SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user