Skip to content

Commit

Permalink
1.20.5 snapshot support
Browse files Browse the repository at this point in the history
  • Loading branch information
yurisuika committed Jan 10, 2024
1 parent b408672 commit c364867
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 127 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
org.gradle.jvmargs = -Xmx3G
loom.platform = fabric

minecraft_version = 1.20.4
yarn_mappings = 1.20.4+build.3
minecraft_version = 23w51b
yarn_mappings = 23w51b+build.4
loader_version = 0.15.3

mod_id = raised
Expand All @@ -11,4 +11,4 @@ mod_version = 3.1.1
maven_group = dev.yurisuika.raised
archives_base_name = raised

fabric_version = 0.92.1+1.20.4
fabric_version = 0.92.1+1.20.5
Original file line number Diff line number Diff line change
Expand Up @@ -17,132 +17,35 @@ public abstract class InGameHudMixin {
@Mixin(value = InGameHud.class, priority = -999999999)
public abstract static class Pre {

// HEAD
@Inject(method = "render", at = @At("HEAD"))
private void startHeadTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
if (getSupport()) {
context.getMatrices().translate(0, -getHud(), 0);
}
}

// SPECTATOR MENU
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/SpectatorHud;renderSpectatorMenu(Lnet/minecraft/client/gui/DrawContext;)V"))
// MAIN HUD
@Inject(method = "renderMainHud", at = @At(value = "HEAD"))
private void startSpectatorMenuTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, -getHud(), 0);
}

@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/SpectatorHud;renderSpectatorMenu(Lnet/minecraft/client/gui/DrawContext;)V", shift = At.Shift.AFTER))
private void endSpectatorMenuTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, +getHud(), 0);
}

// HOTBAR
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;renderHotbar(FLnet/minecraft/client/gui/DrawContext;)V"))
private void startHotbarTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, -getHud(), 0);
}

@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;renderHotbar(FLnet/minecraft/client/gui/DrawContext;)V", shift = At.Shift.AFTER))
private void endHotbarTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, +getHud(), 0);
}

// STATUS BARS
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;renderStatusBars(Lnet/minecraft/client/gui/DrawContext;)V"))
private void startStatusBarsTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, -getHud(), 0);
}

@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;renderStatusBars(Lnet/minecraft/client/gui/DrawContext;)V", shift = At.Shift.AFTER))
private void endStatusBarsTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, +getHud(), 0);
}

// MOUNT HEALTH BAR
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;renderMountHealth(Lnet/minecraft/client/gui/DrawContext;)V"))
private void startMountHealthTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, -getHud(), 0);
}

@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;renderMountHealth(Lnet/minecraft/client/gui/DrawContext;)V", shift = At.Shift.AFTER))
private void endMountHealthTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, +getHud(), 0);
}

// MOUNT JUMP BAR
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;renderMountJumpBar(Lnet/minecraft/entity/JumpingMount;Lnet/minecraft/client/gui/DrawContext;I)V"))
private void startMountJumpBarTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, -getHud(), 0);
}

@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;renderMountJumpBar(Lnet/minecraft/entity/JumpingMount;Lnet/minecraft/client/gui/DrawContext;I)V", shift = At.Shift.AFTER))
private void endMountJumpBarTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, +getHud(), 0);
}

// EXPERIENCE BAR
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;renderExperienceBar(Lnet/minecraft/client/gui/DrawContext;I)V"))
private void startExperienceBarTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, -getHud(), 0);
}

@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;renderExperienceBar(Lnet/minecraft/client/gui/DrawContext;I)V", shift = At.Shift.AFTER))
private void endExperienceBarTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, +getHud(), 0);
}

// HELD ITEM TOOLTIP
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;renderHeldItemTooltip(Lnet/minecraft/client/gui/DrawContext;)V"))
private void startHeldItemTooltipTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, -getHud(), 0);
}

@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;renderHeldItemTooltip(Lnet/minecraft/client/gui/DrawContext;)V", shift = At.Shift.AFTER))
private void endHeldItemTooltipTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, +getHud(), 0);
}

// SPECTATOR TOOLTIP
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/SpectatorHud;render(Lnet/minecraft/client/gui/DrawContext;)V"))
private void startSpectatorHudTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, -getHud(), 0);
}

@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/SpectatorHud;render(Lnet/minecraft/client/gui/DrawContext;)V", shift = At.Shift.AFTER))
private void endSpectatorHudTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, +getHud(), 0);
}
// @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/SpectatorHud;render(Lnet/minecraft/client/gui/DrawContext;)V"))
// private void startSpectatorHudTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
// context.getMatrices().translate(0, -getHud(), 0);
// }
//
// @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/SpectatorHud;render(Lnet/minecraft/client/gui/DrawContext;)V", shift = At.Shift.AFTER))
// private void endSpectatorHudTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
// context.getMatrices().translate(0, +getHud(), 0);
// }

// OVERLAY MESSAGE
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/math/MatrixStack;push()V", ordinal = 0))
@Inject(method = "renderOverlayMessage", at = @At(value = "HEAD"))
private void startOverlayMessageTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, -getHud(), 0);
}

@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/math/MatrixStack;pop()V", ordinal = 0, shift = At.Shift.AFTER))
private void endOverlayMessageTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, +getHud(), 0);
}

// CHAT
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;render(Lnet/minecraft/client/gui/DrawContext;III)V"))
@Inject(method = "renderChat", at = @At(value = "HEAD"))
private void startChatTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, -(getSync() ? getHud() : getChat()), +300);
}

@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;render(Lnet/minecraft/client/gui/DrawContext;III)V", shift = At.Shift.AFTER))
private void endChatTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, +(getSync() ? getHud() : getChat()), -300);
}

// TAIL
@Inject(method = "render", at = @At("TAIL"))
private void startTailTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
if (getSupport()) {
context.getMatrices().translate(0, -getHud(), 0);
}
}

// HOTBAR SELECTOR
@ModifyArgs(method = "renderHotbar", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;drawGuiTexture(Lnet/minecraft/util/Identifier;IIII)V", ordinal = 1))
private void resizeHotbarSelector(Args args) {
Expand All @@ -155,20 +58,22 @@ private void resizeHotbarSelector(Args args) {
@Mixin(value = InGameHud.class, priority = 999999999)
public abstract static class Post {

// HEAD
@Inject(method = "render", at = @At("HEAD"))
private void endHeadTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
if (getSupport()) {
context.getMatrices().translate(0, +getHud(), 0);
}
// MAIN HUD
@Inject(method = "renderMainHud", at = @At(value = "TAIL"))
private void endSpectatorMenuTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, +getHud(), 0);
}

// OVERLAY MESSAGE
@Inject(method = "renderOverlayMessage", at = @At(value = "TAIL"))
private void endOverlayMessageTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, +getHud(), 0);
}

// TAIL
@Inject(method = "render", at = @At("TAIL"))
private void endTailTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
if (getSupport()) {
context.getMatrices().translate(0, +getHud(), 0);
}
// CHAT
@Inject(method = "renderChat", at = @At(value = "TAIL"))
private void endChatTranslate(DrawContext context, float tickDelta, CallbackInfo ci) {
context.getMatrices().translate(0, +(getSync() ? getHud() : getChat()), -300);
}

}
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"accessWidener" : "raised.accesswidener",

"depends": {
"fabricloader": ">=0.14.21",
"minecraft": ">=1.20.2 <=1.20.4",
"fabricloader": ">=0.15.3",
"minecraft": ">=1.20.4",
"java": ">=17"
}
}

0 comments on commit c364867

Please sign in to comment.