Disable the Villager brain

This commit is contained in:
tr7zw 2020-06-19 21:47:12 +02:00
parent bb3dfd8d01
commit 59c2ec04d5

View File

@ -1,4 +1,4 @@
From 305dd8622536f1bd9fc924945f51d3dde8179353 Mon Sep 17 00:00:00 2001
From 372230cb1a8d97665f82a7743d24c5cb6e98b52d Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
Date: Fri, 19 Jun 2020 19:21:35 +0200
Subject: [PATCH] Option for simpler Villagers
@ -6,8 +6,8 @@ Subject: [PATCH] Option for simpler Villagers
Option to extremly simplefy the villager AI.
---
src/main/java/de/tr7zw/yapfa/YapfaConfig.java | 10 +++
.../net/minecraft/server/EntityVillager.java | 83 ++++++++++++++++++-
2 files changed, 91 insertions(+), 2 deletions(-)
.../net/minecraft/server/EntityVillager.java | 85 ++++++++++++++++++-
2 files changed, 92 insertions(+), 3 deletions(-)
diff --git a/src/main/java/de/tr7zw/yapfa/YapfaConfig.java b/src/main/java/de/tr7zw/yapfa/YapfaConfig.java
index 78d21c2ea..5af955493 100644
@ -30,7 +30,7 @@ index 78d21c2ea..5af955493 100644
}
\ No newline at end of file
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
index 7da267d28..48f0d8127 100644
index 7da267d28..4c819d2e2 100644
--- a/src/main/java/net/minecraft/server/EntityVillager.java
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
@@ -6,6 +6,8 @@ import com.google.common.collect.ImmutableSet;
@ -115,7 +115,7 @@ index 7da267d28..48f0d8127 100644
BehaviorController<EntityVillager> behaviorcontroller = new BehaviorController<>(EntityVillager.bN, EntityVillager.bO, dynamic);
this.a(behaviorcontroller);
@@ -153,10 +198,42 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
@@ -153,12 +198,44 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
}
// Spigot End
@ -156,8 +156,11 @@ index 7da267d28..48f0d8127 100644
+ }
+ // YAPFA end
this.world.getMethodProfiler().enter("brain");
if (!inactive) this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper
- if (!inactive) this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper
+ if(!simplerVillagerBehavior) if (!inactive) this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper // YAPFA
this.world.getMethodProfiler().exit();
if (!this.et() && this.bB > 0) {
--this.bB;
@@ -556,6 +633,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
}