Skip to content

Commit

Permalink
Merge pull request #19 from ShadowCat117/1.21
Browse files Browse the repository at this point in the history
Update to 1.21
  • Loading branch information
IzzyDotExe authored Jun 28, 2024
2 parents e318aa2 + f4653c3 commit 8d79c2f
Show file tree
Hide file tree
Showing 10 changed files with 381 additions and 202 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
matrix:
# Use these Java versions
java: [
17, # Current Java LTS & minimum supported by Minecraft
21, # Current Java LTS & minimum supported by Minecraft
]
# and run on both Linux and Windows
os: [ubuntu-20.04, windows-2022]
Expand All @@ -32,7 +32,7 @@ jobs:
- name: build
run: ./gradlew build
- name: capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS
if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Only upload artifacts built from latest java on one OS
uses: actions/upload-artifact@v2
with:
name: Artifacts
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
plugins {
id 'fabric-loom' version '1.0-SNAPSHOT'
id 'fabric-loom' version '1.7-SNAPSHOT'
id 'maven-publish'
}

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21

archivesBaseName = project.archives_base_name
version = project.mod_version
Expand Down Expand Up @@ -53,8 +53,8 @@ processResources {
}

tasks.withType(JavaCompile).configureEach {
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
// Minecraft 1.20.5 (24w14a) upwards uses Java 21.
it.options.release = 21
}

java {
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/versions.html

minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.3
minecraft_version=1.21
yarn_mappings=1.21+build.4
loader_version=0.15.11


# Mod Properties
mod_version = 1.3b4
mod_version = 1.4b1
maven_group = ca.blutopia
archives_base_name = removehud

# Dependencies
fabric_version=0.93.1+1.20.4
modmenu_version=9.0.0
clothconfig_version=13.0.121
fabric_version=0.100.4+1.21
modmenu_version=11.0.1
clothconfig_version=15.0.127
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
39 changes: 37 additions & 2 deletions src/main/java/ca/blutopia/removehud/ModConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ public static void init() {
@ConfigEntry.Category("HUD")
public boolean HeldItemTooltip = true;

@ConfigEntry.Category("OFFSETS")
@Comment("Held item tooltip X offset")
public int HeldItemTooltipXOffset = 0;

@ConfigEntry.Category("OFFSETS")
@Comment("Held item tooltip Y offset")
public int HeldItemTooltipYOffset = 0;

@ConfigEntry.Category("HUD")
public boolean MountJumpbar = true;

Expand Down Expand Up @@ -119,7 +127,7 @@ public static void init() {

@ConfigEntry.Category("HUD")
@Comment("Hunger bar")
public boolean HungerBar;
public boolean HungerBar = true;

@ConfigEntry.Category("OFFSETS")
@Comment("Hunger bar X offset")
Expand All @@ -136,7 +144,7 @@ public static void init() {
public boolean PortalOverlay = true;

@ConfigEntry.Category("Overlays")
@Comment("Frost Overlay, Pumkin head, etc...")
@Comment("Frost Overlay, Pumpkin head, etc...")
public boolean OtherOverlays = true;

@ConfigEntry.Category("Overlays")
Expand All @@ -145,10 +153,37 @@ public static void init() {
@ConfigEntry.Category("HUD")
public boolean ExpBar = true;

@ConfigEntry.Category("OFFSETS")
@Comment("Exp bar X offset")
public int ExpBarXOffset = 0;

@ConfigEntry.Category("OFFSETS")
@Comment("Exp Tooltip Y offset")
public int ExpBarYOffset = 0;

@ConfigEntry.Category("HUD")
public boolean Crosshairs = true;

@ConfigEntry.Category("HUD")
public boolean HotBar = true;

@ConfigEntry.Category("OFFSETS")
@Comment("Hotbar X offset")
public int HotBarXOffset = 0;

@ConfigEntry.Category("OFFSETS")
@Comment("Hotbar Y offset")
public int HotBarYOffset = 0;

@ConfigEntry.Category("HUD")
public boolean OverlayMessage = true;

@ConfigEntry.Category("OFFSETS")
@Comment("Overlay Message X offset")
public int OverlayMessageXOffset = 0;

@ConfigEntry.Category("OFFSETS")
@Comment("Overlay Message Y offset")
public int OverlayMessageYOffset = 0;

}
19 changes: 19 additions & 0 deletions src/main/java/ca/blutopia/removehud/mixin/RemoveBossBar.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ca.blutopia.removehud.mixin;

import ca.blutopia.removehud.ModConfig;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.hud.BossBarHud;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(BossBarHud.class)
public abstract class RemoveBossBar {
@Inject(method = "render(Lnet/minecraft/client/gui/DrawContext;)V", at = @At("HEAD"), cancellable = true)
public void renderBossBars(DrawContext context, CallbackInfo ci) {
if (!ModConfig.INSTANCE.BossBar) {
ci.cancel();
}
}
}
19 changes: 19 additions & 0 deletions src/main/java/ca/blutopia/removehud/mixin/RemoveDebugHud.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ca.blutopia.removehud.mixin;

import ca.blutopia.removehud.ModConfig;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.hud.DebugHud;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(DebugHud.class)
public abstract class RemoveDebugHud {
@Inject(method = "render(Lnet/minecraft/client/gui/DrawContext;)V", at = @At("HEAD"), cancellable = true)
public void renderBossBars(DrawContext context, CallbackInfo ci) {
if (!ModConfig.INSTANCE.DebugHud) {
ci.cancel();
}
}
}
Loading

0 comments on commit 8d79c2f

Please sign in to comment.