Skip to content

Commit

Permalink
Fix mixin inject point rather than repeating code
Browse files Browse the repository at this point in the history
  • Loading branch information
adryd325 committed Aug 24, 2024
1 parent 20e439c commit 0fe7fb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ yarn_mappings=1.21+build.2
loader_version=0.15.11

# Mod Properties
mod_version = 1.0.14
mod_version = 1.0.14.1
maven_group = com.adryd
archives_base_name = sneaky
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ class MixinServerLoginNetworkHandler {
@Nullable
private GameProfile profile;

@Inject(method = "tickVerify", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/PlayerManager;checkCanJoin(Ljava/net/SocketAddress;Lcom/mojang/authlib/GameProfile;)Lnet/minecraft/text/Text;", shift = At.Shift.AFTER))
@Inject(method = "tickVerify", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/ClientConnection;send(Lnet/minecraft/network/packet/Packet;Lnet/minecraft/network/PacketCallbacks;)V", shift = At.Shift.AFTER))
private void atSuccessfulJoin(CallbackInfo ci) {
if (this.server.getPlayerManager().checkCanJoin(this.connection.getAddress(), this.profile) == null) {
IPList.INSTANCE.addToIPList(this.connection.getAddress());
}
IPList.INSTANCE.addToIPList(this.connection.getAddress());
}

@Inject(method = "onDisconnected", at = @At("HEAD"), cancellable = true)
Expand Down

0 comments on commit 0fe7fb5

Please sign in to comment.