Color wolf collars based on team

This commit is contained in:
Spencer 2017-12-28 17:06:59 -05:00 committed by Alexander Meech
parent 428713d56c
commit cc3ed60adc

View File

@ -37,6 +37,7 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.events.PlayerStateChangeEvent;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.GameTeam.PlayerState;
import nautilus.game.arcade.kit.Perk;
import net.minecraft.server.v1_8_R3.EntityCreature;
@ -99,12 +100,19 @@ public class PerkWolfPet extends Perk
Wolf wolf = cur.getWorld().spawn(cur.getLocation(), Wolf.class);
SpigotUtil.setOldOwner_RemoveMeWhenSpigotFixesThis(wolf, cur);
wolf.setOwner(cur);
wolf.setCollarColor(DyeColor.GREEN);
wolf.playEffect(EntityEffect.WOLF_HEARTS);
wolf.setAngry(true);
wolf.setMaxHealth(14);
wolf.setHealth(wolf.getMaxHealth());
GameTeam team = Manager.GetGame().GetTeam(cur);
if (team != null) {
wolf.setCollarColor(DyeColor.getByColor(team.GetColorBase()));
} else {
wolf.setCollarColor(DyeColor.GREEN);
}
if (_baby)
wolf.setBaby();