Class ActionAddWanderingTrade
java.lang.Object
com.blamejared.crafttweaker.api.action.villager.ActionTradeBase
com.blamejared.crafttweaker.api.action.villager.ActionAddWanderingTrade
- All Implemented Interfaces:
IAction,IRuntimeAction,IUndoableAction
-
Field Summary
Fields inherited from class com.blamejared.crafttweaker.api.action.villager.ActionTradeBase
level, profession -
Constructor Summary
ConstructorsConstructorDescriptionActionAddWanderingTrade(int level, net.minecraft.world.entity.npc.VillagerTrades.ItemListing trade) -
Method Summary
Modifier and TypeMethodDescriptionvoidapply()Applies the action, executing all code necessary.voiddescribe()Gets a human-readable description of the action.Gets a human-readable description of the action rollback.protected it.unimi.dsi.fastutil.ints.Int2ObjectMap<net.minecraft.world.entity.npc.VillagerTrades.ItemListing[]>voidundo()Undoes all changes carried out by the action.voidMethods inherited from class com.blamejared.crafttweaker.api.action.villager.ActionTradeBase
getLevel, getProfession, getTradeList, setTradeListMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.blamejared.crafttweaker.api.action.base.IAction
assertLoader, getDeclaredScriptPosition, shouldApplyOn, validate
-
Constructor Details
-
ActionAddWanderingTrade
public ActionAddWanderingTrade(int level, net.minecraft.world.entity.npc.VillagerTrades.ItemListing trade)
-
-
Method Details
-
getTrades
protected it.unimi.dsi.fastutil.ints.Int2ObjectMap<net.minecraft.world.entity.npc.VillagerTrades.ItemListing[]> getTrades()- Overrides:
getTradesin classActionTradeBase
-
apply
public void apply()Description copied from interface:IActionApplies the action, executing all code necessary. -
apply
- Specified by:
applyin classActionTradeBase
-
describe
Description copied from interface:IActionGets a human-readable description of the action.This message is used for logging and to surface information to the user when something goes wrong. It is thus customary to describe the action as accurately as possible without being too verbose.
It is not allowed to return a
nullor otherwise empty description for the action: doing so will raise an error at runtime.- Returns:
- A description of the current action.
-
undo
public void undo()Description copied from interface:IUndoableActionUndoes all changes carried out by the action. -
undo
- Specified by:
undoin classActionTradeBase
-
describeUndo
Description copied from interface:IUndoableActionGets a human-readable description of the action rollback.This message is used for logging and to surface information to the user when something goes wrong. It is thus customary to describe the rollback as accurately as possible without being too verbose.
It is not allowed to return a
nullor otherwise empty description for the rollback: doing so will raise an error at runtime.- Returns:
- A description of the current action rollback.
-