Class SurvivalRewardManager

java.lang.Object
com.storytimeproductions.stweaks.managers.SurvivalRewardManager
All Implemented Interfaces:
org.bukkit.event.Listener

public class SurvivalRewardManager extends Object implements org.bukkit.event.Listener
Gives portal-unlocked players the StoryTime Guide (slot 3) and Threshold Key (slot 5) when they enter the survival world, and handles right-click interactions for both items.

Portal-unlock state is read directly from EDEN's per-player YAML so that STweaks has no compile-time dependency on the EDEN plugin.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new SurvivalRewardManager.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onInventoryClick(org.bukkit.event.inventory.InventoryClickEvent event)
    Handles clicks inside the StoryTime guide menu GUI.
    void
    onInventoryDrag(org.bukkit.event.inventory.InventoryDragEvent event)
    Prevents dragging items inside the StoryTime guide menu GUI.
    void
    onPlayerChangedWorld(org.bukkit.event.player.PlayerChangedWorldEvent event)
    Gives items when entering the lobby, removes them when leaving.
    void
    onPlayerDrop(org.bukkit.event.player.PlayerDropItemEvent event)
    Prevents players from dropping the Guide Book or Threshold Key.
    void
    onPlayerInteract(org.bukkit.event.player.PlayerInteractEvent event)
    Handles right-clicking the Guide Book (opens menu) and Threshold Key (returns to lobby).
    void
    onPlayerJoin(org.bukkit.event.player.PlayerJoinEvent event)
    Gives items to portal-unlocked players who join (they are auto-sent to the lobby).

    Methods inherited from class Object

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

    • SurvivalRewardManager

      public SurvivalRewardManager(Stweaks plugin)
      Constructs a new SurvivalRewardManager.
      Parameters:
      plugin - the Stweaks plugin instance
  • Method Details

    • onPlayerJoin

      public void onPlayerJoin(org.bukkit.event.player.PlayerJoinEvent event)
      Gives items to portal-unlocked players who join (they are auto-sent to the lobby).
      Parameters:
      event - the join event
    • onPlayerChangedWorld

      public void onPlayerChangedWorld(org.bukkit.event.player.PlayerChangedWorldEvent event)
      Gives items when entering the lobby, removes them when leaving.
      Parameters:
      event - the world-change event
    • onPlayerDrop

      public void onPlayerDrop(org.bukkit.event.player.PlayerDropItemEvent event)
      Prevents players from dropping the Guide Book or Threshold Key.
      Parameters:
      event - the drop event
    • onPlayerInteract

      public void onPlayerInteract(org.bukkit.event.player.PlayerInteractEvent event)
      Handles right-clicking the Guide Book (opens menu) and Threshold Key (returns to lobby).
      Parameters:
      event - the interact event
    • onInventoryClick

      public void onInventoryClick(org.bukkit.event.inventory.InventoryClickEvent event)
      Handles clicks inside the StoryTime guide menu GUI.
      Parameters:
      event - the click event
    • onInventoryDrag

      public void onInventoryDrag(org.bukkit.event.inventory.InventoryDragEvent event)
      Prevents dragging items inside the StoryTime guide menu GUI.
      Parameters:
      event - the drag event