Skip to content
This repository was archived by the owner on Jun 22, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
public class MItemSlotUpdate {
final MinecraftClient mc = MinecraftClient.getInstance();
private long lobbyTime = System.currentTimeMillis() - 1000;
private long lastDevCheck = 0;

@Inject(method = "onScreenHandlerSlotUpdate", at = @At("HEAD"))
public void onScreenHandlerSlotUpdate(ScreenHandlerSlotUpdateS2CPacket packet, CallbackInfo ci) {
Expand Down Expand Up @@ -81,31 +80,8 @@ public void onScreenHandlerSlotUpdate(ScreenHandlerSlotUpdateS2CPacket packet, C
// fs toggle
FlightspeedToggle.fs_is_normal = true;

long time = System.currentTimeMillis() / 1000L;
if (time - lastDevCheck > 1) {

new Thread(() -> {
try {
Thread.sleep(10);
if (Config.getBoolean("autoRC")) {
mc.player.sendChatMessage("/rc");
}
if (Config.getBoolean("autotime")) {
ChatUtil.executeCommandSilently("time " + Config.getLong("autotimeval"));
}
if (Config.getBoolean("autonightvis")) {
ChatUtil.executeCommandSilently("nightvis");
}
} catch (Exception e) {
CodeUtilities.log(Level.ERROR, "Error while executing the task!");
e.printStackTrace();
}
}).start();

lastDevCheck = time;
}
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,25 @@ private void updateState(Text component) {
if (minecraftClient.player.isCreative() && text.matches("^» You are now in dev mode\\.$")) {
// fs toggle
FlightspeedToggle.fs_is_normal = true;

new Thread(() -> {
try {
Thread.sleep(10);
if (Config.getBoolean("autoRC")) {
CodeUtilities.MC.player.sendChatMessage("/rc");
}
if (Config.getBoolean("autotime")) {
ChatUtil.executeCommandSilently("time " + Config.getLong("autotimeval"));
}
if (Config.getBoolean("autonightvis")) {
ChatUtil.executeCommandSilently("nightvis");
}
} catch (Exception e) {
CodeUtilities.log(Level.ERROR, "Error while executing the task!");
e.printStackTrace();
}
}).start();

}
}
}