Skip to content

Commit

Permalink
Update dEntity.has_ai
Browse files Browse the repository at this point in the history
  • Loading branch information
Morphan1 committed Mar 2, 2016
1 parent fd15ac8 commit 1a691bd
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,15 @@ public static void toggleAI(Entity entity, boolean hasAI) {
if (!(nmsEntity instanceof EntityInsentient)) {
return;
}
// TODO: 1.9 nmsEntity.getDataWatcher().watch(15, (byte) (hasAI ? 0 : 1));
((EntityInsentient) nmsEntity).m(!hasAI);
}

public static boolean isAIDisabled(Entity entity) {
net.minecraft.server.v1_9_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
if (!(nmsEntity instanceof EntityInsentient)) {
return true;
}
// TODO: 1.9 return nmsEntity.getDataWatcher().getByte(15) != 0;
return false;
return ((EntityInsentient) nmsEntity).cR();
}

public static double getSpeed(Entity entity) {
Expand Down Expand Up @@ -171,10 +170,9 @@ public void run() {
callback.run();
}
nmsEntity.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(oldSpeed);
// TODO: 1.9
//if (aiDisabled) {
// toggleAI(entity, false);
//}
if (aiDisabled) {
toggleAI(entity, false);
}
cancel();
}
}
Expand Down

0 comments on commit 1a691bd

Please sign in to comment.