Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Support 1.20.2 #150

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dependencies {
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
// You may need to force-disable transitiveness on them.
//modImplementation "com.github.DarkKronicle:DarkKore:${project.darkkore_version}" // 1.20.1 version not yet published
modCompileOnly files("run/mods/DarkKore-0.3.5-1.20.1.jar")
modCompileOnly files("run/mods/DarkKore-0.3.5-1.20.2.jar")

modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"

Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.1
loader_version=0.14.21
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.1
loader_version=0.14.22
# Mod Properties
mod_version=2.2.6
maven_group=io.github.darkkronicle
archives_base_name=KronHUD
# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.84.0+1.20.1
fabric_version=0.89.2+1.20.2
darkkore_version=ab012735d8
modmenu_version=7.1.0
modmenu_version=8.0.0

# Uploading data
curseforge_slug=kronhud
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public HudEntry get(Identifier identifier) {
}

public void render(DrawContext context, float delta) {
if (!(client.currentScreen instanceof HudEditScreen) && !client.options.debugEnabled) {
if (!(client.currentScreen instanceof HudEditScreen) && !client.getDebugHud().shouldShowDebugHud()) {
for (HudEntry hud : getEntries()) {
if (hud.isEnabled()) {
hud.render(context, delta);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import net.minecraft.scoreboard.*;
import net.minecraft.text.MutableText;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.minecraft.util.Identifier;
import net.minecraft.util.Util;

Expand All @@ -40,7 +41,7 @@ public class ScoreboardHud extends TextHudEntry implements DynamicallyPositionab
ScoreboardPlayerScore kode = placeScore.getPlayerScore("TheKodeToad", objective);
kode.setScore(2948);

placeScore.setObjectiveSlot(1, objective);
placeScore.setObjectiveSlot(ScoreboardDisplaySlot.SIDEBAR, objective);
return objective;
});

Expand Down Expand Up @@ -69,13 +70,14 @@ public void renderComponent(DrawContext context, float delta) {
ScoreboardObjective scoreboardObjective = null;
Team team = scoreboard.getPlayerTeam(this.client.player.getEntityName());
if (team != null) {
int t = team.getColor().getColorIndex();
if (t >= 0) {
scoreboardObjective = scoreboard.getObjectiveForSlot(3 + t);
Formatting t = team.getColor();
int tc = t.getColorIndex();
if (tc >= 0) {
scoreboardObjective = scoreboard.getObjectiveForSlot(ScoreboardDisplaySlot.fromFormatting(t));
}
}

ScoreboardObjective scoreboardObjective2 = scoreboardObjective != null ? scoreboardObjective : scoreboard.getObjectiveForSlot(1);
ScoreboardObjective scoreboardObjective2 = scoreboardObjective != null ? scoreboardObjective : scoreboard.getObjectiveForSlot(ScoreboardDisplaySlot.SIDEBAR);
if (scoreboardObjective2 != null) {
this.renderScoreboardSidebar(context, scoreboardObjective2);
}
Expand Down