当前位置: 首页>>代码示例>>Java>>正文


Java ServerStatusResponse.func_151320_a方法代码示例

本文整理汇总了Java中net.minecraft.network.ServerStatusResponse.func_151320_a方法的典型用法代码示例。如果您正苦于以下问题:Java ServerStatusResponse.func_151320_a方法的具体用法?Java ServerStatusResponse.func_151320_a怎么用?Java ServerStatusResponse.func_151320_a使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.network.ServerStatusResponse的用法示例。


在下文中一共展示了ServerStatusResponse.func_151320_a方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: func_147138_a

import net.minecraft.network.ServerStatusResponse; //导入方法依赖的package包/类
private void func_147138_a(ServerStatusResponse p_147138_1_)
{
    File var2 = this.getFile("server-icon.png");

    if (var2.isFile())
    {
        ByteBuf var3 = Unpooled.buffer();

        try
        {
            BufferedImage var4 = ImageIO.read(var2);
            Validate.validState(var4.getWidth() == 64, "Must be 64 pixels wide", new Object[0]);
            Validate.validState(var4.getHeight() == 64, "Must be 64 pixels high", new Object[0]);
            ImageIO.write(var4, "PNG", new ByteBufOutputStream(var3));
            ByteBuf var5 = Base64.encode(var3);
            p_147138_1_.func_151320_a("data:image/png;base64," + var5.toString(Charsets.UTF_8));
        }
        catch (Exception var6)
        {
            logger.error("Couldn\'t load server icon", var6);
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:24,代码来源:MinecraftServer.java

示例2: func_147138_a

import net.minecraft.network.ServerStatusResponse; //导入方法依赖的package包/类
private void func_147138_a(ServerStatusResponse p_147138_1_)
{
    File file1 = this.getFile("server-icon.png");

    if (file1.isFile())
    {
        ByteBuf bytebuf = Unpooled.buffer();

        try
        {
            BufferedImage bufferedimage = ImageIO.read(file1);
            Validate.validState(bufferedimage.getWidth() == 64, "Must be 64 pixels wide", new Object[0]);
            Validate.validState(bufferedimage.getHeight() == 64, "Must be 64 pixels high", new Object[0]);
            ImageIO.write(bufferedimage, "PNG", new ByteBufOutputStream(bytebuf));
            ByteBuf bytebuf1 = Base64.encode(bytebuf);
            p_147138_1_.func_151320_a("data:image/png;base64," + bytebuf1.toString(Charsets.UTF_8));
        }
        catch (Exception exception)
        {
            logger.error("Couldn\'t load server icon", exception);
        }
        finally
        {
            bytebuf.release();
        }
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:28,代码来源:MinecraftServer.java


注:本文中的net.minecraft.network.ServerStatusResponse.func_151320_a方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。