From 1ea2a3f94fdc77089678c7a4dd6c861d5b0854a9 Mon Sep 17 00:00:00 2001 From: NavidK0 Date: Mon, 30 Mar 2015 23:07:47 -0400 Subject: [PATCH] Fixed isInvulnerable for real this time --- .../2.2.1/taskArtifacts/cache.properties.lock | Bin 17 -> 17 bytes .gradle/2.2.1/taskArtifacts/fileHashes.bin | Bin 33767 -> 33767 bytes .gradle/2.2.1/taskArtifacts/fileSnapshots.bin | Bin 800400 -> 800400 bytes .../2.2.1/taskArtifacts/outputFileStates.bin | Bin 18752 -> 18752 bytes .gradle/2.2.1/taskArtifacts/taskArtifacts.bin | Bin 35885 -> 35885 bytes .../commands/DisguiseEntityCommand.java | 4 +++- .../disguise/disguisetypes/Disguise.java | 22 ++++++++++++++++-- .../disguise/utilities/PacketsManager.java | 4 ++-- 8 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.gradle/2.2.1/taskArtifacts/cache.properties.lock b/.gradle/2.2.1/taskArtifacts/cache.properties.lock index d213237a4e8b1e738894747d59623bdfea2382a7..f53d71cd402cb62724cf4f20bd175f562ecd7fe1 100644 GIT binary patch literal 17 UcmZQh*}BJ}f~m2C0SuG`0WO3C&j0`b literal 17 UcmZQh*}BJ}f~m2C0Spv#0507GDF6Tf diff --git a/.gradle/2.2.1/taskArtifacts/fileHashes.bin b/.gradle/2.2.1/taskArtifacts/fileHashes.bin index b91ba843d9abfc0a59166b45755154de998d7a45..2446ea5492c7506fd0e6cf2738806bba7aaa6892 100644 GIT binary patch delta 3413 zcmZ9Oc~sO#631I-7(h_OlPD%2m#d(lpptkIka)xcF-j1a8D=<_0l6X|f&mwvL2*Oj z5s#-v2olVy0Yr>15swg&sPRHgTw`!WgSUcFBW!=WfBD1AdsOl2)78~gUERNKE9}`; z*mGY>@JPqL@7{J|ama!i1$IUynjfr2cwNR}^bt|g32CI4uFg5E- zB+-nAZuYpZs;*vmO^`K`mY|(BIU8y8yfzTWMo~*0Zh0HRaZEB8)mt<4` zbkN4trsi?{pOO4;IRA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_bAq@8w;%q@?#{D)!%2=b?(GHK9O`V_?d>`DF-~6~%_cBix0vhTc1{QG zN-mJ)>0I00!?@QYTh5}>D_TDNU=7Rs=@-s1X-~Jg#L3leox=&lT-&X4xI<3?0F!O- A=Kufz diff --git a/.gradle/2.2.1/taskArtifacts/outputFileStates.bin b/.gradle/2.2.1/taskArtifacts/outputFileStates.bin index 495bf37934680b9722d0b99b4c43806e78ff76a9..b68a4381cf73ceeca99d678321bc29ce658a29f5 100644 GIT binary patch delta 175 zcmX>wiSfWB#tB9&JO;g48y)Y8PYmFmEGMy&@x}9ZC~be#u&&D0Adah&Ye_N+_0ro7szJ#_;bxJR9WQ%Q&ct? dN=t)e6`92&P-V9}$t54ze}4f;c3M)%YXDosK7{}P delta 175 zcmX>wiSfWB#tB9&vToOsH#*)GpBTVBSx#al#Hv(a#*0khLm ukSw#LgMkPUyUo+MngM+|cY^pmmzzT7vy+i&9kY;s69fnV0000d5l*}maXl{p diff --git a/src/main/java/me/libraryaddict/disguise/commands/DisguiseEntityCommand.java b/src/main/java/me/libraryaddict/disguise/commands/DisguiseEntityCommand.java index 8c1d250b..cd284159 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/DisguiseEntityCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/DisguiseEntityCommand.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.HashMap; import me.libraryaddict.disguise.DisguiseConfig; -import me.libraryaddict.disguise.DisguiseListener; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.DisguiseType; @@ -42,7 +41,10 @@ public class DisguiseEntityCommand extends BaseDisguiseCommand { /** * Send the player the information + * @param sender + * @param map */ + @Override protected void sendCommandUsage(CommandSender sender, HashMap, Boolean>> map) { ArrayList allowedDisguises = getAllowedDisguises(map); sender.sendMessage(ChatColor.DARK_GREEN + "Choose a disguise then right click a entity to disguise it!"); diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java index 376d25c3..404dbced 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java @@ -19,7 +19,6 @@ import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.PacketsManager; import me.libraryaddict.disguise.utilities.ReflectionManager; import me.libraryaddict.disguise.utilities.DisguiseValues; -import me.libraryaddict.disguise.utilities.ReflectionManager.LibVersion; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -27,7 +26,6 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Horse.Variant; import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitTask; import org.bukkit.util.Vector; @@ -54,6 +52,7 @@ public abstract class Disguise { private boolean velocitySent = DisguiseConfig.isVelocitySent(); private boolean viewSelfDisguise = DisguiseConfig.isViewDisguises(); private FlagWatcher watcher; + private boolean showName = false; @Override public abstract Disguise clone(); @@ -322,6 +321,7 @@ public abstract class Disguise { /** * Get the disguised entity + * @return */ public Entity getEntity() { return entity; @@ -329,6 +329,7 @@ public abstract class Disguise { /** * Get the disguise type + * @return */ public DisguiseType getType() { return disguiseType; @@ -336,6 +337,7 @@ public abstract class Disguise { /** * Get the flag watcher + * @return */ public FlagWatcher getWatcher() { return watcher; @@ -344,6 +346,7 @@ public abstract class Disguise { /** * In use doesn't mean that this disguise is active. It means that Lib's Disguises still stores a reference to the disguise. * getEntity() can still return null if this disguise is active after despawn, logout, etc. + * @return */ public boolean isDisguiseInUse() { return disguiseInUse; @@ -417,6 +420,14 @@ public abstract class Disguise { return velocitySent; } + /** + * Returns true if the entity's name is showing through the disguise + * @return + */ + public boolean isShowName() { + return showName; + } + /** * Removes the disguise and undisguises the entity if its using this disguise. * @@ -482,6 +493,8 @@ public abstract class Disguise { /** * Set the entity of the disguise. Only used for internal things. + * @param entity + * @return */ public Disguise setEntity(Entity entity) { if (this.getEntity() != null) { @@ -498,6 +511,11 @@ public abstract class Disguise { return this; } + public Disguise setShowName(boolean showName) { + this.showName = showName; + return this; + } + public Disguise setHearSelfDisguise(boolean hearSelfDisguise) { this.hearSelfDisguise = hearSelfDisguise; return this; diff --git a/src/main/java/me/libraryaddict/disguise/utilities/PacketsManager.java b/src/main/java/me/libraryaddict/disguise/utilities/PacketsManager.java index e04cde40..453aa736 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/PacketsManager.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/PacketsManager.java @@ -583,7 +583,7 @@ public class PacketsManager { nmsEntity) == ReflectionManager.getNmsField("EntityLiving", "maxNoDamageTicks").getInt(nmsEntity); } else { - hasInvun = (Boolean) ReflectionManager.getNmsMethod("Entity", "isInvulnerable") + hasInvun = (Boolean) ReflectionManager.getNmsMethod("Entity", "isInvulnerable", DamageSource.class) .invoke(nmsEntity, DamageSource.GENERIC); } } catch (Exception ex) { @@ -819,7 +819,7 @@ public class PacketsManager { PacketContainer packet = new PacketContainer(PacketType.Play.Server.ENTITY_METADATA); StructureModifier mods = packet.getModifier(); mods.write(0, observer.getEntityId()); - List watchableList = new ArrayList(); + List watchableList = new ArrayList<>(); byte b = (byte) 1 << 5; if (observer.isSprinting()) b = (byte) (b | 1 << 3);