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

add tiles and update version...

This commit is contained in:
502647092 2015-09-16 15:52:17 +08:00
parent 109452b53b
commit 16003a3526
3 changed files with 16 additions and 5 deletions

View File

@ -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.2</version> <version>1.3</version>
<name>SimpleEssential</name> <name>SimpleEssential</name>
<description>轻量级基础插件</description> <description>轻量级基础插件</description>
<build> <build>

View File

@ -3,7 +3,10 @@
*/ */
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.Chunk;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.command.CommandException; import org.bukkit.command.CommandException;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -41,8 +44,16 @@ public class CommandGc extends BaseCommand {
sender.sendMessage(I18n.p("Gc.maxMem", StringUtil.b2mb(rt.maxMemory()))); sender.sendMessage(I18n.p("Gc.maxMem", StringUtil.b2mb(rt.maxMemory())));
sender.sendMessage(I18n.p("Gc.totalMem", StringUtil.b2mb(rt.totalMemory()))); sender.sendMessage(I18n.p("Gc.totalMem", StringUtil.b2mb(rt.totalMemory())));
sender.sendMessage(I18n.p("Gc.freeMem", StringUtil.b2mb(rt.freeMemory()))); sender.sendMessage(I18n.p("Gc.freeMem", StringUtil.b2mb(rt.freeMemory())));
for (World wd : Bukkit.getWorlds()) for (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 (Chunk chunk : wd.getLoadedChunks())
tileEntities += chunk.getTileEntities().length;
} catch (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()));
}
}; };
@Override @Override

View File

@ -1,5 +1,5 @@
#本文件为基础插件的语言配置文件 #本文件为基础插件的语言配置文件
version: 1.2 version: 1.3
#基础语言配置 #基础语言配置
Base: Base:
offline: "§c玩家 %s 不存在或不在线!" offline: "§c玩家 %s 不存在或不在线!"
@ -40,5 +40,5 @@ Gc:
freeMem: '§6空闲内存: §a%s' freeMem: '§6空闲内存: §a%s'
World: World:
title: '§6当前服务器的启用的世界如下' title: '§6当前服务器的启用的世界如下'
info: '§a%s §3- §a%s §6区块: §a%s §6实体: §a%s §6玩家: §a%s' info: '§a%s §3- §a%s §6区块: §a%s §6实体: §a%s §6tiles: §a%s §6玩家: §a%s'
unknow: '§c未知的世界 §a%s' unknow: '§c未知的世界 §a%s'