Merge remote branch 'org.eclipse.jgit.transport.RemoteConfig@10a3c73/master'

This commit is contained in:
Grant 2012-01-30 00:13:31 -05:00
commit 5b45ea3739
15 changed files with 332 additions and 208 deletions

View File

@ -1,6 +1,14 @@
Changelog: Changelog:
#Versions without changelogs probably had very small misc fixes, like tweaks to the source code #Versions without changelogs probably had very small misc fixes, like tweaks to the source code
Version 1.2.09-dev
- Fixed issue with Repair Mastery (Issue #47)
- Made Arcane Forging fully configurable (Pull Request #52)
- Changed timer to be a bit more efficient (Issue #19)
- Changed to fire EntityDamageEvents for all damage done by mcMMO
- New custom event for developers McMMOPlayerLevelUpEvent
- New custmo event for developers McMMOItemSpawnEvent
Version 1.2.08 Version 1.2.08
- Changed Bukkit events to new event system - Changed Bukkit events to new event system
- Changed aliasing to send both the mcmmo command and the command used. - Changed aliasing to send both the mcmmo command and the command used.

View File

@ -107,14 +107,14 @@
<dependency> <dependency>
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId> <artifactId>bukkit</artifactId>
<version>1.1-R1</version> <version>1.1-R3-SNAPSHOT</version>
<type>jar</type> <type>jar</type>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId> <artifactId>craftbukkit</artifactId>
<version>1.1-R1</version> <version>1.1-R2</version>
<type>jar</type> <type>jar</type>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>

View File

@ -361,8 +361,7 @@ public class Combat
* @param dmg Amount of damage to attempt to do * @param dmg Amount of damage to attempt to do
*/ */
public static void dealDamage(LivingEntity target, int dmg){ public static void dealDamage(LivingEntity target, int dmg){
EntityDamageEvent ede = new EntityDamageEvent(target, EntityDamageEvent.DamageCause.CUSTOM, dmg); dealDamage(target, dmg, EntityDamageEvent.DamageCause.CUSTOM);
Bukkit.getPluginManager().callEvent(ede);
} }
/** /**
@ -375,6 +374,9 @@ public class Combat
public static void dealDamage(LivingEntity target, int dmg, DamageCause cause) { public static void dealDamage(LivingEntity target, int dmg, DamageCause cause) {
EntityDamageEvent ede = new EntityDamageEvent(target, cause, dmg); EntityDamageEvent ede = new EntityDamageEvent(target, cause, dmg);
Bukkit.getPluginManager().callEvent(ede); Bukkit.getPluginManager().callEvent(ede);
if(ede.isCancelled()) return;
target.damage(ede.getDamage());
} }
/** /**
@ -387,6 +389,8 @@ public class Combat
public static void dealDamage(LivingEntity target, int dmg, Player attacker) { public static void dealDamage(LivingEntity target, int dmg, Player attacker) {
EntityDamageEvent ede = new EntityDamageByEntityEvent(attacker, target, EntityDamageEvent.DamageCause.ENTITY_ATTACK, dmg); EntityDamageEvent ede = new EntityDamageByEntityEvent(attacker, target, EntityDamageEvent.DamageCause.ENTITY_ATTACK, dmg);
Bukkit.getPluginManager().callEvent(ede); Bukkit.getPluginManager().callEvent(ede);
target.damage(ede.getDamage());
} }
public static boolean pvpAllowed(EntityDamageByEntityEvent event, World world) public static boolean pvpAllowed(EntityDamageByEntityEvent event, World world)

View File

@ -0,0 +1,89 @@
/*
This file is part of mcMMO.
mcMMO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
mcMMO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with mcMMO. If not, see <http://www.gnu.org/licenses/>.
*/
package com.gmail.nossr50.events;
import org.bukkit.Location;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.bukkit.inventory.ItemStack;
/**
* Called when mcMMO is preparing to drop an item
*/
@SuppressWarnings("serial")
public class McMMOItemSpawnEvent extends Event implements Cancellable {
private Location location;
private ItemStack itemStack;
private boolean cancelled;
public McMMOItemSpawnEvent(Location location, ItemStack itemStack) {
this.location = location;
this.itemStack = itemStack;
this.cancelled = false;
}
/**
* @return Location where the item will be dropped
*/
public Location getLocation() {
return location;
}
/**
* @param location Location where to drop the item
*/
public void setLocation(Location location) {
this.location = location;
}
/**
* @return ItemStack that will be dropped
*/
public ItemStack getItemStack() {
return itemStack;
}
/**
* @param itemStack ItemStack to drop
*/
public void setItemStack(ItemStack itemStack) {
this.itemStack = itemStack;
}
/** Following are required for Cancellable **/
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
/** Rest of file is required boilerplate for custom events **/
private static final HandlerList handlers = new HandlerList();
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}

View File

@ -1,3 +1,19 @@
/*
This file is part of mcMMO.
mcMMO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
mcMMO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with mcMMO. If not, see <http://www.gnu.org/licenses/>.
*/
package com.gmail.nossr50.events; package com.gmail.nossr50.events;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;

View File

@ -226,7 +226,7 @@ public class mcBlockListener implements Listener
ItemStack item = new ItemStack(mat, 1, (byte)0, type); ItemStack item = new ItemStack(mat, 1, (byte)0, type);
if(blockx.getTypeId() == 17) if(blockx.getTypeId() == 17)
{ {
blockx.getLocation().getWorld().dropItemNaturally(blockx.getLocation(), item); m.mcDropItem(blockx.getLocation(), item);
//XP WOODCUTTING //XP WOODCUTTING
if(!plugin.misc.blockWatchList.contains(block)) if(!plugin.misc.blockWatchList.contains(block))
{ {
@ -241,7 +241,7 @@ public class mcBlockListener implements Listener
item = new ItemStack(mat, 1, (short)0, blockx.getData()); item = new ItemStack(mat, 1, (short)0, blockx.getData());
if(Math.random() * 10 > 9) if(Math.random() * 10 > 9)
blockx.getLocation().getWorld().dropItemNaturally(blockx.getLocation(), item); m.mcDropItem(blockx.getLocation(), item);
} }
if(blockx.getType() != Material.AIR) if(blockx.getType() != Material.AIR)
player.incrementStatistic(Statistic.MINE_BLOCK, event.getBlock().getType()); player.incrementStatistic(Statistic.MINE_BLOCK, event.getBlock().getType());
@ -289,7 +289,7 @@ public class mcBlockListener implements Listener
ItemStack inhand = player.getItemInHand(); ItemStack inhand = player.getItemInHand();
Block block = event.getBlock(); Block block = event.getBlock();
Skills.monitorSkills(player); Skills.monitorSkills(player, PP);
/* /*
* ABILITY PREPARATION CHECKS * ABILITY PREPARATION CHECKS
@ -353,13 +353,13 @@ public class mcBlockListener implements Listener
if(item.getType() == Material.CLAY_BALL) if(item.getType() == Material.CLAY_BALL)
{ {
block.getLocation().getWorld().dropItemNaturally(block.getLocation(), item); m.mcDropItem(block.getLocation(), item);
block.getLocation().getWorld().dropItemNaturally(block.getLocation(), item); m.mcDropItem(block.getLocation(), item);
block.getLocation().getWorld().dropItemNaturally(block.getLocation(), item); m.mcDropItem(block.getLocation(), item);
block.getLocation().getWorld().dropItemNaturally(block.getLocation(), item); m.mcDropItem(block.getLocation(), item);
} else } else
{ {
block.getLocation().getWorld().dropItemNaturally(block.getLocation(), item); m.mcDropItem(block.getLocation(), item);
} }
//Spout stuff //Spout stuff
@ -392,13 +392,13 @@ public class mcBlockListener implements Listener
if(item.getType() == Material.CLAY_BALL) if(item.getType() == Material.CLAY_BALL)
{ {
block.getLocation().getWorld().dropItemNaturally(block.getLocation(), item); m.mcDropItem(block.getLocation(), item);
block.getLocation().getWorld().dropItemNaturally(block.getLocation(), item); m.mcDropItem(block.getLocation(), item);
block.getLocation().getWorld().dropItemNaturally(block.getLocation(), item); m.mcDropItem(block.getLocation(), item);
block.getLocation().getWorld().dropItemNaturally(block.getLocation(), item); m.mcDropItem(block.getLocation(), item);
} else } else
{ {
block.getLocation().getWorld().dropItemNaturally(block.getLocation(), item); m.mcDropItem(block.getLocation(), item);
} }
if(LoadProperties.spoutEnabled) if(LoadProperties.spoutEnabled)
@ -431,7 +431,7 @@ public class mcBlockListener implements Listener
if(Math.random() * 10 > 9) if(Math.random() * 10 > 9)
{ {
ItemStack x = new ItemStack(Material.SAPLING, 1, (short)0, block.getData()); ItemStack x = new ItemStack(Material.SAPLING, 1, (short)0, block.getData());
block.getLocation().getWorld().dropItemNaturally(block.getLocation(), x); m.mcDropItem(block.getLocation(), x);
} }
block.setType(Material.AIR); block.setType(Material.AIR);
player.incrementStatistic(Statistic.MINE_BLOCK, event.getBlock().getType()); player.incrementStatistic(Statistic.MINE_BLOCK, event.getBlock().getType());

View File

@ -31,6 +31,7 @@ import com.gmail.nossr50.config.*;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.FakeBlockBreakEvent; import com.gmail.nossr50.datatypes.FakeBlockBreakEvent;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.events.McMMOItemSpawnEvent;
public class m public class m
{ {
@ -255,15 +256,21 @@ public class m
} }
return true; return true;
} }
public static void mcDropItem(Location loc, int id) public static void mcDropItem(Location location, int id)
{
if(loc != null)
{ {
if(location == null) return;
Material mat = Material.getMaterial(id); Material mat = Material.getMaterial(id);
byte damage = 0; ItemStack item = new ItemStack(mat, 1, (byte) 0, (byte) 0);
ItemStack item = new ItemStack(mat, 1, (byte)0, damage); mcDropItem(location, item);
loc.getWorld().dropItemNaturally(loc, item);
} }
public static void mcDropItem(Location location, ItemStack itemStack) {
// We can't get the item until we spawn it and we want to make it cancellable, so we have a custom event.
McMMOItemSpawnEvent event = new McMMOItemSpawnEvent(location, itemStack);
Bukkit.getPluginManager().callEvent(event);
if(event.isCancelled()) return;
location.getWorld().dropItemNaturally(location, itemStack);
} }
public static boolean isSwords(ItemStack is) public static boolean isSwords(ItemStack is)

View File

@ -37,6 +37,7 @@ public class mcTimer implements Runnable
public void run() public void run()
{ {
long curTime = System.currentTimeMillis();
for(Player player : plugin.getServer().getOnlinePlayers()) for(Player player : plugin.getServer().getOnlinePlayers())
{ {
if(player == null) if(player == null)
@ -49,12 +50,12 @@ public class mcTimer implements Runnable
/* /*
* MONITOR SKILLS * MONITOR SKILLS
*/ */
Skills.monitorSkills(player); Skills.monitorSkills(player, PP, curTime);
/* /*
* COOLDOWN MONITORING * COOLDOWN MONITORING
*/ */
Skills.watchCooldowns(player); Skills.watchCooldowns(player, PP, curTime);
/* /*
* PLAYER BLEED MONITORING * PLAYER BLEED MONITORING

View File

@ -269,7 +269,7 @@ public class Excavation
for(ItemStack x : is) for(ItemStack x : is)
{ {
if(x != null) if(x != null)
loc.getWorld().dropItemNaturally(loc, x); m.mcDropItem(loc, x);
} }
//Handle XP related tasks //Handle XP related tasks

View File

@ -1,7 +1,7 @@
package com.gmail.nossr50.skills; package com.gmail.nossr50.skills;
import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.craftbukkit.entity.CraftItem; import org.bukkit.craftbukkit.entity.CraftItem;
import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.*; import org.bukkit.entity.*;
@ -11,6 +11,7 @@ import org.bukkit.material.Wool;
import com.gmail.nossr50.Combat; import com.gmail.nossr50.Combat;
import com.gmail.nossr50.Users; import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
@ -61,7 +62,7 @@ public class Fishing {
getFishingResultsTier5(player, event); getFishingResultsTier5(player, event);
break; break;
} }
player.getWorld().dropItem(player.getLocation(), new ItemStack(Material.RAW_FISH, 1)); m.mcDropItem(player.getLocation(), new ItemStack(Material.RAW_FISH, 1));
Users.getProfile(player).addXP(SkillType.FISHING, LoadProperties.mfishing, player); Users.getProfile(player).addXP(SkillType.FISHING, LoadProperties.mfishing, player);
Skills.XpCheckSkill(SkillType.FISHING, player); Skills.XpCheckSkill(SkillType.FISHING, player);
} }
@ -673,7 +674,7 @@ public class Fishing {
return; return;
Combat.dealDamage(le, 1, event.getPlayer()); Combat.dealDamage(le, 1, event.getPlayer());
World world = le.getWorld(); Location loc = le.getLocation();
/* Neutral Mobs */ /* Neutral Mobs */
if(le instanceof Sheep) if(le instanceof Sheep)
@ -685,26 +686,26 @@ public class Fishing {
wool.setColor(sheep.getColor()); wool.setColor(sheep.getColor());
ItemStack theWool = wool.toItemStack(); ItemStack theWool = wool.toItemStack();
theWool.setAmount((int)(Math.random() * 6)); theWool.setAmount((int)(Math.random() * 6));
world.dropItemNaturally(le.getLocation(), theWool); m.mcDropItem(loc, theWool);
sheep.setSheared(true); sheep.setSheared(true);
} }
} }
else if(le instanceof Pig) else if(le instanceof Pig)
{ {
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.PORK, 1)); m.mcDropItem(loc, new ItemStack(Material.PORK, 1));
} }
else if(le instanceof Cow) else if(le instanceof Cow)
{ {
if(Math.random() * 100 < 99){ if(Math.random() * 100 < 99){
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.MILK_BUCKET, 1)); //rare chance to drop milk m.mcDropItem(loc, new ItemStack(Material.MILK_BUCKET, 1)); //rare chance to drop milk
} }
else if(Math.random() * 10 < 5){ else if(Math.random() * 10 < 5){
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.LEATHER, 1)); m.mcDropItem(loc, new ItemStack(Material.LEATHER, 1));
} }
else{ else{
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.RAW_BEEF, 1)); m.mcDropItem(loc, new ItemStack(Material.RAW_BEEF, 1));
} }
} }
@ -712,14 +713,14 @@ public class Fishing {
{ {
if(Math.random() * 10 <= 7){ if(Math.random() * 10 <= 7){
if(Math.random() * 10 < 5){ if(Math.random() * 10 < 5){
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.FEATHER, 1)); m.mcDropItem(loc, new ItemStack(Material.FEATHER, 1));
} }
else{ else{
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.RAW_CHICKEN, 1)); m.mcDropItem(loc, new ItemStack(Material.RAW_CHICKEN, 1));
} }
} }
else{ else{
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.EGG, 1)); m.mcDropItem(loc, new ItemStack(Material.EGG, 1));
} }
} }
@ -727,37 +728,37 @@ public class Fishing {
{ {
if(Math.random() * 100 < 99){ if(Math.random() * 100 < 99){
if(Math.random() * 10 < 5){ if(Math.random() * 10 < 5){
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.MILK_BUCKET, 1)); //rare chance to drop milk m.mcDropItem(loc, new ItemStack(Material.MILK_BUCKET, 1)); //rare chance to drop milk
} }
else{ else{
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.MUSHROOM_SOUP, 1)); //rare chance to drop soup m.mcDropItem(loc, new ItemStack(Material.MUSHROOM_SOUP, 1)); //rare chance to drop soup
} }
} }
else if(Math.random() * 10 <= 7){ else if(Math.random() * 10 <= 7){
if(Math.random() * 10 < 5){ if(Math.random() * 10 < 5){
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.LEATHER, 1)); m.mcDropItem(loc, new ItemStack(Material.LEATHER, 1));
} }
else{ else{
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.RAW_BEEF, 1)); m.mcDropItem(loc, new ItemStack(Material.RAW_BEEF, 1));
} }
} }
else{ else{
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.RED_MUSHROOM, 3)); m.mcDropItem(loc, new ItemStack(Material.RED_MUSHROOM, 3));
//need some way to remove MushroomCow & replace with regular cow when sheared //need some way to remove MushroomCow & replace with regular cow when sheared
} }
} }
else if(le instanceof Squid) else if(le instanceof Squid)
{ {
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.getMaterial(351), 1, (byte)0, (byte)0)); m.mcDropItem(loc, new ItemStack(Material.getMaterial(351), 1, (byte)0, (byte)0));
} }
else if(le instanceof Snowman){ else if(le instanceof Snowman){
if(Math.random() * 100 < 99){ if(Math.random() * 100 < 99){
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.PUMPKIN, 1)); //rare chance to drop pumpkin m.mcDropItem(loc, new ItemStack(Material.PUMPKIN, 1)); //rare chance to drop pumpkin
} }
else{ else{
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.SNOW_BALL, 5)); m.mcDropItem(loc, new ItemStack(Material.SNOW_BALL, 5));
} }
} }
@ -765,71 +766,71 @@ public class Fishing {
else if(le instanceof Skeleton) else if(le instanceof Skeleton)
{ {
if(Math.random() * 10 < 5) if(Math.random() * 10 < 5)
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.BONE, 1)); m.mcDropItem(loc, new ItemStack(Material.BONE, 1));
else else
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.ARROW, 3)); m.mcDropItem(loc, new ItemStack(Material.ARROW, 3));
} }
else if(le instanceof Spider) else if(le instanceof Spider)
{ {
if(Math.random() * 10 < 5) if(Math.random() * 10 < 5)
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.SPIDER_EYE, 1)); m.mcDropItem(loc, new ItemStack(Material.SPIDER_EYE, 1));
else else
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.STRING, 1)); m.mcDropItem(loc, new ItemStack(Material.STRING, 1));
} }
else if(le instanceof Creeper) else if(le instanceof Creeper)
{ {
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.SULPHUR, 1)); m.mcDropItem(loc, new ItemStack(Material.SULPHUR, 1));
} }
else if(le instanceof Enderman) else if(le instanceof Enderman)
{ {
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.ENDER_PEARL, 1)); m.mcDropItem(loc, new ItemStack(Material.ENDER_PEARL, 1));
} }
else if(le instanceof PigZombie) else if(le instanceof PigZombie)
{ {
if(Math.random() * 10 < 5) if(Math.random() * 10 < 5)
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.ROTTEN_FLESH, 1)); m.mcDropItem(loc, new ItemStack(Material.ROTTEN_FLESH, 1));
else else
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.GOLD_NUGGET, 1)); m.mcDropItem(loc, new ItemStack(Material.GOLD_NUGGET, 1));
} }
else if(le instanceof Blaze) else if(le instanceof Blaze)
{ {
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.BLAZE_ROD, 1)); m.mcDropItem(loc, new ItemStack(Material.BLAZE_ROD, 1));
} }
else if(le instanceof CaveSpider) else if(le instanceof CaveSpider)
{ {
if(Math.random() * 10 < 5) if(Math.random() * 10 < 5)
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.SPIDER_EYE, 1)); m.mcDropItem(loc, new ItemStack(Material.SPIDER_EYE, 1));
else else
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.STRING, 1)); m.mcDropItem(loc, new ItemStack(Material.STRING, 1));
} }
else if(le instanceof Ghast) else if(le instanceof Ghast)
{ {
if(Math.random() * 10 < 5) if(Math.random() * 10 < 5)
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.SULPHUR, 1)); m.mcDropItem(loc, new ItemStack(Material.SULPHUR, 1));
else else
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.GHAST_TEAR, 1)); m.mcDropItem(loc, new ItemStack(Material.GHAST_TEAR, 1));
} }
else if(le instanceof MagmaCube) else if(le instanceof MagmaCube)
{ {
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.MAGMA_CREAM, 1)); m.mcDropItem(loc, new ItemStack(Material.MAGMA_CREAM, 1));
} }
else if(le instanceof Slime) else if(le instanceof Slime)
{ {
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.SLIME_BALL, 1)); m.mcDropItem(loc, new ItemStack(Material.SLIME_BALL, 1));
} }
else if(le instanceof Zombie) else if(le instanceof Zombie)
{ {
world.dropItemNaturally(le.getLocation(), new ItemStack(Material.ROTTEN_FLESH, 1)); m.mcDropItem(loc, new ItemStack(Material.ROTTEN_FLESH, 1));
} }
} }
} }

