chore: remade FastInteract with Accesstransformers

This commit is contained in:
əlemi 2023-03-08 17:25:34 +01:00
parent 9c296d76dc
commit a9a232838d
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 4 additions and 22 deletions

View file

@ -13,32 +13,13 @@ import static ftbsc.bscv.Boscovicino.log;
@AutoService(ILoadable.class) @AutoService(ILoadable.class)
public class FastInteract extends QuickModule implements ICommons { public class FastInteract extends QuickModule implements ICommons {
@Override
protected int getDefaultKey() {
return UNBOUND;
}
Field delayField; protected int getDefaultKey() { return UNBOUND; }
@Override
protected void onEnabled() {
try {
delayField = MC.getClass().getDeclaredField("field_71467_ac");
delayField.setAccessible(true);
} catch (NoSuchFieldException e) {
log("! failed accessing delay field");
this.disable();
}
}
@SubscribeEvent @SubscribeEvent
public void onTick(TickEvent.ClientTickEvent event) { public void onTick(TickEvent.ClientTickEvent event) {
if (MC == null) return; if (MC == null) return;
try {
this.delayField.set(MC, 0); MC.rightClickDelay = 0;
} catch (IllegalAccessException e) {
log("! failed accessing delay field");
this.disable();
}
} }
} }

View file

@ -3,3 +3,4 @@ public net.minecraft.client.gui.screen.Screen field_230705_e_ # children
public net.minecraft.client.network.play.NetworkPlayerInfo field_178866_b # gameMode public net.minecraft.client.network.play.NetworkPlayerInfo field_178866_b # gameMode
public net.minecraft.network.play.client.CPlayerPacket field_149474_g # onGround public net.minecraft.network.play.client.CPlayerPacket field_149474_g # onGround
public net.minecraft.client.multiplayer.PlayerController func_78750_j()V # ensureHasSentCarriedItem() public net.minecraft.client.multiplayer.PlayerController func_78750_j()V # ensureHasSentCarriedItem()
public net.minecraft.client.Minecraft field_71467_ac # rightClickDelay