-
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.
- Loading branch information
Showing
10 changed files
with
108 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package aplini.ipacwhitelist.enums; | ||
|
||
public enum pc { | ||
|
||
CmdAddLogSender("CmdAddLogSender", "最后操作"), | ||
|
||
; | ||
|
||
public final String key; | ||
public final String name; | ||
pc(String key, String name){ | ||
this.key = key; | ||
this.name = name; | ||
} | ||
|
||
static public pc get(String key){ | ||
for(pc li : pc.values()){ | ||
if(li.key.equals(key)){ | ||
return li; | ||
} | ||
} | ||
throw new IllegalArgumentException("找不到指定的 PlayerConfig Key: "+ key); | ||
} | ||
} |
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
29 changes: 27 additions & 2 deletions
29
src/main/java/aplini/ipacwhitelist/utils/PlayerConfig.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,8 +1,33 @@ | ||
package aplini.ipacwhitelist.utils; | ||
|
||
import org.yaml.snakeyaml.Yaml; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class PlayerConfig { | ||
|
||
public String getString(){ | ||
return ""; | ||
public String yamlString = ""; | ||
public Map<String, Object> data = new HashMap<>(); | ||
|
||
|
||
public PlayerConfig setYamlStr(String str){ | ||
this.yamlString = str; | ||
if(!this.yamlString.isEmpty()){ | ||
this.data = new Yaml().load(this.yamlString); | ||
} | ||
return this; | ||
} | ||
|
||
public PlayerConfig putAll(Map<String, Object> map){ | ||
this.data.putAll(map); | ||
return this; | ||
} | ||
|
||
public String getYamlStr(){ | ||
if(data.isEmpty()){ | ||
return ""; | ||
} | ||
return new Yaml().dump(this.data); | ||
} | ||
} |
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