Skip to content

Commit dbdb3f2

Browse files
committed
fix sticky
1 parent 0a95181 commit dbdb3f2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/java/meteordevelopment/meteorclient/mixin/HandledScreenMixin.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
package meteordevelopment.meteorclient.mixin;
77

8+
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
89
import meteordevelopment.meteorclient.systems.modules.Modules;
910
import meteordevelopment.meteorclient.systems.modules.misc.InventoryTweaks;
1011
import meteordevelopment.meteorclient.systems.modules.render.BetterTooltips;
@@ -13,6 +14,7 @@
1314
import net.minecraft.client.gui.screen.Screen;
1415
import net.minecraft.client.gui.screen.ingame.HandledScreen;
1516
import net.minecraft.client.gui.screen.ingame.ScreenHandlerProvider;
17+
import net.minecraft.client.gui.tooltip.TooltipComponent;
1618
import net.minecraft.client.gui.widget.ButtonWidget;
1719
import net.minecraft.item.ItemStack;
1820
import net.minecraft.screen.ScreenHandler;
@@ -123,4 +125,13 @@ private void onDrawSlot(DrawContext context, Slot slot, CallbackInfo ci) {
123125
int color = Modules.get().get(ItemHighlight.class).getColor(slot.getStack());
124126
if (color != -1) context.fill(slot.x, slot.y, slot.x + 16, slot.y + 16, color);
125127
}
128+
129+
@ModifyReturnValue(method = "isItemTooltipSticky", at = @At("RETURN"))
130+
private boolean isTooltipSticky(boolean original, ItemStack item) {
131+
if (item.getTooltipData().orElse(null) instanceof TooltipComponent component) {
132+
return component.isSticky();
133+
}
134+
135+
return original;
136+
}
126137
}

0 commit comments

Comments
 (0)