File tree Expand file tree Collapse file tree 3 files changed +11
-10
lines changed
src/main/java/xyz/theprogramsrc/supercoreapi/spigot/guis Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 1+ ## v5.0.3 Changelog:
2+ ```
3+ * Added missing search term argument
4+ ```
5+
16## v5.0.2 Changelog:
27```
38* Added custom filter for Browser GUI
Original file line number Diff line number Diff line change 66
77 <groupId >xyz.theprogramsrc</groupId >
88 <artifactId >SuperCoreAPI</artifactId >
9- <version >5.0.2 </version >
9+ <version >5.0.3 </version >
1010 <packaging >jar</packaging >
1111
1212 <name >SuperCoreAPI</name >
Original file line number Diff line number Diff line change @@ -32,19 +32,15 @@ protected GUIRows getRows() {
3232 return GUIRows .SIX ;
3333 }
3434
35- public boolean onItemSearch (OBJ obj ){
36- if (this .searchTerm != null ){
37- String itemName = this .getSuperUtils ().removeColor (new SimpleItem (this .getButton (obj ).getItemStack ()).getDisplayName ()).toLowerCase ();
38- String search = this .getSuperUtils ().removeColor (this .searchTerm ).toLowerCase ();
39- return itemName .contains (search );
40- }
41-
42- return true ;
35+ public boolean onItemSearch (OBJ obj , String searchTerm ){
36+ String itemName = this .getSuperUtils ().removeColor (new SimpleItem (this .getButton (obj ).getItemStack ()).getDisplayName ()).toLowerCase ();
37+ String search = this .getSuperUtils ().removeColor (searchTerm ).toLowerCase ();
38+ return itemName .contains (search );
4339 }
4440
4541 @ Override
4642 protected GUIButton [] getButtons () {
47- List <OBJ > objectsFound = Arrays .stream (this .getObjects ()).filter (this :: onItemSearch ).collect (Collectors .toList ());
43+ List <OBJ > objectsFound = Arrays .stream (this .getObjects ()).filter (obj -> this . onItemSearch ( obj , this . searchTerm ) ).collect (Collectors .toList ());
4844 int index0 = this .page * this .maxItemsPerPage ;
4945 int index1 = Math .min (index0 + this .maxItemsPerPage , objectsFound .size ());
5046 int maxPages = (int )Math .round (Math .ceil ((double )objectsFound .size () / (double )maxItemsPerPage ));
You can’t perform that action at this time.
0 commit comments