Nerfed spawner mobs should use PathfinderGoalFloat to swim if available

This commit is contained in:
Byteflux 2015-07-14 10:51:38 -07:00
parent 04705fd392
commit 8de3946478
3 changed files with 59 additions and 10 deletions

View File

@ -1,4 +1,4 @@
From ada098670b08f107d5ac8f7d10f3143cb9287d88 Mon Sep 17 00:00:00 2001
From ca5a9ea7df0a2f0fbe9f584560528dcc1cdb1605 Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Fri, 8 Aug 2014 22:51:26 -0500
Subject: [PATCH] Player affects spawning API

View File

@ -1,4 +1,4 @@
From cc44fb9af500fadaf4d1bd0440380feee1536194 Mon Sep 17 00:00:00 2001
From ee1f272094607998cf0e87fe3e4678f7364ec5e1 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Mon, 25 May 2015 15:37:00 -0500
Subject: [PATCH] mc-dev imports
@ -2144,6 +2144,35 @@ index 0000000..620685a
+ 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 0000000..6014b09
--- /dev/null
+++ b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
@@ -0,0 +1,23 @@
+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 0000000..794cdc8

View File

@ -1,26 +1,46 @@
From 9031da4fcbb0a318f997e732acb6d366f1f66b39 Mon Sep 17 00:00:00 2001
From 16d6d0c97aa09ddcdf5f1073b347306496d94437 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sat, 7 Mar 2015 21:03:06 -0600
Subject: [PATCH] Allow nerfed mobs to jump
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index 73cdd41..120e75b 100644
index f8aec29..e83d94f 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -460,6 +460,12 @@ public abstract class EntityInsentient extends EntityLiving {
@@ -33,6 +33,7 @@ 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);
@@ -460,6 +461,12 @@ 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
--
2.4.1.windows.1
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
index 6014b09..da019c1 100644
--- a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
+++ b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
@@ -6,6 +6,7 @@ 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