1.4.0 hotfix
This commit is contained in:
parent
44040cc87b
commit
2746ac923b
4 changed files with 16 additions and 13 deletions
|
@ -110,7 +110,6 @@ public class Config {
|
|||
config = new ConfigManager("config.yml");
|
||||
config.saveConfig();
|
||||
leaderboard = new ConfigManager("leaderboard.yml");
|
||||
leaderboard.saveConfig();
|
||||
|
||||
//Spawn
|
||||
spawnPosition = new Vector(
|
||||
|
|
|
@ -212,7 +212,7 @@ public class ConfigManager {
|
|||
String yamlString = textBuilder.toString();
|
||||
Map<String, Object> temp = config.getValues(true);
|
||||
for(Map.Entry<String, Object> entry: temp.entrySet()){
|
||||
if(entry.getValue() instanceof Integer || entry.getValue() instanceof Double || entry.getValue() instanceof String || entry.getValue() instanceof Boolean){
|
||||
if(entry.getValue() instanceof Integer || entry.getValue() instanceof Double || entry.getValue() instanceof String || entry.getValue() instanceof Boolean || entry.getValue() instanceof List){
|
||||
String[] parts = entry.getKey().split("\\.");
|
||||
int index = 0;
|
||||
int i = 0;
|
||||
|
@ -230,7 +230,17 @@ public class ConfigManager {
|
|||
int start = yamlString.indexOf(' ', index);
|
||||
int end = yamlString.indexOf('\n', index);
|
||||
if(end == -1) end = yamlString.length();
|
||||
String replace = entry.getValue().toString();
|
||||
String replace;
|
||||
if(entry.getValue() instanceof List){
|
||||
replace = "[";
|
||||
for(Object o : (List<Object>)entry.getValue()){
|
||||
replace = replace + o.toString() + ", ";
|
||||
}
|
||||
replace = replace.substring(0, replace.length()-2);
|
||||
replace = replace + "]";
|
||||
} else {
|
||||
replace = entry.getValue().toString();
|
||||
}
|
||||
if(entry.getValue() instanceof String){
|
||||
replace = "\"" + replace + "\"";
|
||||
}
|
||||
|
|
|
@ -259,10 +259,10 @@ public class EventListener implements Listener {
|
|||
String[] temp = array[0].split(":");
|
||||
for(String handle : blockedCommands){
|
||||
if(
|
||||
array[0].substring(1).equalsIgnoreCase(handle) && Board.isPlayer(player) &&
|
||||
temp[temp.length-1].substring(1).equalsIgnoreCase(handle) && Board.isPlayer(player) &&
|
||||
Game.status != Status.STANDBY
|
||||
array[0].substring(1).equalsIgnoreCase(handle) && Board.isPlayer(player) ||
|
||||
temp[temp.length-1].equalsIgnoreCase(handle) && Board.isPlayer(player)
|
||||
) {
|
||||
if(Game.status == Status.STANDBY) return;
|
||||
player.sendMessage(errorPrefix + message("BLOCKED_COMMAND"));
|
||||
event.setCancelled(true);
|
||||
break;
|
||||
|
|
|
@ -120,13 +120,7 @@ locale: "en-US"
|
|||
# Not really usefully if using permission plugins.
|
||||
# You can add /kill for any use, but it's already blocked on those
|
||||
# playing the game.
|
||||
blockedCommands:
|
||||
- msg
|
||||
- tp
|
||||
- gamemode
|
||||
- kill
|
||||
- give
|
||||
- effect
|
||||
blockedCommands: [msg, tp, gamemode, kill, give, effect]
|
||||
|
||||
# ---------------------------------------------------------- #
|
||||
# ONLY EDIT BEYOND THIS POINT IF YOU KNOW WHAT YOU ARE DOING #
|
||||
|
|
Loading…
Reference in a new issue