View File

@ -82,12 +82,12 @@ public class Herbalism
Location loc = block.getLocation(); Location loc = block.getLocation();
ItemStack is = new ItemStack(mat, 1, (byte)0, (byte)0); ItemStack is = new ItemStack(mat, 1, (byte)0, (byte)0);
PP.addXP(SkillType.HERBALISM, LoadProperties.mwheat, player); PP.addXP(SkillType.HERBALISM, LoadProperties.mwheat, player);
loc.getWorld().dropItemNaturally(loc, is); m.mcDropItem(loc, is);
//DROP SOME SEEDS //DROP SOME SEEDS
mat = Material.SEEDS; mat = Material.SEEDS;
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); m.mcDropItem(loc, is);
herbalismProcCheck(block, player, event, plugin); herbalismProcCheck(block, player, event, plugin);
herbalismProcCheck(block, player, event, plugin); herbalismProcCheck(block, player, event, plugin);
@ -166,18 +166,18 @@ public class Herbalism
{ {
if(Math.random() * 1000 <= PP.getSkillLevel(SkillType.HERBALISM)) if(Math.random() * 1000 <= PP.getSkillLevel(SkillType.HERBALISM))
{ {
loc.getWorld().dropItemNaturally(loc, is); m.mcDropItem(loc, is);
} }
} }
//GREEN THUMB //GREEN THUMB
if(Math.random() * 1500 <= PP.getSkillLevel(SkillType.HERBALISM)) if(Math.random() * 1500 <= PP.getSkillLevel(SkillType.HERBALISM))
{ {
event.setCancelled(true); event.setCancelled(true);
loc.getWorld().dropItemNaturally(loc, is); m.mcDropItem(loc, is);
//DROP SOME SEEDS //DROP SOME SEEDS
mat = Material.SEEDS; mat = Material.SEEDS;
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
loc.getWorld().dropItemNaturally(loc, is); m.mcDropItem(loc, is);
block.setData((byte) 0x1); //Change it to first stage block.setData((byte) 0x1); //Change it to first stage
@ -233,7 +233,7 @@ public class Herbalism
{ {
if(Math.random() * 1000 <= PP.getSkillLevel(SkillType.HERBALISM)) if(Math.random() * 1000 <= PP.getSkillLevel(SkillType.HERBALISM))
{ {
loc.getWorld().dropItemNaturally(target.getLocation(), is); m.mcDropItem(target.getLocation(), is);
} }
PP.addXP(SkillType.HERBALISM, LoadProperties.mcactus, player); PP.addXP(SkillType.HERBALISM, LoadProperties.mcactus, player);
} }
@ -272,7 +272,7 @@ public class Herbalism
{ {
if(Math.random() * 1000 <= PP.getSkillLevel(SkillType.HERBALISM)) if(Math.random() * 1000 <= PP.getSkillLevel(SkillType.HERBALISM))
{ {
loc.getWorld().dropItemNaturally(target.getLocation(), is); m.mcDropItem(target.getLocation(), is);
} }
PP.addXP(SkillType.HERBALISM, LoadProperties.msugar, player); PP.addXP(SkillType.HERBALISM, LoadProperties.msugar, player);
} }
@ -290,7 +290,7 @@ public class Herbalism
{ {
if(Math.random() * 1000 <= PP.getSkillLevel(SkillType.HERBALISM)) if(Math.random() * 1000 <= PP.getSkillLevel(SkillType.HERBALISM))
{ {
loc.getWorld().dropItemNaturally(loc, is); m.mcDropItem(loc, is);
} }
} }
PP.addXP(SkillType.HERBALISM, LoadProperties.mpumpkin, player); PP.addXP(SkillType.HERBALISM, LoadProperties.mpumpkin, player);
@ -303,7 +303,7 @@ public class Herbalism
if(Math.random() * 1000 <= PP.getSkillLevel(SkillType.HERBALISM)) if(Math.random() * 1000 <= PP.getSkillLevel(SkillType.HERBALISM))
{ {
loc.getWorld().dropItemNaturally(loc, is); m.mcDropItem(loc, is);
} }
PP.addXP(SkillType.HERBALISM, LoadProperties.mmelon, player); PP.addXP(SkillType.HERBALISM, LoadProperties.mmelon, player);
} }
@ -316,7 +316,7 @@ public class Herbalism
{ {
if(Math.random() * 1000 <= PP.getSkillLevel(SkillType.HERBALISM)) if(Math.random() * 1000 <= PP.getSkillLevel(SkillType.HERBALISM))
{ {
loc.getWorld().dropItemNaturally(loc, is); m.mcDropItem(loc, is);
} }
} }
PP.addXP(SkillType.HERBALISM, LoadProperties.mmushroom, player); PP.addXP(SkillType.HERBALISM, LoadProperties.mmushroom, player);
@ -327,7 +327,7 @@ public class Herbalism
is = new ItemStack(mat, 1, (byte)0, (byte)0); is = new ItemStack(mat, 1, (byte)0, (byte)0);
if(player != null){ if(player != null){
if(Math.random() * 1000 <= PP.getSkillLevel(SkillType.HERBALISM)){ if(Math.random() * 1000 <= PP.getSkillLevel(SkillType.HERBALISM)){
loc.getWorld().dropItemNaturally(loc, is); m.mcDropItem(loc, is);
} }
} }
PP.addXP(SkillType.HERBALISM, LoadProperties.mflower, player); PP.addXP(SkillType.HERBALISM, LoadProperties.mflower, player);

