mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 09:27:43 +01:00
39 lines
2.5 KiB
Diff
39 lines
2.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: BillyGalbreath <Blake.Galbreath@Gmail.com>
|
|
Date: Tue, 25 Jan 2022 15:03:48 -0600
|
|
Subject: [PATCH] Option for villager display trade item
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/ShowTradesToPlayer.java b/src/main/java/net/minecraft/world/entity/ai/behavior/ShowTradesToPlayer.java
|
|
index c3e0b1f11b58668f9f24eb421abc340e1b49dfac..d809fa4f96e2c528075f544355397903996ecaf6 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/ShowTradesToPlayer.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/ShowTradesToPlayer.java
|
|
@@ -42,6 +42,7 @@ public class ShowTradesToPlayer extends Behavior<Villager> {
|
|
|
|
@Override
|
|
public boolean canStillUse(ServerLevel world, Villager entity, long time) {
|
|
+ if (!entity.level().purpurConfig.villagerDisplayTradeItem) return false; // Purpur
|
|
return this.checkExtraStartConditions(world, entity) && this.lookTime > 0 && entity.getBrain().getMemory(MemoryModuleType.INTERACTION_TARGET).isPresent();
|
|
}
|
|
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index 26351f5ba9fd4f2e231481cfdd52341e0f4d96a4..38ebf581f6abc16b7556057c05cead5c2bfaa0f7 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -2798,6 +2798,7 @@ public class PurpurWorldConfig {
|
|
public boolean villagerLobotomizeEnabled = false;
|
|
public int villagerLobotomizeCheckInterval = 100;
|
|
public boolean villagerLobotomizeWaitUntilTradeLocked = false;
|
|
+ public boolean villagerDisplayTradeItem = true;
|
|
private void villagerSettings() {
|
|
villagerRidable = getBoolean("mobs.villager.ridable", villagerRidable);
|
|
villagerRidableInWater = getBoolean("mobs.villager.ridable-in-water", villagerRidableInWater);
|
|
@@ -2831,6 +2832,7 @@ public class PurpurWorldConfig {
|
|
villagerLobotomizeEnabled = getBoolean("mobs.villager.lobotomize.enabled", villagerLobotomizeEnabled);
|
|
villagerLobotomizeCheckInterval = getInt("mobs.villager.lobotomize.check-interval", villagerLobotomizeCheckInterval);
|
|
villagerLobotomizeWaitUntilTradeLocked = getBoolean("mobs.villager.lobotomize.wait-until-trade-locked", villagerLobotomizeWaitUntilTradeLocked);
|
|
+ villagerDisplayTradeItem = getBoolean("mobs.villager.display-trade-item", villagerDisplayTradeItem);
|
|
}
|
|
|
|
public boolean vindicatorRidable = false;
|