Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions PATCHED.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
| 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 |
| Basic | [MC-171420](https://bugs.mojang.com/browse/MC-171420) | OP players get kicked for not being on the whitelist (enforce = on) |
| Basic | [MC-176806](https://bugs.mojang.com/browse/MC-176806) | Scoreboard criteria for using glowstone doesn't increase score when charging a respawn anchor |
| Basic | [MC-177381](https://bugs.mojang.com/browse/MC-177381) | Game does not count the distance properly if you locate a structure from more than 46340 blocks away |
| Basic | [MC-179072](https://bugs.mojang.com/browse/MC-179072) | Creepers do not defuse when switching from Survival to Creative/Spectator |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package dev.isxander.debugify.mixins.basic.mc171420;

import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
import com.llamalad7.mixinextras.sugar.Local;
import dev.isxander.debugify.fixes.BugFix;
import dev.isxander.debugify.fixes.FixCategory;
import net.minecraft.network.chat.Component;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.network.ServerGamePacketListenerImpl;
import net.minecraft.server.players.PlayerList;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;

@BugFix(id = "MC-171420", category = FixCategory.BASIC, env = BugFix.Env.SERVER, description = "OP players get kicked for not being on the whitelist (enforce = on)")
@Mixin(MinecraftServer.class)
public abstract class MinecraftServerMixin {
@Shadow
public abstract PlayerList getPlayerList();

@WrapWithCondition(method = "kickUnlistedPlayers", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerGamePacketListenerImpl;disconnect(Lnet/minecraft/network/chat/Component;)V"))
private boolean isOpCheck(ServerGamePacketListenerImpl instance, Component component, @Local ServerPlayer serverPlayer) {
return !this.getPlayerList().isOp(serverPlayer.getGameProfile());
}
}
1 change: 1 addition & 0 deletions src/main/resources/debugify.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"basic.mc160095.CactusBlockMixin",
"basic.mc168573.BlocksAttacksMixin",
"basic.mc170462.MobEffectsMixin",
"basic.mc171420.MinecraftServerMixin",
"basic.mc176806.RespawnAnchorBlockMixin",
"basic.mc17738.LocateCommandMixin",
"basic.mc179072.SwellGoalMixin",
Expand Down