diff --git a/PATCHED.md b/PATCHED.md index 9023064e..dee7e51b 100644 --- a/PATCHED.md +++ b/PATCHED.md @@ -82,6 +82,7 @@ | Basic | [MC-147659](https://bugs.mojang.com/browse/MC-147659) | Some witch huts spawn the incorrect cat | | Basic | [MC-147784](https://bugs.mojang.com/browse/MC-147784) | Fletching table flashes crafting table's GUI for about a second upon right-clicking it in spectator mode | | Basic | [MC-155509](https://bugs.mojang.com/browse/MC-155509) | Puffed pufferfish can hurt the player while dying | +| Basic | [MC-158900](https://bugs.mojang.com/browse/MC-158900) | "bad packet id 26" upon connecting after tempban expire | | Basic | [MC-159283](https://bugs.mojang.com/browse/MC-159283) | The End terrain does not generate in multiple rings centered around the world center | | Basic | [MC-160095](https://bugs.mojang.com/browse/MC-160095) | End Rods only break Cactus when moved by pistons | | Basic | [MC-170462](https://bugs.mojang.com/browse/MC-170462) | Bad Omen is considered a positive effect in potion item tooltips | diff --git a/src/main/java/dev/isxander/debugify/mixins/basic/mc158900/PlayerListMixin.java b/src/main/java/dev/isxander/debugify/mixins/basic/mc158900/PlayerListMixin.java new file mode 100644 index 00000000..a52ce2d4 --- /dev/null +++ b/src/main/java/dev/isxander/debugify/mixins/basic/mc158900/PlayerListMixin.java @@ -0,0 +1,26 @@ +package dev.isxander.debugify.mixins.basic.mc158900; + +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; +import com.llamalad7.mixinextras.sugar.Local; +import com.mojang.authlib.GameProfile; +import dev.isxander.debugify.fixes.BugFix; +import dev.isxander.debugify.fixes.FixCategory; +import net.minecraft.server.players.PlayerList; +import net.minecraft.server.players.UserBanList; +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; + +@BugFix(id = "MC-158900", category = FixCategory.BASIC, env = BugFix.Env.SERVER, description = "\"bad packet id 26\" upon connecting after tempban expire") +@Mixin(PlayerList.class) +public class PlayerListMixin { + @Shadow + @Final + private UserBanList bans; + + @ModifyExpressionValue(method = "canPlayerLogin", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/players/UserBanList;isBanned(Lcom/mojang/authlib/GameProfile;)Z")) + private boolean npeCheck(boolean original, @Local(argsOnly = true) GameProfile gameProfile) { + return this.bans.get(gameProfile) != null && original; + } +} diff --git a/src/main/resources/debugify.mixins.json b/src/main/resources/debugify.mixins.json index cf77856d..93ff7ab3 100644 --- a/src/main/resources/debugify.mixins.json +++ b/src/main/resources/debugify.mixins.json @@ -27,6 +27,7 @@ "basic.mc147659.CatSpawnerMixin", "basic.mc147784.FletchingTableBlockMixin", "basic.mc155509.PufferfishMixin", + "basic.mc158900.PlayerListMixin", "basic.mc159283.DensityFunctionsMixin", "basic.mc160095.CactusBlockMixin", "basic.mc168573.BlocksAttacksMixin",