-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Support PlaceholderAPI Relational Placeholder * Use optional. Rename Bi -> Relational, otherTarget -> viewer. --------- Co-authored-by: Rollczi <[email protected]> Co-authored-by: Martin Sulikowski <[email protected]>
- Loading branch information
1 parent
39cfdc9
commit b364d55
Showing
8 changed files
with
67 additions
and
8 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
4 changes: 2 additions & 2 deletions
4
chatformatter-core/src/main/java/com/eternalcode/formatter/ChatMessage.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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package com.eternalcode.formatter; | ||
|
||
import java.util.Optional; | ||
import org.bukkit.entity.Player; | ||
|
||
public record ChatMessage(Player sender, String jsonMessage) { | ||
|
||
public record ChatMessage(Player sender, Optional<Player> viewer, String jsonMessage) { | ||
} |
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
10 changes: 10 additions & 0 deletions
10
...core/src/main/java/com/eternalcode/formatter/placeholder/PlayerRelationalPlaceholder.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,10 @@ | ||
package com.eternalcode.formatter.placeholder; | ||
|
||
import org.bukkit.entity.Player; | ||
|
||
@FunctionalInterface | ||
public interface PlayerRelationalPlaceholder { | ||
|
||
String extract(Player target, Player viewer); | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
...src/main/java/com/eternalcode/formatter/placeholder/PlayerRelationalPlaceholderStack.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,8 @@ | ||
package com.eternalcode.formatter.placeholder; | ||
|
||
import org.bukkit.entity.Player; | ||
|
||
public interface PlayerRelationalPlaceholderStack { | ||
|
||
String apply(String text, Player target, Player viewer); | ||
} |
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