mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
ACTUALLY fixed issue with Disarm never working.
This commit is contained in:
parent
f19b8a88d5
commit
8cfae368c3
@ -100,7 +100,7 @@ public class Combat {
|
||||
}
|
||||
|
||||
if (targetType.equals(EntityType.PLAYER) && mcPermissions.getInstance().disarm(attacker)) {
|
||||
Unarmed.disarmProcCheck(attacker, (Player) target);
|
||||
Unarmed.disarmProcCheck(PPa, (Player) target);
|
||||
}
|
||||
|
||||
startGainXp(attacker, PPa, target, SkillType.UNARMED, plugin);
|
||||
|
@ -43,19 +43,19 @@ public class Unarmed {
|
||||
* @param PPa Profile of the attacking player
|
||||
* @param defender The defending player
|
||||
*/
|
||||
public static void disarmProcCheck(Player attacker, Player defender) {
|
||||
public static void disarmProcCheck(PlayerProfile PPa, Player defender) {
|
||||
final int MAX_BONUS_LEVEL = 1000;
|
||||
|
||||
int skillLevel = Users.getProfile(attacker).getSkillLevel(SkillType.UNARMED);
|
||||
int skillLevel = PPa.getSkillLevel(SkillType.UNARMED);
|
||||
int skillCheck = m.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
||||
|
||||
if (attacker.getItemInHand().equals(Material.AIR)) {
|
||||
if (random.nextInt(3000) <= skillCheck) {
|
||||
ItemStack item = defender.getItemInHand();
|
||||
ItemStack inHand = defender.getItemInHand();
|
||||
|
||||
if (!inHand.getType().equals(Material.AIR)) {
|
||||
if (random.nextInt(3000) <= skillCheck) {
|
||||
defender.sendMessage(mcLocale.getString("Skills.Disarmed"));
|
||||
|
||||
m.mcDropItem(defender.getLocation(), item);
|
||||
m.mcDropItem(defender.getLocation(), inHand);
|
||||
defender.setItemInHand(new ItemStack(Material.AIR));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user