Package codechicken.multipart.api
Class PartConverter
java.lang.Object
codechicken.multipart.api.PartConverter
Created by covers1624 on 4/17/20.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<PartConverter>> The registry name used by PartConverter. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvert(MultipartPlaceContext context) Convert anItemStackabout to be placed into aMultiPartinstance.convert(net.minecraft.world.level.LevelAccessor world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) Convert the block / tile at the given position in world, to aCollectionofMultiPartinstances.
-
Field Details
-
PART_CONVERTERS
public static final net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<PartConverter>> PART_CONVERTERSThe registry name used by PartConverter.
-
-
Constructor Details
-
PartConverter
public PartConverter()
-
-
Method Details
-
convert
public PartConverter.ConversionResult<Collection<MultiPart>> convert(net.minecraft.world.level.LevelAccessor world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) Convert the block / tile at the given position in world, to aCollectionofMultiPartinstances. It should be noted, that a mod can choose to delete the block at the position by returning a failedPartConverter.ConversionResult.- Parameters:
world- The world.pos- The pos.state- The state at pos in world.- Returns:
- A
PartConverter.ConversionResult, providing aCollectionofMultiPartinstances if conversion was successful.
-
convert
Convert anItemStackabout to be placed into aMultiPartinstance.- Parameters:
context- TheMultipartPlaceContextfor the placement.- Returns:
- A
PartConverter.ConversionResult, providing theMultiPartinstance if conversion was successful.
-
emptyResultList
-
emptyResult
-