File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
src/main/java/me/tom/sparse/spigot/chat Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ public void setTrueColor(ChatColor trueColor)
104104
105105 public int getWidth ()
106106 {
107- return 8 + (showText ? ChatMenuAPI .getWidth (" " + value ) : 0 );
107+ return 8 + (showText ? ChatMenuAPI .getWidth (" " + value . current () ) : 0 );
108108 }
109109
110110 public int getHeight ()
Original file line number Diff line number Diff line change @@ -83,4 +83,27 @@ public void onChange(Consumer<State<V>> changeCallback)
8383 {
8484 this .changeCallback = changeCallback ;
8585 }
86+
87+ public boolean equals (Object o )
88+ {
89+ if (this == o ) return true ;
90+ if (!(o instanceof State )) return false ;
91+
92+ State <?> state = (State <?>) o ;
93+
94+ return current != null ? current .equals (state .current ) : state .current == null ;
95+ }
96+
97+ public int hashCode ()
98+ {
99+ return current != null ? current .hashCode () : 0 ;
100+ }
101+
102+ public String toString ()
103+ {
104+ return "State{" +
105+ "current=" + current +
106+ ", previous=" + previous +
107+ '}' ;
108+ }
86109}
You can’t perform that action at this time.
0 commit comments