Package cofh.lib.util

Examples of cofh.lib.util.WeightedRandomNBTTag


          log.error("Invalid entity entry!");
          return null;
        }
        data.setString("EntityId", type);
      }
      return new WeightedRandomNBTTag(genObject.get("weight").getAsInt(), data);
    } else {
      String type = genElement.getAsString();
      if (type == null) {
        log.error("Invalid entity entry!");
        return null;
      }
      NBTTagCompound tag = new NBTTagCompound();
      tag.setString("EntityId", type);
      return new WeightedRandomNBTTag(100, tag);
    }
  }
View Full Code Here


    if (genElement.isJsonArray()) {
      JsonArray blockList = genElement.getAsJsonArray();

      for (int i = 0, e = blockList.size(); i < e; i++) {
        WeightedRandomNBTTag entry = parseEntityEntry(blockList.get(i));
        if (entry == null) {
          return false;
        }
        list.add(entry);
      }
    } else {
      WeightedRandomNBTTag entry = parseEntityEntry(genElement);
      if (entry == null) {
        return false;
      }
      list.add(entry);
    }
View Full Code Here

        if (!FeatureParser.parseEntityList(entry.get("spawnEntity"), mobList)) {
          log.warn("Entry specifies invalid entity list for 'dungeon' generator! Using 'Pig'!");
          mobList.clear();
          NBTTagCompound tag = new NBTTagCompound();
          tag.setString("EntityId", "Pig");
          mobList.add(new WeightedRandomNBTTag(100, tag));
        }
      } else {
        log.warn("Entry specifies invalid entity list for 'dungeon' generator! Using 'Pig'!");
        NBTTagCompound tag = new NBTTagCompound();
        tag.setString("EntityId", "Pig");
        mobList.add(new WeightedRandomNBTTag(100, tag));
      }
      WorldGenDungeon r = new WorldGenDungeon(resList, matList, mobList);
      if (entry.has("spawnerFloor")) {
        resList = new ArrayList<WeightedRandomBlock>();
        if (FeatureParser.parseResList(entry.get("spawnerFloor"), resList)) {
View Full Code Here

TOP

Related Classes of cofh.lib.util.WeightedRandomNBTTag

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.