Skip to content

Commit

Permalink
🐛 修复fakePlayerUseOfflinePlayerUUID导致的无法召唤假人的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
1024-byteeeee committed Sep 21, 2024
1 parent c8b72e5 commit d3963ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;

import com.mojang.authlib.GameProfile;

//#if MC>=11900
Expand All @@ -49,14 +50,14 @@ public abstract class Carpet_EntityPlayerMPFakeMixin {
target = "Lnet/minecraft/util/UserCache;findByName(Ljava/lang/String;)Ljava/util/Optional;"
)
)
private static Optional<GameProfile> useOfflinePlayerUuid(UserCache userCache, String playerName, Operation<GameProfile> original) {
private static Optional<GameProfile> useOfflinePlayerUUID(UserCache userCache, String playerName, Operation<Optional<GameProfile>> original) {
return
AmsServerSettings.fakePlayerUseOfflinePlayerUUID ?
//#if MC>=11900
//$$ Optional.of(new GameProfile(Uuids.getOfflinePlayerUuid(playerName), playerName)) :
//#else
Optional.of(new GameProfile(PlayerEntity.getOfflinePlayerUuid(playerName), playerName)) :
//#endif
Optional.of(original.call(userCache, playerName));
original.call(userCache, playerName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;

import com.mojang.authlib.GameProfile;

//#if MC>=11900
Expand All @@ -49,7 +50,7 @@ public abstract class Carpet_PlayerCommandMixin {
target = "Lnet/minecraft/util/UserCache;findByName(Ljava/lang/String;)Ljava/util/Optional;"
)
)
private static Optional<GameProfile> useOfflinePlayerUuid(UserCache userCache, String playerName, Operation<Optional<GameProfile>> original) {
private static Optional<GameProfile> useOfflinePlayerUUID(UserCache userCache, String playerName, Operation<Optional<GameProfile>> original) {
return
AmsServerSettings.fakePlayerUseOfflinePlayerUUID ?
//#if MC>=11900
Expand Down

0 comments on commit d3963ce

Please sign in to comment.