mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-02-15 11:51:55 +01:00
WIP
This commit is contained in:
parent
1155ffd08e
commit
cccc9ee98d
@ -4,6 +4,7 @@ import java.util.Collections;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
@ -105,6 +106,24 @@ public class JoinLeaveListener implements Listener {
|
|||||||
|
|
||||||
// Add a player to the bStats cache.
|
// Add a player to the bStats cache.
|
||||||
plugin.getMetrics().ifPresent(bStats -> bStats.addPlayer(playerUUID));
|
plugin.getMetrics().ifPresent(bStats -> bStats.addPlayer(playerUUID));
|
||||||
|
|
||||||
|
// Create onIsland placeholders
|
||||||
|
plugin.getAddonsManager().getGameModeAddons().forEach(addon -> {
|
||||||
|
plugin.getPlaceholdersManager()
|
||||||
|
.registerPlaceholder(addon.getDescription().getName() + "_onisland_" + user.getName(), asker -> {
|
||||||
|
if (asker == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
// Get the user who this applies to
|
||||||
|
User named = User.getInstance(user.getUniqueId());
|
||||||
|
if (named.isOnline()) {
|
||||||
|
return plugin.getIslands().getIslands(addon.getOverWorld(), asker).stream()
|
||||||
|
.filter(island -> island.onIsland(named.getLocation())).findFirst().map(i -> "true")
|
||||||
|
.orElse("false");
|
||||||
|
}
|
||||||
|
return "false";
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void firstTime(User user) {
|
private void firstTime(User user) {
|
||||||
|
@ -19,6 +19,7 @@ import world.bentobox.bentobox.util.Util;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Common Game Mode Placeholders
|
* Common Game Mode Placeholders
|
||||||
|
* All of these are prefixed with the game mode's name, e.g., bskykblock_
|
||||||
*/
|
*/
|
||||||
public enum GameModePlaceholder {
|
public enum GameModePlaceholder {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user