name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
AreaShop_Utils_getDurationFromMinutesOrStringInput_rdh | /**
* Parse a time setting that could be minutes or a duration string.
*
* @param input
* The string to parse
* @return milliseconds that the string indicates
*/
public static long getDurationFromMinutesOrStringInput(String input) {
long number;
try {
number = Long.parseLong(input);if (number != (-1)) {
number ... | 3.26 |
AreaShop_Utils_getImportantBuyRegions_rdh | /**
* Get the most important buy AreaShop regions.
* - Returns highest priority, child instead of parent regions.
*
* @param location
* The location to check for regions
* @return empty list if no regions found, 1 member if 1 region is a priority, more if regions with the same priority
*/
public static List<Bu... | 3.26 |
AreaShop_Utils_toName_rdh | /**
* Conversion to name by uuid object.
*
* @param uuid
* The uuid in string format
* @return the name of the player
*/
public static String toName(UUID uuid) {
if (uuid == null) {
return "";
} else {
String name = Bukkit.getOfflinePlayer(uuid).getName();
if (name != null) {
return name;
}
return "";
}
} | 3.26 |
AreaShop_Utils_configToLocation_rdh | /**
* Create a location from a map, reconstruction from the config values.
*
* @param config
* The config section to reconstruct from
* @return The location
*/
public static Location configToLocation(ConfigurationSection config) {
if ((((((config == null) || (!config.isString("world"))) || (!config.isDouble... | 3.26 |
AreaShop_Utils_getDurationFromSecondsOrStringInput_rdh | /**
* Parse a time setting that could be seconds or a duration string.
*
* @param input
* The string to parse
* @return seconds that the string indicates
*/
public static long getDurationFromSecondsOrStringInput(String input) {
long number;
try {
number = Long.parseLong(input);
if (number != (-1)) {
number *= 1... | 3.26 |
AreaShop_Utils_applyColors_rdh | /**
* Convert color and formatting codes to bukkit values.
*
* @param input
* Start string with color and formatting codes in it
* @return String with the color and formatting codes in the bukkit format
*/
public static String applyColors(String input) {
String
result = null;
if (input
!= null) {result = ChatCo... | 3.26 |
AreaShop_Utils_initialize_rdh | /**
* Initialize the utilities class with constants.
*
* @param pluginConfig
* The config of the plugin
*/
public static void initialize(YamlConfiguration pluginConfig) {
config = pluginConfig;// Setup individual identifiers
seconds = getSetAndDefaults("seconds");
minutes = getSetAndDefaults("minutes... | 3.26 |
AreaShop_Utils_isNumeric_rdh | /**
* Check if an input is numeric.
*
* @param input
* The input to check
* @return true if the input is numeric, otherwise false
*/
@SuppressWarnings("ResultOfMethodCallIgnored")
public static boolean isNumeric(String input) {
try {
Integer.parseInt(input);
return true;
} catch
(NumberFormatException ignored... | 3.26 |
AreaShop_Utils_millisToHumanFormat_rdh | /**
* Convert milliseconds to a human readable format.
*
* @param milliseconds
* The amount of milliseconds to convert
* @return A formatted string based on the language file
*/
public static String millisToHumanFormat(long milliseconds) {
long timeLeft = milliseconds + 500;
// To seconds
timeLeft /... | 3.26 |
AreaShop_Utils_checkTimeFormat_rdh | /**
* Checks if the string is a correct time period.
*
* @param time
* String that has to be checked
* @return true if format is correct, false if not
*/
public static boolean checkTimeFormat(String time) {
// Check if the string is not empty and check the length
if ((((time == null) || (time.length() <= 1)) ||... | 3.26 |
AreaShop_Utils_durationStringToLong_rdh | /**
* Methode to tranlate a duration string to a millisecond value.
*
* @param duration
* The duration string
* @return The duration in milliseconds translated from the durationstring, or if it is invalid then 0
*/
public static long durationStringToLong(String duration) {
if (duration == null) {
return 0;
} el... | 3.26 |
AreaShop_Utils_getImportantWorldEditRegions_rdh | /**
* Get a list of regions around a location.
* - Returns highest priority, child instead of parent regions
*
* @param location
* The location to check for regions
* @return empty list if no regions found, 1 member if 1 region is a priority, more if regions with the same priority
*/
public static List<Protect... | 3.26 |
AreaShop_Utils_getRegionsInSelection_rdh | // ======================================================================
// Methods to get WorldGuard or AreaShop regions by location or selection
// ======================================================================
/**
* Get all AreaShop regions intersecting with a WorldEdit selection.
*
* @param selection
*... | 3.26 |
AreaShop_Utils_createCommaSeparatedList_rdh | /**
* Create a comma-separated list.
*
* @param input
* Collection of object which should be concatenated with comma's in between (skipping null values)
* @return Innput object concatenated with comma's in between
*/
public static String createCommaSeparatedList(Collection<?> input) {
StringBuilder result =... | 3.26 |
AreaShop_Utils_getOnlinePlayers_rdh | /**
* Gets the online players.
* Provides backwards compatibility for 1.7- where it returns an array
*
* @return Online players
*/
@SuppressWarnings("unchecked")
public static Collection<? extends Player> getOnlinePlayers() {
try {
Method v8 = Server.class.getMethod("getOnlinePlayers");
if (v8.... | 3.26 |
AreaShop_Utils_getImportantRentRegions_rdh | /**
* Get the most important rental AreaShop regions.
* - Returns highest priority, child instead of parent regions.
*
* @param location
* The location to check for regions
* @return empty list if no regions found, 1 member if 1 region is a priority, more if regions with the same priority
*/
public static Li... | 3.26 |
AreaShop_Utils_toUniqueId_rdh | /**
* Conversion from name to uuid.
*
* @param name
* The name of the player
* @return The uuid of the player
*/
// Fake deprecation by Bukkit to inform developers, method will stay
@SuppressWarnings("deprecation")
public static String toUniqueId(String name) {
if (name ==
null) {
return null;
} else {
return B... | 3.26 |
AreaShop_Utils_getSetAndDefaults_rdh | /**
* Get a string list from the config, combined with the entries specified in the default config.
*
* @param path
* The path to read the lists from
* @return List with all values defined in the config and the default config combined
*/
private static Set<String> getSetAndDefaul... | 3.26 |
AreaShop_Utils_getRegions_rdh | /**
* Get all AreaShop regions containing a location.
*
* @param location
* The location to check
* @return A list with all the AreaShop regions that contain the location
*/
public static List<GeneralRegion> getRegions(Location location) {
return getRegionsInSelection(new WorldEditSelection(location.getWorld(),... | 3.26 |
AreaShop_Utils_isDouble_rdh | /**
* Check if a string is a double.
*
* @param input
* The input
* @return true if the input is a double, otherwise false
*/
@SuppressWarnings("ResultOfMethodCallIgnored")
public static boolean isDouble(String input) {
try {
Double.parseDouble(input);
return true;
} catch (NumberFormatException e) {
return f... | 3.26 |
AreaShop_Utils_combinedMessage_rdh | /**
* Create a message with a list of parts.
*
* @param replacements
* The parts to use
* @param messagePart
* The message to use for the parts
* @param combiner
* The string to use as combiner
* @return A Message object containing the parts combined into one message
*/
public static Message combinedMes... | 3.26 |
AreaShop_Utils_getImportantRegions_rdh | /**
* Get the most important AreaShop regions.
* - Returns highest priority, child instead of parent regions.
*
* @param location
* The location to check for regions
* @param type
* The type of regions to look for, null for all
* @return empty list if no regions found, 1 member if 1 region is a priority, mo... | 3.26 |
AreaShop_Utils_locationToConfig_rdh | /**
* Create a map from a location, to save it in the config.
*
* @param location
* The location to transform
* @param setPitchYaw
* true to save the pitch and yaw, otherwise false
* @return The map with the location values
*/
public static ConfigurationSection locationToConfig(Location location, boolean se... | 3.26 |
AreaShop_Utils_millisToTicks_rdh | /**
* Convert milliseconds to ticks.
*
* @param milliseconds
* Milliseconds to convert
* @return milliseconds divided by 50 (20 ticks per second)
*/
public static long millisToTicks(long
milliseconds) {
return milliseconds / 50;
} | 3.26 |
AreaShop_Utils_formatCurrency_rdh | /**
* Format the currency amount with the characters before and after.
*
* @param amount
* Amount of money to format
* @return Currency character format string
*/
public static String formatCurrency(double amount) {
String before = config.getString("moneyCharacter");
before = before.replace(AreaShop.currency... | 3.26 |
AreaShop_Utils_yawToFacing_rdh | /**
* Get the facing direction based on the yaw.
*
* @param yaw
* The horizontal angle that for example the player is looking
* @return The Block Face of the angle
*/public static BlockFace yawToFacing(float yaw) {
return facings[Math.round(yaw / 45.0F) & 0x7];
} | 3.26 |
AreaShop_Utils_getDurationFromMinutesOrString_rdh | /**
* Get setting from config that could be only a number indicating minutes.
* or a string indicating a duration string.
*
* @param path
* Path of the setting to read
* @return milliseconds that the setting indicates
*/
public static long getDurationFromMinutesOrString(String path) {
if (config.isLong(path) |... | 3.26 |
AreaShop_TeleportFeature_m1_rdh | /**
* Get the start location of a safe teleport search.
*
* @param player
* The player to get it for
* @param toSign
* true to try teleporting to the first sign, false for teleporting to the region
* @return The start location
*/
private Location m1(Player player, Value<Boolean> toSign) {
Location startLoca... | 3.26 |
AreaShop_TeleportFeature_cannotSpawnOn_rdh | /**
* Check if a player can spawn on here.
*
* @param material
* Material to check (assumed that this is below the feet)
* @return true when it is safe to spawn on top of, otherwise false
*/
private static boolean cannotSpawnOn(Material material) {
String name = material.name();
return (((((((((name.equals("CA... | 3.26 |
AreaShop_TeleportFeature_isSafe_rdh | /**
* Checks if a certain location is safe to teleport to.
*
* @param location
* The location to check
* @return true if it is safe, otherwise false
*/
private boolean isSafe(Location location) {
Block feet = location.getBlock();
Block head = feet.getRelative(BlockFace.UP);
Block below = feet.getRelative(BlockF... | 3.26 |
AreaShop_TeleportFeature_teleportPlayer_rdh | /**
* Teleport a player to the region when he has permissions for it.
*
* @param player
* Player that should be teleported
* @return true if the teleport succeeded, otherwise false
*/
public boolean teleportPlayer(Player player) {
return teleportPlayer(player, false, true);
} | 3.26 |
AreaShop_TeleportFeature_canSpawnIn_rdh | /**
* Check if a player can spawn in here.
*
* @param material
* Material to check (assumed that this is at the feet or head level)
* @return true when it is safe to spawn inside, otherwise false
*/
private static boolean canSpawnIn(Material material) {
String name = material.name();
return ((name.contains("DOO... | 3.26 |
AreaShop_TeleportFeature_cannotSpawnBeside_rdh | /**
* Check if a player can spawn next to it.
*
* @param material
* Material to check (assumed that this is somewhere around the player)
* @return true when it is safe to spawn next to, otherwise false
*/
private static boolean cannotSpawnBeside(Material material) {
String name = material.name();
return ((name... | 3.26 |
AreaShop_TeleportFeature_getTeleportLocation_rdh | /**
* Get the teleportlocation set for this region.
*
* @return The teleport location, or null if not set
*/
public Location getTeleportLocation() {
return Utils.configToLocation(getRegion().getConfigurationSectionSetting("general.teleportLocation"));
} | 3.26 |
AreaShop_Materials_signNameToMaterial_rdh | /**
* Get material based on a sign material name.
*
* @param name
* Name of the sign material
* @return null if not a sign, otherwise the material matching the name (when the material is not available on the current minecraft version, it returns the base type)
*/
public static Ma... | 3.26 |
AreaShop_Materials_isSign_rdh | /**
* Check if a Material is a sign (of either the wall or floor type).
*
* @param name
* String to check
* @return true if the given material is a sign
*/
public static boolean isSign(String name) {
return (name != null) && (FLOOR_SIGN_TYPES.contains(name) || WALL_SIGN_TYPES.contains(name));
} | 3.26 |
AreaShop_RegionAccessSet_asUniqueIdList_rdh | /**
* Get this access set as a list of player UUIDs.
*
* @return List of player UUIDs, first players already added by UUID, then players added by name, groups are not in the list
*/
public List<UUID> asUniqueIdList() {
List<UUID> result = new ArrayList<>();
result.addAll(playerUniqueIds);
for (String ... | 3.26 |
AreaShop_RegionAccessSet_getPlayerUniqueIds_rdh | /**
* Get the players that have been added by uuid.
*
* @return Set with players that have been added by uuid
*/
public Set<UUID> getPlayerUniqueIds() {
return playerUniqueIds;
} | 3.26 |
AreaShop_RegionAccessSet_getGroupNames_rdh | /**
* Get the groups.
*
* @return Set with groups added to this RegionAccessSet.
*/
public Set<String> getGroupNames() {
return groupNames;
} | 3.26 |
AreaShop_RegionAccessSet_getPlayerNames_rdh | /**
* Get the players that have been added by name.
*
* @return Set with players that have been added by name
*/
public Set<String> getPlayerNames() {
return playerNames;
} | 3.26 |
AreaShop_AreaShop_getSignlinkerManager_rdh | /**
* Get the SignLinkerManager.
* Handles sign linking mode.
*
* @return The SignLinkerManager
*/
public SignLinkerManager getSignlinkerManager() {
return signLinkerManager;
} | 3.26 |
AreaShop_AreaShop_getBukkitHandler_rdh | /**
* Get the BukkitHandler, for sign interactions.
*
* @return BukkitHandler
*/
public BukkitInterface getBukkitHandler() {
return this.bukkitInterface;
} | 3.26 |
AreaShop_AreaShop_registerDynamicPermissions_rdh | /**
* Register dynamic permissions controlled by config settings.
*/
private void registerDynamicPermissions() {
// Register limit groups of amount of regions a player can have
ConfigurationSection v33 = getConfig().getConfigurationSection("limitGroups");
if (v33 == null) {
return;}
for (String group : v33.getKeys(... | 3.26 |
AreaShop_AreaShop_onEnable_rdh | /**
* Called on start or reload of the server.
*/
@Override
public void onEnable() {
AreaShop.instance = this;
Do.init(this);
managers = new HashSet<>();
boolean error = false;
// Find WorldEdit integration version to load
String weVersion = null;
... | 3.26 |
AreaShop_AreaShop_info_rdh | /**
* Print an information message to the console.
*
* @param message
* The message to print
*/
public static void info(Object... message) {
AreaShop.getInstance().getLogger().info(StringUtils.join(message, " "));
} | 3.26 |
AreaShop_AreaShop_setReady_rdh | /**
* Set if the plugin is ready to be used or not (not to be used from another plugin!).
*
* @param ready
* Indicate if the plugin is ready to be used
*/
public void setReady(boolean ready) {
this.ready = ready;
} | 3.26 |
AreaShop_AreaShop_setChatprefix_rdh | /**
* Set the chatprefix to use in the chat (loaded from config normally).
*
* @param chatprefix
* The string to use in front of chat messages (supports formatting codes)
*/
public void setChatprefix(List<String> chatprefix) {
this.chatprefix = chatprefix;
} | 3.26 |
AreaShop_AreaShop_debug_rdh | /**
* Sends an debug message to the console.
*
* @param message
* The message that should be printed to the console
*/
public static void debug(Object... message) {
if
(AreaShop.getInstance().debug) {
info("Debug: " + StringUtils.join(message, " "));
}
} | 3.26 |
AreaShop_AreaShop_getWorldEditHandler_rdh | /**
* Function to get WorldGuardInterface for version dependent things.
*
* @return WorldGuardInterface
*/
public WorldEditInterface getWorldEditHandler() {
return this.worldEditInterface;
} | 3.26 |
AreaShop_AreaShop_getEconomy_rdh | /**
* Function to get the Vault plugin.
*
* @return Economy
*/
public Economy getEconomy() {
RegisteredServiceProvider<Economy> economy = getServer().getServicesManager().getRegistration(Economy.class);
if ((economy == null) || (economy.getProvider() == null)) {
m0("There is no economy provider to support Vau... | 3.26 |
AreaShop_AreaShop_getCommandManager_rdh | /**
* Function to get the CommandManager.
*
* @return the CommandManager
*/
public CommandManager getCommandManager() {
return commandManager;
} | 3.26 |
AreaShop_AreaShop_getWorldGuardHandler_rdh | /**
* Function to get WorldGuardInterface for version dependent things.
*
* @return WorldGuardInterface
*/
public WorldGuardInterface getWorldGuardHandler() {
return this.worldGuardInterface;
} | 3.26 |
AreaShop_AreaShop_notifyUpdate_rdh | /**
* Notify a player about an update if he wants notifications about it and an update is available.
*
* @param sender
* CommandSender to notify
*/
public void notifyUpdate(CommandSender sender) {
if (((githubUpdateCheck != null) && githubUpdateCheck.hasUpdate()) && sender.hasPermission("areashop.notifyupd... | 3.26 |
AreaShop_AreaShop_hasPermission_rdh | /**
* Check for a permission of a (possibly offline) player.
*
* @param offlinePlayer
* OfflinePlayer to check
* @param permission
* Permission to check
* @return true if the player has the permission, false if the player does not have permission or, is offline and there is not Vault-compatible permission pl... | 3.26 |
AreaShop_AreaShop_getFeatureManager_rdh | /**
* Get the FeatureManager.
* Manages region specific features.
*
* @return The FeatureManager
*/
public FeatureManager getFeatureManager() {
return featureManager;
} | 3.26 |
AreaShop_AreaShop_getWorldEdit_rdh | /**
* Function to get the WorldEdit plugin.
*
* @return WorldEditPlugin
*/
@Override
public WorldEditPlugin getWorldEdit() {
return worldEdit;
} | 3.26 |
AreaShop_AreaShop_reload_rdh | /**
* Reload all files of the plugin and update all regions.
*/
public void reload() {
reload(null);} | 3.26 |
AreaShop_AreaShop_m0_rdh | /**
* Print an error to the console.
*
* @param message
* The message to print
*/
public static void m0(Object... message) {
AreaShop.getInstance().getLogger().severe(StringUtils.join(message, " "));
} | 3.26 |
AreaShop_AreaShop_getConfig_rdh | /**
* Return the config.
*/
@Override
public YamlConfiguration getConfig() {
return fileManager.getConfig();
} | 3.26 |
AreaShop_AreaShop_getWorldGuard_rdh | /**
* Function to get the WorldGuard plugin.
*
* @return WorldGuardPlugin
*/
@Override
public WorldGuardPlugin getWorldGuard() {
return worldGuard;
} | 3.26 |
AreaShop_AreaShop_warn_rdh | /**
* Print a warning to the console.
*
* @param message
* The message to print
*/
public static void warn(Object... message) {
AreaShop.getInstance().getLogger().warning(StringUtils.join(message, " "));
} | 3.26 |
AreaShop_AreaShop_debugTask_rdh | /**
* Print debug message for periodic task.
*
* @param message
* The message to print
*/
public static void debugTask(Object... message) {
if (AreaShop.getInstance().getConfig().getBoolean("debugTask")) {
AreaShop.debug(StringUtils.join(message, " "));
}
} | 3.26 |
AreaShop_AreaShop_getPermissionProvider_rdh | /**
* Get the Vault permissions provider.
*
* @return Vault permissions provider
*/
public Permission getPermissionProvider() {
RegisteredServiceProvider<Permission> permissionProvider = getServer().getServicesManager().getRegistration(Permission.class);if ((permissionProvider == null) || (permissionProvider.getPr... | 3.26 |
AreaShop_AreaShop_cleanVersion_rdh | /**
* Cleanup a version number.
*
* @param version
* Version to clean
* @return Cleaned up version (removed prefixes and suffixes)
*/
private String cleanVersion(String version) {
version = version.toLowerCase();// Strip 'v' as used on Github tags
if (version.startsWith("v")) {
version = versi... | 3.26 |
AreaShop_AreaShop_setupLanguageManager_rdh | /**
* Setup a new LanguageManager.
*/
private void setupLanguageManager() {
languageManager = new LanguageManager(this, f0, getConfig().getString("language"), "EN", chatprefix);
} | 3.26 |
AreaShop_AreaShop_getRegionManager_rdh | /**
* Get the RegionManager.
*
* @param world
* World to get the RegionManager for
* @return RegionManager for the given world, if there is one, otherwise null
*/
public RegionManager getRegionManager(World world) {
return this.worldGuardInterface.getRegionManager(world);
} | 3.26 |
AreaShop_AreaShop_getFileManager_rdh | /**
* Method to get the FileManager (loads/save regions and can be used to get regions).
*
* @return The fileManager
*/
public FileManager getFileManager() {
return fileManager;
} | 3.26 |
AreaShop_AreaShop_getLanguageManager_rdh | /**
* Function to get the LanguageManager.
*
* @return the LanguageManager
*/
public LanguageManager getLanguageManager() {
return languageManager;} | 3.26 |
AreaShop_AreaShop_isReady_rdh | /**
* Indicates if the plugin is ready to be used.
*
* @return true if the plugin is ready, false otherwise
*/
public boolean isReady() {
return ready;
} | 3.26 |
AreaShop_AreaShop_message_rdh | /**
* Send a message to a target, prefixed by the default chat prefix.
*
* @param target
* The target to send the message to
* @param key
* The key of the language string
* @param replacements
* The replacements to insert in the message
*/
public void message(Object target, String key, Object... replacem... | 3.26 |
AreaShop_AreaShop_setupTasks_rdh | /**
* Register all required tasks.
*/
private void setupTasks() {
// Rent expiration timer
long expirationCheck =
Utils.millisToTicks(Utils.getDurationFromSecondsOrString("expiration.delay"));
final AreaShop finalPlugin = this;
if (expirationCheck > 0) {
Do.syncTimer(expirationCheck, () -> {
if (isReady()) {
... | 3.26 |
AreaShop_AreaShop_onDisable_rdh | /**
* Called on shutdown or reload of the server.
*/
@Override
public void onDisable() {
Bukkit.getServer().getScheduler().cancelTasks(this);
// Cleanup managers
for (Manager manager : managers) {
manager.shutdown();
}
managers = null;
fileManager = null;
languageManager = null;... | 3.26 |
AreaShop_AreaShop_debugI_rdh | /**
* Non-static debug to use as implementation of the interface.
*
* @param message
* Object parts of the message that should be logged, toString() will be used
*/
@Override
public void debugI(Object... message) {
AreaShop.debug(StringUtils.join(message, " "));
} | 3.26 |
AreaShop_AreaShop_setDebug_rdh | /**
* Set if the plugin should output debug messages (loaded from config normally).
*
* @param debug
* Indicates if the plugin should output debug messages or not
*/
public void setDebug(boolean debug) {this.debug = debug;
} | 3.26 |
AreaShop_AreaShop_messageNoPrefix_rdh | /**
* Send a message to a target without a prefix.
*
* @param target
* The target to send the message to
* @param key
* The key of the language string
* @param replacements
* The replacements to insert in the message
*/
public void messageNoPrefix(Object target, String key, Object... replacements) {
Mess... | 3.26 |
AreaShop_InfoCommand_showSortedPagedList_rdh | /**
* Display a page of a list of regions.
*
* @param sender
* The CommandSender to send the messages to
* @param regions
* The regions to display
* @param filterGroup
* The group to filter the regions by
* @param keyHeader
* The header to print above the page
* @param pageInput
* The page number,... | 3.26 |
AreaShop_InfoCommand_getTypeOrder_rdh | /**
* Get an integer to order by type, usable for Comparators.
*
* @param region
* The region to get the order for
* @return An integer for sorting by type
*/
private Integer getTypeOrder(GeneralRegion region) {
if (region.getType() == RegionType.RENT) {if (region.getOwner() == null) {
return ... | 3.26 |
AreaShop_RentedRegionEvent_hasExtended_rdh | /**
* Check if the region was extended or rented for the first time.
*
* @return true if the region was extended, false when rented for the first time
*/
public boolean hasExtended() { return extended;
} | 3.26 |
AreaShop_WorldGuardHandler6_buildDomain_rdh | /**
* Build a DefaultDomain from a RegionAccessSet.
*
* @param regionAccessSet
* RegionAccessSet to read
* @return DefaultDomain containing the entities from the RegionAccessSet
*/
private DefaultDomain buildDomain(RegionAccessSet regionAccessSet) {
DefaultDomain owners = new DefaultDomain();
for (Strin... | 3.26 |
AreaShop_SignsFeature_getSignLocations_rdh | /**
* Get a list with all sign locations.
*
* @return A List with all sign locations
*/
public List<Location> getSignLocations() {
List<Location> result = new ArrayList<>();
for (RegionSign sign : signs.values()) { result.add(sign.getLocation());}
return result;
} | 3.26 |
AreaShop_SignsFeature_needsPeriodicUpdate_rdh | /**
* Check if any of the signs need periodic updating.
*
* @return true if one or more of the signs need periodic updating, otherwise false
*/
public boolean needsPeriodicUpdate() {
boolean result = false;
for (RegionSign sign : signs.values()) {
result |= sign.needsPeriodicUpdate();
}
return result;
} | 3.26 |
AreaShop_SignsFeature_update_rdh | /**
* Update all signs connected to this region.
*
* @return true if all signs are updated correctly, false if one or more updates failed
*/
public boolean update() {
boolean result = true;
for (RegionSign sign : signs.values()) {
result &= sign.update();
}
return result;
} | 3.26 |
AreaShop_SignsFeature_locationToString_rdh | /**
* Convert a location to a string to use as map key.
*
* @param location
* The location to get the key for
* @return A string to use in a map for a location
*/
public static String locationToString(Location location) {
return (((((location.getWorld().getName() + ";") + location.getBlockX()) + ";") + location... | 3.26 |
AreaShop_SignsFeature_getSignByLocation_rdh | /**
* Get a sign by a location.
*
* @param location
* The location to get the sign for
* @return The RegionSign that is at the location, or null if none
*/
public static RegionSign getSignByLocation(Location location) {
return allSigns.get(locationToString(location));
} | 3.26 |
AreaShop_SignsFeature_getSignsRef_rdh | /**
* Get the signs of this region.
*
* @return Map with signs: locationString -> RegionSign
*/
Map<String, RegionSign> getSignsRef() {
return signs;
} | 3.26 |
AreaShop_SignsFeature_getSignsByChunk_rdh | /**
* Get the map with signs by chunk.
*
* @return Map with signs by chunk: chunkString -> List<RegionSign>
*/
public static Map<String, List<RegionSign>> getSignsByChunk() {
return signsByChunk;
} | 3.26 |
AreaShop_SignsFeature_chunkToString_rdh | /**
* Convert a chunk to a string to use as map key.
* Use a Location argument to prevent chunk loading!
*
* @param chunk
* The location to get the key for
* @return A string to use in a map for a chunk
*/
public static String chunkToString(Chunk chunk) {
return (((chunk.getWorld().getName() + ";") + chunk.get... | 3.26 |
AreaShop_SignsFeature_getAllSigns_rdh | /**
* Get the map with all signs.
*
* @return Map with all signs: locationString -> RegionSign
*/
public static Map<String, RegionSign> getAllSigns() {return allSigns;
} | 3.26 |
AreaShop_SignsFeature_getSigns_rdh | /**
* Get the signs of this region.
*
* @return List of signs
*/
public List<RegionSign> getSigns() {
return Collections.unmodifiableList(new ArrayList<>(signs.values()));} | 3.26 |
AreaShop_PlayerLoginLogoutListener_updateLastActive_rdh | /**
* Update the last active time for all regions the player is owner off.
*
* @param player
* The player to update the active times for
*/
private void updateLastActive(Player
player) {
for (GeneralRegion region : plugin.getFileManager().getRegions()) {
if (region.isOwner(player)) {
region.u... | 3.26 |
AreaShop_PlayerLoginLogoutListener_onPlayerLogin_rdh | /**
* Called when a sign is changed.
*
* @param event
* The event
*/
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerLogin(PlayerLoginEvent event) {
if (event.getResult() != Result.ALLOWED) {
return;
}
final Player player = event.getPlayer();
// S... | 3.26 |
AreaShop_PlayerLoginLogoutListener_onPlayerLogout_rdh | // Active time updates
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerLogout(PlayerQuitEvent event) {
updateLastActive(event.getPlayer());
} | 3.26 |
AreaShop_FeatureManager_getRegionFeature_rdh | /**
* Instanciate a feature for a certain region.
*
* @param region
* The region to create a feature for
* @param featureClazz
* The class of the feature to create
* @return The feature class
*/
public RegionFeature getRegionFeature(GeneralRegion region, Class<? extends RegionFeature> featureClazz) {
try {
... | 3.26 |
AreaShop_RentingRegionEvent_isExtending_rdh | /**
* Check if the player is extending the region or renting it for the first time.
*
* @return true if the player tries to extend the region, false if he tries to rent it the first time
*/
public boolean isExtending() {
return extending;
} | 3.26 |
AreaShop_RentingRegionEvent_getPlayer_rdh | /**
* Get the player that is trying to rent the region.
*
* @return The player that is trying to rent the region
*/
public OfflinePlayer getPlayer() {
return player;
} | 3.26 |
AreaShop_AddedFriendEvent_getFriend_rdh | /**
* Get the OfflinePlayer that is getting added as friend.
*
* @return The friend that is getting added
*/public OfflinePlayer getFriend() {return friend;
} | 3.26 |
AreaShop_AddedFriendEvent_getBy_rdh | /**
* Get the CommandSender that is adding the friend.
*
* @return null if none, a CommandSender if done by someone (likely Player or ConsoleCommandSender)
*/
public CommandSender getBy() {
return by;
} | 3.26 |
AreaShop_DelfriendCommand_canUse_rdh | /**
* Check if a person can remove friends.
*
* @param person
* The person to check
* @param region
* The region to check for
* @return true if the person can remove friends, otherwise false
*/
public static boolean canUse(CommandSender person, GeneralRegion region) {
if (person.hasPermission("areashop.... | 3.26 |
AreaShop_CommandManager_showHelp_rdh | /**
* Shows the help page for the CommandSender.
*
* @param target
* The CommandSender to show the help to
*/
public void showHelp(CommandSender target) {
if (!target.hasPermission("areashop.help")) {
plugin.message(target, "help-noPermission");
return; }
// Add all messages to a list
... | 3.26 |
AreaShop_CommandManager_getCommands_rdh | /**
* Get the list with AreaShop commands.
*
* @return The list with AreaShop commands
*/
public List<CommandAreaShop> getCommands() {
return commands;
} | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.