mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-12-22 09:08:03 +01:00
WIP: Teams - still testing and debugging, but making progress.
This commit is contained in:
parent
25d2702632
commit
4c69587d9a
@ -553,6 +553,9 @@ sign-acidisland:
|
||||
line4: "Beware!"
|
||||
targetInPVPArea: "Target is in a no-PVP area!"
|
||||
team:
|
||||
color: "&b"
|
||||
leader-color: "&a"
|
||||
leader: " - Leader"
|
||||
listingMembers: "Listing your island members"
|
||||
teamchat:
|
||||
helpChat: "turn on/off team chat"
|
||||
|
@ -6,6 +6,9 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
import us.tastybento.bskyblock.BSkyBlock;
|
||||
import us.tastybento.bskyblock.config.BSBLocale;
|
||||
import us.tastybento.bskyblock.database.managers.IslandsManager;
|
||||
import us.tastybento.bskyblock.database.managers.PlayersManager;
|
||||
import us.tastybento.bskyblock.util.Util;
|
||||
|
||||
import java.util.*;
|
||||
@ -313,7 +316,33 @@ public abstract class AbstractCommand implements CommandExecutor, TabCompleter {
|
||||
public void setErrorResponse(String errorResponse) {
|
||||
this.errorResponse = errorResponse;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// These methods below just neaten up the code in the commands so "plugin." isn't always used
|
||||
/**
|
||||
* @return PlayersManager
|
||||
*/
|
||||
protected PlayersManager getPlayers() {
|
||||
return plugin.getPlayers();
|
||||
}
|
||||
/**
|
||||
* @return IslandsManager
|
||||
*/
|
||||
protected IslandsManager getIslands() {
|
||||
return plugin.getIslands();
|
||||
}
|
||||
/**
|
||||
* @param sender
|
||||
* @return Locale for sender
|
||||
*/
|
||||
protected BSBLocale getLocale(CommandSender sender) {
|
||||
return plugin.getLocale(sender);
|
||||
}
|
||||
/**
|
||||
* @param uuid
|
||||
* @return Locale for UUID
|
||||
*/
|
||||
protected BSBLocale getLocale(UUID uuid) {
|
||||
return plugin.getLocale(uuid);
|
||||
}
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -487,10 +487,15 @@ public class IslandsManager {
|
||||
|
||||
/**
|
||||
* @param playerUUID
|
||||
* @return true if player has island
|
||||
* @return true if player has island and owns it
|
||||
*/
|
||||
public boolean hasIsland(UUID playerUUID) {
|
||||
return islandsByUUID.containsKey(playerUUID);
|
||||
if (islandsByUUID.containsKey(playerUUID) && islandsByUUID.get(playerUUID).getOwner() != null) {
|
||||
if (islandsByUUID.get(playerUUID).getOwner().equals(playerUUID)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -8,7 +8,9 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import us.tastybento.bskyblock.BSkyBlock;
|
||||
@ -327,10 +329,13 @@ public class PlayersManager{
|
||||
* @param adminCheck - if made via an admin call, this will go out to the 'net and grab - may cause lag
|
||||
* @return UUID of player or null if unknown
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public UUID getUUID(String string, boolean adminCheck) {
|
||||
// Look in the database if it ready
|
||||
// TODO: finish this!
|
||||
return Bukkit.getOfflinePlayer(string).getUniqueId();
|
||||
|
||||
//return database.getUUID(string, adminCheck);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user