Class Sniper

java.lang.Object
com.thevoxelbox.voxelsniper.sniper.Sniper
All Implemented Interfaces:
SniperCommander

public class Sniper extends Object implements SniperCommander
  • Constructor Details

    • Sniper

      public Sniper(UUID uuid)
    • Sniper

      public Sniper(Player player)
      Create a sniper from a player.
      Parameters:
      player - the player
      Since:
      3.0.0
  • Method Details

    • getPlayer

      public Player getPlayer()
    • setPlayer

      public void setPlayer(Player player)
      Set the player.
      Parameters:
      player - the player
      Since:
      3.1.0
    • getCommandSender

      public CommandSender getCommandSender()
      Description copied from interface: SniperCommander
      Return the command sender
      Specified by:
      getCommandSender in interface SniperCommander
      Returns:
      the command sender
    • getCurrentToolkit

      @Nullable public @Nullable Toolkit getCurrentToolkit()
    • addToolkit

      public void addToolkit(Toolkit toolkit)
    • getToolkit

      @Nullable public @Nullable Toolkit getToolkit(ItemType itemType)
    • getToolkit

      @Nullable public @Nullable Toolkit getToolkit(String toolkitName)
    • removeToolkit

      public void removeToolkit(Toolkit toolkit)
    • snipe

      public boolean snipe(Player player, Action action, ItemType usedItem, @Nullable @Nullable Block clickedBlock, BlockFace clickedBlockFace)
      Sniper execution call.
      Parameters:
      action - Action player performed
      usedItem - Item in hand of player
      clickedBlock - Block that the player targeted/interacted with
      clickedBlockFace - Face of that targeted Block
      Returns:
      true if command visibly processed, false otherwise.
    • snipeOnCurrentThread

      public boolean snipeOnCurrentThread(Player wePlayer, Player player, Action action, @Nullable @Nullable Block clickedBlock, BlockFace clickedBlockFace, Toolkit toolkit, ToolAction toolAction, BrushProperties currentBrushProperties)
    • sendInfo

      public void sendInfo(boolean prefix)
    • print

      public void print(com.sk89q.worldedit.util.formatting.text.Component component, boolean prefix)
      Description copied from interface: SniperCommander
      Sends a component to a sniper. This method potentially adds the prefix and handle translations.
      Specified by:
      print in interface SniperCommander
      Parameters:
      component - component
      prefix - prefix
    • getUuid

      public UUID getUuid()
    • isEnabled

      public boolean isEnabled()
    • setEnabled

      public void setEnabled(boolean enabled)
    • getToolkits

      public List<Toolkit> getToolkits()