Implement Rabbit types.

By: FearThe137 <admin@fearthe1337.com>
This commit is contained in:
CraftBukkit/Spigot
2014-12-06 22:45:51 +01:00
parent b716a25578
commit 81fb4d905d
3 changed files with 105 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
--- ../work/decompile-8eb82bde//net/minecraft/server/EntityInsentient.java 2014-11-28 17:43:43.105707435 +0000
+++ src/main/java/net/minecraft/server/EntityInsentient.java 2014-11-28 17:38:23.000000000 +0000
--- ../work/decompile-8eb82bde//net/minecraft/server/EntityInsentient.java Sat Dec 6 21:48:11 2014
+++ src/main/java/net/minecraft/server/EntityInsentient.java Sat Dec 6 21:18:38 2014
@@ -4,6 +4,15 @@
import java.util.List;
import java.util.UUID;
@@ -16,6 +16,17 @@
public abstract class EntityInsentient extends EntityLiving {
public int a_;
@@ -13,8 +22,8 @@
protected ControllerJump g;
private EntityAIBodyControl b;
protected NavigationAbstract navigation;
- protected final PathfinderGoalSelector goalSelector;
- protected final PathfinderGoalSelector targetSelector;
+ public PathfinderGoalSelector goalSelector; // PAIL protected final to public
+ public PathfinderGoalSelector targetSelector; // PAIL protected final to public
private EntityLiving goalTarget;
private EntitySenses bi;
private ItemStack[] equipment = new ItemStack[5];
@@ -39,7 +48,9 @@
for (int i = 0; i < this.dropChances.length; ++i) {
this.dropChances[i] = 0.085F;
@@ -161,4 +172,4 @@
+ this.world.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit
this.unleash(false, true);
}
}
}

View File

@@ -0,0 +1,25 @@
--- ../work/decompile-8eb82bde//net/minecraft/server/EntityRabbit.java Sat Dec 6 21:44:10 2014
+++ src/main/java/net/minecraft/server/EntityRabbit.java Sat Dec 6 21:33:23 2014
@@ -21,6 +21,12 @@
this.g = new ControllerJumpRabbit(this, this);
this.moveController = new ControllerMoveRabbit(this);
((Navigation) this.getNavigation()).a(true);
+ this.initializePathFinderGoals(); // CraftBukkit - moved code
+ this.b(0.0D);
+ }
+
+ // CraftBukkit start - code from constructor
+ public void initializePathFinderGoals(){
this.navigation.a(2.5F);
this.goalSelector.a(1, new PathfinderGoalFloat(this));
this.goalSelector.a(1, new PathfinderGoalRabbitPanic(this, 1.33D));
@@ -31,8 +37,8 @@
this.goalSelector.a(11, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 10.0F));
this.bk = new PathfinderGoalRabbitAvoidTarget(this, new EntitySelectorRabbitWolf(this), 16.0F, 1.33D, 1.33D);
this.goalSelector.a(4, this.bk);
- this.b(0.0D);
}
+ // CraftBukkit end
protected float bD() {
return this.moveController.a() && this.moveController.e() > this.locY + 0.5D ? 0.5F : this.br.b();