Update mixins and code for 1.19.4

This commit is contained in:
Aizistral
2026-01-27 22:01:20 +01:00
parent 6dd040f5af
commit 7ffc1b0339
2 changed files with 46 additions and 4 deletions

View File

@@ -1,11 +1,14 @@
package com.aizistral.nochatrestrictions.core;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.Executor;
import com.google.common.collect.ImmutableSet;
import com.mojang.authlib.minecraft.TelemetrySession;
import com.mojang.authlib.minecraft.UserApiService;
import com.mojang.authlib.minecraft.report.AbuseReportLimits;
import com.mojang.authlib.yggdrasil.request.AbuseReportRequest;
import com.mojang.authlib.yggdrasil.response.KeyPairResponse;
public class WrappedUserApiService implements UserApiService {
@@ -18,9 +21,10 @@ public class WrappedUserApiService implements UserApiService {
flags.add(UserFlag.SERVERS_ALLOWED); // always let the player open multiplayer menu
flags.add(UserFlag.REALMS_ALLOWED); // always let the player open Realms menu
// flags.add(UserFlag.TELEMETRY_ENABLED); // not adding this for obvious reasons
// flags.add(UserFlag.OPTIONAL_TELEMETRY_AVAILABLE); // thanks but no thanks
// flags.add(UserFlag.PROFANITY_FILTER_ENABLED) // not adding this one either
FORCED_PROPERTIES = new UserProperties(flags.build());
FORCED_PROPERTIES = new UserProperties(flags.build(), Map.of());
}
private final UserApiService service;
@@ -49,10 +53,27 @@ public class WrappedUserApiService implements UserApiService {
return TelemetrySession.DISABLED;
}
// Methods below primarily concern chat reporting. Not doing anything with them
// here as that's out of scope for this mod, it's more of a No Chat Reports thing
@Override
public KeyPairResponse getKeyPair() {
// Not doing anything with this as that's more of a No Chat Reports thing
return this.service.getKeyPair();
}
@Override
public void reportAbuse(AbuseReportRequest request) {
this.service.reportAbuse(request);
}
@Override
public boolean canSendReports() {
return this.service.canSendReports();
}
@Override
public AbuseReportLimits getAbuseReportLimits() {
return this.service.getAbuseReportLimits();
}
}

View File

@@ -1,11 +1,14 @@
package com.aizistral.nochatrestrictions.core;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.Executor;
import com.google.common.collect.ImmutableSet;
import com.mojang.authlib.minecraft.TelemetrySession;
import com.mojang.authlib.minecraft.UserApiService;
import com.mojang.authlib.minecraft.report.AbuseReportLimits;
import com.mojang.authlib.yggdrasil.request.AbuseReportRequest;
import com.mojang.authlib.yggdrasil.response.KeyPairResponse;
public class WrappedUserApiService implements UserApiService {
@@ -18,9 +21,10 @@ public class WrappedUserApiService implements UserApiService {
flags.add(UserFlag.SERVERS_ALLOWED); // always let the player open multiplayer menu
flags.add(UserFlag.REALMS_ALLOWED); // always let the player open Realms menu
// flags.add(UserFlag.TELEMETRY_ENABLED); // not adding this for obvious reasons
// flags.add(UserFlag.OPTIONAL_TELEMETRY_AVAILABLE); // thanks but no thanks
// flags.add(UserFlag.PROFANITY_FILTER_ENABLED) // not adding this one either
FORCED_PROPERTIES = new UserProperties(flags.build());
FORCED_PROPERTIES = new UserProperties(flags.build(), Map.of());
}
private final UserApiService service;
@@ -49,10 +53,27 @@ public class WrappedUserApiService implements UserApiService {
return TelemetrySession.DISABLED;
}
// Methods below primarily concern chat reporting. Not doing anything with them
// here as that's out of scope for this mod, it's more of a No Chat Reports thing
@Override
public KeyPairResponse getKeyPair() {
// Not doing anything with this as that's more of a No Chat Reports thing
return this.service.getKeyPair();
}
@Override
public void reportAbuse(AbuseReportRequest request) {
this.service.reportAbuse(request);
}
@Override
public boolean canSendReports() {
return this.service.canSendReports();
}
@Override
public AbuseReportLimits getAbuseReportLimits() {
return this.service.getAbuseReportLimits();
}
}