Search in sources :

Example 1 with AddEntityTrophy

use of trofers.common.loot.AddEntityTrophy in project trofers by ochotonida.

the class LootModifiers method start.

protected void start() {
    for (String modid : trophies.trophies.keySet()) {
        HashMap<EntityType<?>, ResourceLocation> trophyMap = new HashMap<>();
        for (Trophy trophy : trophies.trophies.get(modid)) {
            // noinspection ConstantConditions
            EntityType<?> entityType = trophy.entity().getType();
            trophyMap.put(entityType, trophy.id());
        }
        ILootCondition[] conditions = new ILootCondition[] { KilledByPlayer.killedByPlayer().build(), RandomTrophyChanceCondition.randomTrophyChance().build() };
        AddEntityTrophy modifier = new AddEntityTrophy(conditions, ModItems.SMALL_PLATE.get(), trophyMap);
        String name = Trofers.MODID.equals(modid) ? "vanilla" : modid;
        name = name + "_trophies";
        add(name, ModLootModifiers.ADD_ENTITY_TROPHY.get(), modifier);
    }
}
Also used : EntityType(net.minecraft.entity.EntityType) AddEntityTrophy(trofers.common.loot.AddEntityTrophy) Trophy(trofers.common.trophy.Trophy) HashMap(java.util.HashMap) AddEntityTrophy(trofers.common.loot.AddEntityTrophy) ResourceLocation(net.minecraft.util.ResourceLocation) ILootCondition(net.minecraft.loot.conditions.ILootCondition)

Aggregations

HashMap (java.util.HashMap)1 EntityType (net.minecraft.entity.EntityType)1 ILootCondition (net.minecraft.loot.conditions.ILootCondition)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 AddEntityTrophy (trofers.common.loot.AddEntityTrophy)1 Trophy (trofers.common.trophy.Trophy)1