mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-12-16 15:38:14 +01:00
Return if the set entity is the same as the existing entity
This commit is contained in:
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user