Skip to content

Commit

Permalink
Dirty fix for elytra 1 frame issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tr7zw committed Jun 8, 2024
1 parent 12f1051 commit dba029a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/dev/tr7zw/firstperson/LogicHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,17 @@ public class LogicHandler {
private Vec3 offset = Vec3.ZERO; // Current offset used for rendering
private Set<Item> autoVanillaHandItems = new HashSet<>();
private Set<Item> autoDisableItems = new HashSet<>();
private long timeout = 0;

void registerDefaultHandlers() {
FirstPersonAPI.registerPlayerHandler((ActivationHandler) () -> {
if (client.player.isAutoSpinAttack() || client.player.isFallFlying()
|| (client.player.getSwimAmount(1f) != 0 && !isCrawlingOrSwimming(client.player))) {
timeout = System.currentTimeMillis() + 100;
return true;
}
// FIXME: Evil hack to fix weird 1 frame-ish issues when landing with an elytra
if (System.currentTimeMillis() < timeout) {
return true;
}
if (autoDisableItems.contains(client.player.getMainHandItem().getItem())
Expand Down

0 comments on commit dba029a

Please sign in to comment.