Skip to content

Commit

Permalink
Update to 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
hibiii committed Jun 8, 2022
1 parent 82e2a84 commit 40ead3b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 27 deletions.
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version=1.18.1
yarn_mappings=1.18.1+build.22
minecraft_version=1.19
yarn_mappings=1.19+build.1
loader_version=0.12.12

# Mod Properties
mod_version = 1.1.0
mod_version = 1.1.1
maven_group = hibi.boathud
archives_base_name = boathud

# Dependencies
fabric_version=0.46.2+1.18
menu_version=3.0.1
cloth_version=5.0.38
fabric_version=0.55.2+1.19
menu_version=4.0.0
cloth_version=7.0.65
8 changes: 4 additions & 4 deletions src/main/java/hibi/boathud/HudRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ public void render(MatrixStack stack, float tickDelta) {

// Sprites
// Left-right
this.drawTexture(stack, i - 86, this.scaledHeight - 65, 61, this.client.options.keyLeft.isPressed() ? 38 : 30, 17, 8);
this.drawTexture(stack, i - 63, this.scaledHeight - 65, 79, this.client.options.keyRight.isPressed() ? 38 : 30, 17, 8);
this.drawTexture(stack, i - 86, this.scaledHeight - 65, 61, this.client.options.leftKey.isPressed() ? 38 : 30, 17, 8);
this.drawTexture(stack, i - 63, this.scaledHeight - 65, 79, this.client.options.rightKey.isPressed() ? 38 : 30, 17, 8);
// Ping
this.renderPing(stack, i + 75 - nameLen, this.scaledHeight - 65);
// Brake-throttle bar
this.drawTexture(stack, i, this.scaledHeight - 55, 0, this.client.options.keyForward.isPressed() ? 45 : 40, 61, 5);
this.drawTexture(stack, i - 61, this.scaledHeight - 55, 0, this.client.options.keyBack.isPressed() ? 35 : 30, 61, 5);
this.drawTexture(stack, i, this.scaledHeight - 55, 0, this.client.options.forwardKey.isPressed() ? 45 : 40, 61, 5);
this.drawTexture(stack, i - 61, this.scaledHeight - 55, 0, this.client.options.backKey.isPressed() ? 35 : 30, 61, 5);

// Text
// First Row
Expand Down
31 changes: 16 additions & 15 deletions src/main/java/hibi/boathud/MenuInteg.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
import com.terraformersmc.modmenu.api.ModMenuApi;

import net.minecraft.text.TranslatableText;
import net.minecraft.text.MutableText;
import net.minecraft.text.Text;

import me.shedaniel.clothconfig2.api.ConfigBuilder;
import me.shedaniel.clothconfig2.api.ConfigEntryBuilder;
Expand Down Expand Up @@ -32,14 +33,14 @@ public ConfigScreenFactory<?> getModConfigScreenFactory() {
.addEntry(entryBuilder.startEnumSelector(SPEED_FORMAT, SpeedFormat.class, SpeedFormat.values()[Config.configSpeedType])
.setDefaultValue(SpeedFormat.KMPH)
.setSaveConsumer(newVal -> Config.setUnit(newVal.ordinal()))
.setEnumNameProvider(value -> new TranslatableText("boathud.option.speed_format." + value.toString()))
.setEnumNameProvider(value -> Text.translatable("boathud.option.speed_format." + value.toString()))
.build())

.addEntry(entryBuilder.startEnumSelector(BAR_TYPE, BarType.class, BarType.values()[Config.barType])
.setDefaultValue(BarType.PACKED)
.setTooltip(TIP_BAR, TIP_BAR_PACKED, TIP_BAR_MIXED, TIP_BAR_BLUE)
.setSaveConsumer(newVal -> Config.barType = newVal.ordinal())
.setEnumNameProvider(value -> new TranslatableText("boathud.option.bar_type." + value.toString()))
.setEnumNameProvider(value -> Text.translatable("boathud.option.bar_type." + value.toString()))
.build());

builder.setSavingRunnable(() -> Config.save());
Expand All @@ -54,16 +55,16 @@ public enum SpeedFormat {
MS, KMPH, MPH, KT
}

private static final TranslatableText
TITLE = new TranslatableText("boathud.config.title"),
CAT = new TranslatableText("boathud.config.cat"),
ENABLED = new TranslatableText("boathud.option.enabled"),
EXTENDED = new TranslatableText("boathud.option.extended"),
BAR_TYPE = new TranslatableText("boathud.option.bar_type"),
SPEED_FORMAT = new TranslatableText("boathud.option.speed_format"),
TIP_EXTENDED = new TranslatableText("boathud.tooltip.extended"),
TIP_BAR = new TranslatableText("boathud.tooltip.bar_type"),
TIP_BAR_PACKED = new TranslatableText("boathud.tooltip.bar_type.packed"),
TIP_BAR_MIXED = new TranslatableText("boathud.tooltip.bar_type.mixed"),
TIP_BAR_BLUE = new TranslatableText("boathud.tooltip.bar_type.blue");
private static final MutableText
TITLE = Text.translatable("boathud.config.title"),
CAT = Text.translatable("boathud.config.cat"),
ENABLED = Text.translatable("boathud.option.enabled"),
EXTENDED = Text.translatable("boathud.option.extended"),
BAR_TYPE = Text.translatable("boathud.option.bar_type"),
SPEED_FORMAT = Text.translatable("boathud.option.speed_format"),
TIP_EXTENDED = Text.translatable("boathud.tooltip.extended"),
TIP_BAR = Text.translatable("boathud.tooltip.bar_type"),
TIP_BAR_PACKED = Text.translatable("boathud.tooltip.bar_type.packed"),
TIP_BAR_MIXED = Text.translatable("boathud.tooltip.bar_type.mixed"),
TIP_BAR_BLUE = Text.translatable("boathud.tooltip.bar_type.blue");
}
6 changes: 4 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@
"depends": {
"fabricloader": ">=0.12.12",
"fabric": "*",
"minecraft": ">=1.17",
"minecraft": ">=1.19",
"java": ">=17",
"cloth-config2": ">=5.0"
"cloth-config2": ">=7.0"
},
"custom": {
"modmenu": {
"links": {
"modmenu.github_releases": "https://github.com/Hibiii/BoatHud/releases",
"modmenu.curseforge": "https://www.curseforge.com/minecraft/mc-mods/boathud",
"modmenu.modrinth": "https://modrinth.com/mod/boathud/",
"modmenu.discord": "https://discord.gg/Zef3c27dN2"
}
}
Expand Down

0 comments on commit 40ead3b

Please sign in to comment.