mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
Fix entities targetting while being ridden
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
From 6538d3e373f0bc9b0e65ac3c1a60047dab92a874 Mon Sep 17 00:00:00 2001
|
||||
From 14e75a22b2727e6dee6075860a42f6855535490d Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 12 May 2019 00:43:12 -0500
|
||||
Subject: [PATCH] Make giants naturally spawn and have AI
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/BiomeBase.java | 1 +
|
||||
.../java/net/minecraft/server/Biomes.java | 25 ++++++++++
|
||||
.../minecraft/server/EntityGiantZombie.java | 48 ++++++++++++++++++-
|
||||
.../java/net/minecraft/server/Biomes.java | 25 ++++++++++++
|
||||
.../minecraft/server/EntityGiantZombie.java | 39 +++++++++++++++++--
|
||||
.../minecraft/server/EntityInsentient.java | 2 +
|
||||
.../net/minecraft/server/SpawnerCreature.java | 8 ++++
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 7 +++
|
||||
6 files changed, 89 insertions(+), 2 deletions(-)
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 7 ++++
|
||||
6 files changed, 78 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java
|
||||
index 0102a170d..963709846 100644
|
||||
@@ -60,10 +60,10 @@ index 12742870c..d1f8695fe 100644
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityGiantZombie.java b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
index b7e2022b1..c2408e721 100644
|
||||
index 12a96750c..4aaf4ea6c 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
@@ -21,11 +21,55 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
@@ -21,14 +21,27 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
super.initAttributes();
|
||||
this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(100.0D);
|
||||
this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.5D);
|
||||
@@ -71,30 +71,33 @@ index b7e2022b1..c2408e721 100644
|
||||
+ this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(12.0D); // Purpur - match ravager damage
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ protected void initPathfinder() {
|
||||
// Purpur start
|
||||
@Override
|
||||
protected void initPathfinder() {
|
||||
- this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
- this.targetSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
+ if (net.pl3x.purpur.PurpurConfig.giantsHaveAI) {
|
||||
+ this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
+ this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false));
|
||||
+ this.goalSelector.a(7, new PathfinderGoalRandomStrollLand(this, 1.0D));
|
||||
+ this.goalSelector.a(8, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 16.0F));
|
||||
+ this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
|
||||
+ this.goalSelector.a(5, new PathfinderGoalMoveTowardsRestriction(this, 1.0D));
|
||||
+ this.targetSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
+ this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this).a(EntityPigZombie.class));
|
||||
+ this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
|
||||
+ this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillager.class, false));
|
||||
+ this.targetSelector.a(4, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true));
|
||||
+ this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, true));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public float dp() { // jump height
|
||||
+ // make giants jump as high as everything else relative to their size
|
||||
+ // 1.0 makes bottom of feet about as high as their waist when they jump
|
||||
+ return 1.0F;
|
||||
+ }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -37,10 +50,28 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
// 1.0 makes bottom of feet about as high as their waist when they jump
|
||||
return 1.0F;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public GroupDataEntity prepare(GeneratorAccess world, DifficultyDamageScaler difficulty, EnumMobSpawn enummobspawn, GroupDataEntity groupDataEntity, NBTTagCompound nbt) {
|
||||
@@ -113,8 +116,8 @@ index b7e2022b1..c2408e721 100644
|
||||
+ setSlot(EnumItemSlot.MAINHAND, new ItemStack(Items.IRON_SWORD));
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
// Purpur end
|
||||
|
||||
@Override
|
||||
public float a(BlockPosition blockposition, IWorldReader iworldreader) {
|
||||
- return iworldreader.w(blockposition) - 0.5F;
|
||||
|
||||
Reference in New Issue
Block a user