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 Details

  • Constructor Details

    • Homestead

      public Homestead()
  • Method Details

    • getSnowflake

      public static SnowflakeGenerator getSnowflake()
    • getVersion

      public static String getVersion()
    • isSnapshot

      public static boolean isSnapshot()
    • getInstance

      public static Homestead getInstance()
    • isFolia

      public static boolean isFolia()
    • isPaper

      public static boolean isPaper()
    • callEvent

      public static void callEvent(APIEvent event)
    • onEnable

      public void onEnable()
      Specified by:
      onEnable in interface org.bukkit.plugin.Plugin
      Overrides:
      onEnable in class org.bukkit.plugin.java.JavaPlugin
    • runPlayerTask

      public TaskHandle runPlayerTask(org.bukkit.entity.Player player, Runnable callable)
      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

      public TaskHandle 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.
      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

      public TaskHandle runAsyncTimerTask(Runnable callable, int interval)
      Run a repeating task asynchronously with interval in seconds.
      Parameters:
      callable - The task to run.
      interval - The interval, in seconds.
    • runSyncTimerTask

      public TaskHandle runSyncTimerTask(Runnable callable, long ticks)
      Run a repeating task synchronously with interval in ticks.
      Parameters:
      callable - The task to run.
      ticks - The interval, in ticks.
    • runSyncTaskLater

      public TaskHandle runSyncTaskLater(Runnable callable, int delay)
      Run a task synchronously after a delay in seconds.
      Parameters:
      callable - The task to run.
      delay - The delay, in seconds.
    • runAsyncTimerTask

      public TaskHandle runAsyncTimerTask(Runnable callable, int delay, int interval)
      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

      public TaskHandle runAsyncTaskLater(Runnable callable, int delay)
      Run a task asynchronously after a delay in seconds.
      Parameters:
      callable - The task to run.
      delay - The delay, in seconds.
    • runAsyncTask

      public TaskHandle runAsyncTask(Runnable callable)
      Run a task asynchronously.
      Parameters:
      callable - The task to run.
    • runSyncTask

      public TaskHandle runSyncTask(Runnable callable)
      Run a task synchronously.
      Parameters:
      callable - The task to run.
    • runLocationTask

      public TaskHandle runLocationTask(org.bukkit.Location location, Runnable callable)
      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 use
      callable - The task to run
      delay - Ticks to wait before first execution
      period - Ticks between executions
    • getOfflinePlayersSync

      public List<org.bukkit.OfflinePlayer> getOfflinePlayersSync()
      Get a list of offline players.
    • getOnlinePlayersSync

      public List<org.bukkit.entity.Player> getOnlinePlayersSync()
      Get a list of online players.
    • getOfflinePlayerNamesSync

      public List<String> getOfflinePlayerNamesSync()
      Get a list of offline player names.
    • getOnlinePlayerNamesSync

      public List<String> getOnlinePlayerNamesSync()
      Get a list of online player names.
    • getOfflinePlayerSync

      @Nullable public @Nullable org.bukkit.OfflinePlayer getOfflinePlayerSync(UUID playerId)
      Get an offline player with player unique IDs, using safe method.
      Parameters:
      playerId - The player ID.
    • getOfflinePlayerSync

      @Nullable public @Nullable org.bukkit.OfflinePlayer getOfflinePlayerSync(String playerName)
      Get an offline player with player name, using safe method.
      Parameters:
      playerName - The player name.
    • onDisable

      public void onDisable()
      Specified by:
      onDisable in interface org.bukkit.plugin.Plugin
      Overrides:
      onDisable in class org.bukkit.plugin.java.JavaPlugin
    • registerExternalPlugins

      public void registerExternalPlugins()
    • endInstance

      public void endInstance()
      Kill the plugin's instance.
    • endInstance

      public void endInstance(Throwable e)