feat: expose updateDemand and restock on Villager (#12608)
This commit is contained in:
parent
03efecf0d3
commit
3527ccdf2e
@ -419,6 +419,7 @@ public net.minecraft.world.entity.npc.Villager increaseMerchantCareer()V
|
||||
public net.minecraft.world.entity.npc.Villager numberOfRestocksToday
|
||||
public net.minecraft.world.entity.npc.Villager releaseAllPois()V
|
||||
public net.minecraft.world.entity.npc.Villager setUnhappy()V
|
||||
public net.minecraft.world.entity.npc.Villager updateDemand()V
|
||||
public net.minecraft.world.entity.npc.WanderingTrader getWanderTarget()Lnet/minecraft/core/BlockPos;
|
||||
public net.minecraft.world.entity.player.Abilities flyingSpeed
|
||||
public net.minecraft.world.entity.player.Abilities walkingSpeed
|
||||
|
@ -391,4 +391,21 @@ public interface Villager extends AbstractVillager {
|
||||
* reputation regardless of its impact and the player associated.
|
||||
*/
|
||||
public void clearReputations();
|
||||
|
||||
/**
|
||||
* Updates the demand for Villager offers.
|
||||
* Demand can rise and fall based on how often offers are traded.
|
||||
* They can fall when an item is not traded for a while, or rise when the item is resupplied next.
|
||||
* Demand is used to calculate the price of items in the Villager's offers.
|
||||
* <br>
|
||||
* <b>Note: Demand is stored per item and not per Villager.</b>
|
||||
*/
|
||||
public void updateDemand();
|
||||
|
||||
/**
|
||||
* Resets uses of all offers for the Villager. This also internally calls {@link #updateDemand()}.
|
||||
* Calling this will trigger a {@link org.bukkit.event.entity.VillagerReplenishTradeEvent} for each offer that is restocked.
|
||||
* Demand is still updated even if all events are canceled.
|
||||
*/
|
||||
public void restock();
|
||||
}
|
||||
|
@ -380,4 +380,14 @@ public class CraftVillager extends CraftAbstractVillager implements Villager {
|
||||
public void clearReputations() {
|
||||
getHandle().getGossips().gossips.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDemand() {
|
||||
getHandle().updateDemand();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restock() {
|
||||
getHandle().restock();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user