本文整理汇总了Java中org.bukkit.util.CachedServerIcon类的典型用法代码示例。如果您正苦于以下问题:Java CachedServerIcon类的具体用法?Java CachedServerIcon怎么用?Java CachedServerIcon使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CachedServerIcon类属于org.bukkit.util包,在下文中一共展示了CachedServerIcon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onServerListPing
import org.bukkit.util.CachedServerIcon; //导入依赖的package包/类
@HookHandler(priority = Priority.CRITICAL)
public void onServerListPing(final ServerListPingHook hook) {
server.getPluginManager().callEvent(
new ServerListPingEvent(hook.getRequesterAddress(), hook.getMotd().getFullText(), hook
.getCurrentPlayers(), hook.getMaxPlayers()) {
@Override
public void setMotd(String motd) {
super.setMotd(motd);
hook.setMotd(motd);
}
@Override
public void setMaxPlayers(int maxPlayers) {
super.setMaxPlayers(maxPlayers);
hook.setMaxPlayers(maxPlayers);
}
@Override
public void setServerIcon(CachedServerIcon icon) throws IllegalArgumentException,
UnsupportedOperationException {
super.setServerIcon(icon);
}
});
}
示例2: toCachedServerIcon
import org.bukkit.util.CachedServerIcon; //导入依赖的package包/类
public CachedServerIcon toCachedServerIcon() {
if (cachedServerIcon == null) {
synchronized (this) {
if (cachedServerIcon == null) {
try {
cachedServerIcon = Bukkit.loadServerIcon(toBufferedImage());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
}
return cachedServerIcon;
}
示例3: convertBukkitIconToBase64
import org.bukkit.util.CachedServerIcon; //导入依赖的package包/类
@Override
public String convertBukkitIconToBase64(CachedServerIcon icon) {
if (icon == null) {
return null;
}
if (!(icon instanceof CraftIconCache)) {
throw new IllegalArgumentException(icon + " was not created by " + CraftServer.class);
}
return ((CraftIconCache) icon).value;
}
示例4: load
import org.bukkit.util.CachedServerIcon; //导入依赖的package包/类
@Override
public Optional<CachedServerIcon> load(FaviconSource source) throws Exception {
// Try loading the favicon
BufferedImage image = FaviconHelper.loadSafely(core, source);
if (image == null) return Optional.absent(); // Favicon loading failed
else return Optional.of(getServer().loadServerIcon(image)); // Success!
}
示例5: getServerIcon
import org.bukkit.util.CachedServerIcon; //导入依赖的package包/类
@Override
public CachedServerIcon getServerIcon()
{
// TODO Auto-generated method stub
throw new UnimplementedOperationException();
}
示例6: loadServerIcon
import org.bukkit.util.CachedServerIcon; //导入依赖的package包/类
@Override
public CachedServerIcon loadServerIcon(File file) throws IllegalArgumentException, Exception
{
// TODO Auto-generated method stub
throw new UnimplementedOperationException();
}
示例7: getServerIcon
import org.bukkit.util.CachedServerIcon; //导入依赖的package包/类
@Override
public CachedServerIcon getServerIcon() {
throw new UnsupportedOperationException();
}
示例8: loadServerIcon
import org.bukkit.util.CachedServerIcon; //导入依赖的package包/类
@Override
public CachedServerIcon loadServerIcon( File file ) throws Exception {
throw new UnsupportedOperationException();
}
示例9: getServerIcon
import org.bukkit.util.CachedServerIcon; //导入依赖的package包/类
@Override
public CachedServerIcon getServerIcon() {
return null; // TODO: Get icon from Sponge.
}
示例10: loadServerIcon
import org.bukkit.util.CachedServerIcon; //导入依赖的package包/类
@Override
public CachedServerIcon loadServerIcon(File file) throws Exception {
return null; // TODO: Load icon to Sponge.
}
示例11: getServerIcon
import org.bukkit.util.CachedServerIcon; //导入依赖的package包/类
@Override
public CachedServerIcon getServerIcon() {
// TODO Auto-generated method stub
return null;
}
示例12: loadServerIcon
import org.bukkit.util.CachedServerIcon; //导入依赖的package包/类
@Override
public CachedServerIcon loadServerIcon(File arg0) throws IllegalArgumentException, Exception {
// TODO Auto-generated method stub
return null;
}
示例13: getServerIcon
import org.bukkit.util.CachedServerIcon; //导入依赖的package包/类
@Override
public CachedServerIcon getServerIcon() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
示例14: loadServerIcon
import org.bukkit.util.CachedServerIcon; //导入依赖的package包/类
@Override
public CachedServerIcon loadServerIcon(File file) throws IllegalArgumentException, Exception {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
示例15: getServerIcon
import org.bukkit.util.CachedServerIcon; //导入依赖的package包/类
/**
* @see Server#getServerIcon()
*/
public static CachedServerIcon getServerIcon() {
return server.getServerIcon();
}