Ce dev aime les TAB --"

This commit is contained in:
Michel Roux 2012-05-11 15:17:58 +02:00
parent 7eab05fc78
commit 1975864afb
2 changed files with 90 additions and 90 deletions

View File

@ -71,17 +71,17 @@ public class CraftBall extends JavaPlugin implements CommandExecutor {
}
if (args[0].toLowerCase().equals("list")) {
for (Field f : fields) {
sendMess("-----Field: "+f.name, sender);
sendMess("-World: "+ f.world.getName(), sender);
sendMess("-Region: (x,z)", sender);
for (int i=0; i < f.region.npoints; i++) {
sendMess(" -("+f.region.xpoints[i]+","+f.region.ypoints[i]+")", sender);
}
sendMess("-BallItem: "+f.ballItem.getType().toString(), sender);
for (Field f : fields) {
sendMess("-----Field: "+f.name, sender);
sendMess("-World: "+ f.world.getName(), sender);
sendMess("-Region: (x,z)", sender);
for (int i=0; i < f.region.npoints; i++) {
sendMess(" -("+f.region.xpoints[i]+","+f.region.ypoints[i]+")", sender);
}
sendMess("-BallItem: "+f.ballItem.getType().toString(), sender);
}
return true;
}
return true;
}
}
@ -101,13 +101,13 @@ public class CraftBall extends JavaPlugin implements CommandExecutor {
log_info("Succesfully updated config.yml");
}
if (getConfig().get("fields") == null) {
fatal("Error no fields found in config.yml");
return;
}
if (getConfig().get("fields") == null) {
fatal("Error no fields found in config.yml");
return;
}
List<Map<?, ?>> fieldList = getConfig().getMapList("fields");
int fieldCount = 0;
List<Map<?, ?>> fieldList = getConfig().getMapList("fields");
int fieldCount = 0;
for (Map<?, ?> f : fieldList) {
Field field = new Field();
@ -134,14 +134,14 @@ public class CraftBall extends JavaPlugin implements CommandExecutor {
// get region
List<String> points = null;
//points = node.getStringList("region");
//points = node.getStringList("region");
if (f.get("region") == null || !(f.get("region") instanceof List <?>)) {
log_warning("Error found in field list: could not find region");
continue;
}
try {
points = (List <String>) f.get("region");
points = (List <String>) f.get("region");
}
catch (Exception e) {
points = null;
@ -251,11 +251,11 @@ public class CraftBall extends JavaPlugin implements CommandExecutor {
cRead = new BufferedReader(new InputStreamReader(new FileInputStream(cFile), "UTF-8"));
cBuffer = new StringBuffer();
int ch;
while ((ch = cRead.read()) > -1) {
cBuffer.append((char)ch);
}
cString = cBuffer.toString();
cRead.close();
while ((ch = cRead.read()) > -1) {
cBuffer.append((char)ch);
}
cString = cBuffer.toString();
cRead.close();
}
catch (Exception e) {
log_warning("Error, couldn't update/load config.yml:"+e.toString());
@ -274,8 +274,8 @@ public class CraftBall extends JavaPlugin implements CommandExecutor {
//add name variable
if (oldV == null) {
cString = "version: 1.1\r".concat(cString);
cString = cString.replaceAll("(\\s{4}(field\\d+):)", " -\r name: $2\r world: "+getServer().getWorlds().get(0).getName());
log_warning("Updated config.yml from version <1.1, check your world settings in config.yml!");
cString = cString.replaceAll("(\\s{4}(field\\d+):)", " -\r name: $2\r world: "+getServer().getWorlds().get(0).getName());
log_warning("Updated config.yml from version <1.1, check your world settings in config.yml!");
}
//--- writefile section
@ -314,8 +314,8 @@ public class CraftBall extends JavaPlugin implements CommandExecutor {
}
public void fatal(String msg) {
mclog.severe(TAG + " " + msg);
this.getServer().getPluginManager().disablePlugin(this);
mclog.severe(TAG + " " + msg);
this.getServer().getPluginManager().disablePlugin(this);
}