From 496d515972d41444f6cc0d39de00b3b93e5bbac8 Mon Sep 17 00:00:00 2001 From: Spencer Date: Thu, 28 Dec 2017 18:36:59 -0500 Subject: [PATCH] Use team.getDyeColor to color wolf collars --- .../game/arcade/kit/perks/PerkWolfPet.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPet.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPet.java index 10e1ead83..4b279a1f3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPet.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPet.java @@ -107,9 +107,12 @@ public class PerkWolfPet extends Perk GameTeam team = Manager.GetGame().GetTeam(cur); - if (team != null) { - wolf.setCollarColor(DyeColor.getByColor(team.GetColorBase())); - } else { + if (team != null) + { + wolf.setCollarColor(team.getDyeColor()); + } + else + { wolf.setCollarColor(DyeColor.GREEN); } @@ -129,7 +132,12 @@ public class PerkWolfPet extends Perk @EventHandler public void cubTargetCancel(EntityTargetEvent event) { - if (_petMap.containsKey(event.getTarget()) && _petMap.get(event.getTarget()).contains(event.getEntity()) + if (!(event.getTarget() instanceof Player) || !(event.getEntity() instanceof Wolf)) + { + return; + } + + if (_petMap.containsKey(event.getTarget()) && _petMap.get(event.getTarget()).contains(event.getEntity())) { event.setCancelled(true); return; @@ -139,10 +147,11 @@ public class PerkWolfPet extends Perk { for (Wolf wolf : _petMap.get(owner)) { - if (event.getEntity().getEntityId() == wolf.getEntityId()) + if (event.getEntity().equals(wolf)) { if (!Manager.canHurt(owner, (Player) event.getTarget())) { event.setCancelled(true); + return; } } }