Package codechicken.multipart.util
Class MultipartGenerator
java.lang.Object
codechicken.mixin.MixinFactoryImpl<TileMultipart,MultipartGenerator.Factory>
codechicken.mixin.SidedFactory<TileMultipart,MultipartGenerator.Factory,MultiPart>
codechicken.multipart.util.MultipartGenerator
- All Implemented Interfaces:
codechicken.mixin.api.MixinFactory<TileMultipart,MultipartGenerator.Factory>
public class MultipartGenerator
extends codechicken.mixin.SidedFactory<TileMultipart,MultipartGenerator.Factory,MultiPart>
Created by covers1624 on 4/5/20.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface codechicken.mixin.api.MixinFactory
codechicken.mixin.api.MixinFactory.TraitKey -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MultipartGeneratorstatic final codechicken.mixin.api.MixinCompilerFields inherited from class codechicken.mixin.SidedFactory
clientObjectTraitCache, clientTraits, serverObjectTraitCache, serverTraitsFields inherited from class codechicken.mixin.MixinFactoryImpl
baseType, classCache, classSuffix, counter, factoryCache, factoryClass, factoryGenerator, mixinCompiler, registeredTraits, traitLookup -
Method Summary
Modifier and TypeMethodDescriptiongenerateCompositeTile(@Nullable net.minecraft.world.level.block.entity.BlockEntity tile, net.minecraft.core.BlockPos pos, Collection<MultiPart> parts, boolean client) com.google.common.collect.ImmutableSet<codechicken.mixin.api.MixinFactory.TraitKey> com.google.common.collect.ImmutableSet<codechicken.mixin.api.MixinFactory.TraitKey> getTraits(Collection<MultiPart> parts, boolean client) voidload(net.neoforged.bus.api.IEventBus modBus) voidregisterPassThroughInterface(Class<?> iFace) Overload forregisterPassThroughInterface(Class, boolean, boolean), passing true to both boolean parameters.voidregisterPassThroughInterface(Class<?> iFace, boolean client, boolean server) A passthrough interface is an interface to be implemented on the container tile instance, for which all calls are passed directly through to a single implementing part.codechicken.mixin.api.MixinFactory.TraitKeyregisterPassthroughTrait(Class<?> iClass) Methods inherited from class codechicken.mixin.SidedFactory
getObjectTraitCache, getTraitMap, getTraitsForObject, hierarchy, register, registerTrait, registerTraitMethods inherited from class codechicken.mixin.MixinFactoryImpl
construct, getMixinCompiler, getTraitsForClass, registerTrait, registerTrait
-
Field Details
-
INSTANCE
-
MIXIN_COMPILER
public static final codechicken.mixin.api.MixinCompiler MIXIN_COMPILER
-
-
Method Details
-
registerPassThroughInterface
Overload forregisterPassThroughInterface(Class, boolean, boolean), passing true to both boolean parameters.- Parameters:
iFace- The interface.
-
registerPassThroughInterface
A passthrough interface is an interface to be implemented on the container tile instance, for which all calls are passed directly through to a single implementing part. Registering a passthrough interface is equivalent to defining a mixin trait as follows. 1. field 'impl' which contains a reference to the corresponding part. 2. occlusionTest is overriden to prevent more than one part withiFaceexisting in the block space. 3. implementingiFaceand passing all calls directly to the part instance.This allows compatibility with APIs that expect interfaces on the tile entity. If you require more than one part in the space implementing an interface, i.e the old IInventory system. You will need to write your own trait implementation manually. Refer to
TInventoryTile.- Parameters:
iFace- The Interface to implement.client- If this interface should be used client side.server- If this interface should be used server side.
-
load
public void load(net.neoforged.bus.api.IEventBus modBus) -
getTraits
public com.google.common.collect.ImmutableSet<codechicken.mixin.api.MixinFactory.TraitKey> getTraits(MultiPart part, boolean client) -
getTraits
public com.google.common.collect.ImmutableSet<codechicken.mixin.api.MixinFactory.TraitKey> getTraits(Collection<MultiPart> parts, boolean client) -
generateCompositeTile
public TileMultipart generateCompositeTile(@Nullable @Nullable net.minecraft.world.level.block.entity.BlockEntity tile, net.minecraft.core.BlockPos pos, Collection<MultiPart> parts, boolean client) -
registerPassthroughTrait
-