generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Velocity forward protocol v3
- Loading branch information
1 parent
c4b985e
commit 1a0fbd6
Showing
5 changed files
with
58 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/java/one/oktw/mixin/IServerLoginNetworkHandler_RealUUID.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package one.oktw.mixin; | ||
|
||
import java.util.UUID; | ||
|
||
public interface IServerLoginNetworkHandler_RealUUID { | ||
void setRealUUID(UUID uuid); | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/one/oktw/mixin/core/ServerLoginNetworkHandler_KeyCheck.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package one.oktw.mixin.core; | ||
|
||
import com.mojang.authlib.GameProfile; | ||
import net.minecraft.server.network.ServerLoginNetworkHandler; | ||
import one.oktw.mixin.IServerLoginNetworkHandler_RealUUID; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
import java.util.UUID; | ||
|
||
@Mixin(ServerLoginNetworkHandler.class) | ||
public abstract class ServerLoginNetworkHandler_KeyCheck implements IServerLoginNetworkHandler_RealUUID { | ||
private UUID realUUID = null; | ||
|
||
@Redirect(method = "acceptPlayer", at = @At(value = "INVOKE", target = "Lcom/mojang/authlib/GameProfile;getId()Ljava/util/UUID;", remap = false)) | ||
private UUID overrideUuid(GameProfile instance) { | ||
return realUUID != null ? realUUID : instance.getId(); | ||
} | ||
|
||
@Override | ||
public void setRealUUID(UUID uuid) { | ||
realUUID = uuid; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters