Fix position update typo in old versions

This commit is contained in:
fullwall 2023-05-02 00:07:12 +08:00
parent 69b6509a0e
commit db188e1c56
5 changed files with 4 additions and 7 deletions

View File

@ -1112,7 +1112,7 @@ public class NMSImpl implements NMSBridge {
try {
dx = EntityTracker.a(handle.locX) - (long) ENTITY_TRACKER_ENTRY_X.invoke(entry);
dy = EntityTracker.a(handle.locY) - (long) ENTITY_TRACKER_ENTRY_Y.invoke(entry);
dz = EntityTracker.a(handle.locY) - (long) ENTITY_TRACKER_ENTRY_Z.invoke(entry);
dz = EntityTracker.a(handle.locZ) - (long) ENTITY_TRACKER_ENTRY_Z.invoke(entry);
} catch (Throwable e) {
e.printStackTrace();
return;

View File

@ -1165,7 +1165,7 @@ public class NMSImpl implements NMSBridge {
try {
dx = EntityTracker.a(handle.locX) - (long) ENTITY_TRACKER_ENTRY_X.invoke(entry);
dy = EntityTracker.a(handle.locY) - (long) ENTITY_TRACKER_ENTRY_Y.invoke(entry);
dz = EntityTracker.a(handle.locY) - (long) ENTITY_TRACKER_ENTRY_Z.invoke(entry);
dz = EntityTracker.a(handle.locZ) - (long) ENTITY_TRACKER_ENTRY_Z.invoke(entry);
} catch (Throwable e) {
e.printStackTrace();
return;

View File

@ -1172,7 +1172,7 @@ public class NMSImpl implements NMSBridge {
try {
dx = EntityTracker.a(handle.locX) - (long) ENTITY_TRACKER_ENTRY_X.invoke(entry);
dy = EntityTracker.a(handle.locY) - (long) ENTITY_TRACKER_ENTRY_Y.invoke(entry);
dz = EntityTracker.a(handle.locY) - (long) ENTITY_TRACKER_ENTRY_Z.invoke(entry);
dz = EntityTracker.a(handle.locZ) - (long) ENTITY_TRACKER_ENTRY_Z.invoke(entry);
} catch (Throwable e) {
e.printStackTrace();
return;

View File

@ -1214,7 +1214,7 @@ public class NMSImpl implements NMSBridge {
try {
dx = EntityTracker.a(handle.locX) - (long) ENTITY_TRACKER_ENTRY_X.invoke(entry);
dy = EntityTracker.a(handle.locY) - (long) ENTITY_TRACKER_ENTRY_Y.invoke(entry);
dz = EntityTracker.a(handle.locY) - (long) ENTITY_TRACKER_ENTRY_Z.invoke(entry);
dz = EntityTracker.a(handle.locZ) - (long) ENTITY_TRACKER_ENTRY_Z.invoke(entry);
} catch (Throwable e) {
e.printStackTrace();
return;

View File

@ -1820,9 +1820,6 @@ public class NMSImpl implements NMSBridge {
private static Method ENTITY_ATTACK_A = NMS.getMethod(Entity.class, "a", true, EntityLiving.class, Entity.class);
private static Map<Class<?>, Integer> ENTITY_CLASS_TO_INT;
private static Map<Class<?>, String> ENTITY_CLASS_TO_NAME;
private static final MethodHandle ENTITY_TRACKER_ENTRY_X = NMS.getGetter(EntityTrackerEntry.class, "xLoc");
private static final MethodHandle ENTITY_TRACKER_ENTRY_Y = NMS.getGetter(EntityTrackerEntry.class, "yLoc");
private static final MethodHandle ENTITY_TRACKER_ENTRY_Z = NMS.getGetter(EntityTrackerEntry.class, "zLoc");
private static final Location FROM_LOCATION = new Location(null, 0, 0, 0);
private static Method GET_NMS_BLOCK = NMS.getMethod(CraftBlock.class, "getNMSBlock", false);
private static Field GOAL_FIELD = NMS.getField(PathfinderGoalSelector.class, "b");