Skip to content

Commit

Permalink
Fix MC-171420
Browse files Browse the repository at this point in the history
  • Loading branch information
Rektroth committed Jul 4, 2024
1 parent e86ecd1 commit e2c8dee
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Whiteout is an attempt to implement the gameplay and mechanic consistency patche
| [MC-159283](https://bugs.mojang.com/browse/MC-159283) | Paper | No | Low | The End terrain does not generate in multiple rings centered around the world center |
| [MC-163962](https://bugs.mojang.com/browse/MC-163962) | Paper | No | *None* | Villager demand values decrease indefinitely |
| [MC-167279](https://bugs.mojang.com/browse/MC-167279) | Paper | No | Normal | Bees get stuck in the void |
| [MC-171420](https://bugs.mojang.com/browse/MC-171420) | Paper | No | Low | OP players get kicked for not being on the whitelist (enforce = on) |
| [MC-188840](https://bugs.mojang.com/browse/MC-188840) | Paper | Yes | *N/A* | *This ticket covered piston-based block duplication. It is unknown why the ticket was privated/deleted.* |
| [MC-210802](https://bugs.mojang.com/browse/MC-210802) | Paper | No | *None* | Inactive sheep eat grass |
| [MC-224454](https://bugs.mojang.com/browse/MC-224454) | Paper | No | Normal | Entities don't recognize azaleas or flowering azaleas as obstacles when pathfinding |
Expand Down Expand Up @@ -52,7 +53,6 @@ Patches that are considered "lazy" or are for a bug ticket which does not have a
| [MC-145656](https://bugs.mojang.com/browse/MC-145656) | Paper | Attribute "follow_range" is not working to hostile mobs before they find the target |
| [MC-147659](https://bugs.mojang.com/browse/MC-147659) | Paper | Some witch huts spawn the incorrect cat |
| [MC-157395](https://bugs.mojang.com/browse/MC-157395) | Spigot | Small armor stands drop no loot table |
| [MC-171420](https://bugs.mojang.com/browse/MC-171420) | Paper | OP players get kicked for not being on the whitelist (enforce = on) |
| [MC-174630](https://bugs.mojang.com/browse/MC-174630) | Paper | Secondary beacon effect remains when switching primary effect |
| [MC-191591](https://bugs.mojang.com/browse/MC-191591) | Paper | Saddles lose their NBT data when equipped on horses, zombie horses, skeleton horses, mules or donkeys via right-clicking |
| [MC-200092](https://bugs.mojang.com/browse/MC-200092) | Paper | /setworldspawn seems to ignore the 'angle' parameter |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Patch for MC-171420
*
* Authored for CraftBukkit/Spigot by William Blake Galbreath <[email protected]> on October 3, 2020.
* Ported to Fabric by Rektroth <[email protected]> on July 4, 2024.
*/

package io.github.rektroth.whiteout.mixin.mc171420;

import com.mojang.authlib.GameProfile;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.PlayerManager;
import net.minecraft.server.Whitelist;
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.Redirect;

@Mixin(MinecraftServer.class)
public abstract class MinecraftServerMixin {
@Shadow
public abstract PlayerManager getPlayerManager();

/**
* Checks if the player is whitelisted *or* is an operator.
* @param instance The whitelist.
* @param profile The player profile.
* @return True if the player is whitelisted or an operator, false otherwise.
*/
@Redirect(
at = @At(
target = "Lnet/minecraft/server/Whitelist;isAllowed(Lcom/mojang/authlib/GameProfile;)Z",
value = "INVOKE"
),
method = "kickNonWhitelistedPlayers"
)
private boolean isAllowedOrOp(Whitelist instance, GameProfile profile) {
return instance.isAllowed(profile) || this.getPlayerManager().isOperator(profile);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ mc158900=false
mc159283=true
mc163962=false
mc167279=true
mc171420=true
mc188840=false
mc210802=false
mc224454=true
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/whiteout.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"mc159283.EndIslandsMixin",
"mc163962.TradeOfferMixin",
"mc167279.BeeEntityMixin",
"mc171420.MinecraftServerMixin",
"mc188840.PistonBlockMixin",
"mc210802.EatGrassGoalMixin",
"mc210802.ServerChunkLoadingManagerInvoker",
Expand Down

0 comments on commit e2c8dee

Please sign in to comment.