Package de.eldoria.schematicbrush.util
Class WorldEditBrush
java.lang.Object
de.eldoria.schematicbrush.util.WorldEditBrush
Utility class to manage world edit brushes.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
canBeBound
(ItemStack stack) Checks if the stack is not of type block.static @Nullable com.sk89q.worldedit.command.tool.brush.Brush
Get the schematic brush of a player registered on the item in its main hand.static @Nullable com.sk89q.worldedit.command.tool.brush.Brush
Get the schematic brush of a player registered on the item in its main hand.static Optional
<SchematicBrush> getSchematicBrush
(Player player) Get the schematic brush of a player registered on the item in its main hand.static Optional
<SchematicBrush> getSchematicBrush
(Player player, Material material) Get the schematic brush of a player registered on the item in its main hand.static boolean
removeBrush
(Player player) Remove the brush for a player of the item in its main hand.static boolean
removeBrush
(Player player, ItemStack stack) Remove a brush for this player on the item stack type..static boolean
Set the brush for a player and the item in its main hand.static boolean
Set the brush for a player and the item in its main hand.static boolean
setBrush
(Player player, ItemStack stack, com.sk89q.worldedit.command.tool.brush.Brush brush, String permission) Set the brush for a player and the item in its main hand.static com.sk89q.worldedit.world.item.ItemType
toItemType
(ItemStack stack)
-
Method Details
-
getSchematicBrush
Get the schematic brush of a player registered on the item in its main hand.- Parameters:
player
- player for lookup- Returns:
- schematic brush instance if the item is a schematic brush
-
getSchematicBrush
Get the schematic brush of a player registered on the item in its main hand.- Parameters:
player
- player for lookupmaterial
- material to get the registered brush- Returns:
- schematic brush instance if the item is a schematic brush
-
getBrush
@Nullable public static @Nullable com.sk89q.worldedit.command.tool.brush.Brush getBrush(Player player) Get the schematic brush of a player registered on the item in its main hand.- Parameters:
player
- player for lookup- Returns:
- schematic brush instance if the item is a schematic brush
-
getBrush
@Nullable public static @Nullable com.sk89q.worldedit.command.tool.brush.Brush getBrush(Player player, Material material) Get the schematic brush of a player registered on the item in its main hand.- Parameters:
player
- player for lookupmaterial
- material to get the brush- Returns:
- schematic brush instance if the item is a schematic brush
-
setBrush
Set the brush for a player and the item in its main hand.- Parameters:
player
- player to setbrush
- brush to set- Returns:
- true if the brush was set.
-
setBrush
public static boolean setBrush(Player player, com.sk89q.worldedit.command.tool.brush.Brush brush, String permission) Set the brush for a player and the item in its main hand.- Parameters:
player
- player to setbrush
- brush to setpermission
- the permission required to use the brush- Returns:
- true if the brush was set.
-
setBrush
public static boolean setBrush(Player player, ItemStack stack, com.sk89q.worldedit.command.tool.brush.Brush brush, String permission) Set the brush for a player and the item in its main hand.- Parameters:
player
- player to setstack
- the stack to bind the brush tobrush
- brush to setpermission
- the permission required to use the brush- Returns:
- true if the brush was set.
-
removeBrush
Remove the brush for a player of the item in its main hand.- Parameters:
player
- player to set- Returns:
- true if the brush was remove.
-
removeBrush
Remove a brush for this player on the item stack type..- Parameters:
player
- player to setstack
- the item stack- Returns:
- true if the brush was removed.
-
canBeBound
Checks if the stack is not of type block.- Parameters:
stack
- stack- Returns:
- true if the item stack is not of type block
-
toItemType
-