View File

@ -84,50 +84,50 @@ public class Mining
ItemStack item = new ItemStack(mat, 1, (byte)0, damage); ItemStack item = new ItemStack(mat, 1, (byte)0, damage);
if(block.getTypeId() != 89 && block.getTypeId() != 73 && block.getTypeId() != 74 && block.getTypeId() != 56 if(block.getTypeId() != 89 && block.getTypeId() != 73 && block.getTypeId() != 74 && block.getTypeId() != 56
&& block.getTypeId() != 21 && block.getTypeId() != 1 && block.getTypeId() != 16) && block.getTypeId() != 21 && block.getTypeId() != 1 && block.getTypeId() != 16)
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
if(block.getTypeId() == 89) if(block.getTypeId() == 89)
{ {
mat = Material.getMaterial(348); mat = Material.getMaterial(348);
item = new ItemStack(mat, 1, (byte)0, damage); item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
} }
if(block.getTypeId() == 73 || block.getTypeId() == 74) if(block.getTypeId() == 73 || block.getTypeId() == 74)
{ {
mat = Material.getMaterial(331); mat = Material.getMaterial(331);
item = new ItemStack(mat, 1, (byte)0, damage); item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
if(Math.random() * 10 > 5){ if(Math.random() * 10 > 5){
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
} }
} }
if(block.getTypeId() == 21) if(block.getTypeId() == 21)
{ {
mat = Material.getMaterial(351); mat = Material.getMaterial(351);
item = new ItemStack(mat, 1, (byte)0,(byte)0x4); item = new ItemStack(mat, 1, (byte)0,(byte)0x4);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
} }
if(block.getTypeId() == 56) if(block.getTypeId() == 56)
{ {
mat = Material.getMaterial(264); mat = Material.getMaterial(264);
item = new ItemStack(mat, 1, (byte)0, damage); item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
} }
if(block.getTypeId() == 1) if(block.getTypeId() == 1)
{ {
mat = Material.getMaterial(4); mat = Material.getMaterial(4);
item = new ItemStack(mat, 1, (byte)0, damage); item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
} }
if(block.getTypeId() == 16) if(block.getTypeId() == 16)
{ {
mat = Material.getMaterial(263); mat = Material.getMaterial(263);
item = new ItemStack(mat, 1, (byte)0, damage); item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
} }
} }
public static void blockProcCheck(Block block, Player player) public static void blockProcCheck(Block block, Player player)
@ -291,7 +291,7 @@ public class Mining
} }
} }
item = new ItemStack(mat, 1, (byte)0, damage); item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType()); player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR); block.setType(Material.AIR);
} }
@ -305,7 +305,7 @@ public class Mining
} }
mat = Material.getMaterial(87); mat = Material.getMaterial(87);
item = new ItemStack(mat, 1, (byte)0, damage); item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType()); player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR); block.setType(Material.AIR);
} }
@ -319,7 +319,7 @@ public class Mining
} }
mat = Material.getMaterial(348); mat = Material.getMaterial(348);
item = new ItemStack(mat, 1, (byte)0, damage); item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType()); player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR); block.setType(Material.AIR);
} }
@ -333,7 +333,7 @@ public class Mining
} }
mat = Material.getMaterial(263); mat = Material.getMaterial(263);
item = new ItemStack(mat, 1, (byte)0, damage); item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType()); player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR); block.setType(Material.AIR);
} }
@ -346,7 +346,7 @@ public class Mining
blockProcCheck(block, player); blockProcCheck(block, player);
} }
item = new ItemStack(mat, 1, (byte)0, damage); item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType()); player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR); block.setType(Material.AIR);
} }
@ -362,7 +362,7 @@ public class Mining
} }
mat = Material.getMaterial(49); mat = Material.getMaterial(49);
item = new ItemStack(mat, 1, (byte)0, damage); item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType()); player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR); block.setType(Material.AIR);
} }
@ -376,7 +376,7 @@ public class Mining
} }
mat = Material.getMaterial(264); mat = Material.getMaterial(264);
item = new ItemStack(mat, 1, (byte)0, damage); item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType()); player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR); block.setType(Material.AIR);
} }
@ -389,7 +389,7 @@ public class Mining
blockProcCheck(block, player); blockProcCheck(block, player);
} }
item = new ItemStack(mat, 1, (byte)0, damage); item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType()); player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR); block.setType(Material.AIR);
} }
@ -404,12 +404,12 @@ public class Mining
} }
mat = Material.getMaterial(331); mat = Material.getMaterial(331);
item = new ItemStack(mat, 1, (byte)0, damage); item = new ItemStack(mat, 1, (byte)0, damage);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
if(Math.random() * 10 > 5) if(Math.random() * 10 > 5)
{ {
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
} }
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType()); player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR); block.setType(Material.AIR);
@ -423,10 +423,10 @@ public class Mining
} }
mat = Material.getMaterial(351); mat = Material.getMaterial(351);
item = new ItemStack(mat, 1, (byte)0,(byte)0x4); item = new ItemStack(mat, 1, (byte)0,(byte)0x4);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType()); player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
block.setType(Material.AIR); block.setType(Material.AIR);
} }

