forked from OneLiteFeatherNET/BetterGoPaint
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from TheNextLvl-net/mask
add mask mode setting
- Loading branch information
Showing
23 changed files
with
251 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
api/src/main/java/net/thenextlvl/gopaint/api/model/MaskMode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package net.thenextlvl.gopaint.api.model; | ||
|
||
import com.sk89q.worldedit.EditSession; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import net.thenextlvl.gopaint.api.brush.Brush; | ||
import net.thenextlvl.gopaint.api.brush.setting.BrushSettings; | ||
import org.bukkit.block.Block; | ||
|
||
import java.util.Arrays; | ||
import java.util.Optional; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public enum MaskMode { | ||
/** | ||
* This enumeration represents that no mask should be applied. | ||
*/ | ||
DISABLED("Disabled"), | ||
/** | ||
* This enumeration represents that the mask material defined in the interface should be applied | ||
* | ||
* @see Brush#passesMaskCheck(BrushSettings, EditSession, Block) | ||
*/ | ||
INTERFACE("Interface"), | ||
/** | ||
* This enumeration represents the complex mask defined by WorldEdit | ||
* | ||
* @see Brush#passesMaskCheck(BrushSettings, EditSession, Block) | ||
*/ | ||
WORLDEDIT("WorldEdit"); | ||
|
||
private final String name; | ||
|
||
public static Optional<MaskMode> byName(String name) { | ||
return Arrays.stream(values()) | ||
.filter(maskMode -> maskMode.getName().equals(name)) | ||
.findAny(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.