Class PainterListener

java.lang.Object
dev.despical.pixelpainter.listener.PainterListener
All Implemented Interfaces:
org.bukkit.event.Listener

public final class PainterListener extends Object implements org.bukkit.event.Listener
Releases painting resources when a player disconnects and protects the active world.

A departing player's world job and cancellable image preparations are stopped while durable undo data is retained. An explicit world unload is cancelled while the active painting job still holds chunk tickets in that world.

Handlers run on the server thread and only delegate to the painting service and command dispatcher.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a listener bound to an enabled plugin.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onQuit(org.bukkit.event.player.PlayerQuitEvent event)
    Stops the departing owner's world job and cancellable image preparations.
    void
    onWorldUnload(org.bukkit.event.world.WorldUnloadEvent event)
    Prevents an explicit unload from invalidating the active painting world.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PainterListener

      public PainterListener(PixelPainter plugin)
      Creates a listener bound to an enabled plugin.
      Parameters:
      plugin - owning plugin that provides the painting services
  • Method Details

    • onQuit

      public void onQuit(org.bukkit.event.player.PlayerQuitEvent event)
      Stops the departing owner's world job and cancellable image preparations.
      Parameters:
      event - player disconnect notification
    • onWorldUnload

      public void onWorldUnload(org.bukkit.event.world.WorldUnloadEvent event)
      Prevents an explicit unload from invalidating the active painting world.
      Parameters:
      event - proposed world unload