@@ -100,9 +100,7 @@ public void initGui() {
100100 String lastStructure = ModConfig .getClientLastSelectedStructure ();
101101 if (lastStructure != null && !lastStructure .isEmpty ()) {
102102 ResourceLocation id = new ResourceLocation (lastStructure );
103- if (StructureProviderRegistry .getStructureInfo (id ) != null ) {
104- selectStructure (id );
105- }
103+ if (StructureProviderRegistry .getStructureInfo (id ) != null ) selectStructure (id );
106104 }
107105
108106 // Restore modal windows if they were hidden for navigation
@@ -547,11 +545,9 @@ private void buildPreviewRenderer(List<StructureLayer> layers) {
547545 for (int x = 0 ; x < layer .width ; x ++) {
548546 for (int z = 0 ; z < layer .depth ; z ++) {
549547 IBlockState state = layer .getBlockState (x , z );
550- if (state == null || state .getBlock () == Blocks .AIR ) continue ;
551- if (state .getBlock () == Blocks .STRUCTURE_VOID ) continue ;
548+ if (state == null || state .getBlock () == Blocks .AIR || state .getBlock () == Blocks .STRUCTURE_VOID ) continue ;
552549
553- BlockPos pos = new BlockPos (x , y , z );
554- previewRenderer .getWorld ().addBlock (pos , state );
550+ previewRenderer .getWorld ().addBlock (new BlockPos (x , y , z ), state );
555551 }
556552 }
557553 }
@@ -719,20 +715,6 @@ private void applyFilter() {
719715 }
720716 }
721717
722- // Sort: selected first, then tracked, then searchable, then alphabetically
723- ResourceLocation currentSelected = parent .selected ;
724- filteredStructures .sort (Comparator
725- .<ResourceLocation , Integer >comparing (id -> id .equals (currentSelected ) ? 0 : 1 )
726- .thenComparing (id -> StructureSearchManager .isTracked (id ) ? 0 : 1 )
727- .thenComparing (id -> StructureProviderRegistry .canBeSearched (id ) ? 0 : 1 )
728- .thenComparing (id -> {
729- if (ClientSettings .i18nNames ) {
730- StructureInfo info = StructureProviderRegistry .getStructureInfo (id );
731- return info != null ? I18n .format (info .getDisplayName ()) : id .getPath ();
732- }
733- return id .toString ();
734- }));
735-
736718 // Clamp scroll
737719 float maxScroll = getMaxScroll ();
738720 if (scrollOffset > maxScroll ) scrollOffset = maxScroll ;
@@ -836,11 +818,10 @@ public void draw(int mouseX, int mouseY) {
836818 int visibleStart = (int ) (scrollOffset / entryHeight );
837819 int visibleEnd = Math .min (filteredStructures .size (), visibleStart + (height / entryHeight ) + 2 );
838820
839- // FIXME: list needs to be sorted by name with current search at the top
821+ // FIXME: list needs to be sorted by name with currently tracked at the top
840822
841823 for (int i = visibleStart ; i < visibleEnd ; i ++) {
842824 int entryY = y + (i * entryHeight ) - (int ) scrollOffset ;
843-
844825 if (entryY + entryHeight < y || entryY > y + height ) continue ;
845826
846827 ResourceLocation id = filteredStructures .get (i );
0 commit comments