-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
193 additions
and
49 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,46 @@ | ||
# Safe-Chat | ||
# Safe Chat | ||
|
||
No more reportable message without the "unsafe" mark. | ||
Safe Chat is a Minecraft plugin that protects players' messages. | ||
|
||
Whispers are still reportable now. | ||
It'll be solved in the future. | ||
## Features | ||
|
||
The messages will be protected so no one is able to report while enable the plugin. | ||
Because of the way this plugin uses, the game won't mark messages as unverified or unsafe, too. | ||
|
||
![Screenshot](https://truth.bahamut.com.tw/s01/202208/2d76aca3213c8848910a35327962c83b.JPG?w=1000) | ||
|
||
## Configuration | ||
|
||
It's able to configure the format of the messages. | ||
When the first time the plugin enabled, it'll automatically generate the configuration file, | ||
you may change it with the description below: | ||
|
||
The format may contain strings inside a pair of curly brackets that will be replaced. | ||
The table below shows the general ones. | ||
|
||
| Name | Description | | ||
|------------------|----------------------------------------------| | ||
| `_BLACK` | Make the following text black. | | ||
| `_DARK_BLUE` | Make the following text dark blue. | | ||
| `_DARK_GREEN` | Make the following text dark green. | | ||
| `_DARK_AQUA` | Make the following text dark aqua. | | ||
| `_DARK_RED` | Make the following text dark red. | | ||
| `_DARK_PURPLE` | Make the following text dark purple. | | ||
| `_GOLD` | Make the following text gold. | | ||
| `_GRAY` | Make the following text gray. | | ||
| `_DARK_GRAY` | Make the following text dark gray. | | ||
| `_BLUE` | Make the following text blue. | | ||
| `_GREEN` | Make the following text green. | | ||
| `_AQUA` | Make the following text aqua. | | ||
| `_RED` | Make the following text red. | | ||
| `_LIGHT_PURPLE` | Make the following text light purple. | | ||
| `_YELLOW` | Make the following text yellow. | | ||
| `_WHITE` | Make the following text white. | | ||
| `_MAGIC` | Make the following text "magic". | | ||
| `_BOLD` | Make the following text bold. | | ||
| `_STRIKETHROUGH` | Make the following text strikethrough. | | ||
| `_UNDERLINE` | Make the following text underline. | | ||
| `_ITALIC` | Make the following text italic. | | ||
| `_RESET` | Set the following text to the default style. | | ||
|
||
You can find specific ones for every entry in the generated configuration file. |
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ plugins { | |
} | ||
|
||
group 'luminous' | ||
version '1.0.0' | ||
version plugin_version | ||
|
||
repositories { | ||
mavenCentral() | ||
|
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 @@ | ||
plugin_version = 1.1.0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package luminous.safechat.util; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.Map; | ||
|
||
public class Fmt { | ||
public static String format(@NotNull String fmt, @NotNull Map<@NotNull String, Object> args) { | ||
String result = fmt; | ||
for (var arg : args.entrySet()) { | ||
if (arg.getValue() == null) continue; | ||
|
||
result = result.replaceAll("\\{" + arg.getKey() + "}", arg.getValue().toString()); | ||
} | ||
return result; | ||
} | ||
} |
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,16 @@ | ||
# Control the chat format | ||
# | ||
# Format: {sender} - The message sender. | ||
global-message-format: '{_GRAY}<{sender}>{_WHITE} {message}' | ||
|
||
# Control the direct message format the sender see. | ||
# | ||
# Format {sender} - The message sender. | ||
# {target} - The message receiver. | ||
direct-message-sender-format: '{_GRAY}<YOU -> {target}>{_WHITE} {message}' | ||
|
||
# Control the direct message format the receiver see. | ||
# | ||
# Format {sender} - The message sender. | ||
# {target} - The message receiver. | ||
direct-message-target-format: '{_GRAY}<{sender} -> YOU>{_WHITE} {message}' |
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,9 +1,16 @@ | ||
name: SafeChat | ||
version: 1.0.0 | ||
version: 1.1.0 | ||
author: Luminous-Coder | ||
|
||
main: luminous.safechat.Main | ||
api-version: 1.19 | ||
|
||
commands: | ||
safechat: | ||
description: Test whether the plugin is enabled. | ||
msg: | ||
aliases: | ||
- tell | ||
- w | ||
description: Send a private message to another player. | ||
usage: /msg <player name or UUID> <message> |