1
1
package minevalley .core .api .regions .utils ;
2
2
3
3
import minevalley .core .api .users .OnlineUser ;
4
- import org .bukkit .entity .Player ;
5
4
6
- public interface FakeBlock {
7
-
8
- /**
9
- * Shows the block to specific players.
10
- *
11
- * @param players Players to whom the block is shown
12
- */
13
- void show (Player ... players );
5
+ import java .util .function .Function ;
14
6
15
- /**
16
- * Hides the block from specific players.
17
- *
18
- * @param players Players from whom the block is hidden
19
- */
20
- void hide (Player ... players );
7
+ public interface FakeBlock {
21
8
22
9
/**
23
- * Shows the block to specific users.
10
+ * Defines which users can see the fake block
11
+ * <br>
12
+ * <b>Default:</b> Everyone can see the fake block
24
13
*
25
- * @param users Users to whom the block is shown
14
+ * @param function defines whether a specific user can see the fake block
26
15
*/
27
- void show ( OnlineUser ... users );
16
+ void setVisibility ( Function < OnlineUser , Boolean > function );
28
17
29
18
/**
30
- * Hides the block from specific users.
31
- *
32
- * @param users Users from whom the block is hidden
19
+ * Updates the visibility of the fake block
20
+ * <br>
21
+ * <b>Note:</b> This simply calls the function defined in {@link #setVisibility(Function)} for every user that the fake block is or could be visible to
33
22
*/
34
- void hide ( OnlineUser ... users );
23
+ void updateVisibility ( );
35
24
}
0 commit comments