Package com.massivecraft.mcore.xlib.gson

Examples of com.massivecraft.mcore.xlib.gson.JsonElement


      if (!meta.hasStoredEnchants()) return;
      json.add(STORED_ENCHANTS, convertEnchantLevelMap(meta.getStoredEnchants()));
    }
    else
    {
      JsonElement element = json.get(STORED_ENCHANTS);
      if (element == null) return;
      // TODO: Add a pull request to get rid of this entry set loop!
      // TODO: A set, clear, remove all system is missing
      for (Entry<Enchantment, Integer> entry : convertEnchantLevelMap(element).entrySet())
      {
View Full Code Here


    List<String> ret = new ArrayList<String>();

    Iterator<JsonElement> iter = array.iterator();
    while (iter.hasNext())
    {
      JsonElement element = iter.next();
      ret.add(element.getAsString());
    }

    return ret;
  }
View Full Code Here

    boolean trail = TRAIL_DEFAULT;
    List<Color> colors = COLORS_DEFAULT;
    List<Color> fadeColors = FADE_COLORS_DEFAULT;
    Type type = TYPE_DEFAULT;
   
    JsonElement element;
   
    element = json.get(FLICKER);
    if (element != null)
    {
      flicker = element.getAsBoolean();
    }
   
    element = json.get(TRAIL);
    if (element != null)
    {
      trail = element.getAsBoolean();
    }
   
    element = json.get(COLORS);
    if (element != null)
    {
      colors = toColorCollection(element);
    }
   
    element = json.get(FADE_COLORS);
    if (element != null)
    {
      fadeColors = toColorCollection(element);
    }
   
    element = json.get(TYPE);
    if (element != null)
    {
      type = Type.valueOf(element.getAsString());
    }
   
    FireworkEffect ret = FireworkEffect.builder()
    .flicker(flicker)
    .trail(trail)
View Full Code Here

    List<Color> ret = new ArrayList<Color>();
   
    Iterator<JsonElement> iter = array.iterator();
    while (iter.hasNext())
    {
      JsonElement element = iter.next();
      ret.add(Color.fromRGB(element.getAsInt()));
    }
   
    return ret;
  }
View Full Code Here

TOP

Related Classes of com.massivecraft.mcore.xlib.gson.JsonElement

Copyright © 2018 www.massapicom. 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.