Skip to content

Commit

Permalink
fix #25
Browse files Browse the repository at this point in the history
  • Loading branch information
kurrycat committed Jul 13, 2023
1 parent afa8d7f commit 4e78cba
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions common/src/main/java/io/github/kurrycat/mpkmod/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public void loaded() {
EventAPI.EventListener.onRenderOverlay(
e -> {
if (!displayOverlay) return;
if(Minecraft.isF3Enabled()) return;

Profiler.startSection("components");
if (mainGUI != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ public static boolean setInputs(TickInput inputs) {
return Interface.get().get().setInputs(inputs);
}

public static boolean isF3Enabled() {
return Interface.get().map(Interface::isF3Enabled).orElse(false);
}

public enum WorldState {
MENU,
SINGLE_PLAYER,
Expand Down Expand Up @@ -129,5 +133,7 @@ static Optional<Interface> get() {
void copyToClipboard(String content);

boolean setInputs(TickInput inputs);

boolean isF3Enabled();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ public boolean setInputs(TickInput inputs) {
return true;
}

public boolean isF3Enabled() {
return MinecraftClient.getInstance().options.debugEnabled;
}

public List<Integer> getPressedButtons() {
return new ArrayList<>(pressedButtons);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,10 @@ public boolean setInputs(TickInput inputs) {
return true;
}

public boolean isF3Enabled() {
return MinecraftClient.getInstance().options.debugEnabled;
}

public List<Integer> getPressedButtons() {
return new ArrayList<>(pressedButtons);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,10 @@ public boolean setInputs(TickInput inputs) {
return true;
}

public boolean isF3Enabled() {
return Minecraft.getInstance().options.renderDebug;
}

/**
* Is called in {@link Keyboard.Interface Keyboard.Interface}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,10 @@ public boolean setInputs(TickInput inputs) {
return true;
}

public boolean isF3Enabled() {
return Minecraft.getInstance().options.renderDebug;
}

/**
* Is called in {@link Keyboard.Interface Keyboard.Interface}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,10 @@ public boolean setInputs(TickInput inputs) {
return true;
}

public boolean isF3Enabled() {
return Minecraft.getMinecraft().gameSettings.showDebugInfo;
}

/**
* Is called in {@link io.github.kurrycat.mpkmod.compatibility.MCClasses.Keyboard.Interface Keyboard.Interface}
*/
Expand Down

0 comments on commit 4e78cba

Please sign in to comment.