Example usage for net.minecraftforge.common DungeonHooks removeDungeonMob

List of usage examples for net.minecraftforge.common DungeonHooks removeDungeonMob

Introduction

In this page you can find the example usage for net.minecraftforge.common DungeonHooks removeDungeonMob.

Prototype

public static int removeDungeonMob(EntityType<?> name) 

Source Link

Document

Will completely remove a Mob from the dungeon spawn list.

Usage

From source file:ccm.nucleumOmnium.dungeonMaster.DungeonMaster.java

License:Open Source License

public static void init() {
    Configuration config = new Configuration(new File(NucleumOmnium.getCCMFolder(), "DungeonMaster.cfg"));

    List<String> ourDungeonMobs = new ArrayList<String>();
    try {//from   www.  j  a  v  a  2s  . c  o m
        //noinspection unchecked
        ArrayList<DungeonHooks.DungeonMob> dungeonMobs = (ArrayList<DungeonHooks.DungeonMob>) dungeonMobsField
                .get(null);
        for (DungeonHooks.DungeonMob mob : dungeonMobs
                .toArray(new DungeonHooks.DungeonMob[dungeonMobs.size()])) {
            ourDungeonMobs.add(mob.type + ":" + mob.itemWeight);
            DungeonHooks.removeDungeonMob(mob.type);
        }
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }

    for (String thing : config.get(DUNGEONS_PAWNING, "dungeonList",
            ourDungeonMobs.toArray(new String[ourDungeonMobs.size()]), DUNGEON_LIST_HELP).getStringList()) {
        String[] split = thing.split(":");
        DungeonHooks.addDungeonMob(split[0], Integer.parseInt(split[1]));
    }

    config.save();
}