Class SidedListProvider<T>
java.lang.Object
etithespirit.orimod.util.collection.SidedListProvider<T>
- Type Parameters:
T
- The type of element to store.
A provider of two, distinct
List
instances, one for each side of the game.
This is strictly useful in singleplayer setups, where a statically bound list benefits a class
and a different list is needed on the client and server for thread safety or to differentiate
between a reference for the server vs for the client.- Author:
- Eti
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new provider without strict element tracking. -
Method Summary
Modifier and TypeMethodDescriptiongetListForSide
(boolean isClient) Returns the list appropriate for this side.
-
Constructor Details
-
SidedListProvider
public SidedListProvider()Construct a new provider without strict element tracking.
-
-
Method Details
-
getListForSide
Returns the list appropriate for this side.- Parameters:
isClient
- Whether or not to return the client list.- Returns:
- The list appropriate for the current side, be it a client vs. dedicated/integrated server.
- Throws:
IllegalArgumentException
- IfisClient
is true and this is running in a dedicated (not integrated) server build of Minecraft.
-