Class Sniper
java.lang.Object
com.thevoxelbox.voxelsniper.sniper.Sniper
- All Implemented Interfaces:
SniperCommander
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addToolkit
(Toolkit toolkit) Return the command sender@Nullable Toolkit
@Nullable Toolkit
getToolkit
(ItemType itemType) @Nullable Toolkit
getToolkit
(String toolkitName) getUuid()
boolean
void
print
(com.sk89q.worldedit.util.formatting.text.Component component, boolean prefix) Sends a component to a sniper.void
removeToolkit
(Toolkit toolkit) void
sendInfo
(boolean prefix) void
setEnabled
(boolean enabled) void
Set the player.boolean
snipe
(Player player, Action action, ItemType usedItem, @Nullable Block clickedBlock, BlockFace clickedBlockFace) Sniper execution call.boolean
snipeOnCurrentThread
(Player wePlayer, Player player, Action action, @Nullable Block clickedBlock, BlockFace clickedBlockFace, Toolkit toolkit, ToolAction toolAction, BrushProperties currentBrushProperties) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.thevoxelbox.voxelsniper.sniper.SniperCommander
createParserContext, print
-
Constructor Details
-
Sniper
-
Sniper
Create a sniper from a player.- Parameters:
player
- the player- Since:
- 3.0.0
-
-
Method Details
-
getPlayer
-
setPlayer
Set the player.- Parameters:
player
- the player- Since:
- 3.1.0
-
getCommandSender
Description copied from interface:SniperCommander
Return the command sender- Specified by:
getCommandSender
in interfaceSniperCommander
- Returns:
- the command sender
-
getCurrentToolkit
-
addToolkit
-
getToolkit
-
getToolkit
-
removeToolkit
-
snipe
public boolean snipe(Player player, Action action, ItemType usedItem, @Nullable @Nullable Block clickedBlock, BlockFace clickedBlockFace) Sniper execution call.- Parameters:
action
- Action player performedusedItem
- Item in hand of playerclickedBlock
- Block that the player targeted/interacted withclickedBlockFace
- 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 interfaceSniperCommander
- Parameters:
component
- componentprefix
- prefix
-
getUuid
-
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean enabled) -
getToolkits
-