Search in sources :

Example 6 with Career

use of org.spongepowered.api.data.type.Career in project SpongeForge by SpongePowered.

the class MixinVillagerCareer method registerTrades.

private void registerTrades() {
    Career career = SpongeForgeVillagerRegistry.fromNative((VillagerRegistry.VillagerCareer) (Object) this).get();
    for (int i = 0; i < this.trades.size(); i++) {
        int level = i + 1;
        List<EntityVillager.ITradeList> trades = this.trades.get(i);
        for (EntityVillager.ITradeList trade : trades) {
            SpongeVillagerRegistry.getInstance().addMutator(career, level, (TradeOfferListMutator) trade);
        }
    }
}
Also used : IMixinVillagerCareer(org.spongepowered.mod.interfaces.IMixinVillagerCareer) EntityVillager(net.minecraft.entity.passive.EntityVillager) Career(org.spongepowered.api.data.type.Career) SpongeCareer(org.spongepowered.common.entity.SpongeCareer) IMixinVillagerCareer(org.spongepowered.mod.interfaces.IMixinVillagerCareer)

Aggregations

Career (org.spongepowered.api.data.type.Career)6 SpongeCareer (org.spongepowered.common.entity.SpongeCareer)5 List (java.util.List)3 EntityVillager (net.minecraft.entity.passive.EntityVillager)2 MerchantRecipeList (net.minecraft.village.MerchantRecipeList)2 Profession (org.spongepowered.api.data.type.Profession)2 Vector3d (com.flowpowered.math.vector.Vector3d)1 Vector3i (com.flowpowered.math.vector.Vector3i)1 ImmutableList (com.google.common.collect.ImmutableList)1 TypeToken (com.google.common.reflect.TypeToken)1 Field (java.lang.reflect.Field)1 Instant (java.time.Instant)1 Random (java.util.Random)1 UUID (java.util.UUID)1 VillagerRegistry (net.minecraftforge.fml.common.registry.VillagerRegistry)1 LanternKeyFactory.makeImmutableBoundedValueKey (org.lanternpowered.server.data.key.LanternKeyFactory.makeImmutableBoundedValueKey)1 LanternKeyFactory.makeListKey (org.lanternpowered.server.data.key.LanternKeyFactory.makeListKey)1 LanternKeyFactory.makeMutableBoundedValueKey (org.lanternpowered.server.data.key.LanternKeyFactory.makeMutableBoundedValueKey)1 LanternKeyFactory.makeOptionalKey (org.lanternpowered.server.data.key.LanternKeyFactory.makeOptionalKey)1 LanternKeyFactory.makePatternListKey (org.lanternpowered.server.data.key.LanternKeyFactory.makePatternListKey)1