From 22f46cc82411fe2cb406b309e7a94bfe56971efb Mon Sep 17 00:00:00 2001 From: NavidK0 Date: Tue, 8 Mar 2016 06:18:17 -0500 Subject: [PATCH] Update ProtocolLib version to BETA --- build.gradle | 2 +- .../disguisetypes/watchers/HorseWatcher.java | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 56b4b52f..3943f0ea 100644 --- a/build.gradle +++ b/build.gradle @@ -98,7 +98,7 @@ ant.get src: 'http://server.o2gaming.com/downloads/spigot-1.9.jar', dest: file(' dependencies { compile "org.spigotmc:spigot-api:$project.ext.spigotVersion" - compile 'com.comphenix.protocol:ProtocolLib:3.7-SNAPSHOT' + compile 'com.comphenix.protocol:ProtocolLib:3.7.0-BETA' compile name: 'spigot-1.9' testCompile group: 'junit', name: 'junit', version: '4.10' } diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/HorseWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/HorseWatcher.java index ea6f9168..4ff31bca 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/HorseWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/HorseWatcher.java @@ -2,6 +2,7 @@ package me.libraryaddict.disguise.disguisetypes.watchers; import com.google.common.base.Optional; import me.libraryaddict.disguise.disguisetypes.Disguise; +import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Horse.Color; import org.bukkit.entity.Horse.Style; @@ -15,16 +16,25 @@ public class HorseWatcher extends AgeableWatcher { public HorseWatcher(Disguise disguise) { super(disguise); - setColor(Color.values()[new Random().nextInt(Color.values().length)]); + Variant variant = getVariant(); + if (variant == Variant.DONKEY || variant == Variant.MULE || variant == Variant.HORSE) + setColor(Color.values()[new Random().nextInt(Color.values().length)]); } + //TODO: Check and make sure Variants work public Variant getVariant() { return Variant.values()[(int) getValue(14, 0)]; } public void setVariant(Variant variant) { - setValue(14, variant.ordinal()); + Bukkit.broadcastMessage("Variant set to: " + variant); + Bukkit.broadcastMessage("Ordinal: " + variant.ordinal()); + setVariant(variant.ordinal()); + } + + public void setVariant(int variant) { + setValue(14, variant); sendData(14); }