1.18 fuckery part 2

This commit is contained in:
Agatha Lovelace 2021-12-23 00:05:44 +02:00
parent e83e47b3b1
commit a5a3afeb3e
6 changed files with 26 additions and 12 deletions

View File

@ -78,9 +78,14 @@ public abstract class MixinServerLoginNetworkHandler {
// Player has a Mojang account
httpsURLConnection.disconnect();
// Caches the request
mojangAccountNamesCache.add(playername);
if (!config.main.allowExistingNames) {
// Caches the request
mojangAccountNamesCache.add(playername);
} else {
state = ServerLoginNetworkHandler.State.READY_TO_ACCEPT;
this.profile = packet.getProfile();
ci.cancel();
}
// Authentication continues in original method
}
else if(response == HttpURLConnection.HTTP_NO_CONTENT) {

View File

@ -162,6 +162,11 @@ public class AuthConfig {
*/
public boolean premiumAutologin = false;
/*
* Whether to allow offline players with registered usernames to connect.
*/
public boolean allowExistingNames = false;
/**
* Contains a list of lower case (!) player names
* that should always be treated as offline.

View File

@ -30,19 +30,23 @@ dependencies {
// Password hashing
// Argon2
shadow "de.mkammerer:argon2-jvm:${argon2_version}"
shadowCommon ("de.mkammerer:argon2-jvm:${argon2_version}") {
exclude group: "net.java.dev.jna"
}
// BCrypt
shadow "at.favre.lib:bcrypt:${bcrypt_version}"
shadow "at.favre.lib:bytes:${bytes_version}"
shadowCommon "at.favre.lib:bcrypt:${bcrypt_version}"
shadowCommon "at.favre.lib:bytes:${bytes_version}"
// Storage
// leveldb
shadow group: 'org.iq80.leveldb', name: 'leveldb', version: '0.12'
shadow group: 'org.iq80.leveldb', name: 'leveldb-api', version: '0.12'
shadowCommon (group: 'org.iq80.leveldb', name: 'leveldb', version: '0.12') {
exclude group: "com.google.guava"
}
shadowCommon group: 'org.iq80.leveldb', name: 'leveldb-api', version: '0.12'
// JNA lib
shadow 'net.java.dev.jna:jna:5.5.0'
compileOnly 'net.java.dev.jna:jna:5.5.0'
}
shadowJar {

View File

@ -1,4 +1,4 @@
package org.samo_lego.simpleauth.forge;
package org.samo_lego.simpleauth;
import com.mojang.brigadier.CommandDispatcher;
import net.minecraft.server.command.ServerCommandSource;

View File

@ -1,4 +1,4 @@
package org.samo_lego.simpleauth.forge.event;
package org.samo_lego.simpleauth.event;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.ActionResult;

View File

@ -1,4 +1,4 @@
package org.samo_lego.simpleauth.forge.utils.forge;
package org.samo_lego.simpleauth.utils.forge;
import net.minecraft.entity.player.PlayerEntity;