Class Homestead
java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
tfagaming.projects.minecraft.homestead.Homestead
- All Implemented Interfaces:
io.papermc.paper.plugin.lifecycle.event.LifecycleEventOwner,net.kyori.adventure.key.Namespaced,org.bukkit.command.CommandExecutor,org.bukkit.command.TabCompleter,org.bukkit.command.TabExecutor,org.bukkit.plugin.Plugin
public class Homestead
extends org.bukkit.plugin.java.JavaPlugin
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic RegionBanCachestatic RegionChunkCachestatic Databasestatic RegionInviteCachestatic LevelsCachestatic RegionLogCachestatic RegionMemberCachestatic RegionRateCachestatic RegionCachestatic SubAreasCachestatic Vaultstatic WarsCache -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidvoidKill the plugin's instance.voidstatic HomesteadGet a list of offline player names.List<org.bukkit.OfflinePlayer> Get a list of offline players.@Nullable org.bukkit.OfflinePlayergetOfflinePlayerSync(String playerName) Get an offline player with player name, using safe method.@Nullable org.bukkit.OfflinePlayergetOfflinePlayerSync(UUID playerId) Get an offline player with player unique IDs, using safe method.Get a list of online player names.List<org.bukkit.entity.Player> Get a list of online players.static SnowflakeGeneratorstatic Stringstatic booleanisFolia()static booleanisPaper()static booleanvoidvoidonEnable()voidrunAsyncTask(Runnable callable) Run a task asynchronously.runAsyncTaskLater(Runnable callable, int delay) Run a task asynchronously after a delay in seconds.runAsyncTimerTask(Runnable callable, int interval) Run a repeating task asynchronously with interval in seconds.runAsyncTimerTask(Runnable callable, int delay, int interval) Run a repeating task asynchronously with interval in seconds, with a delay in seconds.runLocationTask(org.bukkit.Location location, Runnable callable) Run a task on the region thread that owns the given location.runLocationTaskTimer(org.bukkit.Location location, Runnable callable, long delay, long period) Runs a repeating task on the region scheduler with given location.runPlayerTask(org.bukkit.entity.Player player, Runnable callable) Run a task on the region thread that owns the given player.runPlayerTaskLater(org.bukkit.entity.Player player, Runnable callable, int delay) Run a task on the region thread that owns the given player after a delay in seconds.runPlayerTaskTimer(org.bukkit.entity.Player player, Runnable callable, long delay, long period) Run a repeating task on the region thread that owns the given player.runSyncTask(Runnable callable) Run a task synchronously.runSyncTaskLater(Runnable callable, int delay) Run a task synchronously after a delay in seconds.runSyncTimerTask(Runnable callable, long ticks) Run a repeating task synchronously with interval in ticks.Methods inherited from class org.bukkit.plugin.java.JavaPlugin
getClassLoader, getCommand, getConfig, getDataFolder, getDefaultBiomeProvider, getDefaultWorldGenerator, getDescription, getFile, getLifecycleManager, getLogger, getPlugin, getPluginLoader, getPluginMeta, getProvidingPlugin, getResource, getServer, getTextResource, init, init, isEnabled, isNaggable, onCommand, onLoad, onTabComplete, registerCommand, registerCommand, registerCommand, registerCommand, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toStringMethods inherited from class org.bukkit.plugin.PluginBase
equals, getName, hashCode, namespaceMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.bukkit.plugin.Plugin
getComponentLogger, getDataPath, getLog4JLogger, getSLF4JLogger
-
Field Details
-
database
-
REGION_CACHE
-
MEMBER_CACHE
-
BAN_CACHE
-
CHUNK_CACHE
-
INVITE_CACHE
-
LOG_CACHE
-
RATE_CACHE
-
WAR_CACHE
-
SUBAREA_CACHE
-
LEVEL_CACHE
-
VAULT
-
-
Constructor Details
-
Homestead
public Homestead()
-
-
Method Details
-
getSnowflake
-
getVersion
-
isSnapshot
public static boolean isSnapshot() -
getInstance
-
isFolia
public static boolean isFolia() -
isPaper
public static boolean isPaper() -
callEvent
-
onEnable
public void onEnable()- Specified by:
onEnablein interfaceorg.bukkit.plugin.Plugin- Overrides:
onEnablein classorg.bukkit.plugin.java.JavaPlugin
-
runPlayerTask
Run a task on the region thread that owns the given player. Use this instead of runSyncTask() whenever the task involves world/chunk/location access triggered by a player action (e.g. inventory clicks).- Parameters:
player- The player whose region thread to run on.callable- The task to run.
-
runPlayerTaskLater
Run a task on the region thread that owns the given player after a delay in seconds.- Parameters:
player- The player whose region thread to run on.callable- The task to run.delay- The delay, in seconds.
-
runPlayerTaskTimer
public TaskHandle runPlayerTaskTimer(org.bukkit.entity.Player player, Runnable callable, long delay, long period) Run a repeating task on the region thread that owns the given player.- Parameters:
player- The player whose region thread to run on.callable- The task to run.delay- Ticks to wait before first execution.period- Ticks between executions.
-
runAsyncTimerTask
Run a repeating task asynchronously with interval in seconds.- Parameters:
callable- The task to run.interval- The interval, in seconds.
-
runSyncTimerTask
Run a repeating task synchronously with interval in ticks.- Parameters:
callable- The task to run.ticks- The interval, in ticks.
-
runSyncTaskLater
Run a task synchronously after a delay in seconds.- Parameters:
callable- The task to run.delay- The delay, in seconds.
-
runAsyncTimerTask
Run a repeating task asynchronously with interval in seconds, with a delay in seconds.- Parameters:
callable- The task to run.interval- The interval, in seconds.
-
runAsyncTaskLater
Run a task asynchronously after a delay in seconds.- Parameters:
callable- The task to run.delay- The delay, in seconds.
-
runAsyncTask
Run a task asynchronously.- Parameters:
callable- The task to run.
-
runSyncTask
Run a task synchronously.- Parameters:
callable- The task to run.
-
runLocationTask
Run a task on the region thread that owns the given location. Use this for any event or operation tied to a specific world location.- Parameters:
location- The location whose owning region thread to run on.callable- The task to run.
-
runLocationTaskTimer
public TaskHandle runLocationTaskTimer(org.bukkit.Location location, Runnable callable, long delay, long period) Runs a repeating task on the region scheduler with given location.- Parameters:
location- The location to determine which region thread to usecallable- The task to rundelay- Ticks to wait before first executionperiod- Ticks between executions
-
getOfflinePlayersSync
Get a list of offline players. -
getOnlinePlayersSync
Get a list of online players. -
getOfflinePlayerNamesSync
Get a list of offline player names. -
getOnlinePlayerNamesSync
Get a list of online player names. -
getOfflinePlayerSync
Get an offline player with player unique IDs, using safe method.- Parameters:
playerId- The player ID.
-
getOfflinePlayerSync
Get an offline player with player name, using safe method.- Parameters:
playerName- The player name.
-
onDisable
public void onDisable()- Specified by:
onDisablein interfaceorg.bukkit.plugin.Plugin- Overrides:
onDisablein classorg.bukkit.plugin.java.JavaPlugin
-
registerExternalPlugins
public void registerExternalPlugins() -
endInstance
public void endInstance()Kill the plugin's instance. -
endInstance
-