From 6764a984fbd874dc21cd9c89e3bfef85e8cbea67 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sat, 4 Jan 2014 22:15:49 +1300 Subject: [PATCH] Return if the set entity is the same as the existing entity --- src/me/libraryaddict/disguise/disguisetypes/Disguise.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/me/libraryaddict/disguise/disguisetypes/Disguise.java b/src/me/libraryaddict/disguise/disguisetypes/Disguise.java index f7180644..1615ad23 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/Disguise.java +++ b/src/me/libraryaddict/disguise/disguisetypes/Disguise.java @@ -393,6 +393,8 @@ public abstract class Disguise { */ public void setEntity(Entity entity) { if (this.getEntity() != null) { + if (getEntity() == entity) + return; throw new RuntimeException("This disguise is already in use! Try .clone()"); } this.entity = entity;