Yatopia/patches/Purpur/patches/server/0025-Illusioners-AI-setting...

52 lines
2.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Fri, 5 Jul 2019 11:09:25 -0500
Subject: [PATCH] Illusioners AI settings
diff --git a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
index 50442b3a498d1bab4270e69952a79f5182153ece..c57bf5091430709778dc21d70c8a32819c9d6639 100644
--- a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
+++ b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
@@ -19,6 +19,15 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan
}
+ // Purpur start
+ @Override
+ protected void initAttributes() {
+ this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(this.world.purpurConfig.illusionerMovementSpeed);
+ this.getAttributeInstance(GenericAttributes.FOLLOW_RANGE).setValue(this.world.purpurConfig.illusionerFollowRange);
+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.illusionerMaxHealth);
+ }
+ // Purpur end
+
@Override
protected void initPathfinder() {
super.initPathfinder();
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 3207b8b6166bd28796cb9c199c3ab466f7c0a02e..5c716a6b4f9ff33912ebb274b36eef70679ea87b 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -135,6 +135,20 @@ public class PurpurWorldConfig {
giantMaxHealth = getDouble("mobs.giant.attributes.max-health", giantMaxHealth);
}
+ public double illusionerMovementSpeed = 0.5D;
+ public double illusionerFollowRange = 18.0D;
+ public double illusionerMaxHealth = 32.0D;
+ private void illusionerSettings() {
+ illusionerMovementSpeed = getDouble("mobs.illusioner.movement-speed", illusionerMovementSpeed);
+ illusionerFollowRange = getDouble("mobs.illusioner.follow-range", illusionerFollowRange);
+ if (PurpurConfig.version < 8) {
+ double oldValue = getDouble("mobs.illusioner.max-health", illusionerMaxHealth);
+ set("mobs.illusioner.attributes.max-health", oldValue);
+ set("mobs.illusioner.max-health", null);
+ }
+ illusionerMaxHealth = getDouble("mobs.illusioner.attributes.max-health", illusionerMaxHealth);
+ }
+
public int villagerBrainTicks = 1;
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
private void villagerSettings() {