Skip to content

Commit

Permalink
(experimental) fix for #1569 turtle NPC navigation issues (#1644)
Browse files Browse the repository at this point in the history
* (experimental) fix for #1569 turtle NPC navigation issues

* (for turtle issue) remove the stray field and set the internal field instead
  • Loading branch information
mcmonkey4eva authored and fullwall committed Dec 26, 2018
1 parent 50619f3 commit a21d16c
Showing 1 changed file with 15 additions and 9 deletions.
@@ -1,5 +1,6 @@
package net.citizensnpcs.nms.v1_13_R2.entity;

import net.minecraft.server.v1_13_R2.*;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_13_R2.CraftServer;
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity;
Expand All @@ -14,14 +15,6 @@
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_13_R2.BlockPosition;
import net.minecraft.server.v1_13_R2.ControllerMove;
import net.minecraft.server.v1_13_R2.DamageSource;
import net.minecraft.server.v1_13_R2.EntityTurtle;
import net.minecraft.server.v1_13_R2.IBlockData;
import net.minecraft.server.v1_13_R2.NBTTagCompound;
import net.minecraft.server.v1_13_R2.SoundEffect;
import net.minecraft.server.v1_13_R2.World;

public class TurtleController extends MobEntityController {
public TurtleController() {
Expand All @@ -46,6 +39,19 @@ public EntityTurtleNPC(World world, NPC npc) {
if (npc != null) {
NMSImpl.clearGoals(goalSelector, targetSelector);
this.moveController = new ControllerMove(this);
this.h = new EmptyControllerJump(this);
}
}

static class EmptyControllerJump extends ControllerJump {

public EmptyControllerJump(EntityInsentient var1) {
super(var1);
}

@Override
public void b() {
this.a = false;
}
}

Expand Down Expand Up @@ -199,4 +205,4 @@ public NPC getNPC() {
return npc;
}
}
}
}

0 comments on commit a21d16c

Please sign in to comment.