Package xyz.gmitch215.socketmc.retriever
Class RetrieverType<T>
java.lang.Object
xyz.gmitch215.socketmc.retriever.RetrieverType<T>
- Type Parameters:
T
- The type of the retriever
- All Implemented Interfaces:
Serializable
Represents a type of retriever. They are used to retrieve data from the client. Any data element can be null.
Example:
SocketPlayer sp = ...
SocketRetriever retriever = sp.getRetriever();
// Enum Retriever Type
RetrieverType<Window> window = RetriverType.WINDOW;
// Params: RetrieverType<T>, Consumer<T>
retriever.request(window, w -> {
// Check if null
if (w == null) return;
// Retrieved window object is passed to consumer
int x = w.getHeight();
}
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final RetrieverType
<Integer> A retriever for the client's available processors on its JVM.static final RetrieverType
<String[]> A retriever for the client's command history.static final RetrieverType
<Window> A retriever for the client's window information.static final RetrieverType
<Identifier[]> A retriever for all of the drawn contents on the client's screen made through SocketMC Instructions.static final RetrieverType
<Integer> A retriever for the client's frames per second.static final RetrieverType
<Long> A retriever for the client's free memory on its JVM.static final RetrieverType
<Double> A retriever for the client's percentage of GPU usage, between0.0
to1.0
.static final RetrieverType
<UUID[]> A retriever for the client's hidden players on their social interaction screen.static final RetrieverType
<InputType> A retriever for the client's last input type.static final RetrieverType
<String> A retriever for the client's launched version.static final RetrieverType
<Long> A retriever for the client's maximum memory on its JVM.static final RetrieverType
<OS> A retriever for the client's operating system information.static final RetrieverType
<Boolean> A retriever for whether the client's game is paused.static final RetrieverType
<Map<SocketPlugin, Set<ModPermission>>> A retriever for the permissions the client has for each plugin.static final RetrieverType
<Long> A retriever for the client's total memory on its JVM.static final RetrieverType
<String> A retriever for the client's current version. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static @NotNull RetrieverType
<?> fromByteArray
(byte[] bytes) Converts a byte array to a retriever type.getId()
Gets the ID of the retriever.Gets the permission required to use this retriever.static @NotNull ModPermission
Gets the permission required to use a retriever by its ID.getType()
Gets the type of the retriever.int
hashCode()
byte[]
Converts the retriever type to a byte array.static @NotNull RetrieverType<?>[]
values()
Gets all the retriever types.static <T> @NotNull RetrieverType<T>[]
Gets all the retriever types of a specific type.
-
Field Details
-
CURRENT_WINDOW
A retriever for the client's window information. -
OPERATING_SYSTEM
A retriever for the client's operating system information. -
PAUSED
A retriever for whether the client's game is paused. -
FPS
A retriever for the client's frames per second. -
GPU_UTILIZATION
A retriever for the client's percentage of GPU usage, between0.0
to1.0
. -
LAUNCH_VERSION
A retriever for the client's launched version. -
VERSION_TYPE
A retriever for the client's current version. -
LAST_INPUT_TYPE
A retriever for the client's last input type. -
AVAILABLE_PROCESSORS
A retriever for the client's available processors on its JVM. -
PLUGIN_PERMISSIONS
A retriever for the permissions the client has for each plugin. -
FREE_MEMORY
A retriever for the client's free memory on its JVM. -
TOTAL_MEMORY
A retriever for the client's total memory on its JVM. -
MAX_MEMORY
A retriever for the client's maximum memory on its JVM. -
COMMAND_HISTORY
A retriever for the client's command history. -
HIDDEN_PLAYERS
A retriever for the client's hidden players on their social interaction screen. -
DRAWN_CONTENTS
A retriever for all of the drawn contents on the client's screen made through SocketMC Instructions.
This currently includes the following instructions:
-
-
Method Details
-
getId
Gets the ID of the retriever.- Returns:
- The ID of the retriever
-
getType
Gets the type of the retriever.- Returns:
- The type of the retriever
-
getPermission
Gets the permission required to use this retriever.- Returns:
- Retriever Permission
-
equals
-
hashCode
public int hashCode() -
getPermission
Gets the permission required to use a retriever by its ID.- Parameters:
id
- Retriever Type ID- Returns:
- Retriever Permission
-
toByteArray
public byte[] toByteArray()Converts the retriever type to a byte array.- Returns:
- Byte Array Representation
-
fromByteArray
Converts a byte array to a retriever type.- Parameters:
bytes
- The byte array to convert- Returns:
- The retriever type
-
values
Gets all the retriever types of a specific type.- Type Parameters:
T
- The type of the retriever- Parameters:
type
- The type of the retriever- Returns:
- All Retriever Types of the specified type
-
values
Gets all the retriever types.- Returns:
- All Retriever Types
-