Make server whitelist work by matching player's ID.
Work on minecraft version 1.19.2.
Code From mcmod.cn@alltime2838
import com.mojang.authlib.GameProfile;
import net.minecraft.server.players.UserWhiteList;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(UserWhiteList.class)
public class MixinWhitelist {
@Overwrite
protected String getKeyForUser(GameProfile gameProfile) {
return gameProfile.getName().toString();
}
}
If you prefer to use Eclipse:
- Run the following command:
./gradlew genEclipseRuns
- Open Eclipse, Import > Existing Gradle Project > Select Folder
or run
gradlew eclipse
to generate the project.
If you prefer to use IntelliJ:
- Open IDEA, and import project.
- Select your build.gradle file and have it import.
- Run the following command:
./gradlew genIntellijRuns
- Refresh the Gradle Project in IDEA if required.
If at any point you are missing libraries in your IDE, or you've run into problems you can
run gradlew --refresh-dependencies
to refresh the local cache. gradlew clean
to reset everything
{this does not affect your code} and then start the process again.