Fixed NoCheat issue (again).

This commit is contained in:
GJ 2012-03-06 14:27:34 -05:00
parent 798cc3bbb3
commit d401a69560
3 changed files with 10 additions and 5 deletions

View File

@ -16,6 +16,7 @@
*/ */
package com.gmail.nossr50.skills; package com.gmail.nossr50.skills;
import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
@ -23,6 +24,7 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.getspout.spoutapi.sound.SoundEffect; import org.getspout.spoutapi.sound.SoundEffect;
import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.Enchantment;
import org.bukkit.event.player.PlayerAnimationEvent;
import com.gmail.nossr50.Users; import com.gmail.nossr50.Users;
import com.gmail.nossr50.m; import com.gmail.nossr50.m;
@ -188,6 +190,7 @@ public class Mining
Material type = block.getType(); Material type = block.getType();
int tier = m.getTier(player); int tier = m.getTier(player);
int durabilityLoss = LoadProperties.abilityDurabilityLoss; int durabilityLoss = LoadProperties.abilityDurabilityLoss;
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
switch(type) switch(type)
{ {
@ -214,6 +217,7 @@ public class Mining
case STONE: case STONE:
if((block.getData() == (byte) 5) || plugin.misc.blockWatchList.contains(block)) if((block.getData() == (byte) 5) || plugin.misc.blockWatchList.contains(block))
return; return;
Bukkit.getPluginManager().callEvent(armswing);
Skills.abilityDurabilityLoss(player.getItemInHand(), durabilityLoss); Skills.abilityDurabilityLoss(player.getItemInHand(), durabilityLoss);
blockProcCheck(block, player); blockProcCheck(block, player);
blockProcCheck(block, player); blockProcCheck(block, player);

View File

@ -264,6 +264,7 @@ public class WoodCutting
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player); PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
Bukkit.getPluginManager().callEvent(armswing); Bukkit.getPluginManager().callEvent(armswing);
if(LoadProperties.woodcuttingrequiresaxe)
Skills.abilityDurabilityLoss(player.getItemInHand(), LoadProperties.abilityDurabilityLoss); Skills.abilityDurabilityLoss(player.getItemInHand(), LoadProperties.abilityDurabilityLoss);
if(LoadProperties.spoutEnabled) if(LoadProperties.spoutEnabled)
SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation()); SpoutStuff.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());