Package codechicken.mixin
Class SidedFactory<B,F,T>
java.lang.Object
codechicken.mixin.MixinFactoryImpl<B,F>
codechicken.mixin.SidedFactory<B,F,T>
- All Implemented Interfaces:
MixinFactory<B,F>
Created by covers1624 on 20/1/24.
-
Nested Class Summary
Nested classes/interfaces inherited from interface codechicken.mixin.api.MixinFactory
MixinFactory.TraitKey -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<Class<?>,com.google.common.collect.ImmutableSet<MixinFactory.TraitKey>> protected final Map<Class<?>,MixinFactory.TraitKey> protected final Map<Class<?>,com.google.common.collect.ImmutableSet<MixinFactory.TraitKey>> protected final Map<Class<?>,MixinFactory.TraitKey> Fields inherited from class codechicken.mixin.MixinFactoryImpl
baseType, classCache, classSuffix, counter, factoryCache, factoryClass, factoryGenerator, mixinCompiler, registeredTraits, traitLookup -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSidedFactory(MixinCompiler mc, Class<B> baseType, Class<F> factory, String suffix) -
Method Summary
Modifier and TypeMethodDescriptionprotected Map<Class<?>,com.google.common.collect.ImmutableSet<MixinFactory.TraitKey>> getObjectTraitCache(boolean client) protected Map<Class<?>,MixinFactory.TraitKey> getTraitMap(boolean client) com.google.common.collect.ImmutableSet<MixinFactory.TraitKey>getTraitsForObject(T thing, boolean client) Gets all theMixinFactory.TraitKey's this generator knows about from thething's class hierarchy.protected net.covers1624.quack.collection.FastStream<Class<?>>protected voidvoidregisterTrait(Class<?> marker, @Nullable Class<?> clientTrait, @Nullable Class<?> serverTrait) Registers a trait to be applied to the host tile in the presence of a specific marker class existing in the class hierarchy of a part instance.voidregisterTrait(Class<?> marker, Class<?> trait) Overload ofregisterTrait(Class, Class, Class), using the same trait impl for client and server.Methods inherited from class codechicken.mixin.MixinFactoryImpl
construct, getMixinCompiler, getTraitsForClass, registerTrait, registerTrait
-
Field Details
-
clientTraits
-
serverTraits
-
clientObjectTraitCache
protected final Map<Class<?>,com.google.common.collect.ImmutableSet<MixinFactory.TraitKey>> clientObjectTraitCache -
serverObjectTraitCache
protected final Map<Class<?>,com.google.common.collect.ImmutableSet<MixinFactory.TraitKey>> serverObjectTraitCache
-
-
Constructor Details
-
SidedFactory
-
-
Method Details
-
registerTrait
Overload ofregisterTrait(Class, Class, Class), using the same trait impl for client and server.- Parameters:
marker- The Marker class, to be found in the part instances class hierarchy.
-
registerTrait
public void registerTrait(Class<?> marker, @Nullable @Nullable Class<?> clientTrait, @Nullable @Nullable Class<?> serverTrait) Registers a trait to be applied to the host tile in the presence of a specific marker class existing in the class hierarchy of a part instance.- Parameters:
marker- The Marker class, to be found in the part instances class hierarchy.clientTrait- The trait class to be applied on the client side.serverTrait- The trait class to be applied on the server side.
-
getTraitsForObject
public com.google.common.collect.ImmutableSet<MixinFactory.TraitKey> getTraitsForObject(T thing, boolean client) Gets all theMixinFactory.TraitKey's this generator knows about from thething's class hierarchy.- Parameters:
thing- The thing to get all traits from.client- If this is the client side or not.- Returns:
- The
MixinFactory.TraitKeys.
-
hierarchy
-
getTraitMap
-
getObjectTraitCache
protected Map<Class<?>,com.google.common.collect.ImmutableSet<MixinFactory.TraitKey>> getObjectTraitCache(boolean client) -
register
-