mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +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,48 +232,78 @@ public final class CombatUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (damager.getType()) {
|
/* Temporary fix for MCPC+
|
||||||
case WOLF:
|
*
|
||||||
|
* This will be reverted back to the switch statement once the fix is addressed on their end.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (damager.getType() == EntityType.WOLF) {
|
||||||
Wolf wolf = (Wolf) damager;
|
Wolf wolf = (Wolf) damager;
|
||||||
AnimalTamer tamer = wolf.getOwner();
|
AnimalTamer tamer = wolf.getOwner();
|
||||||
|
|
||||||
if (tamer == null || !(tamer instanceof Player) || !shouldProcessSkill(target, SkillType.TAMING)) {
|
if (tamer != null && tamer instanceof Player && shouldProcessSkill(target, SkillType.TAMING)) {
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
Player master = (Player) tamer;
|
Player master = (Player) tamer;
|
||||||
|
|
||||||
if (Misc.isNPCEntity(master)) {
|
if (!Misc.isNPCEntity(master) && Permissions.skillEnabled(master, SkillType.TAMING)) {
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Permissions.skillEnabled(master, SkillType.TAMING)) {
|
|
||||||
processTamingCombat(target, master, wolf, event);
|
processTamingCombat(target, master, wolf, event);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
if (damager.getType() == EntityType.ARROW) {
|
||||||
|
|
||||||
case ARROW:
|
|
||||||
LivingEntity shooter = ((Arrow) damager).getShooter();
|
LivingEntity shooter = ((Arrow) damager).getShooter();
|
||||||
|
|
||||||
if (shooter == null || !(shooter instanceof Player) || !shouldProcessSkill(target, SkillType.ARCHERY)) {
|
if (shooter != null && shooter instanceof Player && shouldProcessSkill(target, SkillType.ARCHERY)) {
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
Player player = (Player) shooter;
|
Player player = (Player) shooter;
|
||||||
|
|
||||||
if (Misc.isNPCEntity(player)) {
|
if (!Misc.isNPCEntity(player) && Permissions.skillEnabled(player, SkillType.ARCHERY)) {
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Permissions.skillEnabled(player, SkillType.ARCHERY)) {
|
|
||||||
processArcheryCombat(target, player, event, damager);
|
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 (target instanceof Player) {
|
||||||
if (Misc.isNPCEntity(target)) {
|
if (Misc.isNPCEntity(target)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user