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:
parent
01efafffea
commit
910abbc116
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>cn.citycraft</groupId>
|
<groupId>cn.citycraft</groupId>
|
||||||
<artifactId>SimpleEssential</artifactId>
|
<artifactId>SimpleEssential</artifactId>
|
||||||
<version>1.3</version>
|
<version>1.4</version>
|
||||||
<name>SimpleEssential</name>
|
<name>SimpleEssential</name>
|
||||||
<description>轻量级基础插件</description>
|
<description>轻量级基础插件</description>
|
||||||
<build>
|
<build>
|
||||||
|
@ -3,8 +3,11 @@
|
|||||||
*/
|
*/
|
||||||
package cn.citycraft.SimpleEssential.command;
|
package cn.citycraft.SimpleEssential.command;
|
||||||
|
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandException;
|
import org.bukkit.command.CommandException;
|
||||||
@ -36,7 +39,15 @@ public class CommandWorld extends BaseCommand {
|
|||||||
case 0:
|
case 0:
|
||||||
sender.sendMessage(I18n.p("World.title"));
|
sender.sendMessage(I18n.p("World.title"));
|
||||||
for (final World wd : Bukkit.getWorlds()) {
|
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:
|
case 1:
|
||||||
final World wd = Bukkit.getWorld(args[1]);
|
final World wd = Bukkit.getWorld(args[1]);
|
||||||
|
Loading…
Reference in New Issue
Block a user