Record Class Transformable
- Record Components:
transformers- Map of transformer entries to apply to the transformer the key refers to
BlockTransformer.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Transformable> private static final com.mojang.serialization.Codec<ResourceKey<BlockTransformer>> private final Map<ResourceKey<BlockTransformer>, BlockTransformer.BlockTransformData> The field for thetransformersrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionTransformable(Map<ResourceKey<BlockTransformer>, BlockTransformer.BlockTransformData> transformers) Creates an instance of aTransformablerecord class.Transformable(ResourceKey<BlockTransformer> transformer, BlockTransformer.BlockTransformData transformData) Create a transformable appending a transformer entry to a single transformer -
Method Summary
Modifier and TypeMethodDescriptionstatic Transformableaxe(BlockTransformer.BlockTransformData transformData) Create a transformable appending the given transform to theBlockTransformers.AXE.final booleanIndicates whether some other object is "equal to" this one.static Transformableflattening(Block original, Block flattened) Create a transformable appending a basic flattening transform to theBlockTransformers.SHOVELwhich disallows transformation via the block's bottom face and requires the block above to be air.final inthashCode()Returns a hash code value for this object.static Transformablehoe(BlockTransformer.BlockTransformData transformData) Create a transformable appending the given transform to theBlockTransformers.HOE.private static com.mojang.datafixers.util.Either<com.mojang.datafixers.util.Pair<ResourceKey<BlockTransformer>, BlockTransformer.BlockTransformData>, Map<ResourceKey<BlockTransformer>, BlockTransformer.BlockTransformData>> pack(Transformable transformable) static TransformableCreate a transformable appending a basic scraping transform to theBlockTransformers.AXE.static Transformableshovel(BlockTransformer.BlockTransformData transformData) Create a transformable appending the given transform to theBlockTransformers.SHOVEL.static TransformableCreate a transformable appending a basic stripping transform to theBlockTransformers.AXE.static TransformableCreate a transformable appending a farmland-esque tilling transform to theBlockTransformers.HOE.static Transformabletilling(Block original, Block tilled, ResourceKey<LootTable> loot) Create a transformable appending a tilling transform with drops to theBlockTransformers.HOE.final StringtoString()Returns a string representation of this record class.Returns the value of thetransformersrecord component.private static Transformableunpack(com.mojang.datafixers.util.Either<com.mojang.datafixers.util.Pair<ResourceKey<BlockTransformer>, BlockTransformer.BlockTransformData>, Map<ResourceKey<BlockTransformer>, BlockTransformer.BlockTransformData>> either) static TransformableCreate a transformable appending a basic wax-off transform to theBlockTransformers.AXE.
-
Field Details
-
transformers
The field for thetransformersrecord component. -
KEY_CODEC
-
CODEC
-
-
Constructor Details
-
Transformable
public Transformable(ResourceKey<BlockTransformer> transformer, BlockTransformer.BlockTransformData transformData) Create a transformable appending a transformer entry to a single transformer- Parameters:
transformer- The block transformer to append totransformData- The transformer entry to be appended
-
Transformable
public Transformable(Map<ResourceKey<BlockTransformer>, BlockTransformer.BlockTransformData> transformers) Creates an instance of aTransformablerecord class.- Parameters:
transformers- the value for thetransformersrecord component
-
-
Method Details
-
stripping
Create a transformable appending a basic stripping transform to theBlockTransformers.AXE.- Parameters:
original- The original block (the one this value will be attached to)stripped- The stripped block- Returns:
- a new transformable
-
scraping
Create a transformable appending a basic scraping transform to the
BlockTransformers.AXE.Blocks which are part of the
NeoForgeDataMaps.OXIDIZABLESdatamap will have this transform automatically generated for them and should not declare one explicitly.- Parameters:
original- The original block (the one this value will be attached to)scraped- The scraped block- Returns:
- a new transformable
-
waxOff
Create a transformable appending a basic wax-off transform to the
BlockTransformers.AXE.Blocks which are part of the
NeoForgeDataMaps.WAXABLESdatamap will have this transform automatically generated for them and should not declare one explicitly.- Parameters:
original- The original block (the one this value will be attached to)unwaxed- The block with wax removed- Returns:
- a new transformable
-
axe
Create a transformable appending the given transform to theBlockTransformers.AXE.- Parameters:
transformData- The transform to append- Returns:
- a new transformable
-
flattening
Create a transformable appending a basic flattening transform to theBlockTransformers.SHOVELwhich disallows transformation via the block's bottom face and requires the block above to be air.- Parameters:
original- The original block (the one this value will be attached to)flattened- The flattened block- Returns:
- a new transformable
-
shovel
Create a transformable appending the given transform to theBlockTransformers.SHOVEL.- Parameters:
transformData- The transform to append- Returns:
- a new transformable
-
tilling
Create a transformable appending a farmland-esque tilling transform to the
BlockTransformers.HOE.The transform converts the block, requires the block above to be air and disallows transformation via the block's bottom face, matching the vanilla dirt->farmland transformation.
- Parameters:
original- The original block (the one this value will be attached to)tilled- The tilled block- Returns:
- a new transformable
-
tilling
Create a transformable appending a tilling transform with drops to the
BlockTransformers.HOE.The transform converts the block and drops loot from the given table from the interacted face, matching the vanilla rooted dirt->dirt transformation.
- Parameters:
original- The original block (the one this value will be attached to)tilled- The tilled blockloot- The loot table to roll when the transform succeeds- Returns:
- a new transformable
-
hoe
Create a transformable appending the given transform to theBlockTransformers.HOE.- Parameters:
transformData- The transform to append- Returns:
- a new transformable
-
unpack
private static Transformable unpack(com.mojang.datafixers.util.Either<com.mojang.datafixers.util.Pair<ResourceKey<BlockTransformer>, BlockTransformer.BlockTransformData>, Map<ResourceKey<BlockTransformer>, BlockTransformer.BlockTransformData>> either) -
pack
private static com.mojang.datafixers.util.Either<com.mojang.datafixers.util.Pair<ResourceKey<BlockTransformer>, BlockTransformer.BlockTransformData>, Map<ResourceKey<BlockTransformer>, BlockTransformer.BlockTransformData>> pack(Transformable transformable) -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
transformers
Returns the value of thetransformersrecord component.- Returns:
- the value of the
transformersrecord component
-