Package alexiil.mc.lib.net
Class NetObjectCache<T>
java.lang.Object
alexiil.mc.lib.net.NetObjectCache<T>
public final class NetObjectCache<T>
extends java.lang.Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
NetObjectCache.IEntrySerialiser<T>
-
Constructor Summary
Constructors Constructor Description NetObjectCache(ParentNetId parent, it.unimi.dsi.fastutil.Hash.Strategy<T> equality, NetObjectCache.IEntrySerialiser<T> serialiser)
-
Method Summary
Modifier and Type Method Description static <T> NetObjectCache<T>
createMappedIdentifier(ParentNetId parent, java.util.function.Function<T,net.minecraft.util.Identifier> nameGetter, java.util.function.Function<net.minecraft.util.Identifier,T> objectGetter)
static <T> NetObjectCache<T>
createMappedIdentifier(ParentNetId parent, java.util.function.Function<T,net.minecraft.util.Identifier> nameGetter, java.util.Map<net.minecraft.util.Identifier,T> map)
int
getId(ActiveConnection connection, T obj)
T
getObj(ActiveConnection connection, int id)
void
notBuffered()
-
Constructor Details
-
NetObjectCache
public NetObjectCache(ParentNetId parent, it.unimi.dsi.fastutil.Hash.Strategy<T> equality, NetObjectCache.IEntrySerialiser<T> serialiser)
-
-
Method Details
-
notBuffered
public void notBuffered()- See Also:
NetIdBase.notBuffered()
-
createMappedIdentifier
public static <T> NetObjectCache<T> createMappedIdentifier(ParentNetId parent, java.util.function.Function<T,net.minecraft.util.Identifier> nameGetter, java.util.function.Function<net.minecraft.util.Identifier,T> objectGetter) -
createMappedIdentifier
public static <T> NetObjectCache<T> createMappedIdentifier(ParentNetId parent, java.util.function.Function<T,net.minecraft.util.Identifier> nameGetter, java.util.Map<net.minecraft.util.Identifier,T> map) -
getId
-
getObj
-