forked from MrSlayerGod/open-osrs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClient.java
2431 lines (2056 loc) · 55.9 KB
/
Client.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright (c) 2016-2017, Adam <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.api;
import com.jagex.oldscape.pub.OAuthApi;
import java.awt.Canvas;
import java.awt.Dimension;
import java.math.BigInteger;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.runelite.api.annotations.Varbit;
import net.runelite.api.annotations.VisibleForDevtools;
import net.runelite.api.annotations.VisibleForExternalPlugins;
import net.runelite.api.clan.ClanChannel;
import net.runelite.api.clan.ClanID;
import net.runelite.api.clan.ClanSettings;
import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldPoint;
import net.runelite.api.events.PlayerChanged;
import net.runelite.api.hooks.Callbacks;
import net.runelite.api.hooks.DrawCallbacks;
import net.runelite.api.vars.AccountType;
import net.runelite.api.widgets.ItemQuantityMode;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetInfo;
import org.slf4j.Logger;
import org.intellij.lang.annotations.MagicConstant;
/**
* Represents the RuneScape client.
*/
public interface Client extends OAuthApi, GameEngine
{
/**
* The injected client invokes these callbacks to send events to us
*/
Callbacks getCallbacks();
/**
* The injected client invokes these callbacks for scene drawing, which is
* used by the gpu plugin to override the client's normal scene drawing code
*/
DrawCallbacks getDrawCallbacks();
void setDrawCallbacks(DrawCallbacks drawCallbacks);
/**
* Retrieve a global logger for the client.
* This is most useful for mixins which can't have their own.
*/
Logger getLogger();
String getBuildID();
/**
* Gets a list of all valid players from the player cache.
*
* @return a list of all players
*/
List<Player> getPlayers();
/**
* Gets a list of all valid NPCs from the NPC cache.
*
* @return a list of all NPCs
*/
List<NPC> getNpcs();
/**
* Gets an array of all cached NPCs.
*
* @return cached NPCs
*/
NPC[] getCachedNPCs();
/**
* Gets an array of all cached players.
*
* @return cached players
*/
Player[] getCachedPlayers();
/**
* Gets the current modified level of a skill.
*
* @param skill the skill
* @return the modified skill level
*/
int getBoostedSkillLevel(Skill skill);
/**
* Gets the real level of a skill.
*
* @param skill the skill
* @return the skill level
*/
int getRealSkillLevel(Skill skill);
/**
* Calculates the total level from real skill levels.
*
* @return the total level
*/
int getTotalLevel();
/**
* Adds a new chat message to the chatbox.
*
* @param type the type of message
* @param name the name of the player that sent the message
* @param message the message contents
* @param sender the sender/channel name
* @return the message node for the message
*/
MessageNode addChatMessage(ChatMessageType type, String name, String message, String sender);
/**
* Adds a new chat message to the chatbox.
*
* @param type the type of message
* @param name the name of the player that sent the message
* @param message the message contents
* @param sender the sender/channel name
* @param postEvent whether to post the chat message event
* @return the message node for the message
*/
MessageNode addChatMessage(ChatMessageType type, String name, String message, String sender, boolean postEvent);
/**
* Gets the current game state.
*
* @return the game state
*/
GameState getGameState();
/**
* Gets the current game state as an int
*
* @return the game state
*/
int getRSGameState();
/**
* Sets the current game state
*
* @param gameState
*/
void setGameState(GameState gameState);
/**
* Sets the current game state
* This takes an int instead of a {@link GameState} so it can
* can handle states that aren't in the enum yet
*
* @param gameState
*/
void setGameState(int gameState);
/**
* Causes the client to shutdown. It is faster than
* {@link java.applet.Applet#stop()} because it doesn't wait for 4000ms.
* This will call {@link System#exit} when it is done
*/
void stopNow();
/**
* Gets the login screen world select state.
*
* @return the world select state
*/
boolean isWorldSelectOpen();
/**
* Sets the login screen world select state.
*/
void setWorldSelectOpen(boolean open);
/**
* DEPRECATED. See getAccountHash instead.
* Gets the current logged in username.
*
* @return the logged in username
* @see OAuthApi#getAccountHash()
*/
@Deprecated
String getUsername();
/**
* Sets the current logged in username.
*
* @param name the logged in username
*/
void setUsername(String name);
/**
* Sets the password on login screen.
*
* @param password the login screen password
*/
void setPassword(String password);
/**
* Sets the 6 digit pin used for authenticator on login screen.
*
* @param otp one time password
*/
void setOtp(String otp);
/**
* Gets currently selected login field. 0 is username, and 1 is password.
*
* @return currently selected login field
*/
int getCurrentLoginField();
/**
* Gets index of current login state. 2 is username/password form, 4 is authenticator form
*
* @return current login state index
*/
int getLoginIndex();
/**
* Gets the account type of the logged in player.
*
* @return the account type
*/
AccountType getAccountType();
@Override
Canvas getCanvas();
/**
* Gets the current FPS (frames per second).
*
* @return the FPS
*/
int getFPS();
/**
* Gets the x-axis coordinate of the camera.
* <p>
* This value is a local coordinate value similar to
* {@link #getLocalDestinationLocation()}.
*
* @return the camera x coordinate
*/
int getCameraX();
/**
* Gets the y-axis coordinate of the camera.
* <p>
* This value is a local coordinate value similar to
* {@link #getLocalDestinationLocation()}.
*
* @return the camera y coordinate
*/
int getCameraY();
/**
* Gets the z-axis coordinate of the camera.
* <p>
* This value is a local coordinate value similar to
* {@link #getLocalDestinationLocation()}.
*
* @return the camera z coordinate
*/
int getCameraZ();
/**
* Gets the actual pitch of the camera.
* <p>
* The value returned by this method is measured in JAU, or Jagex
* Angle Unit, which is 1/1024 of a revolution.
*
* @return the camera pitch
*/
int getCameraPitch();
/**
* Gets the yaw of the camera.
*
* @return the camera yaw
*/
int getCameraYaw();
/**
* Gets the current world number of the logged in player.
*
* @return the logged in world number
*/
int getWorld();
/**
* Gets the canvas height
*/
int getCanvasHeight();
/**
* Gets the canvas width
*/
int getCanvasWidth();
/**
* Gets the height of the viewport.
*
* @return the viewport height
*/
int getViewportHeight();
/**
* Gets the width of the viewport.
*
* @return the viewport width
*/
int getViewportWidth();
/**
* Gets the x-axis offset of the viewport.
*
* @return the x-axis offset
*/
int getViewportXOffset();
/**
* Gets the y-axis offset of the viewport.
*
* @return the y-axis offset
*/
int getViewportYOffset();
/**
* Gets the scale of the world (zoom value).
*
* @return the world scale
*/
int getScale();
/**
* Gets the current position of the mouse on the canvas.
*
* @return the mouse canvas position
*/
Point getMouseCanvasPosition();
/**
* Gets a 3D array containing the heights of tiles in the
* current scene.
*
* @return the tile heights
*/
int[][][] getTileHeights();
/**
* Gets a 3D array containing the settings of tiles in the
* current scene.
*
* @return the tile settings
*/
byte[][][] getTileSettings();
/**
* Gets the current plane the player is on.
* <p>
* This value indicates the current map level above ground level, where
* ground level is 0. For example, going up a ladder in Lumbridge castle
* will put the player on plane 1.
* <p>
* Note: This value will never be below 0. Basements and caves below ground
* level use a tile offset and are still considered plane 0 by the game.
*
* @return the plane
*/
int getPlane();
/**
* Gets the max plane the client can render.
* <p>
* Unlike the plane, the ScenePlane is affected the current status of roof visibility.
* <p>
*
* @return the plane
*/
int getScenePlane();
/**
* Gets the current scene
*/
Scene getScene();
/**
* Gets the logged in player instance.
*
* @return the logged in player
* <p>
* (getLocalPlayerIndex returns the local index, useful for menus/interacting)
*/
Player getLocalPlayer();
int getLocalPlayerIndex();
/**
* Gets the item composition corresponding to an items ID.
*
* @param id the item ID
* @return the corresponding item composition
* @see ItemID
*/
@Nonnull
ItemComposition getItemComposition(int id);
/**
* Get the local player's follower, such as a pet
* @return
*/
@Nullable
NPC getFollower();
/**
* Gets the item composition corresponding to an items ID.
*
* @param id the item ID
* @return the corresponding item composition
* @see ItemID
*/
@Nonnull
ItemComposition getItemDefinition(int id);
/**
* Creates an item icon sprite with passed variables.
*
* @param itemId the item ID
* @param quantity the item quantity
* @param border whether to draw a border
* @param shadowColor the shadow color
* @param stackable whether the item is stackable
* @param noted whether the item is noted
* @param scale the scale of the sprite
* @return the created sprite
*/
@Nullable
SpritePixels createItemSprite(int itemId, int quantity, int border, int shadowColor, @MagicConstant(valuesFromClass = ItemQuantityMode.class) int stackable, boolean noted, int scale);
/**
* Get the item model cache. These models are used for drawing widgets of type {@link net.runelite.api.widgets.WidgetType#MODEL}
* and inventory item icons
* @return
*/
NodeCache getItemModelCache();
/**
* Get the item sprite cache. These are 2d SpritePixels which are used to raster item images on the inventory and
* on widgets of type {@link net.runelite.api.widgets.WidgetType#GRAPHIC}
* @return
*/
NodeCache getItemSpriteCache();
/**
* Loads and creates the sprite images of the passed archive and file IDs.
*
* @param source the sprite index
* @param archiveId the sprites archive ID
* @param fileId the sprites file ID
* @return the sprite image of the file
*/
@Nullable
SpritePixels[] getSprites(IndexDataBase source, int archiveId, int fileId);
/**
* Gets the sprite index.
*/
IndexDataBase getIndexSprites();
/**
* Gets the script index.
*/
IndexDataBase getIndexScripts();
/**
* Gets the config index.
*/
IndexDataBase getIndexConfig();
/**
* Gets an index by id
*/
IndexDataBase getIndex(int id);
/**
* Returns the x-axis base coordinate.
* <p>
* This value is the x-axis world coordinate of tile (0, 0) in
* the current scene (ie. the bottom-left most coordinates in the scene).
*
* @return the base x-axis coordinate
*/
int getBaseX();
/**
* Returns the y-axis base coordinate.
* <p>
* This value is the y-axis world coordinate of tile (0, 0) in
* the current scene (ie. the bottom-left most coordinates in the scene).
*
* @return the base y-axis coordinate
*/
int getBaseY();
/**
* Gets the current mouse button that is pressed.
*
* @return the pressed mouse button
*/
int getMouseCurrentButton();
/**
* Gets the currently selected tile. (ie. last right clicked tile)
*
* @return the selected tile
*/
@Nullable
Tile getSelectedSceneTile();
/**
* Checks whether a widget is currently being dragged.
*
* @return true if dragging a widget, false otherwise
*/
boolean isDraggingWidget();
/**
* Gets the widget currently being dragged.
*
* @return the dragged widget, null if not dragging any widget
*/
@Nullable
Widget getDraggedWidget();
/**
* Gets the widget that is being dragged on.
* <p>
* The widget being dragged has the {@link net.runelite.api.widgets.WidgetConfig#DRAG_ON}
* flag set, and is the widget currently under the dragged widget.
*
* @return the dragged on widget, null if not dragging any widget
*/
@Nullable
Widget getDraggedOnWidget();
/**
* Sets the widget that is being dragged on.
*
* @param widget the new dragged on widget
*/
void setDraggedOnWidget(Widget widget);
/**
* Get the number of client cycles the current dragged widget
* has been dragged for.
*
* @return
*/
int getDragTime();
/**
* Gets Interface ID of the root widget
*/
int getTopLevelInterfaceId();
/**
* Gets the root widgets.
*
* @return the root widgets
*/
Widget[] getWidgetRoots();
/**
* Gets a widget corresponding to the passed widget info.
*
* @param widget the widget info
* @return the widget
*/
@Nullable
Widget getWidget(WidgetInfo widget);
/**
* Gets a widget by its raw group ID and child ID.
* <p>
* Note: Use {@link #getWidget(WidgetInfo)} for a more human-readable
* version of this method.
*
* @param groupId the group ID
* @param childId the child widget ID
* @return the widget corresponding to the group and child pair
*/
@Nullable
Widget getWidget(int groupId, int childId);
/**
* Gets a widget by it's packed ID.
*
* <p>
* Note: Use {@link #getWidget(WidgetInfo)} or {@link #getWidget(int, int)} for
* a more readable version of this method.
*/
@Nullable
Widget getWidget(int packedID);
/**
* Gets an array containing the x-axis canvas positions
* of all widgets.
*
* @return array of x-axis widget coordinates
*/
int[] getWidgetPositionsX();
/**
* Gets an array containing the y-axis canvas positions
* of all widgets.
*
* @return array of y-axis widget coordinates
*/
int[] getWidgetPositionsY();
/**
* Creates a new widget element
*
* @return
*/
Widget createWidget();
/**
* Gets the current run energy of the logged in player.
*
* @return the run energy
*/
int getEnergy();
/**
* Gets the current weight of the logged in player.
*
* @return the weight
*/
int getWeight();
/**
* Gets an array of options that can currently be used on other players.
* <p>
* For example, if the player is in a PVP area the "Attack" option
* will become available in the array. Otherwise, it won't be there.
*
* @return an array of options
*/
String[] getPlayerOptions();
/**
* Gets an array of whether an option is enabled or not.
*
* @return the option priorities
*/
boolean[] getPlayerOptionsPriorities();
/**
* Gets an array of player menu types.
*
* @return the player menu types
*/
int[] getPlayerMenuTypes();
/**
* Gets a list of all RuneScape worlds.
*
* @return world list
*/
World[] getWorldList();
/**
* Create a new menu entry
* @param idx the index to create the menu entry at. Accepts negative indexes eg. -1 inserts at the end.
* @return the newly created menu entry
*/
MenuEntry createMenuEntry(int idx);
/**
* Create a new menu entry
* @return the newly created menu entry
*/
MenuEntry createMenuEntry(String option, String target, int identifier, int opcode, int param1, int param2, boolean forceLeftClick);
/**
* Gets an array of currently open right-click menu entries that can be
* clicked and activated.
*
* @return array of open menu entries
*/
MenuEntry[] getMenuEntries();
/**
* @return amount of menu entries the client has (same as client.getMenuEntries().size())
*/
int getMenuOptionCount();
/**
* Sets the array of open menu entries.
* <p>
* This method should typically be used in the context of the {@link net.runelite.api.events.MenuOpened}
* event, since setting the menu entries will be overwritten the next frame
*
* @param entries new array of open menu entries
*/
void setMenuEntries(MenuEntry[] entries);
/**
* Set the amount of menu entries the client has.
* If you decrement this count, it's the same as removing the last one
*/
void setMenuOptionCount(int count);
/**
* Checks whether a right-click menu is currently open.
*
* @return true if a menu is open, false otherwise
*/
boolean isMenuOpen();
/**
* Get the menu x location. Only valid if the menu is open.
*
* @return the menu x location
*/
int getMenuX();
/**
* Get the menu y location. Only valid if the menu is open.
*
* @return the menu y location
*/
int getMenuY();
/**
* Get the menu height. Only valid if the menu is open.
*
* @return the menu height
*/
int getMenuHeight();
/**
* Get the menu width. Only valid if the menu is open.
*
* @return the menu width
*/
int getMenuWidth();
/**
* Gets the angle of the map, or target camera yaw.
*
* @return the map angle
*/
int getMapAngle();
/**
* Set the target camera yaw
*
* @param cameraYawTarget
*/
void setCameraYawTarget(int cameraYawTarget);
/**
* Checks whether the client window is currently resized.
*
* @return true if resized, false otherwise
*/
boolean isResized();
/**
* Gets the client revision number.
*
* @return the revision
*/
int getRevision();
/**
* Gets an array of map region IDs that are currently loaded.
*
* @return the map regions
*/
int[] getMapRegions();
/**
* Contains a 3D array of template chunks for instanced areas.
* <p>
* The array returned is of format [z][x][y], where z is the
* plane, x and y the x-axis and y-axis coordinates of a tile
* divided by the size of a chunk.
* <p>
* The bits of the int value held by the coordinates are -1 if there is no data,
* structured in the following format:
* <pre>{@code
* 0 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | |rot| y chunk coord | x chunk coord |pln| |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* }</pre>
*
* @return the array of instance template chunks
* @see Constants#CHUNK_SIZE
* @see InstanceTemplates
*/
int[][][] getInstanceTemplateChunks();
/**
* Returns a 2D array containing XTEA encryption keys used to decrypt
* map region files.
* <p>
* The array maps the region keys at index {@code n} to the region
* ID held in {@link #getMapRegions()} at {@code n}.
* <p>
* The array of keys for the region make up a 128-bit encryption key
* spread across 4 integers.
*
* @return the XTEA encryption keys
*/
int[][] getXteaKeys();
/**
* Gets an array of all client varplayers.
*
* @return local player variables
*/
int[] getVarps();
/**
* Get an array of all server varplayers. These vars are only
* modified by the server, and so represent the server's idea of
* the varp values.
* @return the server varps
*/
@VisibleForDevtools
int[] getServerVarps();
/**
* Gets an array of all client variables.
*/
Map<Integer, Object> getVarcMap();
/**
* Gets the value corresponding to the passed player variable.
*
* @param varPlayer the player variable
* @return the value
*/
int getVar(VarPlayer varPlayer);
/**
* Gets the value corresponding to the passed player variable.
* This returns the server's idea of the value, not the client's. This is
* specifically the last value set by the server regardless of changes to
* the var by the client.
*
* @param varPlayer the player variable
* @return the value
*/
int getServerVar(VarPlayer varPlayer);
/**
* Gets a value corresponding to the passed varbit.
*
* @param varbit the varbit id
* @return the value
* @see Client#getVarbitValue(int)
*/
@Deprecated
int getVar(@Varbit int varbit);
/**
* Gets the value of the given varbit.
*
* @param varbit the varbit id
* @return the value
*/
int getVarbitValue(@Varbit int varbit);
/**
* Gets the value of the given varbit.
* This returns the server's idea of the value, not the client's. This is
* specifically the last value set by the server regardless of changes to
* the var by the client.
* @param varbit the varbit id
* @return the value
*/
int getServerVarbitValue(@Varbit int varbit);
/**
* Gets an int value corresponding to the passed variable.
*
* @param varClientInt the variable
* @return the value
*/
int getVar(VarClientInt varClientInt);
/**
* Gets a String value corresponding to the passed variable.
*
* @param varClientStr the variable
* @return the value
*/
String getVar(VarClientStr varClientStr);
/**
* Gets the value of a given VarPlayer.
*
* @param varpId the VarPlayer id
* @return the value
*/
@VisibleForExternalPlugins
int getVarpValue(int varpId);
/**
* Gets the value of a given VarPlayer.
* This returns the server's idea of the value, not the client's. This is
* specifically the last value set by the server regardless of changes to
* the var by the client.
*
* @param varpId the VarPlayer id
* @return the value
*/
@VisibleForExternalPlugins
int getServerVarpValue(int varpId);
/**
* Gets the value of a given VarClientInt
*
* @param varcIntId the VarClientInt id
* @return the value
*/
@VisibleForExternalPlugins
int getVarcIntValue(int varcIntId);
/**
* Gets the value of a given VarClientStr
*
* @param varcStrId the VarClientStr id
* @return the value
*/
@VisibleForExternalPlugins
String getVarcStrValue(int varcStrId);
/**
* Sets a VarClientString to the passed value
*/
void setVar(VarClientStr varClientStr, String value);
/**
* Sets a VarClientInt to the passed value
*/
void setVar(VarClientInt varClientStr, int value);
/**
* Sets the value of a varbit
*
* @param varbit the varbit id
* @param value the new value
*/
void setVarbit(@Varbit int varbit, int value);
/**
* Gets the varbit composition for a given varbit id
*
* @param id
* @return
*/
@Nullable
VarbitComposition getVarbit(int id);