예제 #1
0
 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());
 }
예제 #2
0
 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);
 }
예제 #3
0
 public void removeProperty(String path) {
   set(path, null);
 }
예제 #4
0
 public void setProperty(String path, Object object) {
   set(path, object);
 }
예제 #5
0
 public void setProperty(final String path, final BigDecimal bigDecimal) {
   set(path, bigDecimal.toString());
 }
예제 #6
0
 public void setProperty(String path, Map object) {
   set(path, new LinkedHashMap(object));
 }
예제 #7
0
 public void setProperty(String path, List object) {
   set(path, new ArrayList(object));
 }