Interface IVillagerTradeRegistrationHandler
public interface IVillagerTradeRegistrationHandler
Manages the registration of components necessary to manipulate villager trades.
Refer to the documentation of the various methods for more information.
- Since:
- 9.1.0
-
Method Summary
Modifier and TypeMethodDescription<T extends net.minecraft.world.entity.npc.VillagerTrades.ItemListing>
voidregisterTradeConverter(Class<T> tradeClass, Function<T, CTTradeObject> tradeConverter) Registers a trade converter for the specified trade class.
-
Method Details
-
registerTradeConverter
<T extends net.minecraft.world.entity.npc.VillagerTrades.ItemListing> void registerTradeConverter(Class<T> tradeClass, Function<T, CTTradeObject> tradeConverter) Registers a trade converter for the specified trade class.A trade converter is defined as a function that obtains an object of the given type and transforms it into an instance of
CTTradeObject. This allows CraftTweaker to be able to understand the data of the trade and manipulate it as needed to allow for removal or inspection.- Type Parameters:
T- The type of the trade for which the converter is for.- Parameters:
tradeClass- TheClassof the trade for which the converter is being registered.tradeConverter- AFunctionthat can convert an object of the given class type into aCTTradeObjectso that it can be understood by CraftTweaker.- Since:
- 9.1.0
-