From 581f337198e5ac85045ba375541a493034f94d80 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sat, 25 Mar 2023 20:51:29 +0700 Subject: [PATCH 1/2] Don't use Streams.concat because they don't improve performance here --- src/main/kotlin/ru/dbotthepony/mc/otm/capability/Ext.kt | 8 ++++---- .../ru/dbotthepony/mc/otm/compat/curios/CuriosCompat.kt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/capability/Ext.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/capability/Ext.kt index 2192faf38..a404652a6 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/capability/Ext.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/capability/Ext.kt @@ -209,7 +209,7 @@ fun ICapabilityProvider.getMatteryEnergySided(side: Direction? = null): LazyOpti * Contains all items that player might carry */ fun Player.itemsStream(includeCosmetics: Boolean = true): Stream { - val streams = LinkedList>() + val streams = ArrayList>() streams.add(inventory.stream()) matteryPlayer?.let { @@ -226,7 +226,7 @@ fun Player.itemsStream(includeCosmetics: Boolean = true): Stream streams.add(cosmeticArmorStream()) } - return Streams.concat(*streams.toTypedArray()) + return streams.stream().flatMap { it } } /** @@ -256,7 +256,7 @@ fun Player.allItemsStream(includeCosmetics: Boolean = true): Stream { - val streams = LinkedList>() + val streams = ArrayList>() streams.add(inventory.awareStream()) matteryPlayer?.let { @@ -273,7 +273,7 @@ fun Player.awareItemsStream(includeCosmetics: Boolean = false): Stream { From a1fd94826660daf2412ca7c6a6aed0f2db889492 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sat, 25 Mar 2023 21:20:56 +0700 Subject: [PATCH 2/2] Add missing auto align to curios panel in matter reconstructor --- .../mc/otm/client/screen/matter/MatterReconstructorScreen.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/matter/MatterReconstructorScreen.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/matter/MatterReconstructorScreen.kt index 5a15bdecc..cbfdf5b89 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/matter/MatterReconstructorScreen.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/matter/MatterReconstructorScreen.kt @@ -29,7 +29,7 @@ class MatterReconstructorScreen(menu: MatterReconstructorMenu, inventory: Invent ProgressGaugePanel(this, frame, menu.progress, 37f, PROGRESS_ARROW_TOP) makeDeviceControls(this, frame, redstoneConfig = menu.redstoneConfig, itemConfig = menu.itemConfig, energyConfig = menu.energyConfig) - makeCuriosPanel(this, frame, menu.equipment.curiosSlots) + makeCuriosPanel(this, frame, menu.equipment.curiosSlots, autoAlign = true) PlayerEquipmentPanel(this, frame, armorSlots = menu.equipment.armorSlots).also { it.leftSided = false