public void setProperty(final String path, final Location loc) { set((path == null ? "" : path + ".") + "world", loc.getWorld().getName()); set((path == null ? "" : path + ".") + "x", loc.getX()); set((path == null ? "" : path + ".") + "y", loc.getY()); set((path == null ? "" : path + ".") + "z", loc.getZ()); set((path == null ? "" : path + ".") + "yaw", loc.getYaw()); set((path == null ? "" : path + ".") + "pitch", loc.getPitch()); }
public void setProperty(final String path, final ItemStack stack) { final Map<String, Object> map = new HashMap<String, Object>(); map.put("type", stack.getType().toString()); map.put("amount", stack.getAmount()); map.put("damage", stack.getDurability()); Map<Enchantment, Integer> enchantments = stack.getEnchantments(); if (!enchantments.isEmpty()) { Map<String, Integer> enchant = new HashMap<String, Integer>(); for (Map.Entry<Enchantment, Integer> entry : enchantments.entrySet()) { enchant.put(entry.getKey().getName().toLowerCase(Locale.ENGLISH), entry.getValue()); } map.put("enchant", enchant); } // getData().getData() is broken // map.put("data", stack.getDurability()); set(path, map); }
public void removeProperty(String path) { set(path, null); }
public void setProperty(String path, Object object) { set(path, object); }
public void setProperty(final String path, final BigDecimal bigDecimal) { set(path, bigDecimal.toString()); }
public void setProperty(String path, Map object) { set(path, new LinkedHashMap(object)); }
public void setProperty(String path, List object) { set(path, new ArrayList(object)); }