Skip to content

Commit 1ec077f

Browse files
author
Weldify
committed
Fix
1 parent 788e88e commit 1ec077f

File tree

7 files changed

+19
-24
lines changed

7 files changed

+19
-24
lines changed

build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,8 @@ dependencies {
9090

9191
// Helper library
9292
// If you do not need Halplibe you can comment this line out or delete this line
93-
modImplementation("turniplabs:halplibe:${project.halplibe_version}")
94-
95-
modImplementation("turniplabs:modmenu-bta:${project.mod_menu_version}")
93+
// modImplementation("turniplabs:halplibe:${project.halplibe_version}")
94+
// modImplementation("turniplabs:modmenu-bta:${project.mod_menu_version}")
9695

9796
implementation "org.slf4j:slf4j-api:1.8.0-beta4"
9897
implementation "org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0"

gradle.properties

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ bta_channel=release
77
# Loader
88
loader_version=0.15.6-bta.7
99

10-
# Other mods
11-
mod_menu_version=3.0.0
12-
halplibe_version=5.2.4
13-
1410
# Mod
1511
mod_version=1.0.0
1612
mod_group=weldify

src/main/java/justauth/JustAuth.java renamed to src/main/java/weldify/justauth/JustAuth.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package justauth;
1+
package weldify.justauth;
22

33
import net.minecraft.core.net.packet.PacketLogin;
44

src/main/java/justauth/mixin/PacketHandlerLoginMixin.java renamed to src/main/java/weldify/justauth/mixin/PacketHandlerLoginMixin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
package justauth.mixin;
1+
package weldify.justauth.mixin;
22

33
import net.minecraft.core.net.packet.PacketLogin;
44
import net.minecraft.server.net.handler.PacketHandlerLogin;
55
import org.spongepowered.asm.mixin.Mixin;
66
import org.spongepowered.asm.mixin.injection.At;
77
import org.spongepowered.asm.mixin.injection.Inject;
88
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
9-
import justauth.JustAuth;
9+
import weldify.justauth.JustAuth;
1010

1111
import java.nio.file.Files;
1212
import java.nio.file.Paths;

src/main/java/justauth/mixin/PacketLoginMixin.java renamed to src/main/java/weldify/justauth/mixin/PacketLoginMixin.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
package justauth.mixin;
1+
package weldify.justauth.mixin;
22

33
import net.minecraft.core.Global;
44
import net.minecraft.core.net.packet.PacketLogin;
55
import org.spongepowered.asm.mixin.Mixin;
66
import org.spongepowered.asm.mixin.injection.At;
77
import org.spongepowered.asm.mixin.injection.Inject;
88
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
9-
import justauth.JustAuth;
9+
import weldify.justauth.JustAuth;
1010

1111
import java.io.DataInputStream;
1212
import java.io.DataOutputStream;
@@ -18,7 +18,7 @@
1818
public class PacketLoginMixin {
1919
@Inject(method = "read", at = @At("HEAD"), remap = false)
2020
void read(DataInputStream dis, CallbackInfo ci) throws IOException {
21-
int length = dis.readByte();
21+
byte length = dis.readByte();
2222
byte[] password = new byte[length];
2323
dis.readFully(password);
2424

@@ -30,13 +30,15 @@ void read(DataInputStream dis, CallbackInfo ci) throws IOException {
3030
}
3131

3232
@Inject(method = "write", at = @At("HEAD"), remap = false)
33-
void write(DataOutputStream dos, CallbackInfo ci) {
34-
try {
35-
byte[] password = Files.readAllBytes(Paths.get("just.auth"));
36-
dos.writeByte(password.length);
37-
dos.write(password);
38-
} catch (Exception ignored) {
39-
// Don't send anything! Might let people join regular servers.
33+
void write(DataOutputStream dos, CallbackInfo ci) throws IOException {
34+
// @Note: I don't know why the server would want to write this packet back, but it does.
35+
if (Global.isServer) {
36+
dos.writeByte(0);
37+
return;
4038
}
39+
40+
byte[] password = Files.readAllBytes(Paths.get("just.auth"));
41+
dos.writeByte(password.length);
42+
dos.write(password);
4143
}
4244
}

src/main/resources/fabric.mod.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
"license": "WTFPL",
1010

1111
"environment": "*",
12-
"mixins": [
13-
"justauth.mixins.json"
14-
],
12+
"mixins": ["justauth.mixins.json"],
1513

1614
"depends": {
1715
"minecraft": "*",

src/main/resources/justauth.mixins.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"required": true,
33
"minVersion": "0.8",
4-
"package": "justauth.mixin",
4+
"package": "weldify.justauth.mixin",
55
"compatibilityLevel": "JAVA_8",
66
"mixins": ["PacketLoginMixin"],
77
"server": ["PacketHandlerLoginMixin"],

0 commit comments

Comments
 (0)