Fix magma cubes, slimes, and pathfinding for some mobs

This commit is contained in:
fullwall 2016-05-17 18:30:58 +08:00
parent f9edd70041
commit 02a1813206
5 changed files with 10 additions and 24 deletions

View File

@ -72,13 +72,6 @@ public class MagmaCubeController extends MobEntityController {
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bT()).toString())));
}
@Override
public void ci() {
if (npc == null) {
super.ci();
}
}
@Override
public void collide(net.minecraft.server.v1_9_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
@ -182,10 +175,11 @@ public class MagmaCubeController extends MobEntityController {
}
@Override
public void M() {
super.M();
if (npc != null)
public void m() {
super.m();
if (npc != null) {
npc.update();
}
}
@Override

View File

@ -26,7 +26,6 @@ import net.minecraft.server.v1_9_R2.SoundEffect;
import net.minecraft.server.v1_9_R2.World;
public class SlimeController extends MobEntityController {
public SlimeController() {
super(EntitySlimeNPC.class);
}
@ -74,13 +73,6 @@ public class SlimeController extends MobEntityController {
npc.data().get(NPC.DEATH_SOUND_METADATA, SoundEffect.a.b(super.bT()).toString())));
}
@Override
public void ci() {
if (npc == null) {
super.ci();
}
}
@Override
public void collide(net.minecraft.server.v1_9_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
@ -192,8 +184,8 @@ public class SlimeController extends MobEntityController {
}
@Override
public void M() {
super.M();
public void m() {
super.m();
if (npc != null) {
npc.update();
}

View File

@ -174,8 +174,9 @@ public class SnowmanController extends MobEntityController {
@Override
public void M() {
super.M();
if (npc != null)
if (npc != null) {
npc.update();
}
}
@Override

View File

@ -181,7 +181,6 @@ public class NMS {
* an Exception like it should.
*/
public static GameProfile fillProfileProperties(GameProfile profile, boolean requireSecure) throws Exception {
if (Bukkit.isPrimaryThread())
throw new IllegalStateException("NMS.fillProfileProperties cannot be invoked from the main thread.");
@ -741,7 +740,7 @@ public class NMS {
yaw = clampYaw(yaw);
handle.aO = yaw;
if (!(handle instanceof EntityHuman))
handle.aM = yaw;
handle.aN = yaw;
handle.aP = yaw;
}

View File

@ -126,7 +126,7 @@ public class Util {
}
for (T check : values) {
String name = check.name().toLowerCase();
if (name.replace("_", "").equals(toMatch) || name.matches(toMatch) || name.startsWith(toMatch)) {
if (name.replace("_", "").equals(toMatch) || name.startsWith(toMatch)) {
return check;
}
}