File tree Expand file tree Collapse file tree 5 files changed +75
-0
lines changed
simpleclient-1.19.4/src/main/java/simpleclient/feature
simpleclient-1.20/src/main/java/simpleclient/feature
simpleclient-core/src/main/java/simpleclient/feature Expand file tree Collapse file tree 5 files changed +75
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ public void init() {
1818 });
1919 addFeature (new FPS ());
2020 addFeature (new PerformanceBoost ());
21+ addFeature (new Ping ());
2122 addFeature (new Motionblur ());
2223 addFeature (new Zoom ());
2324 super .init ();
Original file line number Diff line number Diff line change 1+ package simpleclient .feature ;
2+
3+ import com .google .gson .JsonArray ;
4+ import net .minecraft .client .Minecraft ;
5+ import net .minecraft .client .multiplayer .PlayerInfo ;
6+ import simpleclient .text .Style ;
7+
8+ public class Ping extends DraggableTextFeature {
9+ public Ping () {
10+ super (FeatureType .PING );
11+ }
12+
13+ @ Override
14+ public String valueForParameter (String parameter ) {
15+ if (parameter .equals ("ping" )) {
16+ Minecraft minecraft = Minecraft .getInstance ();
17+ PlayerInfo entry = minecraft .getConnection ().getPlayerInfo (minecraft .player .getUUID ());
18+ return entry == null ? "-" : (entry .getLatency () + "ms" );
19+ }
20+ else return "" ;
21+ }
22+
23+ @ Override
24+ public String valueForDummyParameter (String parameter ) {
25+ if (parameter .equals ("ping" )) return "-" ;
26+ else return "" ;
27+ }
28+
29+ @ Override
30+ public JsonArray getDefaultFormat () {
31+ JsonArray format = new JsonArray ();
32+ format .add (text ("Ping: " , new Style ()));
33+ format .add (parameter ("ping" , new Style ()));
34+ return format ;
35+ }
36+ }
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ public void init() {
1818 });
1919 addFeature (new FPS ());
2020 addFeature (new PerformanceBoost ());
21+ addFeature (new Ping ());
2122 //addFeature(new Motionblur());
2223 addFeature (new Zoom ());
2324 super .init ();
Original file line number Diff line number Diff line change 1+ package simpleclient .feature ;
2+
3+ import com .google .gson .JsonArray ;
4+ import net .minecraft .client .Minecraft ;
5+ import net .minecraft .client .multiplayer .PlayerInfo ;
6+ import simpleclient .text .Style ;
7+
8+ public class Ping extends DraggableTextFeature {
9+ public Ping () {
10+ super (FeatureType .PING );
11+ }
12+
13+ @ Override
14+ public String valueForParameter (String parameter ) {
15+ if (parameter .equals ("ping" )) {
16+ Minecraft minecraft = Minecraft .getInstance ();
17+ PlayerInfo entry = minecraft .getConnection ().getPlayerInfo (minecraft .player .getUUID ());
18+ return entry == null ? "-" : (entry .getLatency () + "ms" );
19+ }
20+ else return "" ;
21+ }
22+
23+ @ Override
24+ public String valueForDummyParameter (String parameter ) {
25+ if (parameter .equals ("ping" )) return "-" ;
26+ else return "" ;
27+ }
28+
29+ @ Override
30+ public JsonArray getDefaultFormat () {
31+ JsonArray format = new JsonArray ();
32+ format .add (text ("Ping: " , new Style ()));
33+ format .add (parameter ("ping" , new Style ()));
34+ return format ;
35+ }
36+ }
Original file line number Diff line number Diff line change 33public enum FeatureType {
44 FPS ("fps" , "FPS" ),
55 PERFORMANCE_BOOST ("performance_boost" , "Performance Boost" ),
6+ PING ("ping" , "Ping" ),
67 MOTIONBLUR ("motionblur" , "Motionblur" ),
78 ZOOM ("zoom" , "Zoom" );
89
You can’t perform that action at this time.
0 commit comments