2121import baritone .api .command .exception .CommandException ;
2222import baritone .api .command .exception .CommandInvalidTypeException ;
2323import baritone .api .utils .Helper ;
24-
25- import java .awt .*;
26- import java .util .Arrays ;
27- import java .util .List ;
28- import java .util .function .Function ;
2924import net .minecraft .ChatFormatting ;
3025import net .minecraft .network .chat .ClickEvent ;
3126import net .minecraft .network .chat .Component ;
3227import net .minecraft .network .chat .HoverEvent ;
3328import net .minecraft .network .chat .MutableComponent ;
3429
30+ import java .util .Arrays ;
31+ import java .util .List ;
32+ import java .util .function .Function ;
33+
3534public class Paginator <E > implements Helper {
3635
3736 public final List <E > entries ;
@@ -78,12 +77,10 @@ public void display(Function<E, Component> transform, String commandPrefix) {
7877 MutableComponent prevPageComponent = Component .literal ("<<" );
7978 if (hasPrevPage ) {
8079 prevPageComponent .setStyle (prevPageComponent .getStyle ()
81- .withClickEvent (new ClickEvent (
82- ClickEvent .Action .RUN_COMMAND ,
80+ .withClickEvent (new ClickEvent .RunCommand (
8381 String .format ("%s %d" , commandPrefix , page - 1 )
8482 ))
85- .withHoverEvent (new HoverEvent (
86- HoverEvent .Action .SHOW_TEXT ,
83+ .withHoverEvent (new HoverEvent .ShowText (
8784 Component .literal ("Click to view previous page" )
8885 )));
8986 } else {
@@ -92,9 +89,8 @@ public void display(Function<E, Component> transform, String commandPrefix) {
9289 MutableComponent nextPageComponent = Component .literal (">>" );
9390 if (hasNextPage ) {
9491 nextPageComponent .setStyle (nextPageComponent .getStyle ()
95- .withClickEvent (new ClickEvent (ClickEvent .Action .RUN_COMMAND , String .format ("%s %d" , commandPrefix , page + 1 )))
96- .withHoverEvent (new HoverEvent (
97- HoverEvent .Action .SHOW_TEXT ,
92+ .withClickEvent (new ClickEvent .RunCommand (String .format ("%s %d" , commandPrefix , page + 1 )))
93+ .withHoverEvent (new HoverEvent .ShowText (
9894 Component .literal ("Click to view next page" )
9995 )));
10096 } else {
0 commit comments