-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added ServerHandshakePacketListenerImpl
- Loading branch information
Showing
5 changed files
with
38 additions
and
25 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
28 changes: 28 additions & 0 deletions
28
...ain/java/ua/caunt/bungeeforge/mixin/server/network/ServerHandshakePacketListenerImpl.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,28 @@ | ||
package ua.caunt.bungeeforge.mixin.server.network; | ||
|
||
import net.minecraft.network.Connection; | ||
import net.minecraft.network.protocol.handshake.ClientIntentionPacket; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
import ua.caunt.bungeeforge.bridge.network.ConnectionBridge; | ||
import ua.caunt.bungeeforge.bridge.network.protocol.handshake.ClientIntentionPacketBridge; | ||
|
||
@Mixin(net.minecraft.server.network.ServerHandshakePacketListenerImpl.class) | ||
public class ServerHandshakePacketListenerImpl { | ||
@Final | ||
@Shadow | ||
private Connection connection; | ||
|
||
@Inject(method = "handleIntention(Lnet/minecraft/network/protocol/handshake/ClientIntentionPacket;)V", at = @At("HEAD")) | ||
public void bungee$handleIntention(ClientIntentionPacket p_9975_, CallbackInfo ci) { | ||
ClientIntentionPacketBridge clientIntentionPacketBridge = (ClientIntentionPacketBridge) p_9975_; | ||
ConnectionBridge connectionBridge = (ConnectionBridge) connection; | ||
|
||
connectionBridge.bungee$setSpoofedId(clientIntentionPacketBridge.bungee$getSpoofedId()); | ||
connectionBridge.bungee$setSpoofedProperties(clientIntentionPacketBridge.bungee$getSpoofedProperties()); | ||
} | ||
} |
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