#Yggrasill.. thigs.

1 messages · Page 1 of 1 (latest)

peak patio
#

Hi don't know someone who know Ygg... thing.. i can't figure out this..
Tbh i'm stack on it like 2 weeks, i tried everything but still the strange outputs...
Java

    @Override
    public JsonElement serialize(YggdrasilSerializable src, Type typeOfSrc, JsonSerializationContext context) {
        final JsonObject map = new JsonObject();

        ItemStack is = null;


        try {
            Fields f = new Fields(src);
            f.forEach(fieldContext -> {

                Object object;
                try {
                    if(fieldContext.isPrimitive()) {
                        object = fieldContext.getPrimitive();
                        map.add(fieldContext.getID(), new Gson().toJsonTree(object));
                    } else {
                        object = fieldContext.getObject();
                        map.add(fieldContext.getID(), new Gson().toJsonTree(object));
                    }

                    System.out.println("ID: "+fieldContext.getID() + "   - Data: "+object);
                } catch (StreamCorruptedException ex) {

                }
            });

            return map;

        } catch (Exception e) {
            throw new RuntimeException(e);
        }


//        return context.serialize(map, objectStringMapType);
    }
hazy pivot
#

in what way are you debugging this?

peak patio
#

basically

#

the PrintOut

#

or CustomLogger