Skip to content

Commit

Permalink
CtrlClick to save filters
Browse files Browse the repository at this point in the history
  • Loading branch information
Direwolf20-MC committed Sep 8, 2024
1 parent 802875a commit 5f11d4e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.resources.sounds.SimpleSoundInstance;
import net.minecraft.network.chat.Component;
Expand Down Expand Up @@ -137,7 +138,7 @@ public void renderInventorySection(GuiGraphics guiGraphics, int relX, int relY)

@Override
public boolean mouseClicked(double x, double y, int btn) {
if (btn == 1 && hoveredSlot != null && hoveredSlot instanceof InventoryHolderSlot) {
if (btn == 0 && Screen.hasControlDown() && hoveredSlot != null && hoveredSlot instanceof InventoryHolderSlot) {
PacketDistributor.sendToServer(new InventoryHolderSaveSlotPayload(hoveredSlot.getSlotIndex()));
Minecraft.getInstance().getSoundManager().play(SimpleSoundInstance.forUI(SoundEvents.UI_BUTTON_CLICK, 1.0F));
return true;
Expand Down

0 comments on commit 5f11d4e

Please sign in to comment.