mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Temporary fix for MCPC+ entity issues. This change will be reverted
after the fix is made in MCPC+. Fixes #1197
This commit is contained in:
parent
1647ef4fae
commit
7b5372a985
@ -232,49 +232,79 @@ public final class CombatUtils {
|
||||
}
|
||||
}
|
||||
|
||||
switch (damager.getType()) {
|
||||
case WOLF:
|
||||
Wolf wolf = (Wolf) damager;
|
||||
AnimalTamer tamer = wolf.getOwner();
|
||||
/* Temporary fix for MCPC+
|
||||
*
|
||||
* This will be reverted back to the switch statement once the fix is addressed on their end.
|
||||
*/
|
||||
|
||||
if (tamer == null || !(tamer instanceof Player) || !shouldProcessSkill(target, SkillType.TAMING)) {
|
||||
break;
|
||||
}
|
||||
if (damager.getType() == EntityType.WOLF) {
|
||||
Wolf wolf = (Wolf) damager;
|
||||
AnimalTamer tamer = wolf.getOwner();
|
||||
|
||||
if (tamer != null && tamer instanceof Player && shouldProcessSkill(target, SkillType.TAMING)) {
|
||||
Player master = (Player) tamer;
|
||||
|
||||
if (Misc.isNPCEntity(master)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (Permissions.skillEnabled(master, SkillType.TAMING)) {
|
||||
if (!Misc.isNPCEntity(master) && Permissions.skillEnabled(master, SkillType.TAMING)) {
|
||||
processTamingCombat(target, master, wolf, event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case ARROW:
|
||||
LivingEntity shooter = ((Arrow) damager).getShooter();
|
||||
|
||||
if (shooter == null || !(shooter instanceof Player) || !shouldProcessSkill(target, SkillType.ARCHERY)) {
|
||||
break;
|
||||
}
|
||||
if (damager.getType() == EntityType.ARROW) {
|
||||
LivingEntity shooter = ((Arrow) damager).getShooter();
|
||||
|
||||
if (shooter != null && shooter instanceof Player && shouldProcessSkill(target, SkillType.ARCHERY)) {
|
||||
Player player = (Player) shooter;
|
||||
|
||||
if (Misc.isNPCEntity(player)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (Permissions.skillEnabled(player, SkillType.ARCHERY)) {
|
||||
if (!Misc.isNPCEntity(player) && Permissions.skillEnabled(player, SkillType.ARCHERY)) {
|
||||
processArcheryCombat(target, player, event, damager);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// switch (damager.getType()) {
|
||||
// case WOLF:
|
||||
// Wolf wolf = (Wolf) damager;
|
||||
// AnimalTamer tamer = wolf.getOwner();
|
||||
//
|
||||
// if (tamer == null || !(tamer instanceof Player) || !shouldProcessSkill(target, SkillType.TAMING)) {
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// Player master = (Player) tamer;
|
||||
//
|
||||
// if (Misc.isNPCEntity(master)) {
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// if (Permissions.skillEnabled(master, SkillType.TAMING)) {
|
||||
// processTamingCombat(target, master, wolf, event);
|
||||
// }
|
||||
//
|
||||
// break;
|
||||
//
|
||||
// case ARROW:
|
||||
// LivingEntity shooter = ((Arrow) damager).getShooter();
|
||||
//
|
||||
// if (shooter == null || !(shooter instanceof Player) || !shouldProcessSkill(target, SkillType.ARCHERY)) {
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// Player player = (Player) shooter;
|
||||
//
|
||||
// if (Misc.isNPCEntity(player)) {
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// if (Permissions.skillEnabled(player, SkillType.ARCHERY)) {
|
||||
// processArcheryCombat(target, player, event, damager);
|
||||
// }
|
||||
// break;
|
||||
//
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
|
||||
if (target instanceof Player) {
|
||||
if (Misc.isNPCEntity(target)) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user