fix(reflection): correct SRG fallback names for noJumpDelay / rightClickDelay
Telly Bridge Scaffold (and other paths that lean on ReflectionUtil.setJumpDelay / setRightClickDelay) silently broke under DLL injection because the SRG name we were trying on the production runtime was wrong: noJumpDelay was f_20889_ -> f_20954_ (LivingEntity) rightClickDelay was f_91076_ -> f_91011_ (Minecraft) findField walks the superclass chain and tries every candidate name, so in a dev mojmap environment the mojmap names match first and we never noticed. In a SRG production runtime both candidates miss, findField throws ReflectionException, the surrounding try swallows it as "Failed to set ... field", and Telly Bridge's jump-delay reset never lands - the scaffold then mis-times the next placement. The other ReflectionUtil entries (yRot/xRot/depthBufferId/ brewingStand/missTime) use SRG names that were already correct for 1.20.1; left untouched. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -86,7 +86,7 @@ public final class ReflectionUtil {
|
||||
public static void setJumpDelay(LivingEntity livingEntity, int delay) {
|
||||
if (livingEntity == null) return;
|
||||
try {
|
||||
Field field = findField(livingEntity.getClass(), "noJumpDelay", "f_20889_");
|
||||
Field field = findField(livingEntity.getClass(), "noJumpDelay", "f_20954_");
|
||||
field.setInt(livingEntity, delay);
|
||||
} catch (Exception ex) {
|
||||
ClientBase.logger.error("Failed to set noJumpDelay field", ex);
|
||||
@@ -96,7 +96,7 @@ public final class ReflectionUtil {
|
||||
public static void setRightClickDelay(int delay) {
|
||||
if (ClientBase.mc == null) return;
|
||||
try {
|
||||
Field field = findField(ClientBase.mc.getClass(), "rightClickDelay", "f_91076_");
|
||||
Field field = findField(ClientBase.mc.getClass(), "rightClickDelay", "f_91011_");
|
||||
field.setInt(ClientBase.mc, delay);
|
||||
} catch (Exception ex) {
|
||||
ClientBase.logger.error("Failed to set rightClickDelay field", ex);
|
||||
|
||||
Reference in New Issue
Block a user