mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 05:47:45 +01:00
Nerfed spawner mobs should use PathfinderGoalFloat to swim if available
This commit is contained in:
parent
ee2b2ec193
commit
c17ecdd93f
@ -8,17 +8,39 @@ diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
private boolean bo;
|
||||
private Entity bp;
|
||||
private NBTTagCompound bq;
|
||||
+ public PathfinderGoalFloat goalFloat; // PaperSpigot
|
||||
|
||||
public EntityInsentient(World world) {
|
||||
super(world);
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
// Spigot Start
|
||||
if ( this.fromMobSpawner )
|
||||
{
|
||||
+ // PaperSpigot start - Allow nerfed mobs to jump
|
||||
+ this.world.methodProfiler.a("goalSelector");
|
||||
+ this.goalSelector.a();
|
||||
+ this.world.methodProfiler.c("jump");
|
||||
+ this.g.b();
|
||||
+ if (goalFloat != null) {
|
||||
+ if (goalFloat.a()) goalFloat.e();
|
||||
+ this.g.b();
|
||||
+ }
|
||||
+ // PaperSpigot end
|
||||
return;
|
||||
}
|
||||
// Spigot End
|
||||
--
|
||||
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
|
||||
+++ b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
|
||||
@@ -0,0 +0,0 @@ public class PathfinderGoalFloat extends PathfinderGoal {
|
||||
|
||||
public PathfinderGoalFloat(EntityInsentient entityinsentient) {
|
||||
this.a = entityinsentient;
|
||||
+ entityinsentient.goalFloat = this; // PaperSpigot
|
||||
this.a(4);
|
||||
((Navigation) entityinsentient.getNavigation()).d(true);
|
||||
}
|
||||
--
|
||||
1.9.5.msysgit.1
|
||||
|
||||
|
@ -2144,6 +2144,35 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ return this.id == MobEffectList.WEAKNESS.id ? (double) (-0.5F * (float) (i + 1)) : 1.3D * (double) (i + 1);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
|
||||
@@ -0,0 +0,0 @@
|
||||
+package net.minecraft.server;
|
||||
+
|
||||
+public class PathfinderGoalFloat extends PathfinderGoal {
|
||||
+
|
||||
+ private EntityInsentient a;
|
||||
+
|
||||
+ public PathfinderGoalFloat(EntityInsentient entityinsentient) {
|
||||
+ this.a = entityinsentient;
|
||||
+ this.a(4);
|
||||
+ ((Navigation) entityinsentient.getNavigation()).d(true);
|
||||
+ }
|
||||
+
|
||||
+ public boolean a() {
|
||||
+ return this.a.V() || this.a.ab();
|
||||
+ }
|
||||
+
|
||||
+ public void e() {
|
||||
+ if (this.a.bc().nextFloat() < 0.8F) {
|
||||
+ this.a.getControllerJump().a();
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityEnderChest.java b/src/main/java/net/minecraft/server/TileEntityEnderChest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
|
Loading…
Reference in New Issue
Block a user