Update 1.20 reflection fields

This commit is contained in:
Flowsqy 2023-06-10 19:25:44 +02:00
parent 926062b2dc
commit 70aa818d9a
2 changed files with 4 additions and 4 deletions

View File

@ -33,10 +33,10 @@ public class FakeArmorStandImpl extends FakeEntityImpl<String> implements FakeAr
final Field dataSharedFlagsId = Entity.class.getDeclaredField("an"); // DATA_SHARED_FLAGS_ID
dataSharedFlagsId.setAccessible(true);
DATA_SHARED_FLAGS_ID = forceCast(dataSharedFlagsId.get(null));
final Field dataCustomNameField = Entity.class.getDeclaredField("aR"); // DATA_CUSTOM_NAME
final Field dataCustomNameField = Entity.class.getDeclaredField("aU"); // DATA_CUSTOM_NAME
dataCustomNameField.setAccessible(true);
DATA_CUSTOM_NAME = forceCast(dataCustomNameField.get(null));
final Field dataCustomNameVisibleField = Entity.class.getDeclaredField("aS"); // DATA_CUSTOM_NAME_VISIBLE
final Field dataCustomNameVisibleField = Entity.class.getDeclaredField("aV"); // DATA_CUSTOM_NAME_VISIBLE
dataCustomNameVisibleField.setAccessible(true);
DATA_CUSTOM_NAME_VISIBLE = forceCast(dataCustomNameVisibleField.get(null));
} catch (ReflectiveOperationException e) {

View File

@ -31,10 +31,10 @@ public abstract class FakeEntityImpl<T> implements FakeEntity {
final Field entityCounterField = Entity.class.getDeclaredField("d"); // ENTITY_COUNTER
entityCounterField.setAccessible(true);
ENTITY_COUNTER = (AtomicInteger) entityCounterField.get(null);
final Field dataNoGravityField = Entity.class.getDeclaredField("aU"); // DATA_NO_GRAVITY
final Field dataNoGravityField = Entity.class.getDeclaredField("aX"); // DATA_NO_GRAVITY
dataNoGravityField.setAccessible(true);
DATA_NO_GRAVITY = forceCast(dataNoGravityField.get(null));
final Field dataSilentField = Entity.class.getDeclaredField("aT"); // DATA_SILENT
final Field dataSilentField = Entity.class.getDeclaredField("aW"); // DATA_SILENT
dataSilentField.setAccessible(true);
DATA_SILENT = forceCast(dataSilentField.get(null));
} catch (ReflectiveOperationException e) {