Add config for villager trading

This commit is contained in:
Ben Kerllenevich
2025-01-11 17:29:39 -08:00
committed by granny
parent f399f40924
commit fd21066058
6 changed files with 33 additions and 80 deletions

View File

@@ -14,6 +14,14 @@
@Override
public Brain<Villager> getBrain() {
return (Brain<Villager>)super.getBrain();
@@ -365,6 +_,7 @@
return InteractionResult.CONSUME;
}
+ if (this.level().purpurConfig.villagerAllowTrading) // Purpur - Add config for villager trading
this.startTrading(player);
}
@@ -707,7 +_,7 @@
@Override

View File

@@ -14,3 +14,14 @@
@Override
protected void registerGoals() {
this.goalSelector.addGoal(0, new FloatGoal(this));
@@ -133,8 +_,10 @@
return InteractionResult.CONSUME;
}
+ if (this.level().purpurConfig.wanderingTraderAllowTrading) { // Purpur - Add config for villager trading
this.setTradingPlayer(player);
this.openTradingScreen(player, this.getDisplayName(), 1);
+ } // Purpur - Add config for villager trading
}
return InteractionResult.SUCCESS;