View File

@ -77,33 +77,32 @@ public class Skills
return (int) (((deactivatedTimeStamp + (cooldown * 1000)) - System.currentTimeMillis())/1000); return (int) (((deactivatedTimeStamp + (cooldown * 1000)) - System.currentTimeMillis())/1000);
} }
public static void watchCooldowns(Player player){ public static void watchCooldowns(Player player, PlayerProfile PP, long curTime){
PlayerProfile PP = Users.getProfile(player); if(!PP.getGreenTerraInformed() && curTime - (PP.getGreenTerraDeactivatedTimeStamp()*1000) >= (LoadProperties.greenTerraCooldown * 1000)){
if(!PP.getGreenTerraInformed() && System.currentTimeMillis() - (PP.getGreenTerraDeactivatedTimeStamp()*1000) >= (LoadProperties.greenTerraCooldown * 1000)){
PP.setGreenTerraInformed(true); PP.setGreenTerraInformed(true);
player.sendMessage(mcLocale.getString("Skills.YourGreenTerra")); player.sendMessage(mcLocale.getString("Skills.YourGreenTerra"));
} }
if(!PP.getTreeFellerInformed() && System.currentTimeMillis() - (PP.getTreeFellerDeactivatedTimeStamp()*1000) >= (LoadProperties.greenTerraCooldown * 1000)){ if(!PP.getTreeFellerInformed() && curTime - (PP.getTreeFellerDeactivatedTimeStamp()*1000) >= (LoadProperties.greenTerraCooldown * 1000)){
PP.setTreeFellerInformed(true); PP.setTreeFellerInformed(true);
player.sendMessage(mcLocale.getString("Skills.YourTreeFeller")); player.sendMessage(mcLocale.getString("Skills.YourTreeFeller"));
} }
if(!PP.getSuperBreakerInformed() && System.currentTimeMillis() - (PP.getSuperBreakerDeactivatedTimeStamp()*1000) >= (LoadProperties.superBreakerCooldown * 1000)){ if(!PP.getSuperBreakerInformed() && curTime - (PP.getSuperBreakerDeactivatedTimeStamp()*1000) >= (LoadProperties.superBreakerCooldown * 1000)){
PP.setSuperBreakerInformed(true); PP.setSuperBreakerInformed(true);
player.sendMessage(mcLocale.getString("Skills.YourSuperBreaker")); player.sendMessage(mcLocale.getString("Skills.YourSuperBreaker"));
} }
if(!PP.getSerratedStrikesInformed() && System.currentTimeMillis() - (PP.getSerratedStrikesDeactivatedTimeStamp()*1000) >= (LoadProperties.serratedStrikeCooldown * 1000)){ if(!PP.getSerratedStrikesInformed() && curTime - (PP.getSerratedStrikesDeactivatedTimeStamp()*1000) >= (LoadProperties.serratedStrikeCooldown * 1000)){
PP.setSerratedStrikesInformed(true); PP.setSerratedStrikesInformed(true);
player.sendMessage(mcLocale.getString("Skills.YourSerratedStrikes")); player.sendMessage(mcLocale.getString("Skills.YourSerratedStrikes"));
} }
if(!PP.getBerserkInformed() && System.currentTimeMillis() - (PP.getBerserkDeactivatedTimeStamp()*1000) >= (LoadProperties.berserkCooldown * 1000)){ if(!PP.getBerserkInformed() && curTime - (PP.getBerserkDeactivatedTimeStamp()*1000) >= (LoadProperties.berserkCooldown * 1000)){
PP.setBerserkInformed(true); PP.setBerserkInformed(true);
player.sendMessage(mcLocale.getString("Skills.YourBerserk")); player.sendMessage(mcLocale.getString("Skills.YourBerserk"));
} }
if(!PP.getSkullSplitterInformed() && System.currentTimeMillis() - (PP.getSkullSplitterDeactivatedTimeStamp()*1000) >= (LoadProperties.skullSplitterCooldown * 1000)){ if(!PP.getSkullSplitterInformed() && curTime - (PP.getSkullSplitterDeactivatedTimeStamp()*1000) >= (LoadProperties.skullSplitterCooldown * 1000)){
PP.setSkullSplitterInformed(true); PP.setSkullSplitterInformed(true);
player.sendMessage(mcLocale.getString("Skills.YourSkullSplitter")); player.sendMessage(mcLocale.getString("Skills.YourSkullSplitter"));
} }
if(!PP.getGigaDrillBreakerInformed() && System.currentTimeMillis() - (PP.getGigaDrillBreakerDeactivatedTimeStamp()*1000) >= (LoadProperties.gigaDrillBreakerCooldown * 1000)){ if(!PP.getGigaDrillBreakerInformed() && curTime - (PP.getGigaDrillBreakerDeactivatedTimeStamp()*1000) >= (LoadProperties.gigaDrillBreakerCooldown * 1000)){
PP.setGigaDrillBreakerInformed(true); PP.setGigaDrillBreakerInformed(true);
player.sendMessage(mcLocale.getString("Skills.YourGigaDrillBreaker")); player.sendMessage(mcLocale.getString("Skills.YourGigaDrillBreaker"));
} }
@ -126,31 +125,31 @@ public class Skills
PP.setHoePreparationMode(true); PP.setHoePreparationMode(true);
} }
} }
public static void monitorSkills(Player player){ public static void monitorSkills(Player player, PlayerProfile PP) {
PlayerProfile PP = Users.getProfile(player); monitorSkills(player, PP, System.currentTimeMillis());
if(PP != null) }
{ public static void monitorSkills(Player player, PlayerProfile PP, long curTime){
if(PP.getHoePreparationMode() && System.currentTimeMillis() - (PP.getHoePreparationATS()*1000) >= 4000){ if(PP.getHoePreparationMode() && curTime - (PP.getHoePreparationATS()*1000) >= 4000){
PP.setHoePreparationMode(false); PP.setHoePreparationMode(false);
player.sendMessage(mcLocale.getString("Skills.LowerHoe")); player.sendMessage(mcLocale.getString("Skills.LowerHoe"));
} }
if(PP.getAxePreparationMode() && System.currentTimeMillis() - (PP.getAxePreparationATS()*1000) >= 4000){ if(PP.getAxePreparationMode() && curTime - (PP.getAxePreparationATS()*1000) >= 4000){
PP.setAxePreparationMode(false); PP.setAxePreparationMode(false);
player.sendMessage(mcLocale.getString("Skills.LowerAxe")); player.sendMessage(mcLocale.getString("Skills.LowerAxe"));
} }
if(PP.getPickaxePreparationMode() && System.currentTimeMillis() - (PP.getPickaxePreparationATS()*1000) >= 4000){ if(PP.getPickaxePreparationMode() && curTime - (PP.getPickaxePreparationATS()*1000) >= 4000){
PP.setPickaxePreparationMode(false); PP.setPickaxePreparationMode(false);
player.sendMessage(mcLocale.getString("Skills.LowerPickAxe")); player.sendMessage(mcLocale.getString("Skills.LowerPickAxe"));
} }
if(PP.getSwordsPreparationMode() && System.currentTimeMillis() - (PP.getSwordsPreparationATS()*1000) >= 4000){ if(PP.getSwordsPreparationMode() && curTime - (PP.getSwordsPreparationATS()*1000) >= 4000){
PP.setSwordsPreparationMode(false); PP.setSwordsPreparationMode(false);
player.sendMessage(mcLocale.getString("Skills.LowerSword")); player.sendMessage(mcLocale.getString("Skills.LowerSword"));
} }
if(PP.getFistsPreparationMode() && System.currentTimeMillis() - (PP.getFistsPreparationATS()*1000) >= 4000){ if(PP.getFistsPreparationMode() && curTime - (PP.getFistsPreparationATS()*1000) >= 4000){
PP.setFistsPreparationMode(false); PP.setFistsPreparationMode(false);
player.sendMessage(mcLocale.getString("Skills.LowerFists")); player.sendMessage(mcLocale.getString("Skills.LowerFists"));
} }
if(PP.getShovelPreparationMode() && System.currentTimeMillis() - (PP.getShovelPreparationATS()*1000) >= 4000){ if(PP.getShovelPreparationMode() && curTime - (PP.getShovelPreparationATS()*1000) >= 4000){
PP.setShovelPreparationMode(false); PP.setShovelPreparationMode(false);
player.sendMessage(mcLocale.getString("Skills.LowerShovel")); player.sendMessage(mcLocale.getString("Skills.LowerShovel"));
} }
@ -159,7 +158,7 @@ public class Skills
* HERBALISM ABILITY * HERBALISM ABILITY
*/ */
if(mcPermissions.getInstance().herbalismAbility(player)){ if(mcPermissions.getInstance().herbalismAbility(player)){
if(PP.getGreenTerraMode() && (PP.getGreenTerraDeactivatedTimeStamp()*1000) <= System.currentTimeMillis()){ if(PP.getGreenTerraMode() && (PP.getGreenTerraDeactivatedTimeStamp()*1000) <= curTime){
PP.setGreenTerraMode(false); PP.setGreenTerraMode(false);
PP.setGreenTerraInformed(false); PP.setGreenTerraInformed(false);
player.sendMessage(mcLocale.getString("Skills.GreenTerraOff")); player.sendMessage(mcLocale.getString("Skills.GreenTerraOff"));
@ -169,7 +168,7 @@ public class Skills
* AXES ABILITY * AXES ABILITY
*/ */
if(mcPermissions.getInstance().axesAbility(player)){ if(mcPermissions.getInstance().axesAbility(player)){
if(PP.getSkullSplitterMode() && (PP.getSkullSplitterDeactivatedTimeStamp()*1000) <= System.currentTimeMillis()){ if(PP.getSkullSplitterMode() && (PP.getSkullSplitterDeactivatedTimeStamp()*1000) <= curTime){
PP.setSkullSplitterMode(false); PP.setSkullSplitterMode(false);
PP.setSkullSplitterInformed(false); PP.setSkullSplitterInformed(false);
player.sendMessage(mcLocale.getString("Skills.SkullSplitterOff")); player.sendMessage(mcLocale.getString("Skills.SkullSplitterOff"));
@ -179,7 +178,7 @@ public class Skills
* WOODCUTTING ABILITY * WOODCUTTING ABILITY
*/ */
if(mcPermissions.getInstance().woodCuttingAbility(player)){ if(mcPermissions.getInstance().woodCuttingAbility(player)){
if(PP.getTreeFellerMode() && (PP.getTreeFellerDeactivatedTimeStamp()*1000) <= System.currentTimeMillis()){ if(PP.getTreeFellerMode() && (PP.getTreeFellerDeactivatedTimeStamp()*1000) <= curTime){
PP.setTreeFellerMode(false); PP.setTreeFellerMode(false);
PP.setTreeFellerInformed(false); PP.setTreeFellerInformed(false);
player.sendMessage(mcLocale.getString("Skills.TreeFellerOff")); player.sendMessage(mcLocale.getString("Skills.TreeFellerOff"));
@ -189,7 +188,7 @@ public class Skills
* MINING ABILITY * MINING ABILITY
*/ */
if(mcPermissions.getInstance().miningAbility(player)){ if(mcPermissions.getInstance().miningAbility(player)){
if(PP.getSuperBreakerMode() && (PP.getSuperBreakerDeactivatedTimeStamp()*1000) <= System.currentTimeMillis()){ if(PP.getSuperBreakerMode() && (PP.getSuperBreakerDeactivatedTimeStamp()*1000) <= curTime){
PP.setSuperBreakerMode(false); PP.setSuperBreakerMode(false);
PP.setSuperBreakerInformed(false); PP.setSuperBreakerInformed(false);
player.sendMessage(mcLocale.getString("Skills.SuperBreakerOff")); player.sendMessage(mcLocale.getString("Skills.SuperBreakerOff"));
@ -199,7 +198,7 @@ public class Skills
* EXCAVATION ABILITY * EXCAVATION ABILITY
*/ */
if(mcPermissions.getInstance().excavationAbility(player)){ if(mcPermissions.getInstance().excavationAbility(player)){
if(PP.getGigaDrillBreakerMode() && (PP.getGigaDrillBreakerDeactivatedTimeStamp()*1000) <= System.currentTimeMillis()){ if(PP.getGigaDrillBreakerMode() && (PP.getGigaDrillBreakerDeactivatedTimeStamp()*1000) <= curTime){
PP.setGigaDrillBreakerMode(false); PP.setGigaDrillBreakerMode(false);
PP.setGigaDrillBreakerInformed(false); PP.setGigaDrillBreakerInformed(false);
player.sendMessage(mcLocale.getString("Skills.GigaDrillBreakerOff")); player.sendMessage(mcLocale.getString("Skills.GigaDrillBreakerOff"));
@ -209,7 +208,7 @@ public class Skills
* SWORDS ABILITY * SWORDS ABILITY
*/ */
if(mcPermissions.getInstance().swordsAbility(player)){ if(mcPermissions.getInstance().swordsAbility(player)){
if(PP.getSerratedStrikesMode() && (PP.getSerratedStrikesDeactivatedTimeStamp()*1000) <= System.currentTimeMillis()){ if(PP.getSerratedStrikesMode() && (PP.getSerratedStrikesDeactivatedTimeStamp()*1000) <= curTime){
PP.setSerratedStrikesMode(false); PP.setSerratedStrikesMode(false);
PP.setSerratedStrikesInformed(false); PP.setSerratedStrikesInformed(false);
player.sendMessage(mcLocale.getString("Skills.SerratedStrikesOff")); player.sendMessage(mcLocale.getString("Skills.SerratedStrikesOff"));
@ -219,14 +218,13 @@ public class Skills
* UNARMED ABILITY * UNARMED ABILITY
*/ */
if(mcPermissions.getInstance().unarmedAbility(player)){ if(mcPermissions.getInstance().unarmedAbility(player)){
if(PP.getBerserkMode() && (PP.getBerserkDeactivatedTimeStamp()*1000) <= System.currentTimeMillis()){ if(PP.getBerserkMode() && (PP.getBerserkDeactivatedTimeStamp()*1000) <= curTime){
PP.setBerserkMode(false); PP.setBerserkMode(false);
PP.setBerserkInformed(false); PP.setBerserkInformed(false);
player.sendMessage(mcLocale.getString("Skills.BerserkOff")); player.sendMessage(mcLocale.getString("Skills.BerserkOff"));
} }
} }
} }
}
public static void abilityActivationCheck(Player player) public static void abilityActivationCheck(Player player)
{ {
if(LoadProperties.enableOnlyActivateWhenSneaking && !player.isSneaking()) if(LoadProperties.enableOnlyActivateWhenSneaking && !player.isSneaking())

View File

@ -84,7 +84,7 @@ public class Unarmed {
ItemStack item = defender.getItemInHand(); ItemStack item = defender.getItemInHand();
if(item != null) if(item != null)
{ {
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
ItemStack itemx = null; ItemStack itemx = null;
defender.setItemInHand(itemx); defender.setItemInHand(itemx);
} }
@ -99,7 +99,7 @@ public class Unarmed {
ItemStack item = defender.getItemInHand(); ItemStack item = defender.getItemInHand();
if(item != null) if(item != null)
{ {
loc.getWorld().dropItemNaturally(loc, item); m.mcDropItem(loc, item);
ItemStack itemx = null; ItemStack itemx = null;
defender.setItemInHand(itemx); defender.setItemInHand(itemx);
} }

View File

@ -48,7 +48,7 @@ public class WoodCutting
if(Math.random() * 1000 <= PP.getSkillLevel(SkillType.WOODCUTTING)) if(Math.random() * 1000 <= PP.getSkillLevel(SkillType.WOODCUTTING))
{ {
ItemStack item = new ItemStack(mat, 1, (short) 0, type); ItemStack item = new ItemStack(mat, 1, (short) 0, type);
block.getWorld().dropItemNaturally(block.getLocation(), item); m.mcDropItem(block.getLocation(), item);
} }
} }
} }