1
0
mirror of https://e.coding.net/circlecloud/SimpleEssential.git synced 2024-11-17 01:18:47 +00:00

fix world command error...

Signed-off-by: j502647092 <jtb1@163.com>
This commit is contained in:
j502647092 2015-10-17 23:34:03 +08:00
parent 01efafffea
commit 910abbc116
2 changed files with 13 additions and 2 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>cn.citycraft</groupId>
<artifactId>SimpleEssential</artifactId>
<version>1.3</version>
<version>1.4</version>
<name>SimpleEssential</name>
<description>轻量级基础插件</description>
<build>

View File

@ -3,8 +3,11 @@
*/
package cn.citycraft.SimpleEssential.command;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandException;
@ -36,7 +39,15 @@ public class CommandWorld extends BaseCommand {
case 0:
sender.sendMessage(I18n.p("World.title"));
for (final World wd : Bukkit.getWorlds()) {
sender.sendMessage(I18n.p("World.info", wd.getName(), wd.getEnvironment().toString(), wd.getLoadedChunks().length, wd.getEntities().size(), wd.getPlayers().size()));
int tileEntities = 0;
try {
for (final Chunk chunk : wd.getLoadedChunks()) {
tileEntities += chunk.getTileEntities().length;
}
} catch (final ClassCastException ex) {
org.bukkit.Bukkit.getLogger().log(Level.SEVERE, "无法读取区块信息 错误世界: " + wd, ex);
}
sender.sendMessage(I18n.p("World.info", wd.getName(), wd.getEnvironment().toString(), wd.getLoadedChunks().length, wd.getEntities().size(), tileEntities, wd.getPlayers().size()));
}
case 1:
final World wd = Bukkit.getWorld(args[1]);