Return if the set entity is the same as the existing entity

This commit is contained in:
libraryaddict 2014-01-04 22:15:49 +13:00
parent c7ae572c15
commit 6764a984fb

@ -393,6 +393,8 @@ public abstract class Disguise {
*/ */
public void setEntity(Entity entity) { public void setEntity(Entity entity) {
if (this.getEntity() != null) { if (this.getEntity() != null) {
if (getEntity() == entity)
return;
throw new RuntimeException("This disguise is already in use! Try .clone()"); throw new RuntimeException("This disguise is already in use! Try .clone()");
} }
this.entity = entity; this.entity = entity;