Package net.minecraft.util.com.google.gson

Examples of net.minecraft.util.com.google.gson.JsonObject.addProperty()


    }

    public JsonElement a(ServerPingPlayerSample serverpingplayersample, Type type, JsonSerializationContext jsonserializationcontext) {
        JsonObject jsonobject = new JsonObject();

        jsonobject.addProperty("max", Integer.valueOf(serverpingplayersample.a()));
        jsonobject.addProperty("online", Integer.valueOf(serverpingplayersample.b()));
        if (serverpingplayersample.c() != null && serverpingplayersample.c().length > 0) {
            JsonArray jsonarray = new JsonArray();

            for (int i = 0; i < serverpingplayersample.c().length; ++i) {
View Full Code Here


    public JsonElement a(ServerPingPlayerSample serverpingplayersample, Type type, JsonSerializationContext jsonserializationcontext) {
        JsonObject jsonobject = new JsonObject();

        jsonobject.addProperty("max", Integer.valueOf(serverpingplayersample.a()));
        jsonobject.addProperty("online", Integer.valueOf(serverpingplayersample.b()));
        if (serverpingplayersample.c() != null && serverpingplayersample.c().length > 0) {
            JsonArray jsonarray = new JsonArray();

            for (int i = 0; i < serverpingplayersample.c().length; ++i) {
                JsonObject jsonobject1 = new JsonObject();
View Full Code Here

            for (int i = 0; i < serverpingplayersample.c().length; ++i) {
                JsonObject jsonobject1 = new JsonObject();
                UUID uuid = serverpingplayersample.c()[i].getId();

                jsonobject1.addProperty("id", uuid == null ? "" : uuid.toString());
                jsonobject1.addProperty("name", serverpingplayersample.c()[i].getName());
                jsonarray.add(jsonobject1);
            }

            jsonobject.add("sample", jsonarray);
View Full Code Here

            for (int i = 0; i < serverpingplayersample.c().length; ++i) {
                JsonObject jsonobject1 = new JsonObject();
                UUID uuid = serverpingplayersample.c()[i].getId();

                jsonobject1.addProperty("id", uuid == null ? "" : uuid.toString());
                jsonobject1.addProperty("name", serverpingplayersample.c()[i].getName());
                jsonarray.add(jsonobject1);
            }

            jsonobject.add("sample", jsonarray);
        }
View Full Code Here

    }

    public JsonElement a(UserCacheEntry usercacheentry, Type type, JsonSerializationContext jsonserializationcontext) {
        JsonObject jsonobject = new JsonObject();

        jsonobject.addProperty("name", usercacheentry.a().getName());
        UUID uuid = usercacheentry.a().getId();

        jsonobject.addProperty("uuid", uuid == null ? "" : uuid.toString());
        jsonobject.addProperty("expiresOn", UserCache.a.format(usercacheentry.b()));
        return jsonobject;
View Full Code Here

        JsonObject jsonobject = new JsonObject();

        jsonobject.addProperty("name", usercacheentry.a().getName());
        UUID uuid = usercacheentry.a().getId();

        jsonobject.addProperty("uuid", uuid == null ? "" : uuid.toString());
        jsonobject.addProperty("expiresOn", UserCache.a.format(usercacheentry.b()));
        return jsonobject;
    }

    public UserCacheEntry a(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) {
View Full Code Here

        jsonobject.addProperty("name", usercacheentry.a().getName());
        UUID uuid = usercacheentry.a().getId();

        jsonobject.addProperty("uuid", uuid == null ? "" : uuid.toString());
        jsonobject.addProperty("expiresOn", UserCache.a.format(usercacheentry.b()));
        return jsonobject;
    }

    public UserCacheEntry a(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) {
        if (jsonelement.isJsonObject()) {
View Full Code Here

                jsonobject.add("extra", jsonarray);
            }

            if (ichatbasecomponent instanceof ChatComponentText) {
                jsonobject.addProperty("text", ((ChatComponentText) ichatbasecomponent).g());
            } else {
                if (!(ichatbasecomponent instanceof ChatMessage)) {
                    throw new IllegalArgumentException("Don\'t know how to serialize " + ichatbasecomponent + " as a Component");
                }
View Full Code Here

                    throw new IllegalArgumentException("Don\'t know how to serialize " + ichatbasecomponent + " as a Component");
                }

                ChatMessage chatmessage = (ChatMessage) ichatbasecomponent;

                jsonobject.addProperty("translate", chatmessage.i());
                if (chatmessage.j() != null && chatmessage.j().length > 0) {
                    JsonArray jsonarray1 = new JsonArray();
                    Object[] aobject = chatmessage.j();
                    int i = aobject.length;
View Full Code Here

            Entry entry = (Entry) iterator.next();

            if (((StatisticWrapper) entry.getValue()).b() != null) {
                JsonObject jsonobject1 = new JsonObject();

                jsonobject1.addProperty("value", Integer.valueOf(((StatisticWrapper) entry.getValue()).a()));

                try {
                    jsonobject1.add("progress", ((StatisticWrapper) entry.getValue()).b().a());
                } catch (Throwable throwable) {
                    b.warn("Couldn\'t save statistic " + ((Statistic) entry.getKey()).e() + ": error serializing progress", throwable);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.