mirror of
https://github.com/TeamMidnightDust/MidnightControls.git
synced 2025-12-16 08:35:10 +01:00
port: The Copper Age (1.21.9)
This commit is contained in:
@@ -40,7 +40,7 @@ public interface HandledScreenAccessor {
|
||||
*/
|
||||
Slot midnightcontrols$getSlotAt(double posX, double posY);
|
||||
|
||||
boolean midnightcontrols$isClickOutsideBounds(double mouseX, double mouseY, int x, int y, int button);
|
||||
boolean midnightcontrols$isClickOutsideBounds(double mouseX, double mouseY, int left, int top);
|
||||
|
||||
/**
|
||||
* Handles a mouse click on the specified slot.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package eu.midnightdust.midnightcontrols.client.util.platform;
|
||||
|
||||
import dev.architectury.injectables.annotations.ExpectPlatform;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightInput;
|
||||
import eu.midnightdust.midnightcontrols.client.mixin.CreativeInventoryScreenAccessor;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
|
||||
@@ -11,6 +12,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static eu.midnightdust.midnightcontrols.client.MidnightInput.ENTER_KEY_INPUT;
|
||||
|
||||
public class ItemGroupUtil {
|
||||
@ExpectPlatform
|
||||
public static List<ItemGroup> getVisibleGroups(CreativeInventoryScreen screen) {
|
||||
@@ -24,10 +27,10 @@ public class ItemGroupUtil {
|
||||
.filter(element -> element.getMessage() != null && element.getMessage().getContent() != null)
|
||||
.anyMatch(element -> {
|
||||
if (next && element.getMessage().getString().equals(">")) {
|
||||
element.onPress();
|
||||
element.onPress(ENTER_KEY_INPUT);
|
||||
return true;
|
||||
} else if (element.getMessage().getString().equals("<")) {
|
||||
element.onPress();
|
||||
element.onPress(ENTER_KEY_INPUT);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user