Java 类org.bukkit.craftbukkit.util.CraftIconCache 实例源码

项目:Uranium    文件:CraftServer.java   
private void loadIcon() {
    icon = new CraftIconCache(null);
    try {
        final File file = new File(new File("."), "server-icon.png");
        if (file.isFile()) {
            icon = loadServerIcon0(file);
        }
    } catch (Exception ex) {
        getLogger().log(Level.WARNING, "Couldn't load server icon", ex);
    }
}
项目:Uranium    文件:CraftServer.java   
@Override
public CraftIconCache loadServerIcon(File file) throws Exception {
    Validate.notNull(file, "File cannot be null");
    if (!file.isFile()) {
        throw new IllegalArgumentException(file + " is not a file");
    }
    return loadServerIcon0(file);
}
项目:Uranium    文件:CraftServer.java   
static CraftIconCache loadServerIcon0(BufferedImage image) throws Exception {
    ByteBuf bytebuf = Unpooled.buffer();

    Validate.isTrue(image.getWidth() == 64, "Must be 64 pixels wide");
    Validate.isTrue(image.getHeight() == 64, "Must be 64 pixels high");
    ImageIO.write(image, "PNG", new ByteBufOutputStream(bytebuf));
    ByteBuf bytebuf1 = Base64.encode(bytebuf);

    return new CraftIconCache("data:image/png;base64," + bytebuf1.toString(Charsets.UTF_8));
}
项目:ThermosRebased    文件:CraftServer.java   
private void loadIcon() {
    icon = new CraftIconCache(null);
    try {
        final File file = new File(new File("."), "server-icon.png");
        if (file.isFile()) {
            icon = loadServerIcon0(file);
        }
    } catch (Exception ex) {
        getLogger().log(Level.WARNING, "Couldn't load server icon", ex);
    }
}
项目:ThermosRebased    文件:CraftServer.java   
@Override
public CraftIconCache loadServerIcon(File file) throws Exception {
    Validate.notNull(file, "File cannot be null");
    if (!file.isFile()) {
        throw new IllegalArgumentException(file + " is not a file");
    }
    return loadServerIcon0(file);
}
项目:ThermosRebased    文件:CraftServer.java   
static CraftIconCache loadServerIcon0(BufferedImage image) throws Exception {
    ByteBuf bytebuf = Unpooled.buffer();

    Validate.isTrue(image.getWidth() == 64, "Must be 64 pixels wide");
    Validate.isTrue(image.getHeight() == 64, "Must be 64 pixels high");
    ImageIO.write(image, "PNG", new ByteBufOutputStream(bytebuf));
    ByteBuf bytebuf1 = Base64.encode(bytebuf);

    return new CraftIconCache("data:image/png;base64," + bytebuf1.toString(Charsets.UTF_8));
}
项目:Thermos    文件:CraftServer.java   
private void loadIcon() {
    icon = new CraftIconCache(null);
    try {
        final File file = new File(new File("."), "server-icon.png");
        if (file.isFile()) {
            icon = loadServerIcon0(file);
        }
    } catch (Exception ex) {
        getLogger().log(Level.WARNING, "Couldn't load server icon", ex);
    }
}
项目:Thermos    文件:CraftServer.java   
@Override
public CraftIconCache loadServerIcon(File file) throws Exception {
    Validate.notNull(file, "File cannot be null");
    if (!file.isFile()) {
        throw new IllegalArgumentException(file + " is not a file");
    }
    return loadServerIcon0(file);
}
项目:Thermos    文件:CraftServer.java   
static CraftIconCache loadServerIcon0(BufferedImage image) throws Exception {
    ByteBuf bytebuf = Unpooled.buffer();

    Validate.isTrue(image.getWidth() == 64, "Must be 64 pixels wide");
    Validate.isTrue(image.getHeight() == 64, "Must be 64 pixels high");
    ImageIO.write(image, "PNG", new ByteBufOutputStream(bytebuf));
    ByteBuf bytebuf1 = Base64.encode(bytebuf);

    return new CraftIconCache("data:image/png;base64," + bytebuf1.toString(Charsets.UTF_8));
}
项目:KCauldron    文件:CraftServer.java   
private void loadIcon() {
    icon = new CraftIconCache(null);
    try {
        final File file = new File(new File("."), "server-icon.png");
        if (file.isFile()) {
            icon = loadServerIcon0(file);
        }
    } catch (Exception ex) {
        getLogger().log(Level.WARNING, "Couldn't load server icon", ex);
    }
}
项目:KCauldron    文件:CraftServer.java   
@Override
public CraftIconCache loadServerIcon(File file) throws Exception {
    Validate.notNull(file, "File cannot be null");
    if (!file.isFile()) {
        throw new IllegalArgumentException(file + " is not a file");
    }
    return loadServerIcon0(file);
}
项目:KCauldron    文件:CraftServer.java   
static CraftIconCache loadServerIcon0(BufferedImage image) throws Exception {
    ByteBuf bytebuf = Unpooled.buffer();

    Validate.isTrue(image.getWidth() == 64, "Must be 64 pixels wide");
    Validate.isTrue(image.getHeight() == 64, "Must be 64 pixels high");
    ImageIO.write(image, "PNG", new ByteBufOutputStream(bytebuf));
    ByteBuf bytebuf1 = Base64.encode(bytebuf);

    return new CraftIconCache("data:image/png;base64," + bytebuf1.toString(Charsets.UTF_8));
}
项目:CauldronGit    文件:CraftServer.java   
private void loadIcon() {
    icon = new CraftIconCache(null);
    try {
        final File file = new File(new File("."), "server-icon.png");
        if (file.isFile()) {
            icon = loadServerIcon0(file);
        }
    } catch (Exception ex) {
        getLogger().log(Level.WARNING, "Couldn't load server icon", ex);
    }
}
项目:CauldronGit    文件:CraftServer.java   
@Override
public CraftIconCache loadServerIcon(File file) throws Exception {
    Validate.notNull(file, "File cannot be null");
    if (!file.isFile()) {
        throw new IllegalArgumentException(file + " is not a file");
    }
    return loadServerIcon0(file);
}
项目:CauldronGit    文件:CraftServer.java   
static CraftIconCache loadServerIcon0(BufferedImage image) throws Exception {
    ByteBuf bytebuf = Unpooled.buffer();

    Validate.isTrue(image.getWidth() == 64, "Must be 64 pixels wide");
    Validate.isTrue(image.getHeight() == 64, "Must be 64 pixels high");
    ImageIO.write(image, "PNG", new ByteBufOutputStream(bytebuf));
    ByteBuf bytebuf1 = Base64.encode(bytebuf);

    return new CraftIconCache("data:image/png;base64," + bytebuf1.toString(Charsets.UTF_8));
}
项目:Cauldron-Old    文件:CraftServer.java   
private void loadIcon() {
    icon = new CraftIconCache(null);
    try {
        final File file = new File(new File("."), "server-icon.png");
        if (file.isFile()) {
            icon = loadServerIcon0(file);
        }
    } catch (Exception ex) {
        getLogger().log(Level.WARNING, "Couldn't load server icon", ex);
    }
}
项目:Cauldron-Old    文件:CraftServer.java   
@Override
public CraftIconCache loadServerIcon(File file) throws Exception {
    Validate.notNull(file, "File cannot be null");
    if (!file.isFile()) {
        throw new IllegalArgumentException(file + " is not a file");
    }
    return loadServerIcon0(file);
}
项目:Cauldron-Old    文件:CraftServer.java   
static CraftIconCache loadServerIcon0(BufferedImage image) throws Exception {
    ByteBuf bytebuf = Unpooled.buffer();

    Validate.isTrue(image.getWidth() == 64, "Must be 64 pixels wide");
    Validate.isTrue(image.getHeight() == 64, "Must be 64 pixels high");
    ImageIO.write(image, "PNG", new ByteBufOutputStream(bytebuf));
    ByteBuf bytebuf1 = Base64.encode(bytebuf);

    return new CraftIconCache("data:image/png;base64," + bytebuf1.toString(Charsets.UTF_8));
}
项目:DiffUtils    文件:CraftServer_188.java   
private void loadIcon() {
    icon = new CraftIconCache(null);
    try {
        final File file = new File(new File("."), "server-icon.png");
        if (file.isFile()) {
            icon = loadServerIcon0(file);
        }
    } catch (Exception ex) {
        getLogger().log(Level.WARNING, "Couldn't load server icon", ex);
    }
}
项目:DiffUtils    文件:CraftServer_188.java   
@Override
public CraftIconCache loadServerIcon(File file) throws Exception {
    Validate.notNull(file, "File cannot be null");
    if (!file.isFile()) {
        throw new IllegalArgumentException(file + " is not a file");
    }
    return loadServerIcon0(file);
}
项目:DiffUtils    文件:CraftServer_188.java   
static CraftIconCache loadServerIcon0(BufferedImage image) throws Exception {
    ByteBuf bytebuf = Unpooled.buffer();

    Validate.isTrue(image.getWidth() == 64, "Must be 64 pixels wide");
    Validate.isTrue(image.getHeight() == 64, "Must be 64 pixels high");
    ImageIO.write(image, "PNG", new ByteBufOutputStream(bytebuf));
    ByteBuf bytebuf1 = Base64.encode(bytebuf);

    return new CraftIconCache("data:image/png;base64," + bytebuf1.toString(Charsets.UTF_8));
}
项目:DiffUtils    文件:CraftServer_1710.java   
private void loadIcon() {
    icon = new CraftIconCache(null);
    try {
        final File file = new File(new File("."), "server-icon.png");
        if (file.isFile()) {
            icon = loadServerIcon0(file);
        }
    } catch (Exception ex) {
        getLogger().log(Level.WARNING, "Couldn't load server icon", ex);
    }
}
项目:DiffUtils    文件:CraftServer_1710.java   
@Override
public CraftIconCache loadServerIcon(File file) throws Exception {
    Validate.notNull(file, "File cannot be null");
    if (!file.isFile()) {
        throw new IllegalArgumentException(file + " is not a file");
    }
    return loadServerIcon0(file);
}
项目:DiffUtils    文件:CraftServer_1710.java   
static CraftIconCache loadServerIcon0(BufferedImage image) throws Exception {
    ByteBuf bytebuf = Unpooled.buffer();

    Validate.isTrue(image.getWidth() == 64, "Must be 64 pixels wide");
    Validate.isTrue(image.getHeight() == 64, "Must be 64 pixels high");
    ImageIO.write(image, "PNG", new ByteBufOutputStream(bytebuf));
    ByteBuf bytebuf1 = Base64.encode(bytebuf);

    return new CraftIconCache("data:image/png;base64," + bytebuf1.toString(Charsets.UTF_8));
}
项目:Cauldron-Reloaded    文件:CraftServer.java   
private void loadIcon() {
    icon = new CraftIconCache(null);
    try {
        final File file = new File(new File("."), "server-icon.png");
        if (file.isFile()) {
            icon = loadServerIcon0(file);
        }
    } catch (Exception ex) {
        getLogger().log(Level.WARNING, "Couldn't load server icon", ex);
    }
}
项目:Cauldron-Reloaded    文件:CraftServer.java   
@Override
public CraftIconCache loadServerIcon(File file) throws Exception {
    Validate.notNull(file, "File cannot be null");
    if (!file.isFile()) {
        throw new IllegalArgumentException(file + " is not a file");
    }
    return loadServerIcon0(file);
}
项目:Cauldron-Reloaded    文件:CraftServer.java   
static CraftIconCache loadServerIcon0(BufferedImage image) throws Exception {
    ByteBuf bytebuf = Unpooled.buffer();

    Validate.isTrue(image.getWidth() == 64, "Must be 64 pixels wide");
    Validate.isTrue(image.getHeight() == 64, "Must be 64 pixels high");
    ImageIO.write(image, "PNG", new ByteBufOutputStream(bytebuf));
    ByteBuf bytebuf1 = Base64.encode(bytebuf);

    return new CraftIconCache("data:image/png;base64," + bytebuf1.toString(Charsets.UTF_8));
}
项目:FFoKC    文件:CraftServer.java   
private void loadIcon() {
    icon = new CraftIconCache(null);
    try {
        final File file = new File(new File("."), "server-icon.png");
        if (file.isFile()) {
            icon = loadServerIcon0(file);
        }
    } catch (Exception ex) {
        getLogger().log(Level.WARNING, "Couldn't load server icon", ex);
    }
}
项目:FFoKC    文件:CraftServer.java   
@Override
public CraftIconCache loadServerIcon(File file) throws Exception {
    Validate.notNull(file, "File cannot be null");
    if (!file.isFile()) {
        throw new IllegalArgumentException(file + " is not a file");
    }
    return loadServerIcon0(file);
}
项目:FFoKC    文件:CraftServer.java   
static CraftIconCache loadServerIcon0(BufferedImage image) throws Exception {
    ByteBuf bytebuf = Unpooled.buffer();

    Validate.isTrue(image.getWidth() == 64, "Must be 64 pixels wide");
    Validate.isTrue(image.getHeight() == 64, "Must be 64 pixels high");
    ImageIO.write(image, "PNG", new ByteBufOutputStream(bytebuf));
    ByteBuf bytebuf1 = Base64.encode(bytebuf);

    return new CraftIconCache("data:image/png;base64," + bytebuf1.toString(Charsets.UTF_8));
}
项目:CraftBukkit    文件:CraftServer.java   
private void loadIcon() {
    icon = new CraftIconCache(null);
    try {
        final File file = new File(new File("."), "server-icon.png");
        if (file.isFile()) {
            icon = loadServerIcon0(file);
        }
    } catch (Exception ex) {
        getLogger().log(Level.WARNING, "Couldn't load server icon", ex);
    }
}
项目:CraftBukkit    文件:CraftServer.java   
@Override
public CraftIconCache loadServerIcon(File file) throws Exception {
    Validate.notNull(file, "File cannot be null");
    if (!file.isFile()) {
        throw new IllegalArgumentException(file + " is not a file");
    }
    return loadServerIcon0(file);
}
项目:CraftBukkit    文件:CraftServer.java   
static CraftIconCache loadServerIcon0(BufferedImage image) throws Exception {
    ByteBuf bytebuf = Unpooled.buffer();

    Validate.isTrue(image.getWidth() == 64, "Must be 64 pixels wide");
    Validate.isTrue(image.getHeight() == 64, "Must be 64 pixels high");
    ImageIO.write(image, "PNG", new ByteBufOutputStream(bytebuf));
    ByteBuf bytebuf1 = Base64.encode(bytebuf);

    return new CraftIconCache("data:image/png;base64," + bytebuf1.toString(Charsets.UTF_8));
}
项目:Craftbukkit    文件:CraftServer.java   
private void loadIcon() {
    icon = new CraftIconCache(null);
    try {
        final File file = new File(new File("."), "server-icon.png");
        if (file.isFile()) {
            icon = loadServerIcon0(file);
        }
    } catch (Exception ex) {
        getLogger().log(Level.WARNING, "Couldn't load server icon", ex);
    }
}
项目:Craftbukkit    文件:CraftServer.java   
@Override
public CraftIconCache loadServerIcon(File file) throws Exception {
    Validate.notNull(file, "File cannot be null");
    if (!file.isFile()) {
        throw new IllegalArgumentException(file + " is not a file");
    }
    return loadServerIcon0(file);
}
项目:Craftbukkit    文件:CraftServer.java   
static CraftIconCache loadServerIcon0(BufferedImage image) throws Exception {
    ByteBuf bytebuf = Unpooled.buffer();

    Validate.isTrue(image.getWidth() == 64, "Must be 64 pixels wide");
    Validate.isTrue(image.getHeight() == 64, "Must be 64 pixels high");
    ImageIO.write(image, "PNG", new ByteBufOutputStream(bytebuf));
    ByteBuf bytebuf1 = Base64.encode(bytebuf);

    return new CraftIconCache("data:image/png;base64," + bytebuf1.toString(Charsets.UTF_8));
}
项目:Tweakkit-Server    文件:CraftServer.java   
private void loadIcon() {
    icon = new CraftIconCache(null);
    try {
        final File file = new File(new File("."), "server-icon.png");
        if (file.isFile()) {
            icon = loadServerIcon0(file);
        }
    } catch (Exception ex) {
        getLogger().log(Level.WARNING, "Couldn't load server icon", ex);
    }
}
项目:Tweakkit-Server    文件:CraftServer.java   
@Override
public CraftIconCache loadServerIcon(File file) throws Exception {
    Validate.notNull(file, "File cannot be null");
    if (!file.isFile()) {
        throw new IllegalArgumentException(file + " is not a file");
    }
    return loadServerIcon0(file);
}
项目:Tweakkit-Server    文件:CraftServer.java   
static CraftIconCache loadServerIcon0(BufferedImage image) throws Exception {
    ByteBuf bytebuf = Unpooled.buffer();

    Validate.isTrue(image.getWidth() == 64, "Must be 64 pixels wide");
    Validate.isTrue(image.getHeight() == 64, "Must be 64 pixels high");
    ImageIO.write(image, "PNG", new ByteBufOutputStream(bytebuf));
    ByteBuf bytebuf1 = Base64.encode(bytebuf);

    return new CraftIconCache("data:image/png;base64," + bytebuf1.toString(Charsets.UTF_8));
}
项目:Cauldron    文件:CraftServer.java   
private void loadIcon() {
    icon = new CraftIconCache(null);
    try {
        final File file = new File(new File("."), "server-icon.png");
        if (file.isFile()) {
            icon = loadServerIcon0(file);
        }
    } catch (Exception ex) {
        getLogger().log(Level.WARNING, "Couldn't load server icon", ex);
    }
}