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

@ -323,7 +323,7 @@ public class Combat
PlayerProfile PPd = Users.getProfile(defender); PlayerProfile PPd = Users.getProfile(defender);
if(System.currentTimeMillis() >= (PPd.getRespawnATS()*1000) + 5000 if(System.currentTimeMillis() >= (PPd.getRespawnATS()*1000) + 5000
&& ((PPd.getLastLogin()+5)*1000) < System.currentTimeMillis() && ((PPd.getLastLogin()+5)*1000) < System.currentTimeMillis()
&& defender.getHealth() >= 1) && defender.getHealth() >= 1)
{ {

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;
@ -33,7 +35,7 @@ import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
public class Mining public class Mining
{ {
public static void miningDrops(Block block) public static void miningDrops(Block block)
@ -145,7 +147,7 @@ public class Mining
{ {
int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.MINING); int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.MINING);
if(skillLevel > 1000 || (Math.random() * 1000 <= skillLevel)) if(skillLevel > 1000 || (Math.random() * 1000 <= skillLevel))
blockProcSimulate(block, player); blockProcSimulate(block, player);
} }
@ -188,7 +190,8 @@ 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)
{ {
case OBSIDIAN: case OBSIDIAN:
@ -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,7 +264,8 @@ public class WoodCutting
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player); PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
Bukkit.getPluginManager().callEvent(armswing); Bukkit.getPluginManager().callEvent(armswing);
Skills.abilityDurabilityLoss(player.getItemInHand(), LoadProperties.abilityDurabilityLoss); if(LoadProperties.woodcuttingrequiresaxe)
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());
} }