diff --git a/eco-api/src/main/java/com/willfp/eco/core/tuples/Pair.java b/eco-api/src/main/java/com/willfp/eco/core/tuples/Pair.java
index abd41675..d4ecd5f1 100644
--- a/eco-api/src/main/java/com/willfp/eco/core/tuples/Pair.java
+++ b/eco-api/src/main/java/com/willfp/eco/core/tuples/Pair.java
@@ -38,4 +38,26 @@ public class Pair {
this.first = first;
this.second = second;
}
+
+ /**
+ * component1 exists to allow a pair to be destructured by kotlin.
+ * The default kotlin pair already has this, however there is no default
+ * pair in java so this exists for parity.
+ *
+ * @return First.
+ */
+ public A component1() {
+ return first;
+ }
+
+ /**
+ * component2 exists to allow a pair to be destructured by kotlin.
+ * The default kotlin pair already has this, however there is no default
+ * pair in java so this exists for parity.
+ *
+ * @return First.
+ */
+ public B component2() {
+ return second;
+ }
}
diff --git a/eco-api/src/main/java/com/willfp/eco/core/tuples/Triplet.java b/eco-api/src/main/java/com/willfp/eco/core/tuples/Triplet.java
index c857ab69..1254a88c 100644
--- a/eco-api/src/main/java/com/willfp/eco/core/tuples/Triplet.java
+++ b/eco-api/src/main/java/com/willfp/eco/core/tuples/Triplet.java
@@ -34,4 +34,15 @@ public class Triplet extends Pair {
this.third = third;
}
+
+ /**
+ * component3 exists to allow a pair to be destructured by kotlin.
+ * The default kotlin pair already has this, however there is no default
+ * pair in java so this exists for parity.
+ *
+ * @return First.
+ */
+ public C component3() {
+ return third;
+ }
}
diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/gui/GUIListener.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/gui/GUIListener.kt
index b37bbf06..c17c5123 100644
--- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/gui/GUIListener.kt
+++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/gui/GUIListener.kt
@@ -73,9 +73,7 @@ class GUIListener(private val plugin: EcoPlugin) : Listener {
val menu = MenuHandler.getMenu(inv) ?: return
- val rowColumn = MenuUtils.convertSlotToRowColumn(inv.firstEmpty())
- val row = rowColumn.first!!
- val column = rowColumn.second!!
+ val (row, column) = MenuUtils.convertSlotToRowColumn(inv.firstEmpty())
val slot = menu.getSlot(row, column)
if (!slot.isCaptive) {