• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IJsonSerializable类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.minecraft.util.IJsonSerializable的典型用法代码示例。如果您正苦于以下问题:Java IJsonSerializable类的具体用法?Java IJsonSerializable怎么用?Java IJsonSerializable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IJsonSerializable类属于net.minecraft.util包,在下文中一共展示了IJsonSerializable类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: func_150870_b

import net.minecraft.util.IJsonSerializable; //导入依赖的package包/类
public <T extends IJsonSerializable> T func_150870_b(StatBase p_150870_1_)
{
    TupleIntJsonSerializable tupleintjsonserializable = (TupleIntJsonSerializable)this.statsData.get(p_150870_1_);
    return (T)(tupleintjsonserializable != null ? tupleintjsonserializable.getJsonSerializableValue() : null);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:6,代码来源:StatFileWriter.java


示例2: parseJson

import net.minecraft.util.IJsonSerializable; //导入依赖的package包/类
public Map<StatBase, TupleIntJsonSerializable> parseJson(String p_150881_1_)
{
    JsonElement jsonelement = (new JsonParser()).parse(p_150881_1_);

    if (!jsonelement.isJsonObject())
    {
        return Maps.<StatBase, TupleIntJsonSerializable>newHashMap();
    }
    else
    {
        JsonObject jsonobject = jsonelement.getAsJsonObject();
        Map<StatBase, TupleIntJsonSerializable> map = Maps.<StatBase, TupleIntJsonSerializable>newHashMap();

        for (Entry<String, JsonElement> entry : jsonobject.entrySet())
        {
            StatBase statbase = StatList.getOneShotStat((String)entry.getKey());

            if (statbase != null)
            {
                TupleIntJsonSerializable tupleintjsonserializable = new TupleIntJsonSerializable();

                if (((JsonElement)entry.getValue()).isJsonPrimitive() && ((JsonElement)entry.getValue()).getAsJsonPrimitive().isNumber())
                {
                    tupleintjsonserializable.setIntegerValue(((JsonElement)entry.getValue()).getAsInt());
                }
                else if (((JsonElement)entry.getValue()).isJsonObject())
                {
                    JsonObject jsonobject1 = ((JsonElement)entry.getValue()).getAsJsonObject();

                    if (jsonobject1.has("value") && jsonobject1.get("value").isJsonPrimitive() && jsonobject1.get("value").getAsJsonPrimitive().isNumber())
                    {
                        tupleintjsonserializable.setIntegerValue(jsonobject1.getAsJsonPrimitive("value").getAsInt());
                    }

                    if (jsonobject1.has("progress") && statbase.func_150954_l() != null)
                    {
                        try
                        {
                            Constructor <? extends IJsonSerializable > constructor = statbase.func_150954_l().getConstructor(new Class[0]);
                            IJsonSerializable ijsonserializable = (IJsonSerializable)constructor.newInstance(new Object[0]);
                            ijsonserializable.fromJson(jsonobject1.get("progress"));
                            tupleintjsonserializable.setJsonSerializableValue(ijsonserializable);
                        }
                        catch (Throwable throwable)
                        {
                            logger.warn("Invalid statistic progress in " + this.statsFile, throwable);
                        }
                    }
                }

                map.put(statbase, tupleintjsonserializable);
            }
            else
            {
                logger.warn("Invalid statistic in " + this.statsFile + ": Don\'t know what " + (String)entry.getKey() + " is");
            }
        }

        return map;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:62,代码来源:StatisticsFile.java


示例3: func_150954_l

import net.minecraft.util.IJsonSerializable; //导入依赖的package包/类
public Class <? extends IJsonSerializable > func_150954_l()
{
    return this.field_150956_d;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:StatBase.java


示例4: func_150953_b

import net.minecraft.util.IJsonSerializable; //导入依赖的package包/类
public StatBase func_150953_b(Class <? extends IJsonSerializable > p_150953_1_)
{
    this.field_150956_d = p_150953_1_;
    return this;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:6,代码来源:StatBase.java


示例5: func_150953_b

import net.minecraft.util.IJsonSerializable; //导入依赖的package包/类
public Achievement func_150953_b(Class <? extends IJsonSerializable > p_150953_1_)
{
    return (Achievement)super.func_150953_b(p_150953_1_);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:Achievement.java


示例6: getSerializableClazz

import net.minecraft.util.IJsonSerializable; //导入依赖的package包/类
public Class <? extends IJsonSerializable > getSerializableClazz()
{
    return this.serializableClazz;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:StatBase.java


示例7: setSerializableClazz

import net.minecraft.util.IJsonSerializable; //导入依赖的package包/类
public StatBase setSerializableClazz(Class <? extends IJsonSerializable > clazz)
{
    this.serializableClazz = clazz;
    return this;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:6,代码来源:StatBase.java


示例8: setSerializableClazz

import net.minecraft.util.IJsonSerializable; //导入依赖的package包/类
public Achievement setSerializableClazz(Class <? extends IJsonSerializable > clazz)
{
    return (Achievement)super.setSerializableClazz(clazz);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:Achievement.java


示例9: parseJson

import net.minecraft.util.IJsonSerializable; //导入依赖的package包/类
public Map<StatBase, TupleIntJsonSerializable> parseJson(String p_150881_1_)
{
    JsonElement jsonelement = (new JsonParser()).parse(p_150881_1_);

    if (!jsonelement.isJsonObject())
    {
        return Maps.<StatBase, TupleIntJsonSerializable>newHashMap();
    }
    else
    {
        JsonObject jsonobject = jsonelement.getAsJsonObject();
        Map<StatBase, TupleIntJsonSerializable> map = Maps.<StatBase, TupleIntJsonSerializable>newHashMap();

        for (Entry<String, JsonElement> entry : jsonobject.entrySet())
        {
            StatBase statbase = StatList.getOneShotStat((String)entry.getKey());

            if (statbase != null)
            {
                TupleIntJsonSerializable tupleintjsonserializable = new TupleIntJsonSerializable();

                if (((JsonElement)entry.getValue()).isJsonPrimitive() && ((JsonElement)entry.getValue()).getAsJsonPrimitive().isNumber())
                {
                    tupleintjsonserializable.setIntegerValue(((JsonElement)entry.getValue()).getAsInt());
                }
                else if (((JsonElement)entry.getValue()).isJsonObject())
                {
                    JsonObject jsonobject1 = ((JsonElement)entry.getValue()).getAsJsonObject();

                    if (jsonobject1.has("value") && jsonobject1.get("value").isJsonPrimitive() && jsonobject1.get("value").getAsJsonPrimitive().isNumber())
                    {
                        tupleintjsonserializable.setIntegerValue(jsonobject1.getAsJsonPrimitive("value").getAsInt());
                    }

                    if (jsonobject1.has("progress") && statbase.getSerializableClazz() != null)
                    {
                        try
                        {
                            Constructor <? extends IJsonSerializable > constructor = statbase.getSerializableClazz().getConstructor(new Class[0]);
                            IJsonSerializable ijsonserializable = (IJsonSerializable)constructor.newInstance(new Object[0]);
                            ijsonserializable.fromJson(jsonobject1.get("progress"));
                            tupleintjsonserializable.setJsonSerializableValue(ijsonserializable);
                        }
                        catch (Throwable throwable)
                        {
                            LOGGER.warn("Invalid statistic progress in {}", new Object[] {this.statsFile, throwable});
                        }
                    }
                }

                map.put(statbase, tupleintjsonserializable);
            }
            else
            {
                LOGGER.warn("Invalid statistic in {}: Don\'t know what {} is", new Object[] {this.statsFile, entry.getKey()});
            }
        }

        return map;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:62,代码来源:StatisticsManagerServer.java


示例10: getProgress

import net.minecraft.util.IJsonSerializable; //导入依赖的package包/类
public <T extends IJsonSerializable> T getProgress(StatBase p_150870_1_)
{
    TupleIntJsonSerializable tupleintjsonserializable = (TupleIntJsonSerializable)this.statsData.get(p_150870_1_);
    return (T)(tupleintjsonserializable != null ? tupleintjsonserializable.getJsonSerializableValue() : null);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:6,代码来源:StatisticsManager.java


示例11: func_150870_b

import net.minecraft.util.IJsonSerializable; //导入依赖的package包/类
public IJsonSerializable func_150870_b(StatBase p_150870_1_)
{
    TupleIntJsonSerializable var2 = (TupleIntJsonSerializable)this.field_150875_a.get(p_150870_1_);
    return var2 != null ? var2.getJsonSerializableValue() : null;
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:6,代码来源:StatFileWriter.java


示例12: func_150881_a

import net.minecraft.util.IJsonSerializable; //导入依赖的package包/类
public Map func_150881_a(String p_150881_1_)
{
    JsonElement var2 = (new JsonParser()).parse(p_150881_1_);

    if (!var2.isJsonObject())
    {
        return Maps.newHashMap();
    }
    else
    {
        JsonObject var3 = var2.getAsJsonObject();
        HashMap var4 = Maps.newHashMap();
        Iterator var5 = var3.entrySet().iterator();

        while (var5.hasNext())
        {
            Entry var6 = (Entry)var5.next();
            StatBase var7 = StatList.func_151177_a((String)var6.getKey());

            if (var7 != null)
            {
                TupleIntJsonSerializable var8 = new TupleIntJsonSerializable();

                if (((JsonElement)var6.getValue()).isJsonPrimitive() && ((JsonElement)var6.getValue()).getAsJsonPrimitive().isNumber())
                {
                    var8.setIntegerValue(((JsonElement)var6.getValue()).getAsInt());
                }
                else if (((JsonElement)var6.getValue()).isJsonObject())
                {
                    JsonObject var9 = ((JsonElement)var6.getValue()).getAsJsonObject();

                    if (var9.has("value") && var9.get("value").isJsonPrimitive() && var9.get("value").getAsJsonPrimitive().isNumber())
                    {
                        var8.setIntegerValue(var9.getAsJsonPrimitive("value").getAsInt());
                    }

                    if (var9.has("progress") && var7.func_150954_l() != null)
                    {
                        try
                        {
                            Constructor var10 = var7.func_150954_l().getConstructor(new Class[0]);
                            IJsonSerializable var11 = (IJsonSerializable)var10.newInstance(new Object[0]);
                            var8.setJsonSerializableValue(var11);
                        }
                        catch (Throwable var12)
                        {
                            logger.warn("Invalid statistic progress in " + this.field_150887_d, var12);
                        }
                    }
                }

                var4.put(var7, var8);
            }
            else
            {
                logger.warn("Invalid statistic in " + this.field_150887_d + ": Don\'t know what " + (String)var6.getKey() + " is");
            }
        }

        return var4;
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:63,代码来源:StatisticsFile.java


示例13: func_150870_b

import net.minecraft.util.IJsonSerializable; //导入依赖的package包/类
@Override
public IJsonSerializable func_150870_b(StatBase p_150870_1_) {
	return new JsonSerializableSet();
}
 
开发者ID:unascribed,项目名称:Farrago,代码行数:5,代码来源:FakeStatFileWriter.java


示例14: func_150872_a

import net.minecraft.util.IJsonSerializable; //导入依赖的package包/类
@Override
public IJsonSerializable func_150872_a(StatBase p_150872_1_, IJsonSerializable p_150872_2_) {
	return new JsonSerializableSet();
}
 
开发者ID:unascribed,项目名称:Farrago,代码行数:5,代码来源:FakeStatFileWriter.java


示例15: func_150870_b

import net.minecraft.util.IJsonSerializable; //导入依赖的package包/类
public IJsonSerializable func_150870_b(StatBase p_150870_1_)
{
    TupleIntJsonSerializable tupleintjsonserializable = (TupleIntJsonSerializable)this.field_150875_a.get(p_150870_1_);
    return tupleintjsonserializable != null ? tupleintjsonserializable.getJsonSerializableValue() : null;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:6,代码来源:StatFileWriter.java


示例16: func_150881_a

import net.minecraft.util.IJsonSerializable; //导入依赖的package包/类
public Map func_150881_a(String p_150881_1_)
{
    JsonElement jsonelement = (new JsonParser()).parse(p_150881_1_);

    if (!jsonelement.isJsonObject())
    {
        return Maps.newHashMap();
    }
    else
    {
        JsonObject jsonobject = jsonelement.getAsJsonObject();
        HashMap hashmap = Maps.newHashMap();
        Iterator iterator = jsonobject.entrySet().iterator();

        while (iterator.hasNext())
        {
            Entry entry = (Entry)iterator.next();
            StatBase statbase = StatList.func_151177_a((String)entry.getKey());

            if (statbase != null)
            {
                TupleIntJsonSerializable tupleintjsonserializable = new TupleIntJsonSerializable();

                if (((JsonElement)entry.getValue()).isJsonPrimitive() && ((JsonElement)entry.getValue()).getAsJsonPrimitive().isNumber())
                {
                    tupleintjsonserializable.setIntegerValue(((JsonElement)entry.getValue()).getAsInt());
                }
                else if (((JsonElement)entry.getValue()).isJsonObject())
                {
                    JsonObject jsonobject1 = ((JsonElement)entry.getValue()).getAsJsonObject();

                    if (jsonobject1.has("value") && jsonobject1.get("value").isJsonPrimitive() && jsonobject1.get("value").getAsJsonPrimitive().isNumber())
                    {
                        tupleintjsonserializable.setIntegerValue(jsonobject1.getAsJsonPrimitive("value").getAsInt());
                    }

                    if (jsonobject1.has("progress") && statbase.func_150954_l() != null)
                    {
                        try
                        {
                            Constructor constructor = statbase.func_150954_l().getConstructor(new Class[0]);
                            IJsonSerializable ijsonserializable = (IJsonSerializable)constructor.newInstance(new Object[0]);
                            ijsonserializable.func_152753_a(jsonobject1.get("progress"));
                            tupleintjsonserializable.setJsonSerializableValue(ijsonserializable);
                        }
                        catch (Throwable throwable)
                        {
                            logger.warn("Invalid statistic progress in " + this.field_150887_d, throwable);
                        }
                    }
                }

                hashmap.put(statbase, tupleintjsonserializable);
            }
            else
            {
                logger.warn("Invalid statistic in " + this.field_150887_d + ": Don\'t know what " + (String)entry.getKey() + " is");
            }
        }

        return hashmap;
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:64,代码来源:StatisticsFile.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GHLabel类代码示例发布时间:2022-05-22
下一篇:
Java IASTDeclaration类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap