From 224d9335649144c3bb62f738f7824ef37cfdd8ca Mon Sep 17 00:00:00 2001 From: CovertJaguar Date: Mon, 7 Jan 2013 14:55:17 -0800 Subject: [PATCH] Added an accessor for villagers --- .../mods/fml/common/registry/VillagerRegistry.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/fml/common/cpw/mods/fml/common/registry/VillagerRegistry.java b/fml/common/cpw/mods/fml/common/registry/VillagerRegistry.java index 7fd8b323f..e5068ab2d 100644 --- a/fml/common/cpw/mods/fml/common/registry/VillagerRegistry.java +++ b/fml/common/cpw/mods/fml/common/registry/VillagerRegistry.java @@ -4,6 +4,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Random; +import java.util.Collection; +import java.util.Collections; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.item.Item; @@ -148,7 +150,16 @@ public class VillagerRegistry } return defaultSkin; } - + + /** + * Returns a list of all added villager types + * + * @return newVillagerIds + */ + public static Collection getRegisteredVillagers() + { + return Collections.unmodifiableCollection(instance().newVillagerIds); + } /** * Callback to handle trade setup for villagers *