/
Island.java
2144 lines (1752 loc) · 60.7 KB
/
Island.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package com.bgsoftware.superiorskyblock.api.island;
import com.bgsoftware.superiorskyblock.api.SuperiorSkyblockAPI;
import com.bgsoftware.superiorskyblock.api.data.IDatabaseBridgeHolder;
import com.bgsoftware.superiorskyblock.api.enums.Rating;
import com.bgsoftware.superiorskyblock.api.enums.SyncStatus;
import com.bgsoftware.superiorskyblock.api.island.algorithms.IslandBlocksTrackerAlgorithm;
import com.bgsoftware.superiorskyblock.api.island.algorithms.IslandCalculationAlgorithm;
import com.bgsoftware.superiorskyblock.api.island.algorithms.IslandEntitiesTrackerAlgorithm;
import com.bgsoftware.superiorskyblock.api.island.bank.BankTransaction;
import com.bgsoftware.superiorskyblock.api.island.bank.IslandBank;
import com.bgsoftware.superiorskyblock.api.island.warps.IslandWarp;
import com.bgsoftware.superiorskyblock.api.island.warps.WarpCategory;
import com.bgsoftware.superiorskyblock.api.key.Key;
import com.bgsoftware.superiorskyblock.api.key.KeyMap;
import com.bgsoftware.superiorskyblock.api.missions.IMissionsHolder;
import com.bgsoftware.superiorskyblock.api.missions.Mission;
import com.bgsoftware.superiorskyblock.api.objects.Pair;
import com.bgsoftware.superiorskyblock.api.persistence.IPersistentDataHolder;
import com.bgsoftware.superiorskyblock.api.service.message.IMessageComponent;
import com.bgsoftware.superiorskyblock.api.upgrades.Upgrade;
import com.bgsoftware.superiorskyblock.api.upgrades.UpgradeLevel;
import com.bgsoftware.superiorskyblock.api.wrappers.SuperiorPlayer;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.Biome;
import org.bukkit.block.Block;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.EntityType;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffectType;
import javax.annotation.Nullable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
public interface Island extends Comparable<Island>, IMissionsHolder, IPersistentDataHolder, IDatabaseBridgeHolder {
/*
* General methods
*/
/**
* Get the owner of the island.
*/
SuperiorPlayer getOwner();
/**
* Get the unique-id of the island.
*/
UUID getUniqueId();
/**
* Get the creation time of the island.
*/
long getCreationTime();
/**
* Get the creation time of the island, in a formatted string.
*/
String getCreationTimeDate();
/**
* Re-sync the island with a new dates formatter.
*/
void updateDatesFormatter();
/*
* Player related methods
*/
/**
* Get the list of members of the island.
*
* @param includeOwner Whether the owner should be returned.
*/
List<SuperiorPlayer> getIslandMembers(boolean includeOwner);
/**
* Get the list of members of the island with specific roles.
*
* @param playerRoles The roles to filter with.
*/
List<SuperiorPlayer> getIslandMembers(PlayerRole... playerRoles);
/**
* Get the list of all banned players.
*/
List<SuperiorPlayer> getBannedPlayers();
/**
* Get the list of all visitors that are on the island, including vanished ones.
*/
List<SuperiorPlayer> getIslandVisitors();
/**
* Get the list of all visitors that are on the island.
*
* @param vanishPlayers Should vanish players be included?
*/
List<SuperiorPlayer> getIslandVisitors(boolean vanishPlayers);
/**
* Get the list of all the players that are on the island.
*/
List<SuperiorPlayer> getAllPlayersInside();
/**
* Get all the visitors that visited the island until now.
*/
List<SuperiorPlayer> getUniqueVisitors();
/**
* Get all the visitors that visited the island until now, with the time they last visited.
*/
List<Pair<SuperiorPlayer, Long>> getUniqueVisitorsWithTimes();
/**
* Invite a player to the island.
*
* @param superiorPlayer The player to invite.
*/
void inviteMember(SuperiorPlayer superiorPlayer);
/**
* Revoke an invitation of a player.
*
* @param superiorPlayer The player to revoke his invite.
*/
void revokeInvite(SuperiorPlayer superiorPlayer);
/**
* Checks whether the player has been invited to the island.
*/
boolean isInvited(SuperiorPlayer superiorPlayer);
/**
* Get all the invited players of the island.
*/
List<SuperiorPlayer> getInvitedPlayers();
/**
* Add a player to the island.
*
* @param superiorPlayer The player to add.
* @param playerRole The role to give to the player.
*/
void addMember(SuperiorPlayer superiorPlayer, PlayerRole playerRole);
/**
* Kick a member from the island.
*
* @param superiorPlayer The player to kick.
*/
void kickMember(SuperiorPlayer superiorPlayer);
/**
* Check whether a player is a member of the island.
*
* @param superiorPlayer The player to check.
*/
boolean isMember(SuperiorPlayer superiorPlayer);
/**
* Ban a member from the island.
*
* @param superiorPlayer The player to ban.
*/
void banMember(SuperiorPlayer superiorPlayer);
/**
* Ban a member from the island.
*
* @param superiorPlayer The player to ban.
* @param whom The player that executed the ban command.
* If null, CONSOLE will be chosen as the banner.
*/
void banMember(SuperiorPlayer superiorPlayer, @Nullable SuperiorPlayer whom);
/**
* Unban a player from the island.
*
* @param superiorPlayer The player to unban.
*/
void unbanMember(SuperiorPlayer superiorPlayer);
/**
* Checks whether a player is banned from the island.
*
* @param superiorPlayer The player to check.
*/
boolean isBanned(SuperiorPlayer superiorPlayer);
/**
* Add a player to the island as a co-op member.
*
* @param superiorPlayer The player to add.
*/
void addCoop(SuperiorPlayer superiorPlayer);
/**
* Remove a player from being a co-op member.
*
* @param superiorPlayer The player to remove.
*/
void removeCoop(SuperiorPlayer superiorPlayer);
/**
* Check whether a player is a co-op member of the island.
*
* @param superiorPlayer The player to check.
*/
boolean isCoop(SuperiorPlayer superiorPlayer);
/**
* Get the list of all co-op players.
*/
List<SuperiorPlayer> getCoopPlayers();
/**
* Get the coop players limit of the island.
*/
int getCoopLimit();
/**
* Get the coop players limit of the island that was set using a command.
*/
int getCoopLimitRaw();
/**
* Set the coop players limit of the island.
*
* @param coopLimit The coop players limit to set.
*/
void setCoopLimit(int coopLimit);
/**
* Update status of a player if he's inside the island or not.
*
* @param superiorPlayer The player to add.
*/
void setPlayerInside(SuperiorPlayer superiorPlayer, boolean inside);
/**
* Check whether a player is a visitor of the island or not.
*
* @param superiorPlayer The player to check.
* @param checkCoopStatus Whether to check for coop status or not.
* If enabled, coops will not be considered as visitors.
*/
boolean isVisitor(SuperiorPlayer superiorPlayer, boolean checkCoopStatus);
/*
* Location related methods
*/
/**
* Get the center location of the island, depends on the world environment.
*
* @param environment The environment.
*/
Location getCenter(World.Environment environment);
/**
* Get the members' teleport location of the island, depends on the world environment.
* Similar to {@link #getIslandHome(World.Environment)}
*
* @param environment The environment.
*/
@Nullable
Location getTeleportLocation(World.Environment environment);
/**
* Get all the teleport locations of the island.
* Similar to {@link #getIslandHomes()}
*/
Map<World.Environment, Location> getTeleportLocations();
/**
* Set the members' teleport location of the island.
* Similar to {@link #setIslandHome(Location)}
*
* @param teleportLocation The new teleport location.
*/
void setTeleportLocation(Location teleportLocation);
/**
* Set the members' teleport location of the island.
* Similar to {@link #setIslandHome(org.bukkit.World.Environment, Location)}
*
* @param environment The environment to change teleport location for.
* @param teleportLocation The new teleport location.
*/
void setTeleportLocation(World.Environment environment, @Nullable Location teleportLocation);
/**
* Get the members' home location of the island, depends on the world environment.
*
* @param environment The environment.
*/
@Nullable
Location getIslandHome(World.Environment environment);
/**
* Get all the home locations of the island.
*/
Map<World.Environment, Location> getIslandHomes();
/**
* Set the members' teleport location of the island.
*
* @param homeLocation The new home location.
*/
void setIslandHome(Location homeLocation);
/**
* Set the members' teleport location of the island.
*
* @param environment The environment to change teleport location for.
* @param homeLocation The new home location.
*/
void setIslandHome(World.Environment environment, @Nullable Location homeLocation);
/**
* Get the visitors' teleport location of the island.
*
* @deprecated See {@link #getVisitorsLocation(World.Environment)}
*/
@Nullable
@Deprecated
Location getVisitorsLocation();
/**
* Get the visitors' teleport location of the island.
*
* @param environment The environment to get the visitors-location from.
* Currently unused, it has no effect.
*/
@Nullable
Location getVisitorsLocation(World.Environment environment);
/**
* Set the visitors' teleport location of the island.
*
* @param visitorsLocation The new visitors location.
*/
void setVisitorsLocation(@Nullable Location visitorsLocation);
/**
* Get the minimum location of the island.
*/
Location getMinimum();
/**
* Get the minimum protected location of the island.
*/
Location getMinimumProtected();
/**
* Get the maximum location of the island.
*/
Location getMaximum();
/**
* Get the minimum protected location of the island.
*/
Location getMaximumProtected();
/**
* Get all the chunks of the island from all the environments.
*/
List<Chunk> getAllChunks();
/**
* Get all the chunks of the island from all the environments.
*
* @param onlyProtected Whether only chunks inside the protected area should be returned.
*/
List<Chunk> getAllChunks(boolean onlyProtected);
/**
* Get all the chunks of the island.
*
* @param environment The environment to get the chunks from.
*/
List<Chunk> getAllChunks(World.Environment environment);
/**
* Get all the chunks of the island, including empty ones.
*
* @param environment The environment to get the chunks from.
* @param onlyProtected Whether only chunks inside the protected area should be returned.
*/
List<Chunk> getAllChunks(World.Environment environment, boolean onlyProtected);
/**
* Get all the chunks of the island.
*
* @param environment The environment to get the chunks from.
* @param onlyProtected Whether only chunks inside the protected area should be returned.
* @param noEmptyChunks Should empty chunks be loaded or not?
*/
List<Chunk> getAllChunks(World.Environment environment, boolean onlyProtected, boolean noEmptyChunks);
/**
* Get all the loaded chunks of the island.
*
* @param onlyProtected Whether only chunks inside the protected area should be returned.
* @param noEmptyChunks Should empty chunks be loaded or not?
*/
List<Chunk> getLoadedChunks(boolean onlyProtected, boolean noEmptyChunks);
/**
* Get all the loaded chunks of the island.
*
* @param environment The environment to get the chunks from.
* @param onlyProtected Whether only chunks inside the protected area should be returned.
* @param noEmptyChunks Should empty chunks be loaded or not?
*/
List<Chunk> getLoadedChunks(World.Environment environment, boolean onlyProtected, boolean noEmptyChunks);
/**
* Get all the chunks of the island asynchronized, including empty chunks.
*
* @param environment The environment to get the chunks from.
* @param onlyProtected Whether only chunks inside the protected area should be returned.
* @param onChunkLoad A consumer that will be ran when the chunk is loaded. Can be null.
*/
List<CompletableFuture<Chunk>> getAllChunksAsync(World.Environment environment, boolean onlyProtected, @Nullable Consumer<Chunk> onChunkLoad);
/**
* Get all the chunks of the island asynchronized.
*
* @param environment The environment to get the chunks from.
* @param onlyProtected Whether only chunks inside the protected area should be returned.
* @param noEmptyChunks Should empty chunks be loaded or not?
* @param onChunkLoad A consumer that will be ran when the chunk is loaded. Can be null.
*/
List<CompletableFuture<Chunk>> getAllChunksAsync(World.Environment environment, boolean onlyProtected, boolean noEmptyChunks, @Nullable Consumer<Chunk> onChunkLoad);
/**
* Reset all the chunks of the island (will make all chunks empty).
*
* @param environment The environment to reset chunks in.
* @param onlyProtected Whether only chunks inside the protected area should be reset.
*/
void resetChunks(World.Environment environment, boolean onlyProtected);
/**
* Reset all the chunks of the island (will make all chunks empty).
*
* @param environment The environment to reset chunks in.
* @param onlyProtected Whether only chunks inside the protected area should be reset.
* @param onFinish Callback runnable.
*/
void resetChunks(World.Environment environment, boolean onlyProtected, @Nullable Runnable onFinish);
/**
* Reset all the chunks of the island from all the worlds (will make all chunks empty).
*
* @param onlyProtected Whether only chunks inside the protected area should be reset.
*/
void resetChunks(boolean onlyProtected);
/**
* Reset all the chunks of the island from all the worlds (will make all chunks empty).
*
* @param onlyProtected Whether only chunks inside the protected area should be reset.
* @param onFinish Callback runnable.
*/
void resetChunks(boolean onlyProtected, @Nullable Runnable onFinish);
/**
* Check if the location is inside the island's area.
*
* @param location The location to check.
*/
boolean isInside(Location location);
/**
* Check if a chunk location is inside the island's area.
*
* @param world The world of the chunk.
* @param chunkX The x-coords of the chunk.
* @param chunkZ The z-coords of the chunk.
*/
boolean isInside(World world, int chunkX, int chunkZ);
/**
* Check if the location is inside the island's protected area.
*
* @param location The location to check.
*/
boolean isInsideRange(Location location);
/**
* Check if the location is inside the island's protected area.
*
* @param location The location to check.
* @param extraRadius Add extra radius to the protected range.
*/
boolean isInsideRange(Location location, int extraRadius);
/**
* Check if the chunk is inside the island's protected area.
*
* @param chunk The chunk to check.
*/
boolean isInsideRange(Chunk chunk);
/**
* Is the normal world enabled for the island?
*/
boolean isNormalEnabled();
/**
* Enable/disable the normal world for the island.
*/
void setNormalEnabled(boolean enabled);
/**
* Is the nether world enabled for the island?
*/
boolean isNetherEnabled();
/**
* Enable/disable the nether world for the island.
*/
void setNetherEnabled(boolean enabled);
/**
* Is the end world enabled for the island?
*/
boolean isEndEnabled();
/**
* Enable/disable the end world for the island.
*/
void setEndEnabled(boolean enabled);
/**
* Get the unlocked worlds flag.
*/
int getUnlockedWorldsFlag();
/*
* Permissions related methods
*/
/**
* Check if a CommandSender has a permission.
*
* @param sender The command-sender to check.
* @param islandPrivilege The permission to check.
*/
boolean hasPermission(CommandSender sender, IslandPrivilege islandPrivilege);
/**
* Check if a player has a permission.
*
* @param superiorPlayer The player to check.
* @param islandPrivilege The permission to check.
*/
boolean hasPermission(SuperiorPlayer superiorPlayer, IslandPrivilege islandPrivilege);
/**
* Check if a role has a permission.
*
* @param playerRole The role to check.
* @param islandPrivilege The permission to check.
*/
boolean hasPermission(PlayerRole playerRole, IslandPrivilege islandPrivilege);
/**
* Set a permission to a specific role.
*
* @param playerRole The role to set the permission to.
* @param islandPrivilege The permission to set.
* @param value The value to give the permission (Unused)
* @deprecated See {@link #setPermission(PlayerRole, IslandPrivilege)}
*/
@Deprecated
void setPermission(PlayerRole playerRole, IslandPrivilege islandPrivilege, boolean value);
/**
* Set a permission to a specific role.
*
* @param playerRole The role to set the permission to.
* @param islandPrivilege The permission to set.
*/
void setPermission(PlayerRole playerRole, IslandPrivilege islandPrivilege);
/**
* Reset the roles permissions to default values.
*/
void resetPermissions();
/**
* Set a permission to a specific player.
*
* @param superiorPlayer The player to set the permission to.
* @param islandPrivilege The permission to set.
* @param value The value to give the permission.
*/
void setPermission(SuperiorPlayer superiorPlayer, IslandPrivilege islandPrivilege, boolean value);
/**
* Reset player permissions to default values.
*/
void resetPermissions(SuperiorPlayer superiorPlayer);
/**
* Get the permission-node of a player.
*
* @param superiorPlayer The player to check.
*/
PermissionNode getPermissionNode(SuperiorPlayer superiorPlayer);
/**
* Get the required role for a specific permission.
*
* @param islandPrivilege The permission to check.
*/
PlayerRole getRequiredPlayerRole(IslandPrivilege islandPrivilege);
/**
* Get all the custom player permissions of the island.
*/
Map<SuperiorPlayer, PermissionNode> getPlayerPermissions();
/**
* Get the permissions and their required roles.
*/
Map<IslandPrivilege, PlayerRole> getRolePermissions();
/*
* General methods
*/
/**
* Checks whether the island is the spawn island.
*/
boolean isSpawn();
/**
* Get the name of the island.
*/
String getName();
/**
* Set the name of the island.
*
* @param islandName The name to set.
*/
void setName(String islandName);
/**
* Get the name of the island, unformatted.
*/
String getRawName();
/**
* Get the description of the island.
*/
String getDescription();
/**
* Set the description of the island.
*
* @param description The description to set.
*/
void setDescription(String description);
/**
* Disband the island.
*/
void disbandIsland();
/**
* Transfer the island's leadership to another player.
*
* @param superiorPlayer The player to transfer the leadership to.
* @return True if the transfer was succeed, otherwise false.
*/
boolean transferIsland(SuperiorPlayer superiorPlayer);
/**
* Replace a player with a new player.
*
* @param originalPlayer The old player to be replaced.
* @param newPlayer The new player.
*/
void replacePlayers(SuperiorPlayer originalPlayer, SuperiorPlayer newPlayer);
/**
* Recalculate the island's worth value.
*
* @param asker The player who makes the operation.
*/
void calcIslandWorth(@Nullable SuperiorPlayer asker);
/**
* Recalculate the island's worth value.
*
* @param asker The player who makes the operation.
* @param callback Runnable which will be ran when process is finished.
*/
void calcIslandWorth(@Nullable SuperiorPlayer asker, @Nullable Runnable callback);
/**
* Get the calculation algorithm used by this island.
*/
IslandCalculationAlgorithm getCalculationAlgorithm();
/**
* Update the border of all the players inside the island.
*/
void updateBorder();
/**
* Update the fly status for a player on this island.
*
* @param superiorPlayer The player to update.
*/
void updateIslandFly(SuperiorPlayer superiorPlayer);
/**
* Get the island radius of the island.
*/
int getIslandSize();
/**
* Set the radius of the island.
*
* @param islandSize The radius for the island.
*/
void setIslandSize(int islandSize);
/**
* Get the island radius of the island that was set with a command.
*/
int getIslandSizeRaw();
/**
* Get the discord that is associated with the island.
*/
String getDiscord();
/**
* Set the discord that will be associated with the island.
*/
void setDiscord(String discord);
/**
* Get the paypal that is associated with the island.
*/
String getPaypal();
/**
* Get the paypal that will be associated with the island.
*/
void setPaypal(String paypal);
/**
* The current biome of the island.
*/
Biome getBiome();
/**
* Change the biome of the island's area.
*/
void setBiome(Biome biome);
/**
* Change the biome of the island's area.
*
* @param updateBlocks Whether the blocks get updated or not.
*/
void setBiome(Biome biome, boolean updateBlocks);
/**
* Check whether the island is locked to visitors.
*/
boolean isLocked();
/**
* Lock or unlock the island to visitors.
*
* @param locked Whether the island should be locked to visitors.
*/
void setLocked(boolean locked);
/**
* Checks whether the island is ignored in the top islands.
*/
boolean isIgnored();
/**
* Set whether the island should be ignored in the top islands.
*/
void setIgnored(boolean ignored);
/**
* Send a plain message to all the members of the island.
*
* @param message The message to send
* @param ignoredMembers An array of ignored members.
*/
void sendMessage(String message, UUID... ignoredMembers);
/**
* Send a message to all the members of the island.
*
* @param messageComponent The message to send
* @param args Arguments for the component.
*/
void sendMessage(IMessageComponent messageComponent, Object... args);
/**
* Send a message to all the members of the island.
*
* @param messageComponent The message to send
* @param ignoredMembers An array of ignored members.
* @param args Arguments for the component.
*/
void sendMessage(IMessageComponent messageComponent, List<UUID> ignoredMembers, Object... args);
/**
* Send a plain message to all the members of the island.
*
* @param title The main title to send.
* @param subtitle The sub title to send.
* @param fadeIn The fade-in duration in ticks.
* @param duration The title duration in ticks.
* @param fadeOut The fade-out duration in ticks.
* @param ignoredMembers An array of ignored members.
*/
void sendTitle(@Nullable String title, @Nullable String subtitle, int fadeIn, int duration, int fadeOut, UUID... ignoredMembers);
/**
* Execute a command on all the members of the island.
* You can use {player-name} as a placeholder for the member's name.
*
* @param command The command to execute.
* @param onlyOnlineMembers Whether the command should be executed only for online members.
* @param ignoredMembers An array of ignored members.
*/
void executeCommand(String command, boolean onlyOnlineMembers, UUID... ignoredMembers);
/**
* Checks whether the island is being recalculated currently.
*/
boolean isBeingRecalculated();
/**
* Update the last time the island was used.
*/
void updateLastTime();
/**
* Flag the island as a currently active island.
*/
void setCurrentlyActive();
/**
* Get the last time the island was updated.
*/
long getLastTimeUpdate();
/**
* Set the last time the island was updated.
*
* @param lastTimeUpdate The last time the island was updated.
*/
void setLastTimeUpdate(long lastTimeUpdate);
/*
* Bank related methods
*/
/**
* Get the bank of the island.
*/
IslandBank getIslandBank();
/**
* Get the limit of the bank.
*/
BigDecimal getBankLimit();
/**
* Set a new limit for the bank.
*
* @param bankLimit The limit to set. Use -1 to remove the limit.
*/
void setBankLimit(BigDecimal bankLimit);
/**
* Get the limit of the bank that was set using a command.
*/
BigDecimal getBankLimitRaw();
/**
* Give the bank interest to this island.
*
* @param checkOnlineOwner Check if the island-owner was online recently.
* @return Whether the money was given.
*/
boolean giveInterest(boolean checkOnlineOwner);
/**
* Get the last time that the bank interest was given.
*/
long getLastInterestTime();
/**
* Set the last time that the bank interest was given.
*
* @param lastInterest The time it was given.
*/
void setLastInterestTime(long lastInterest);
/**
* Get the duration until the bank interest will be given again, in seconds
*/
long getNextInterest();
/*
* Worth related methods
*/
/**
* Handle a placement of a block.
*
* @param block The block that was placed.
*/
void handleBlockPlace(Block block);
/**
* Handle a placement of a block with a specific amount.
*
* @param block The block that was placed.
* @param amount The amount of the block.
*/
void handleBlockPlace(Block block, int amount);
/**
* Handle a placement of a block with a specific amount.
*
* @param block The block that was placed.
* @param amount The amount of the block.
* @param save Whether the block counts should be saved into database.
*/
void handleBlockPlace(Block block, int amount, boolean save);
/**
* Handle a placement of a block's key with a specific amount.
*
* @param key The block's key that was placed.
* @param amount The amount of the block.
*/
void handleBlockPlace(Key key, int amount);
/**
* Handle a placement of a block's key with a specific amount.
*
* @param key The block's key that was placed.
* @param amount The amount of the block.
* @param save Whether the block counts should be saved into database.
*/
void handleBlockPlace(Key key, int amount, boolean save);
/**
* Handle a placement of a block's key with a specific amount.
*
* @param key The block's key that was placed.
* @param amount The amount of the block.
* @param save Whether the block counts should be saved into database.
*/
void handleBlockPlace(Key key, BigInteger amount, boolean save);
/**
* Handle a placement of a block's key with a specific amount.
*
* @param key The block's key that was placed.
* @param amount The amount of the block.
* @param save Whether the block counts should be saved into database.
* @param updateLastTimeStatus Whether to update last time island was updated or not.
*/
void handleBlockPlace(Key key, BigInteger amount, boolean save, boolean updateLastTimeStatus);
/**
* Handle placements of many blocks in one time.
*