Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lobotomize Villager Bug #1629

Open
3 of 4 tasks
Potothingi opened this issue Jan 7, 2025 · 0 comments
Open
3 of 4 tasks

Lobotomize Villager Bug #1629

Potothingi opened this issue Jan 7, 2025 · 0 comments

Comments

@Potothingi
Copy link

Spark link

https://spark.lucko.me/aKlGgISQYr

Expected behavior

Lobotomized villagers restock their trades.

Observed/Actual behavior

Lobotomized villagers do not restock trades.

Steps/models to reproduce

Trade with lobotomized villagers and wait for them to restock their items.

Purpur version

Current Purpur Version: 1.21.3-2358-16ce24a (MC: 1.21.3)*

  • You are running the latest version

Agreements

  • I am running the latest version of Purpur available from https://purpurmc.org/downloads.
  • I have searched for and ensured there isn't already an open issue regarding this.
  • I ticked all the boxes without actually reading them
  • My version of Minecraft is supported by Purpur.

Other

This bug appears to be caused by a missing piece of code:
else if (this.isLobotomized && shouldRestock()) restock(); // Purpur

1.21.1:

+ // Purpur start
+ if (this.level().purpurConfig.villagerLobotomizeEnabled) {
+ // treat as inactive if lobotomized
+ inactive = inactive || checkLobotomized();
+ } else {
+ this.isLobotomized = false;
+ }
+ // Purpur end
// Pufferfish start
if (!inactive && (getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) { // Purpur - only use brain if no rider
this.getBrain().tick((ServerLevel) this.level(), this); // Paper
}
+ else if (this.isLobotomized && shouldRestock()) restock(); // Purpur
// Pufferfish end
this.level().getProfiler().pop();
if (this.assignProfessionWhenSpawned) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java

1.21.3:

+ // Purpur start
+ if (this.level().purpurConfig.villagerLobotomizeEnabled) {
+ // treat as inactive if lobotomized
+ inactive = inactive || checkLobotomized();
+ } else {
+ this.isLobotomized = false;
+ }
+ // Purpur end
// Pufferfish start
if (!inactive && (getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) {
this.getBrain().tick(world, this); // Paper // Purpur
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant