You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Refreshes and updates every tracked by this viewer engine entities viewers to see if they follow the spawning rules.
76
+
* If they do not they will no longer see the entity;
77
+
*/
43
78
publicvoidrefresh() {
44
79
getTracked0().forEach(entity -> {
45
80
for (UUIDviewer : entity.getViewers()) {
@@ -58,19 +93,40 @@ public void setExecutor(Executor executor) {
58
93
this.executor = executor;
59
94
}
60
95
96
+
/**
97
+
* Tells this ViewerEngine to begin tracking a specific {@link WrapperEntity}
98
+
* @param entity the entity to begin tracking.
99
+
*/
61
100
publicvoidtrack(@NotNullWrapperEntityentity) {
62
101
tracked.add(entity);
63
102
}
64
103
104
+
/**
105
+
* Tells this ViewerEngine to stop tracking a specific {@link WrapperEntity}
106
+
* @param entity the entity to stop tracking.
107
+
*/
108
+
publicvoiduntrack(@NotNullWrapperEntityentity) {
109
+
tracked.remove(entity);
110
+
}
111
+
65
112
publicvoidclearTracked() {
66
113
tracked.clear();
67
114
}
68
115
116
+
/**
117
+
* Checks if a viewer/user validates every viewer rule handled by this viewer engine or not.
118
+
* @param user The user to check
119
+
* @param entity The entity that is getting its own viewer rules checked as well as the global defined one with {@link ViewerEngine#addViewerRule(ViewerRule)}
120
+
* @return true if the user passed and did not fail any rules, false otherwise
0 commit comments