Class WorldEditBrush

java.lang.Object
de.eldoria.schematicbrush.util.WorldEditBrush

public final class WorldEditBrush extends Object
Utility class to manage world edit brushes.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Checks if the stack is not of type block.
    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.
    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.
    Get the schematic brush of a player registered on the item in its main hand.
    getSchematicBrush(Player player, Material material)
    Get the schematic brush of a player registered on the item in its main hand.
    static boolean
    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
    setBrush(Player player, com.sk89q.worldedit.command.tool.brush.Brush brush)
    Set the brush for a player and the item in its main hand.
    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.
    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
     

    Methods inherited from class java.lang.Object

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

    • getSchematicBrush

      public static Optional<SchematicBrush> getSchematicBrush(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
    • getSchematicBrush

      public static Optional<SchematicBrush> getSchematicBrush(Player player, Material material)
      Get the schematic brush of a player registered on the item in its main hand.
      Parameters:
      player - player for lookup
      material - 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 lookup
      material - material to get the brush
      Returns:
      schematic brush instance if the item is a schematic brush
    • setBrush

      public static boolean setBrush(Player player, com.sk89q.worldedit.command.tool.brush.Brush brush)
      Set the brush for a player and the item in its main hand.
      Parameters:
      player - player to set
      brush - 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 set
      brush - brush to set
      permission - 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 set
      stack - the stack to bind the brush to
      brush - brush to set
      permission - the permission required to use the brush
      Returns:
      true if the brush was set.
    • removeBrush

      public static boolean removeBrush(Player player)
      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

      public static boolean removeBrush(Player player, ItemStack stack)
      Remove a brush for this player on the item stack type..
      Parameters:
      player - player to set
      stack - the item stack
      Returns:
      true if the brush was removed.
    • canBeBound

      public static boolean canBeBound(ItemStack stack)
      Checks if the stack is not of type block.
      Parameters:
      stack - stack
      Returns:
      true if the item stack is not of type block
    • toItemType

      public static com.sk89q.worldedit.world.item.ItemType toItemType(ItemStack stack)