Skip to content

Commit 4c52dd5

Browse files
committed
should fix hotbar swaps messing with other players' held items
1 parent 529c025 commit 4c52dd5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/com/lambda/mixin/entity/PlayerInventoryMixin.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package com.lambda.mixin.entity;
1919

20+
import com.lambda.Lambda;
2021
import com.lambda.interaction.request.hotbar.HotbarManager;
2122
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
2223
import net.minecraft.entity.player.PlayerInventory;
@@ -29,6 +30,7 @@ public class PlayerInventoryMixin {
2930
@SuppressWarnings({"MixinAnnotationTarget"})
3031
@ModifyExpressionValue(method = "*", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/player/PlayerInventory;selectedSlot:I", opcode = Opcodes.GETFIELD))
3132
private int modifySelectedSlot(int original) {
33+
if (((PlayerInventory) ((Object) this)).player != Lambda.getMc().player) return original;
3234
final int hotbarSlot = HotbarManager.getActiveSlot();
3335
if (hotbarSlot == -1) return original;
3436
return hotbarSlot;

0 commit comments

Comments
 (0)