-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Villager Trades cache and API to provide Villager trades manually (…
…#91) * Merge getModListVersion * Rename getModListVersion to getModListVersionForMobDrops * Cache Villager trades + IVillagerInfoProvider * Fix * helpers
- Loading branch information
Showing
10 changed files
with
574 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/java/com/kuba6000/mobsinfo/api/IVillagerInfoProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.kuba6000.mobsinfo.api; | ||
|
||
import java.util.ArrayList; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
import net.minecraft.entity.passive.EntityVillager; | ||
|
||
import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler; | ||
|
||
/** | ||
* You should add this interface on your villager handler (on a class that implements {@link IVillageTradeHandler}) | ||
*/ | ||
public interface IVillagerInfoProvider { | ||
|
||
/** | ||
* You should provide information about all the things that your handler can add to trade list: | ||
* | ||
* @param villager Villager | ||
* @param profession Profession id | ||
* @param trades Trade list, add trades to this list (use {@link VillagerTrade#create} to create drops) | ||
*/ | ||
void provideTrades(@Nonnull final EntityVillager villager, final int profession, | ||
@Nonnull ArrayList<VillagerTrade> trades); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.