public class ProtectionStones
extends org.bukkit.plugin.java.JavaPlugin
| Modifier and Type | Field and Description |
|---|---|
static File |
blockDataFolder |
static com.electronwill.nightconfig.core.file.CommentedFileConfig |
config |
static int |
CONFIG_VERSION |
static File |
configLocation |
static Set<UUID> |
toggleList |
| Constructor and Description |
|---|
ProtectionStones() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCommandArgument(PSCommandArg psca)
Add a command argument to /ps.
|
static org.bukkit.inventory.ItemStack |
createProtectBlockItem(PSProtectBlock b)
Get a protection block item from a protect block config object.
|
void |
debug(String msg)
Print a debug message (only prints if the plugin is in debug mode).
|
static PSProtectBlock |
getBlockOptions(org.bukkit.block.Block block)
Get the protection block config options for the block specified.
|
static PSProtectBlock |
getBlockOptions(org.bukkit.inventory.ItemStack item)
Get the protection block config options for the item specified.
|
static PSProtectBlock |
getBlockOptions(String blockType)
Gets the config options for the protection block type specified.
|
List<PSCommandArg> |
getCommandArguments() |
PSConfig |
getConfigOptions() |
List<PSProtectBlock> |
getConfiguredBlocks()
Returns the list of PSProtectBlocks configured through the config.
|
static PSEconomy |
getEconomy() |
static ProtectionStones |
getInstance() |
net.luckperms.api.LuckPerms |
getLuckPerms() |
static Logger |
getPluginLogger() |
static PSProtectBlock |
getProtectBlockFromAlias(String name)
Get the config options for a protect block based on its alias
|
PSEconomy |
getPSEconomy() |
static List<PSRegion> |
getPSRegions(org.bukkit.World w,
String identifier)
Get protection stone regions using an ID or alias.
|
net.milkbowl.vault.economy.Economy |
getVaultEconomy() |
boolean |
isDebug() |
boolean |
isLuckPermsSupportEnabled() |
boolean |
isPlaceholderAPISupportEnabled() |
static boolean |
isProtectBlock(org.bukkit.block.Block b)
Check whether or not a given block is a protection block, and actually protects a region.
|
static boolean |
isProtectBlockItem(org.bukkit.inventory.ItemStack item)
Check if an item is a valid protection block, and if the block type has restrict-obtaining on, check if it was
created by ProtectionStones (custom NBT tag).
|
static boolean |
isProtectBlockItem(org.bukkit.inventory.ItemStack item,
boolean checkNBT)
Check if an item is a valid protection block, and if checkNBT is true, check if it was created by
ProtectionStones.
|
static boolean |
isProtectBlockType(org.bukkit.block.Block b) |
static boolean |
isProtectBlockType(String material)
Get whether or not a material is used as a protection block.
|
static boolean |
isPSNameAlreadyUsed(String name)
Check if a ProtectionStones name is already used by a region globally (from /ps name)
|
static boolean |
isPSRegion(com.sk89q.worldguard.protection.regions.ProtectedRegion r)
Check if a WorldGuard
ProtectedRegion is a ProtectionStones region, and is configured in the config. |
static boolean |
isPSRegionFormat(com.sk89q.worldguard.protection.regions.ProtectedRegion r)
Check if a WorldGuard
ProtectedRegion has the format of a ProtectionStones region, but is not necessarily configured
in the config. |
boolean |
isVaultSupportEnabled() |
static void |
loadConfig(boolean isReload) |
void |
onEnable() |
void |
onLoad() |
static boolean |
removePSRegion(org.bukkit.World w,
String psID)
Removes a protection stone region given its ID, and the region manager it is stored in
Note: Does not remove the PS block.
|
static boolean |
removePSRegion(org.bukkit.World w,
String psID,
org.bukkit.entity.Player cause)
Removes a protection stone region given its ID, and the region manager it is stored in, with a player as its cause
Note: Does not remove the PS block, and does not check if the player (cause) has permission to do this.
|
void |
setConfigOptions(PSConfig conf) |
void |
setDebug(boolean debug) |
getClassLoader, getCommand, getConfig, getDataFolder, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, isEnabled, isNaggable, onCommand, onDisable, onTabComplete, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toStringpublic static final int CONFIG_VERSION
public static File configLocation
public static File blockDataFolder
public static com.electronwill.nightconfig.core.file.CommentedFileConfig config
public void addCommandArgument(PSCommandArg psca)
psca - PSCommandArg object to be addedpublic List<PSCommandArg> getCommandArguments()
public boolean isPlaceholderAPISupportEnabled()
public boolean isVaultSupportEnabled()
public net.milkbowl.vault.economy.Economy getVaultEconomy()
public boolean isLuckPermsSupportEnabled()
public net.luckperms.api.LuckPerms getLuckPerms()
public void setDebug(boolean debug)
debug - whether the plugin should be in debug modepublic boolean isDebug()
public void debug(String msg)
msg - the message to printpublic PSConfig getConfigOptions()
public void setConfigOptions(PSConfig conf)
conf - config object to replace current configpublic List<PSProtectBlock> getConfiguredBlocks()
public static ProtectionStones getInstance()
public static Logger getPluginLogger()
public static PSEconomy getEconomy()
public static PSProtectBlock getBlockOptions(org.bukkit.block.Block block)
block - the block to get the block options ofpublic static PSProtectBlock getBlockOptions(org.bukkit.inventory.ItemStack item)
item - the item to get the block options ofpublic static PSProtectBlock getBlockOptions(String blockType)
blockType - the material type name (Bukkit) of the protect block to get the options for, or "PLAYER_HEAD name" for headspublic static boolean isProtectBlockType(org.bukkit.block.Block b)
public static boolean isProtectBlockType(String material)
material - material type to check (Bukkit material name), or "PLAYER_HEAD name" for headspublic static boolean isProtectBlock(org.bukkit.block.Block b)
b - the block to look atpublic static boolean isPSRegion(com.sk89q.worldguard.protection.regions.ProtectedRegion r)
ProtectedRegion is a ProtectionStones region, and is configured in the config.r - the region to checkpublic static boolean isPSRegionFormat(com.sk89q.worldguard.protection.regions.ProtectedRegion r)
ProtectedRegion has the format of a ProtectionStones region, but is not necessarily configured
in the config.r - the region to checkpublic static boolean isPSNameAlreadyUsed(String name)
name - the name to search forpublic static List<PSRegion> getPSRegions(org.bukkit.World w, String identifier)
w - the world to search in (only if it is an id; aliases/names are global)identifier - id or alias of the regionpublic static boolean removePSRegion(org.bukkit.World w,
String psID)
w - the world that the region is inpsID - the worldguard region ID of the regionpublic static boolean removePSRegion(org.bukkit.World w,
String psID,
org.bukkit.entity.Player cause)
w - the world that the region is inpsID - the worldguard region ID of the regioncause - the player that caused the removalpublic static PSProtectBlock getProtectBlockFromAlias(String name)
name - the alias of the protection blockpublic static boolean isProtectBlockItem(org.bukkit.inventory.ItemStack item,
boolean checkNBT)
item - the item to checkcheckNBT - whether or not to check if the plugin signed off on the item (restrict-obtaining)public static boolean isProtectBlockItem(org.bukkit.inventory.ItemStack item)
item - the item to checkpublic static org.bukkit.inventory.ItemStack createProtectBlockItem(PSProtectBlock b)
b - the config options for the protection blockpublic static void loadConfig(boolean isReload)
public void onLoad()
onLoad in interface org.bukkit.plugin.PluginonLoad in class org.bukkit.plugin.java.JavaPluginpublic void onEnable()
onEnable in interface org.bukkit.plugin.PluginonEnable in class org.bukkit.plugin.java.JavaPluginCopyright © 2021. All rights reserved.