Skip to content
Closed
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 @@ -107,6 +107,7 @@
| Basic | [MC-227337](https://bugs.mojang.com/browse/MC-227337) | When a shulker bullet hits an entity, the explodes sound is not played and particles are not produced |
| Basic | [MC-231743](https://bugs.mojang.com/browse/MC-231743) | minecraft.used:minecraft.POTTABLE_PLANT doesn't increase when placing plants into flower pots |
| Basic | [MC-232869](https://bugs.mojang.com/browse/MC-232869) | Adult striders can spawn with saddles in peaceful mode |
| Basic | [MC-232968](https://bugs.mojang.com/browse/MC-232968) | Spectators can prevent the closing animation of a chest/barrel when viewing it at the same time as a non-spectator |
| Basic | [MC-245394](https://bugs.mojang.com/browse/MC-245394) | The sounds of raid horns blaring aren't controlled by the correct sound slider |
| Basic | [MC-251068](https://bugs.mojang.com/browse/MC-251068) | If you delete your only world, then you are no longer automatically thrown into the menu of creating a new world |
| Basic | [MC-267125](https://bugs.mojang.com/browse/MC-267125) | Command suggestions for reloadable content are not affected by /reload |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package dev.isxander.debugify.mixins.basic.mc232968;

import com.llamalad7.mixinextras.expression.Definition;
import com.llamalad7.mixinextras.expression.Expression;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import dev.isxander.debugify.fixes.BugFix;
import dev.isxander.debugify.fixes.FixCategory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.block.entity.ContainerOpenersCounter;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;

import java.util.function.Predicate;

@BugFix(id = "MC-232968", category = FixCategory.BASIC, env = BugFix.Env.SERVER, description = "Spectators can prevent the closing animation of a chest/barrel when viewing it at the same time as a non-spectator")
@Mixin(ContainerOpenersCounter.class)
public abstract class ContainerOpenersCounterMixin {
@Shadow
protected abstract boolean isOwnContainer(Player player);

@Definition(id = "isOwnContainer", method = "Lnet/minecraft/world/level/block/entity/ContainerOpenersCounter;isOwnContainer(Lnet/minecraft/world/entity/player/Player;)Z")
@Expression("?::isOwnContainer")
@ModifyExpressionValue(method = "getPlayersWithContainerOpen", at = @At("MIXINEXTRAS:EXPRESSION"))
private Predicate<Player> fixSpectatorContainerOpen(Predicate<Player> original) {
return player -> isOwnContainer(player) && !player.isSpectator();
}
}
1 change: 1 addition & 0 deletions src/main/resources/debugify.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"basic.mc227337.ShulkerBulletMixin",
"basic.mc231743.FlowerPotBlockMixin",
"basic.mc232869.StriderMixin",
"basic.mc232968.ContainerOpenersCounterMixin",
"basic.mc245394.RaidMixin",
"basic.mc267125.MinecraftServerMixin",
"basic.mc268617.FileUtilMixin",
Expand Down