mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@850b736 Close PRs opened from orgs or bot accounts (#10281) PaperMC/Paper@54a2340 check if itemstack is stackable first (#10285) PaperMC/Paper@9c4bb0d add rich message component support to configuration (#10225) PaperMC/Paper@8870d22 Fire EntityDamageByEntityEvent for unowned wither skulls patch (#10244) PaperMC/Paper@bbc03d8 improve BanList types (#10239) PaperMC/Paper@ce5c8dd Configurable max block/fluid ticks (#10266) PaperMC/Paper@880fef7 Deprecate extra ban methods with raw BanEntry (#9580) PaperMC/Paper@60218cd Don't tick empty worlds (#9025) PaperMC/Paper@b21eb4d add overloads to use suspicious effect entry to mushroom cow and suspicious stew meta (#10245) PaperMC/Paper@89d51d5 Allow enabling sand duping (#10191) PaperMC/Paper@6ad63fb Per world ticks per spawn settings (#6891)
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 0135c477ca5e8401177083bcd41573d7e24ec850..a1b2c5ea3687fc0cfc3c1b9e170aa801c9cc541c 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -2788,6 +2788,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);
|
|
@@ -2821,6 +2822,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;
|