Skip to content

Commit

Permalink
Add onRemove for cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Nov 23, 2022
1 parent 5408e70 commit b28d689
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Expand Up @@ -96,6 +96,11 @@ public void onDespawn() {
}
}

@Override
public void onRemove() {
onDespawn();
}

@Override
public void onSpawn() {
changed = true;
Expand Down
5 changes: 5 additions & 0 deletions main/src/main/java/net/citizensnpcs/trait/SitTrait.java
Expand Up @@ -35,6 +35,11 @@ public void onDespawn() {
}
}

@Override
public void onRemove() {
onDespawn();
}

@Override
public void run() {
if (!npc.isSpawned() || !isSitting()) {
Expand Down
Expand Up @@ -105,6 +105,11 @@ public void onDespawn() {
}
}

@Override
public void onRemove() {
onDespawn();
}

@Override
public void run() {
if (!npc.isSpawned())
Expand Down

0 comments on commit b28d689

Please sign in to comment.