mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Fix riding speed of all flying mobs to honor generic.flyingSpeed attribute
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From 668c44f337c6b7f620fab17ba88b2b3cb809ad1b Mon Sep 17 00:00:00 2001
|
||||
From 0b558dadf8a216b1eea6c4835b85634df09d6c63 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 6 Feb 2020 19:53:59 -0600
|
||||
Subject: [PATCH] Ridables
|
||||
@@ -8,9 +8,9 @@ Subject: [PATCH] Ridables
|
||||
.../net/minecraft/server/ControllerMove.java | 6 +-
|
||||
.../java/net/minecraft/server/Entity.java | 63 +-
|
||||
.../net/minecraft/server/EntityAgeable.java | 2 +-
|
||||
.../java/net/minecraft/server/EntityBat.java | 40 ++
|
||||
.../java/net/minecraft/server/EntityBee.java | 117 +++-
|
||||
.../net/minecraft/server/EntityBlaze.java | 33 +
|
||||
.../java/net/minecraft/server/EntityBat.java | 54 ++
|
||||
.../java/net/minecraft/server/EntityBee.java | 118 +++-
|
||||
.../net/minecraft/server/EntityBlaze.java | 47 ++
|
||||
.../java/net/minecraft/server/EntityCat.java | 34 +-
|
||||
.../minecraft/server/EntityCaveSpider.java | 17 +
|
||||
.../net/minecraft/server/EntityChicken.java | 19 +
|
||||
@@ -26,7 +26,7 @@ Subject: [PATCH] Ridables
|
||||
.../net/minecraft/server/EntityEvoker.java | 22 +
|
||||
.../java/net/minecraft/server/EntityFish.java | 21 +-
|
||||
.../java/net/minecraft/server/EntityFox.java | 57 +-
|
||||
.../net/minecraft/server/EntityGhast.java | 28 +-
|
||||
.../net/minecraft/server/EntityGhast.java | 42 +-
|
||||
.../minecraft/server/EntityGiantZombie.java | 25 +
|
||||
.../net/minecraft/server/EntityGuardian.java | 47 +-
|
||||
.../minecraft/server/EntityGuardianElder.java | 17 +
|
||||
@@ -47,8 +47,8 @@ Subject: [PATCH] Ridables
|
||||
.../minecraft/server/EntityMushroomCow.java | 17 +
|
||||
.../net/minecraft/server/EntityOcelot.java | 19 +
|
||||
.../net/minecraft/server/EntityPanda.java | 47 +-
|
||||
.../net/minecraft/server/EntityParrot.java | 65 +-
|
||||
.../net/minecraft/server/EntityPhantom.java | 59 +-
|
||||
.../net/minecraft/server/EntityParrot.java | 77 ++-
|
||||
.../net/minecraft/server/EntityPhantom.java | 73 ++-
|
||||
.../java/net/minecraft/server/EntityPig.java | 48 +-
|
||||
.../net/minecraft/server/EntityPigZombie.java | 17 +
|
||||
.../net/minecraft/server/EntityPillager.java | 19 +
|
||||
@@ -72,12 +72,12 @@ Subject: [PATCH] Ridables
|
||||
.../minecraft/server/EntityTropicalFish.java | 17 +
|
||||
.../net/minecraft/server/EntityTurtle.java | 115 +++-
|
||||
.../net/minecraft/server/EntityTypes.java | 6 +
|
||||
.../java/net/minecraft/server/EntityVex.java | 36 +-
|
||||
.../java/net/minecraft/server/EntityVex.java | 61 +-
|
||||
.../net/minecraft/server/EntityVillager.java | 22 +
|
||||
.../server/EntityVillagerTrader.java | 18 +
|
||||
.../minecraft/server/EntityVindicator.java | 19 +
|
||||
.../net/minecraft/server/EntityWitch.java | 21 +-
|
||||
.../net/minecraft/server/EntityWither.java | 51 +-
|
||||
.../net/minecraft/server/EntityWither.java | 65 +-
|
||||
.../java/net/minecraft/server/EntityWolf.java | 121 ++--
|
||||
.../net/minecraft/server/EntityZombie.java | 19 +
|
||||
.../minecraft/server/EntityZombieHusk.java | 17 +
|
||||
@@ -96,7 +96,7 @@ Subject: [PATCH] Ridables
|
||||
.../controller/ControllerMoveWASDWater.java | 43 ++
|
||||
.../pathfinder/PathfinderGoalHasRider.java | 21 +
|
||||
.../craftbukkit/entity/CraftEntity.java | 27 +
|
||||
92 files changed, 3115 insertions(+), 200 deletions(-)
|
||||
92 files changed, 3222 insertions(+), 201 deletions(-)
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/controller/ControllerLookWASD.java
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/controller/ControllerMoveWASD.java
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDFlying.java
|
||||
@@ -284,10 +284,10 @@ index 3d27f0964a..822316a65f 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityBat.java b/src/main/java/net/minecraft/server/EntityBat.java
|
||||
index 34239160be..a6218158e1 100644
|
||||
index 34239160be..dfc2ce9729 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityBat.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityBat.java
|
||||
@@ -14,9 +14,32 @@ public class EntityBat extends EntityAmbient {
|
||||
@@ -14,9 +14,44 @@ public class EntityBat extends EntityAmbient {
|
||||
|
||||
public EntityBat(EntityTypes<? extends EntityBat> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -315,12 +315,33 @@ index 34239160be..a6218158e1 100644
|
||||
+ public double getMaxY() {
|
||||
+ return world.purpurConfig.batMaxY;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void e(Vec3D vec3d) {
|
||||
+ super.e(vec3d);
|
||||
+ if (hasRider() && !onGround) {
|
||||
+ float speed = (float) getAttributeInstance(GenericAttributes.FLYING_SPEED).getValue();
|
||||
+ setSpeed(speed);
|
||||
+ Vec3D mot = getMot();
|
||||
+ move(EnumMoveType.SELF, mot.multiply(speed, 1.0, speed));
|
||||
+ setMot(mot.a(0.9D));
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
protected void initDatawatcher() {
|
||||
super.initDatawatcher();
|
||||
@@ -95,6 +118,13 @@ public class EntityBat extends EntityAmbient {
|
||||
@@ -64,6 +99,8 @@ public class EntityBat extends EntityAmbient {
|
||||
protected void initAttributes() {
|
||||
super.initAttributes();
|
||||
this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(6.0D);
|
||||
+ this.getAttributeMap().b(GenericAttributes.FLYING_SPEED); // Purpur
|
||||
+ this.getAttributeInstance(GenericAttributes.FLYING_SPEED).setValue(0.6000000238418579D); // Purpur
|
||||
}
|
||||
|
||||
public boolean isAsleep() {
|
||||
@@ -95,6 +132,13 @@ public class EntityBat extends EntityAmbient {
|
||||
|
||||
@Override
|
||||
protected void mobTick() {
|
||||
@@ -334,7 +355,7 @@ index 34239160be..a6218158e1 100644
|
||||
super.mobTick();
|
||||
BlockPosition blockposition = new BlockPosition(this);
|
||||
BlockPosition blockposition1 = blockposition.up();
|
||||
@@ -229,4 +259,14 @@ public class EntityBat extends EntityAmbient {
|
||||
@@ -229,4 +273,14 @@ public class EntityBat extends EntityAmbient {
|
||||
protected float b(EntityPose entitypose, EntitySize entitysize) {
|
||||
return entitysize.height / 2.0F;
|
||||
}
|
||||
@@ -350,7 +371,7 @@ index 34239160be..a6218158e1 100644
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityBee.java b/src/main/java/net/minecraft/server/EntityBee.java
|
||||
index c7d79efdf6..fd0fd43070 100644
|
||||
index c7d79efdf6..7e4aad7716 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityBee.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityBee.java
|
||||
@@ -36,9 +36,7 @@ public class EntityBee extends EntityAnimal implements EntityBird {
|
||||
@@ -364,7 +385,7 @@ index c7d79efdf6..fd0fd43070 100644
|
||||
public void tick() {
|
||||
if (getEntity().locY() <= 0) {
|
||||
getEntity().setNoGravity(false);
|
||||
@@ -46,13 +44,54 @@ public class EntityBee extends EntityAnimal implements EntityBird {
|
||||
@@ -46,13 +44,55 @@ public class EntityBee extends EntityAnimal implements EntityBird {
|
||||
super.tick();
|
||||
}
|
||||
};
|
||||
@@ -408,20 +429,21 @@ index c7d79efdf6..fd0fd43070 100644
|
||||
+
|
||||
+ @Override
|
||||
+ public void e(Vec3D vec3d) {
|
||||
+ if (hasRider() && !onGround) {
|
||||
+ float speed = (float) this.getAttributeInstance(GenericAttributes.FLYING_SPEED).getValue();
|
||||
+ setSpeed(speed);
|
||||
+ move(EnumMoveType.SELF, getMot().multiply(speed, speed, speed));
|
||||
+ setMot(getMot().a(0.9D));
|
||||
+ }
|
||||
+ super.e(vec3d);
|
||||
+ if (hasRider() && !onGround) {
|
||||
+ float speed = (float) getAttributeInstance(GenericAttributes.FLYING_SPEED).getValue();
|
||||
+ setSpeed(speed);
|
||||
+ Vec3D mot = getMot();
|
||||
+ move(EnumMoveType.SELF, mot.multiply(speed, speed, speed));
|
||||
+ setMot(mot.a(0.9D));
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
protected void initDatawatcher() {
|
||||
super.initDatawatcher();
|
||||
@@ -67,6 +106,7 @@ public class EntityBee extends EntityAnimal implements EntityBird {
|
||||
@@ -67,6 +107,7 @@ public class EntityBee extends EntityAnimal implements EntityBird {
|
||||
|
||||
@Override
|
||||
protected void initPathfinder() {
|
||||
@@ -429,7 +451,7 @@ index c7d79efdf6..fd0fd43070 100644
|
||||
this.goalSelector.a(0, new EntityBee.b(this, 1.399999976158142D, true));
|
||||
this.goalSelector.a(1, new EntityBee.d());
|
||||
this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D));
|
||||
@@ -82,6 +122,7 @@ public class EntityBee extends EntityAnimal implements EntityBird {
|
||||
@@ -82,6 +123,7 @@ public class EntityBee extends EntityAnimal implements EntityBird {
|
||||
this.goalSelector.a(7, new EntityBee.g());
|
||||
this.goalSelector.a(8, new EntityBee.l());
|
||||
this.goalSelector.a(9, new PathfinderGoalFloat(this));
|
||||
@@ -437,7 +459,7 @@ index c7d79efdf6..fd0fd43070 100644
|
||||
this.targetSelector.a(1, (new EntityBee.h(this)).a(new Class[0]));
|
||||
this.targetSelector.a(2, new EntityBee.c(this));
|
||||
}
|
||||
@@ -588,6 +629,7 @@ public class EntityBee extends EntityAnimal implements EntityBird {
|
||||
@@ -588,6 +630,7 @@ public class EntityBee extends EntityAnimal implements EntityBird {
|
||||
|
||||
private d() {
|
||||
super(); // CraftBukkit - decompile error
|
||||
@@ -445,7 +467,7 @@ index c7d79efdf6..fd0fd43070 100644
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -648,6 +690,7 @@ public class EntityBee extends EntityAnimal implements EntityBird {
|
||||
@@ -648,6 +691,7 @@ public class EntityBee extends EntityAnimal implements EntityBird {
|
||||
|
||||
private g() {
|
||||
super(); // CraftBukkit - decompile error
|
||||
@@ -453,7 +475,7 @@ index c7d79efdf6..fd0fd43070 100644
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -712,6 +755,7 @@ public class EntityBee extends EntityAnimal implements EntityBird {
|
||||
@@ -712,6 +756,7 @@ public class EntityBee extends EntityAnimal implements EntityBird {
|
||||
|
||||
private i() {
|
||||
super(); // CraftBukkit - decompile error
|
||||
@@ -461,7 +483,7 @@ index c7d79efdf6..fd0fd43070 100644
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1230,4 +1274,67 @@ public class EntityBee extends EntityAnimal implements EntityBird {
|
||||
@@ -1230,4 +1275,67 @@ public class EntityBee extends EntityAnimal implements EntityBird {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -530,7 +552,7 @@ index c7d79efdf6..fd0fd43070 100644
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityBlaze.java b/src/main/java/net/minecraft/server/EntityBlaze.java
|
||||
index da6a3fa2c8..5d2d69cbf4 100644
|
||||
index da6a3fa2c8..1e220131ca 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityBlaze.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityBlaze.java
|
||||
@@ -10,6 +10,7 @@ public class EntityBlaze extends EntityMonster {
|
||||
@@ -541,7 +563,7 @@ index da6a3fa2c8..5d2d69cbf4 100644
|
||||
this.a(PathType.WATER, -1.0F);
|
||||
this.a(PathType.LAVA, 8.0F);
|
||||
this.a(PathType.DANGER_FIRE, 0.0F);
|
||||
@@ -17,13 +18,37 @@ public class EntityBlaze extends EntityMonster {
|
||||
@@ -17,13 +18,49 @@ public class EntityBlaze extends EntityMonster {
|
||||
this.f = 10;
|
||||
}
|
||||
|
||||
@@ -565,6 +587,18 @@ index da6a3fa2c8..5d2d69cbf4 100644
|
||||
+ public double getMaxY() {
|
||||
+ return world.purpurConfig.blazeMaxY;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void e(Vec3D vec3d) {
|
||||
+ super.e(vec3d);
|
||||
+ if (hasRider() && !onGround) {
|
||||
+ float speed = (float) getAttributeInstance(GenericAttributes.FLYING_SPEED).getValue();
|
||||
+ setSpeed(speed);
|
||||
+ Vec3D mot = getMot();
|
||||
+ move(EnumMoveType.SELF, mot.multiply(speed, 1.0, speed));
|
||||
+ setMot(mot.a(0.9D));
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
@@ -579,7 +613,16 @@ index da6a3fa2c8..5d2d69cbf4 100644
|
||||
this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this).a(new Class[0])); // Purpur - decompile error
|
||||
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
|
||||
}
|
||||
@@ -87,6 +112,14 @@ public class EntityBlaze extends EntityMonster {
|
||||
@@ -34,6 +71,8 @@ public class EntityBlaze extends EntityMonster {
|
||||
this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(6.0D);
|
||||
this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.23000000417232513D);
|
||||
this.getAttributeInstance(GenericAttributes.FOLLOW_RANGE).setValue(48.0D);
|
||||
+ this.getAttributeMap().b(GenericAttributes.FLYING_SPEED); // Purpur
|
||||
+ this.getAttributeInstance(GenericAttributes.FLYING_SPEED).setValue(0.6000000238418579D); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -87,6 +126,14 @@ public class EntityBlaze extends EntityMonster {
|
||||
this.damageEntity(DamageSource.DROWN, 1.0F);
|
||||
}
|
||||
|
||||
@@ -1655,10 +1698,10 @@ index 82a32d5dbf..4f53090d3d 100644
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityGhast.java b/src/main/java/net/minecraft/server/EntityGhast.java
|
||||
index e1c2540d14..6044625b12 100644
|
||||
index e1c2540d14..85e6c195f3 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityGhast.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityGhast.java
|
||||
@@ -14,11 +14,35 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
@@ -14,11 +14,47 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
this.moveController = new EntityGhast.ControllerGhast(this);
|
||||
}
|
||||
|
||||
@@ -1682,6 +1725,18 @@ index e1c2540d14..6044625b12 100644
|
||||
+ public double getMaxY() {
|
||||
+ return world.purpurConfig.ghastMaxY;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void e(Vec3D vec3d) {
|
||||
+ super.e(vec3d);
|
||||
+ if (hasRider() && !onGround) {
|
||||
+ float speed = (float) getAttributeInstance(GenericAttributes.FLYING_SPEED).getValue();
|
||||
+ setSpeed(speed);
|
||||
+ Vec3D mot = getMot();
|
||||
+ move(EnumMoveType.SELF, mot.multiply(speed, 1.0, speed));
|
||||
+ setMot(mot.a(0.9D));
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
@@ -1694,7 +1749,16 @@ index e1c2540d14..6044625b12 100644
|
||||
this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, (entityliving) -> {
|
||||
return Math.abs(entityliving.locY() - this.locY()) <= 4.0D;
|
||||
}));
|
||||
@@ -255,7 +279,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
@@ -60,6 +96,8 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
super.initAttributes();
|
||||
this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(10.0D);
|
||||
this.getAttributeInstance(GenericAttributes.FOLLOW_RANGE).setValue(100.0D);
|
||||
+ this.getAttributeMap().b(GenericAttributes.FLYING_SPEED); // Purpur
|
||||
+ this.getAttributeInstance(GenericAttributes.FLYING_SPEED).setValue(0.6000000238418579D); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -255,7 +293,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1703,7 +1767,7 @@ index e1c2540d14..6044625b12 100644
|
||||
|
||||
private final EntityGhast i;
|
||||
private int j;
|
||||
@@ -266,7 +290,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
@@ -266,7 +304,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2707,10 +2771,10 @@ index f50ed19080..87ed9a8ca0 100644
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityParrot.java b/src/main/java/net/minecraft/server/EntityParrot.java
|
||||
index 94e57a2d85..95b786a5a6 100644
|
||||
index 94e57a2d85..7ba2f3a351 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityParrot.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityParrot.java
|
||||
@@ -62,12 +62,71 @@ public class EntityParrot extends EntityPerchable implements EntityBird {
|
||||
@@ -62,12 +62,83 @@ public class EntityParrot extends EntityPerchable implements EntityBird {
|
||||
|
||||
public EntityParrot(EntityTypes<? extends EntityParrot> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -2778,12 +2842,24 @@ index 94e57a2d85..95b786a5a6 100644
|
||||
+ public double getMaxY() {
|
||||
+ return world.purpurConfig.parrotMaxY;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void e(Vec3D vec3d) {
|
||||
+ super.e(vec3d);
|
||||
+ if (hasRider() && !onGround) {
|
||||
+ float speed = (float) getAttributeInstance(GenericAttributes.FLYING_SPEED).getValue();
|
||||
+ setSpeed(speed);
|
||||
+ Vec3D mot = getMot();
|
||||
+ move(EnumMoveType.SELF, mot.multiply(speed, 1.0, speed));
|
||||
+ setMot(mot.a(0.9D));
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Nullable
|
||||
@Override
|
||||
public GroupDataEntity prepare(GeneratorAccess generatoraccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) {
|
||||
@@ -83,8 +142,10 @@ public class EntityParrot extends EntityPerchable implements EntityBird {
|
||||
@@ -83,8 +154,10 @@ public class EntityParrot extends EntityPerchable implements EntityBird {
|
||||
@Override
|
||||
protected void initPathfinder() {
|
||||
this.goalSit = new PathfinderGoalSit(this);
|
||||
@@ -2796,10 +2872,10 @@ index 94e57a2d85..95b786a5a6 100644
|
||||
this.goalSelector.a(2, this.goalSit);
|
||||
this.goalSelector.a(2, new PathfinderGoalFollowOwner(this, 1.0D, 5.0F, 1.0F, true));
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
index 90eeddb1af..850d5efff1 100644
|
||||
index 90eeddb1af..c3a5e24617 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
@@ -22,6 +22,28 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -22,6 +22,40 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
this.lookController = new EntityPhantom.f(this);
|
||||
}
|
||||
|
||||
@@ -2823,12 +2899,24 @@ index 90eeddb1af..850d5efff1 100644
|
||||
+ public double getMaxY() {
|
||||
+ return world.purpurConfig.phantomMaxY;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void e(Vec3D vec3d) {
|
||||
+ super.e(vec3d);
|
||||
+ if (hasRider() && !onGround) {
|
||||
+ float speed = (float) getAttributeInstance(GenericAttributes.FLYING_SPEED).getValue();
|
||||
+ setSpeed(speed);
|
||||
+ Vec3D mot = getMot();
|
||||
+ move(EnumMoveType.SELF, mot.multiply(speed, speed, speed));
|
||||
+ setMot(mot.a(0.9D));
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
protected EntityAIBodyControl o() {
|
||||
return new EntityPhantom.d(this);
|
||||
@@ -29,9 +51,11 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -29,9 +63,11 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
|
||||
@Override
|
||||
protected void initPathfinder() {
|
||||
@@ -2840,15 +2928,17 @@ index 90eeddb1af..850d5efff1 100644
|
||||
this.targetSelector.a(1, new EntityPhantom.b());
|
||||
}
|
||||
|
||||
@@ -39,6 +63,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -39,6 +75,9 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
protected void initAttributes() {
|
||||
super.initAttributes();
|
||||
this.getAttributeMap().b(GenericAttributes.ATTACK_DAMAGE);
|
||||
+ this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.01D); // Purpur
|
||||
+ this.getAttributeMap().b(GenericAttributes.FLYING_SPEED); // Purpur
|
||||
+ this.getAttributeInstance(GenericAttributes.FLYING_SPEED).setValue(0.6000000238418579D); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -103,7 +128,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -103,7 +142,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
|
||||
@Override
|
||||
public void movementTick() {
|
||||
@@ -2857,7 +2947,7 @@ index 90eeddb1af..850d5efff1 100644
|
||||
this.setOnFire(8);
|
||||
}
|
||||
|
||||
@@ -215,6 +240,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -215,6 +254,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
|
||||
@Override
|
||||
public boolean a() {
|
||||
@@ -2865,7 +2955,7 @@ index 90eeddb1af..850d5efff1 100644
|
||||
if (this.c > 0) {
|
||||
--this.c;
|
||||
return false;
|
||||
@@ -244,6 +270,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -244,6 +284,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
|
||||
@Override
|
||||
public boolean b() {
|
||||
@@ -2873,7 +2963,7 @@ index 90eeddb1af..850d5efff1 100644
|
||||
EntityLiving entityliving = EntityPhantom.this.getGoalTarget();
|
||||
|
||||
return entityliving != null ? EntityPhantom.this.a(entityliving, PathfinderTargetCondition.a) : false;
|
||||
@@ -258,6 +285,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -258,6 +299,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
|
||||
@Override
|
||||
public boolean a() {
|
||||
@@ -2881,7 +2971,7 @@ index 90eeddb1af..850d5efff1 100644
|
||||
EntityLiving entityliving = EntityPhantom.this.getGoalTarget();
|
||||
|
||||
return entityliving != null ? EntityPhantom.this.a(EntityPhantom.this.getGoalTarget(), PathfinderTargetCondition.a) : false;
|
||||
@@ -447,14 +475,23 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -447,14 +489,23 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2907,7 +2997,7 @@ index 90eeddb1af..850d5efff1 100644
|
||||
}
|
||||
|
||||
class d extends EntityAIBodyControl {
|
||||
@@ -470,7 +507,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -470,7 +521,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2916,7 +3006,7 @@ index 90eeddb1af..850d5efff1 100644
|
||||
|
||||
private float j = 0.1F;
|
||||
|
||||
@@ -479,7 +516,19 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -479,7 +530,19 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -4107,10 +4197,10 @@ index 4100e367a4..a0d932c403 100644
|
||||
if (this.bg == null) {
|
||||
this.bg = SystemUtils.a("entity", IRegistry.ENTITY_TYPE.getKey(this));
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityVex.java b/src/main/java/net/minecraft/server/EntityVex.java
|
||||
index cf274666c7..d5605d412b 100644
|
||||
index cf274666c7..d890f7bdfa 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityVex.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityVex.java
|
||||
@@ -19,6 +19,28 @@ public class EntityVex extends EntityMonster {
|
||||
@@ -19,6 +19,50 @@ public class EntityVex extends EntityMonster {
|
||||
this.f = 3;
|
||||
}
|
||||
|
||||
@@ -4134,12 +4224,43 @@ index cf274666c7..d5605d412b 100644
|
||||
+ public double getMaxY() {
|
||||
+ return world.purpurConfig.vexMaxY;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void e(Vec3D vec3d) {
|
||||
+ super.e(vec3d);
|
||||
+ if (hasRider()) {
|
||||
+ float speed;
|
||||
+ if (onGround) {
|
||||
+ speed = (float) getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue() * 0.1F;
|
||||
+ } else {
|
||||
+ speed = (float) getAttributeInstance(GenericAttributes.FLYING_SPEED).getValue();
|
||||
+ }
|
||||
+ setSpeed(speed);
|
||||
+ Vec3D mot = getMot();
|
||||
+ move(EnumMoveType.SELF, mot.multiply(speed, 1.0, speed));
|
||||
+ setMot(mot.a(0.9D));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean b(float f, float f1) {
|
||||
+ return false; // no fall damage please
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public void move(EnumMoveType enummovetype, Vec3D vec3d) {
|
||||
super.move(enummovetype, vec3d);
|
||||
@@ -42,10 +64,12 @@ public class EntityVex extends EntityMonster {
|
||||
@@ -27,7 +71,7 @@ public class EntityVex extends EntityMonster {
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
- this.noclip = true;
|
||||
+ this.noclip = !hasRider(); // Purpur
|
||||
super.tick();
|
||||
this.noclip = false;
|
||||
this.setNoGravity(true);
|
||||
@@ -42,10 +86,12 @@ public class EntityVex extends EntityMonster {
|
||||
protected void initPathfinder() {
|
||||
super.initPathfinder();
|
||||
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||
@@ -4152,7 +4273,16 @@ index cf274666c7..d5605d412b 100644
|
||||
this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); // CraftBukkit - decompile error
|
||||
this.targetSelector.a(2, new EntityVex.b(this));
|
||||
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
|
||||
@@ -287,14 +311,22 @@ public class EntityVex extends EntityMonster {
|
||||
@@ -56,6 +102,8 @@ public class EntityVex extends EntityMonster {
|
||||
super.initAttributes();
|
||||
this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(14.0D);
|
||||
this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(4.0D);
|
||||
+ this.getAttributeMap().b(GenericAttributes.FLYING_SPEED); // Purpur
|
||||
+ this.getAttributeInstance(GenericAttributes.FLYING_SPEED).setValue(0.6000000238418579D); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -287,14 +335,21 @@ public class EntityVex extends EntityMonster {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4168,7 +4298,6 @@ index cf274666c7..d5605d412b 100644
|
||||
+ // Purpur start
|
||||
+ public void tick(EntityHuman rider) {
|
||||
+ super.tick(rider);
|
||||
+ getEntity().noclip = false;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
@@ -4328,7 +4457,7 @@ index 1432d3f6bf..447387bd78 100644
|
||||
this.targetSelector.a(2, this.bz);
|
||||
this.targetSelector.a(3, this.bA);
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java
|
||||
index 8977c3516b..459d85baa0 100644
|
||||
index 8977c3516b..293afeb23b 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityWither.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityWither.java
|
||||
@@ -18,7 +18,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
@@ -4340,7 +4469,7 @@ index 8977c3516b..459d85baa0 100644
|
||||
private static final DataWatcherObject<Integer> bx = DataWatcher.a(EntityWither.class, DataWatcherRegistry.b);
|
||||
private final float[] by = new float[2];
|
||||
private final float[] bz = new float[2];
|
||||
@@ -39,15 +39,47 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
@@ -39,15 +39,59 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
this.setHealth(this.getMaxHealth());
|
||||
this.getNavigation().d(true);
|
||||
this.f = 50;
|
||||
@@ -4369,6 +4498,18 @@ index 8977c3516b..459d85baa0 100644
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void e(Vec3D vec3d) {
|
||||
+ super.e(vec3d);
|
||||
+ if (hasRider() && !onGround) {
|
||||
+ float speed = (float) getAttributeInstance(GenericAttributes.FLYING_SPEED).getValue();
|
||||
+ setSpeed(speed);
|
||||
+ Vec3D mot = getMot();
|
||||
+ move(EnumMoveType.SELF, mot.multiply(speed, 0.5, speed));
|
||||
+ setMot(mot.a(0.9D));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void onMount(EntityHuman entityhuman) {
|
||||
+ this.datawatcher.set(targetList().get(0), 0);
|
||||
+ this.datawatcher.set(targetList().get(1), 0);
|
||||
@@ -4389,7 +4530,7 @@ index 8977c3516b..459d85baa0 100644
|
||||
this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, new Class[0]));
|
||||
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityInsentient.class, 0, false, false, EntityWither.bG));
|
||||
}
|
||||
@@ -125,7 +157,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
@@ -125,7 +169,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
}
|
||||
|
||||
this.setMot(vec3d);
|
||||
@@ -4398,7 +4539,7 @@ index 8977c3516b..459d85baa0 100644
|
||||
this.yaw = (float) MathHelper.d(vec3d.z, vec3d.x) * 57.295776F - 90.0F;
|
||||
}
|
||||
|
||||
@@ -189,6 +221,13 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
@@ -189,6 +233,13 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
|
||||
@Override
|
||||
protected void mobTick() {
|
||||
@@ -4412,7 +4553,16 @@ index 8977c3516b..459d85baa0 100644
|
||||
int i;
|
||||
|
||||
if (this.eq() > 0) {
|
||||
@@ -523,11 +562,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
@@ -512,6 +563,8 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.6000000238418579D);
|
||||
this.getAttributeInstance(GenericAttributes.FOLLOW_RANGE).setValue(40.0D);
|
||||
this.getAttributeInstance(GenericAttributes.ARMOR).setValue(4.0D);
|
||||
+ this.getAttributeMap().b(GenericAttributes.FLYING_SPEED); // Purpur
|
||||
+ this.getAttributeInstance(GenericAttributes.FLYING_SPEED).setValue(0.6000000238418579D); // Purpur
|
||||
}
|
||||
|
||||
public int eq() {
|
||||
@@ -523,11 +576,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
}
|
||||
|
||||
public int getHeadTarget(int i) {
|
||||
@@ -4426,7 +4576,7 @@ index 8977c3516b..459d85baa0 100644
|
||||
}
|
||||
|
||||
public boolean J_() {
|
||||
@@ -541,7 +580,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
@@ -541,7 +594,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
|
||||
@Override
|
||||
protected boolean n(Entity entity) {
|
||||
|
||||
Reference in New Issue
Block a user