Skip to content

Commit

Permalink
Remove unused mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
james58899 committed Jun 8, 2022
1 parent 88531cc commit 18387cc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import net.minecraft.network.packet.c2s.login.LoginHelloC2SPacket;
import net.minecraft.server.network.ServerLoginNetworkHandler;
import one.oktw.VelocityLib;
import one.oktw.mixin.ServerLoginNetworkHandler_DelayHello;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand All @@ -16,25 +15,15 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(ServerLoginNetworkHandler.class)
public class ServerLoginNetworkHandler_EarlySendPacket implements ServerLoginNetworkHandler_DelayHello {
public class ServerLoginNetworkHandler_EarlySendPacket {
@Shadow
@Nullable GameProfile profile;
private LoginHelloC2SPacket helloPacket = null;

@Inject(method = "onHello", at = @At(value = "HEAD"), cancellable = true)
private void skipKeyPacket(LoginHelloC2SPacket packet, CallbackInfo ci) {
if (profile != null && profile.isComplete()) return; // Already receive profile form velocity.

helloPacket = packet;
((ServerLoginNetworkAddon) ((NetworkHandlerExtensions) this).getAddon()).sendPacket(VelocityLib.PLAYER_INFO_CHANNEL, PacketByteBufs.empty());
ci.cancel();
}

@Nullable
@Override
public LoginHelloC2SPacket delayedHelloPacket() {
LoginHelloC2SPacket packet = helloPacket;
helloPacket = null; // Only read once.
return packet;
}
}

0 comments on commit 18387cc

Please sign in to comment.