Skip to content

Commit

Permalink
Backport to 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
dima-dencep committed Jun 26, 2023
1 parent 5bb7193 commit 8292c80
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 20 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ jobs:

game-versions: |
${{ steps.read_property.outputs.minecraft_version }}
1.20
dependencies: |
cloth-config
Expand Down Expand Up @@ -104,7 +103,6 @@ jobs:
game-versions: |
${{ steps.read_property.outputs.minecraft_version }}
1.20
dependencies: |
fabric-api
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.github.dimadencep.mods.rrls.accessor;

import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.util.math.MatrixStack;

public interface SplashAccessor {
boolean isAttached();

void render(DrawContext context, boolean isGame);
void render(MatrixStack context, boolean isGame);

void reload();
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.github.dimadencep.mods.rrls.Rrls;
import com.github.dimadencep.mods.rrls.accessor.SplashAccessor;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.gui.screen.Overlay;
import net.minecraft.client.gui.screen.SplashOverlay;
import net.minecraft.resource.ResourceReload;
Expand Down Expand Up @@ -46,7 +46,7 @@ public abstract class SplashOverlayMixin extends Overlay implements SplashAccess
private long reloadStartTime;

@Shadow
protected abstract void renderProgressBar(DrawContext drawContext, int minX, int minY, int maxX, int maxY, float opacity);
protected abstract void renderProgressBar(MatrixStack drawContext, int minX, int minY, int maxX, int maxY, float opacity);

@Inject(
method = "<init>",
Expand Down Expand Up @@ -76,11 +76,11 @@ public void pauses(CallbackInfoReturnable<Boolean> cir) {
}

@Override
public void render(DrawContext context, boolean isGame) {
public void render(MatrixStack context, boolean isGame) {
if (!Rrls.config.showIn.canShow(isGame)) return;

int i = context.getScaledWindowWidth();
int j = context.getScaledWindowHeight();
int i = this.client.getWindow().getScaledWidth();
int j = this.client.getWindow().getScaledHeight();

int s = (int) ((double) j * 0.8325);
int r = (int) (Math.min(i * 0.75, j) * 0.5);
Expand Down Expand Up @@ -126,7 +126,7 @@ public void reload() {
),
cancellable = true
)
public void render(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
public void render(MatrixStack context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
if (this.rrls_attach)
ci.cancel();
}
Expand Down
2 changes: 1 addition & 1 deletion fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"depends": {
"fabric": "*",
"fabric-api": "*",
"minecraft": "~1.20",
"minecraft": "~1.19",
"cloth-config": "*"
},
"recommends": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ public RrlsForge() {
@SubscribeEvent
public void onRenderGui(RenderGuiEvent.Pre event) {
if (this.client.overlay instanceof SplashAccessor accessor && accessor.isAttached())
accessor.render(event.getGuiGraphics(), true);
accessor.render(event.getPoseStack(), true);
}

@SubscribeEvent
public void onScreenRender(ScreenEvent.Render event) {
if (this.client.overlay instanceof SplashAccessor accessor && accessor.isAttached())
accessor.render(event.getGuiGraphics(), false);
accessor.render(event.getPoseStack(), false);
}

@SubscribeEvent
Expand Down
2 changes: 1 addition & 1 deletion forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ side = "BOTH"
[[dependencies.rrls]]
modId = "minecraft"
mandatory = true
versionRange = "[1.20,)"
versionRange = "[1.19,)"
ordering = "NONE"
side = "BOTH"

Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
org.gradle.jvmargs=-Xmx4G

# Properties
minecraft_version = 1.20.1
yarn_mappings = 1.20.1+build.8
minecraft_version = 1.19.4
yarn_mappings = 1.19.4+build.2
loader_version = 0.14.21
forge_version = 1.20.1-47.0.19
forge_version = 1.19.4-45.1.2

# Mod Properties
mod_version = 3.1.0
maven_group = com.github.dima_dencep.mods
archives_base_name = Rrls

# Dependencies
modmenu_version = 7.1.0
fabric_api_version = 0.84.0+1.20.1
cloth_config_version = 11.0.99
modmenu_version = 6.2.3
fabric_api_version = 0.84.0+1.19.4
cloth_config_version = 10.0.96

0 comments on commit 8292c80

Please sign in to comment.