Skip to content

Commit

Permalink
4.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Madis0 committed Sep 26, 2023
1 parent 7dddf08 commit 93b36fa
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 11 deletions.
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/develop/
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.1
loader_version=0.14.22

# Mod Properties
mod_version = 4.0.0
mod_version = 4.0.1
maven_group = io.github.madis0
archives_base_name = onebar

# Dependencies
fabric_api_version=0.87.0+1.20.1
modmenu_version=7.2.1
cloth_config_version=11.1.106
exordium_version=1.1.4-1.20.1
fabric_api_version=0.89.2+1.20.2
modmenu_version=8.0.0
cloth_config_version=12.0.109
exordium_version=1.2.1-1.20.2
10 changes: 7 additions & 3 deletions src/main/java/io/github/madis0/ClientProperties.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.madis0;

import io.github.madis0.mixin.DebugHudAccessor;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.AttackIndicator;
Expand Down Expand Up @@ -43,7 +44,8 @@ public ClientProperties(){
baseStartH -= distance;
}

if (MinecraftClient.getInstance().options.debugTpsEnabled){
if (((DebugHudAccessor)MinecraftClient.getInstance().inGameHud.getDebugHud()).isRenderingAndTickChartsVisible() ||
MinecraftClient.getInstance().inGameHud.getDebugHud().showShowPacketSizeAndPingCharts()) {
baseStartH -= 50;
}

Expand All @@ -60,10 +62,12 @@ else if (client.options.getMainArm().getValue() == Arm.LEFT) {
xpStartW = xpStartW - 20;
}

if (MinecraftClient.getInstance().options.debugTpsEnabled)
if (((DebugHudAccessor)MinecraftClient.getInstance().inGameHud.getDebugHud()).isRenderingAndTickChartsVisible() ||
MinecraftClient.getInstance().inGameHud.getDebugHud().showShowPacketSizeAndPingCharts()) {
xpStartH = baseStartH + 11;
else
} else {
xpStartH = baseStartH + 28;
}

xpEndW = xpStartW + 18;
xpEndH = xpStartH + 1;
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/io/github/madis0/mixin/DebugHudAccessor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.github.madis0.mixin;

import net.minecraft.client.gui.hud.DebugHud;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(DebugHud.class)
public interface DebugHudAccessor {

@Accessor
boolean isRenderingAndTickChartsVisible();
}
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"depends": {
"fabric-api": "*",
"cloth-config2": "*",
"minecraft": ">=1.20-"
"minecraft": ">=1.20.2-"
},
"suggests": {
"modmenu": "*"
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/onebar.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"compatibilityLevel": "JAVA_17",
"client": [
"ClientSoulFireBlockMixin",
"DebugHudAccessor",
"InGameHudMixin"
],
"injectors": {
Expand Down

0 comments on commit 93b36fa

Please sign in to comment.