Skip to content

Commit fe850e8

Browse files
committed
[release] Make authme buttons not overlap with reconnect.
1 parent 458c42f commit fe850e8

3 files changed

Lines changed: 28 additions & 2 deletions

File tree

build.gradle

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ repositories {
1515
// for more information about repositories.
1616
maven { url 'https://maven.wispforest.io' }
1717
maven { url 'https://maven.terraformersmc.com/' }
18+
exclusiveContent {
19+
forRepository {
20+
maven {
21+
name = "Modrinth"
22+
url = "https://api.modrinth.com/maven"
23+
}
24+
}
25+
filter {
26+
includeGroup "maven.modrinth"
27+
}
28+
}
1829
}
1930

2031
// All the dependencies are declared at gradle/libs.version.toml and referenced with "libs.<id>"
@@ -40,6 +51,11 @@ dependencies {
4051
include "io.wispforest:owo-sentinel:${project.owo_version}"
4152
annotationProcessor modImplementation("io.wispforest:owo-lib:${project.owo_version}")
4253
modImplementation("com.terraformersmc:modmenu:${project.modmenu_version}")
54+
55+
if (project.compat_testing == "1") {
56+
modImplementation "maven.modrinth:yjgIrBjZ:kHOHwnYe" // AuthMe; 'reconnect' overlaps with 'back to server' button
57+
modImplementation "maven.modrinth:9s6osm5g:6XGTNEII" // cloth-config; dependency of AuthMe.
58+
}
4359
}
4460

4561
processResources {

gradle.properties

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ org.gradle.jvmargs = -Xmx1G
33
org.gradle.parallel = true
44

55
# Mod Properties
6-
version = 1.0.0
6+
version = 1.0.1
77
maven_group = dev.captain8771
88
archives_base_name = random_stuff
99
# https://maven.wispforest.io/io/wispforest/owo-lib/
1010
owo_version=0.10.3+1.19.4
1111
modmenu_version=6.2.2
1212

1313
# Dependencies are managed at gradle/libs.versions.toml
14+
15+
16+
# for compat testing, set this to 1.
17+
compat_testing=0

src/main/java/dev/captain8771/random_stuff/mixin/DisconnectScreenMixin.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import net.minecraft.registry.Registry;
1919
import net.minecraft.registry.SimpleRegistry;
2020
import net.minecraft.text.Text;
21+
import org.quiltmc.loader.api.QuiltLoader;
2122
import org.quiltmc.qsl.registry.impl.sync.client.ClientRegistrySync;
2223
import org.spongepowered.asm.mixin.Final;
2324
import org.spongepowered.asm.mixin.Mixin;
@@ -58,7 +59,12 @@ protected DisconnectScreenMixin(Text title) {
5859
ConnectScreen.connect(this.parent, mc, serverAddress, RandomStuffMod.lastServer);
5960
});
6061
if (RandomStuffMod.CONFIG.reconnectRelated.reconnectButton()) {
61-
this.addDrawableChild(ReconnectButton.positionAndSize(this.width / 2 - 100, Math.min(this.height / 2 + this.reasonHeight / 2 + 9, this.height - 30) + 20, 200, 20).build());
62+
int y = Math.min(this.height / 2 + this.reasonHeight / 2 + 9, this.height - 30) + 20;
63+
// check if the 'authme' mod is installed
64+
if (QuiltLoader.isModLoaded("authme")) {
65+
y += 30;
66+
}
67+
this.addDrawableChild(ReconnectButton.positionAndSize(this.width / 2 - 100, y, 200, 20).build());
6268
}
6369

6470
if (RandomStuffMod.CONFIG.reconnectRelated.autoReconnect()) {

0 commit comments

Comments
 (0)