File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
api/src/main/java/kr/toxicity/model/api/tracker
core/src/main/kotlin/kr/toxicity/model/manager Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -302,7 +302,12 @@ public boolean close() {
302302 return close (Tracker .CloseReason .REMOVE );
303303 }
304304
305- private boolean close (@ NotNull Tracker .CloseReason reason ) {
305+ /**
306+ * Closes this registry
307+ * @param reason close reason
308+ * @return success
309+ */
310+ public boolean close (@ NotNull Tracker .CloseReason reason ) {
306311 if (!closed .compareAndSet (false , true )) return false ;
307312 viewedPlayer ().forEach (value -> value .sendEntityData (this ));
308313 viewedPlayerMap .clear ();
Original file line number Diff line number Diff line change @@ -905,6 +905,7 @@ public String toString() {
905905 @ RequiredArgsConstructor
906906 public enum CloseReason {
907907 REMOVE (false ),
908+ PLUGIN_DISABLE (true ),
908909 DESPAWN (true )
909910 ;
910911 private final boolean save ;
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import kr.toxicity.model.api.nms.ModelInteractionHand
1717import kr.toxicity.model.api.pack.PackZipper
1818import kr.toxicity.model.api.tracker.EntityTracker
1919import kr.toxicity.model.api.tracker.EntityTrackerRegistry
20+ import kr.toxicity.model.api.tracker.Tracker
2021import kr.toxicity.model.util.PLUGIN
2122import kr.toxicity.model.util.registerListener
2223import org.bukkit.entity.Entity
@@ -179,7 +180,7 @@ object EntityManager : GlobalManager {
179180 override fun end () {
180181 EntityTrackerRegistry .registries {
181182 it.save()
182- it.close()
183+ it.close(Tracker . CloseReason . PLUGIN_DISABLE )
183184 }
184185 }
185186
You can’t perform that action at this time.
0 commit comments