Class PixelPainter

java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
dev.despical.pixelpainter.PixelPainter
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 final class PixelPainter extends org.bukkit.plugin.java.JavaPlugin
Starts PixelPainter and connects its configuration, commands and painting services.

The entry point owns service lifetimes rather than loading YAML or managing worker queues itself. ConfigurationManager creates and validates resources; TaskExecutor handles blocking image/file work and server-thread callbacks; PaintService owns world jobs, chunk tickets and persistent recovery history.

Startup proceeds in that order so commands cannot observe missing resources or unrecovered journals. Any initialization failure disables the plugin. Shutdown releases world resources before closing the worker executor, leaving completed undo journals available for recovery on the next startup.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the command dispatcher that tracks per-player preparations.
    Returns cached source names without starting file I/O during completion.
    Returns the service responsible for local source files and downloads.
    <T> void
    io(Callable<T> task, Consumer<T> completed, Consumer<Exception> failed)
    Submits blocking work through the bounded executor.
    Returns the current configured message templates.
    void
    Releases world resources and commands before closing the background workers.
    void
     
    Returns the service that owns painting and terrain restoration.
    Returns the current palette of server-resolved block colors.
    void
    Refreshes cached source names after a worker finishes scanning the image folder.
    void
    Delegates an all-or-nothing resource reload on the server thread.
    Returns the facade for Paper and Folia region-aware scheduling.
    Returns the operational settings currently published on the server thread.

    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, toString

    Methods inherited from class org.bukkit.plugin.PluginBase

    equals, getName, hashCode, namespace

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.bukkit.plugin.Plugin

    getComponentLogger, getDataPath, getLog4JLogger, getSLF4JLogger
  • Constructor Details

    • PixelPainter

      public PixelPainter()
  • Method Details

    • onEnable

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

      public void reloadSettings() throws Exception
      Delegates an all-or-nothing resource reload on the server thread.
      Throws:
      Exception - if a resource cannot be loaded or fails validation
    • io

      public <T> void io(Callable<T> task, Consumer<T> completed, Consumer<Exception> failed)
      Submits blocking work through the bounded executor.
      Type Parameters:
      T - result type
      Parameters:
      task - worker operation without live Bukkit world access
      completed - server-thread success handler
      failed - server-thread failure or queue-rejection handler
    • refreshImages

      public void refreshImages(Consumer<List<String>> completed, Consumer<Exception> failed)
      Refreshes cached source names after a worker finishes scanning the image folder.
      Parameters:
      completed - server-thread callback receiving the refreshed names
      failed - server-thread failure handler
    • onDisable

      public void onDisable()
      Releases world resources and commands before closing the background workers.
      Specified by:
      onDisable in interface org.bukkit.plugin.Plugin
      Overrides:
      onDisable in class org.bukkit.plugin.java.JavaPlugin
    • settings

      public Settings settings()
      Returns the operational settings currently published on the server thread.
      Returns:
      validated settings after successful initialization
    • messages

      public Messages messages()
      Returns the current configured message templates.
      Returns:
      validated message resources
    • palette

      public BlockPalette palette()
      Returns the current palette of server-resolved block colors.
      Returns:
      validated block palette
    • images

      public ImageStore images()
      Returns the service responsible for local source files and downloads.
      Returns:
      image store after successful initialization
    • painter

      public PaintService painter()
      Returns the service that owns painting and terrain restoration.
      Returns:
      server-thread painting service
    • scheduling

      public Scheduling scheduling()
      Returns the facade for Paper and Folia region-aware scheduling.
      Returns:
      scheduler facade after successful initialization
    • commands

      public PainterCommands commands()
      Returns the command dispatcher that tracks per-player preparations.
      Returns:
      command dispatcher after successful initialization
    • imageNames

      public List<String> imageNames()
      Returns cached source names without starting file I/O during completion.
      Returns:
      sorted source-image names