-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add clear tag, shortcut for close tag, some placeholders
- Loading branch information
Showing
11 changed files
with
193 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,8 @@ jobs: | |
MAVEN_URL: ${{ secrets.MAVEN_URL }} | ||
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | ||
|
||
MODRINTH: ${{ secrets.MODRINTH }} | ||
CHANGELOG: ${{ github.event.release.body }} | ||
- name: Upload GitHub release | ||
uses: AButler/[email protected] | ||
with: | ||
|
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
42 changes: 42 additions & 0 deletions
42
src/main/java/eu/pb4/placeholders/api/node/parent/TransformNode.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,42 @@ | ||
package eu.pb4.placeholders.api.node.parent; | ||
|
||
import eu.pb4.placeholders.api.ParserContext; | ||
import eu.pb4.placeholders.api.node.TextNode; | ||
import eu.pb4.placeholders.impl.GeneralUtils; | ||
import net.minecraft.text.MutableText; | ||
import net.minecraft.text.Style; | ||
import net.minecraft.text.Text; | ||
|
||
import java.util.Arrays; | ||
import java.util.function.Function; | ||
|
||
public final class TransformNode extends ParentNode { | ||
private final Function<MutableText, Text> transform; | ||
|
||
public TransformNode(TextNode[] nodes, Function<MutableText, Text> transform) { | ||
super(nodes); | ||
this.transform = transform; | ||
} | ||
|
||
public static TransformNode deepStyle(Function<Style, Style> styleFunction, TextNode... nodes) { | ||
return new TransformNode(nodes, new GeneralUtils.MutableTransformer(styleFunction)); | ||
} | ||
|
||
@Override | ||
protected Text applyFormatting(MutableText out, ParserContext context) { | ||
return this.transform.apply(out); | ||
} | ||
|
||
@Override | ||
public ParentTextNode copyWith(TextNode[] children) { | ||
return new TransformNode(children, this.transform); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "TransformNode{" + | ||
"transform=" + transform + | ||
", children=" + Arrays.toString(children) + | ||
'}'; | ||
} | ||
} |
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