-
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.
- Loading branch information
Showing
11 changed files
with
62 additions
and
51 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# CnUsername | ||
|
||
Allow player to use Chinese chars in username of Minecraft | ||
|
||
允许玩家使用中文名甚至特殊字符进入服务器 | ||
|
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
30 changes: 30 additions & 0 deletions
30
src/main/java/me/xpyex/moduel/cnusername/CnUsernamePlugin.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,30 @@ | ||
package me.xpyex.moduel.cnusername; | ||
|
||
import java.io.File; | ||
import java.nio.charset.StandardCharsets; | ||
import java.nio.file.Files; | ||
import java.util.List; | ||
|
||
public interface CnUsernamePlugin { | ||
public default String readPluginPattern() { | ||
try { | ||
File f = new File(getDataFolder(), "pattern.txt"); | ||
File folder = f.getParentFile(); | ||
if (folder.exists() && folder.isFile()) { | ||
Logging.info("错误: 插件目录下已存在CnUsername文件,且非文件夹"); | ||
return null; | ||
} | ||
if (!f.exists()) { | ||
folder.mkdirs(); | ||
f.createNewFile(); | ||
} | ||
List<String> content = Files.readAllLines(f.toPath(), StandardCharsets.UTF_8); | ||
return content.isEmpty() ? null : content.get(0); | ||
} catch (Throwable e) { | ||
e.printStackTrace(); | ||
return null; | ||
} | ||
} | ||
|
||
public File getDataFolder(); | ||
} |
2 changes: 1 addition & 1 deletion
2
...va/me/xpyex/model/cnusername/Logging.java → ...a/me/xpyex/moduel/cnusername/Logging.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
4 changes: 3 additions & 1 deletion
4
...ername/ClassVisitorAllowedCharacters.java → ...bungee/ClassVisitorAllowedCharacters.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
3 changes: 2 additions & 1 deletion
3
...cnusername/ClassVisitorLoginListener.java → .../minecraft/ClassVisitorLoginListener.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: CnUsername | ||
main: me.xpyex.plugin.cnusername.bungee.CnUsernameBC | ||
version: '1.0.4' | ||
version: '${version}' | ||
author: XPYEX |