Record Class BlockTransformer.BlockTransformData
java.lang.Object
java.lang.Record
net.minecraft.core.component.BlockTransformer.BlockTransformData
- Enclosing class:
BlockTransformer
public static record BlockTransformer.BlockTransformData(Holder<BlockStateProvider> blockStateProvider, Holder<SoundEvent> sound, BlockTransformer.TransformParticle particle, List<Direction> disallowedFaces, Optional<ResourceKey<LootTable>> loot, BlockTransformer.DropStrategy dropStrategy, boolean updateFromNeighbors, BlockTransformer.TransformType transformType, boolean consumeOnUse, int itemDamagePerUse)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Holder<BlockStateProvider> The field for theblockStateProviderrecord component.static final com.mojang.serialization.Codec<BlockTransformer.BlockTransformData> private final booleanThe field for theconsumeOnUserecord component.The field for thedisallowedFacesrecord component.private final BlockTransformer.DropStrategyThe field for thedropStrategyrecord component.private final intThe field for theitemDamagePerUserecord component.private final Optional<ResourceKey<LootTable>> The field for thelootrecord component.private final BlockTransformer.TransformParticleThe field for theparticlerecord component.private final Holder<SoundEvent> The field for thesoundrecord component.private final BlockTransformer.TransformTypeThe field for thetransformTyperecord component.private final booleanThe field for theupdateFromNeighborsrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionBlockTransformData(Holder<BlockStateProvider> blockStateProvider, Holder<SoundEvent> sound, BlockTransformer.TransformParticle particle, List<Direction> disallowedFaces, Optional<ResourceKey<LootTable>> loot, BlockTransformer.DropStrategy dropStrategy, boolean updateFromNeighbors, BlockTransformer.TransformType transformType, boolean consumeOnUse, int itemDamagePerUse) Creates an instance of aBlockTransformDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theblockStateProviderrecord component.builder(Holder<BlockStateProvider> targetStateProvider) builder(BlockPredicate predicate, Block block) builder(BlockStateProvider targetStateProvider) booleanReturns the value of theconsumeOnUserecord component.Returns the value of thedisallowedFacesrecord component.Returns the value of thedropStrategyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of theitemDamagePerUserecord component.loot()Returns the value of thelootrecord component.particle()Returns the value of theparticlerecord component.sound()Returns the value of thesoundrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetransformTyperecord component.booleanReturns the value of theupdateFromNeighborsrecord component.
-
Field Details
-
blockStateProvider
The field for theblockStateProviderrecord component. -
sound
The field for thesoundrecord component. -
particle
The field for theparticlerecord component. -
disallowedFaces
-
loot
The field for thelootrecord component. -
dropStrategy
The field for thedropStrategyrecord component. -
updateFromNeighbors
private final boolean updateFromNeighborsThe field for theupdateFromNeighborsrecord component. -
transformType
The field for thetransformTyperecord component. -
consumeOnUse
private final boolean consumeOnUseThe field for theconsumeOnUserecord component. -
itemDamagePerUse
private final int itemDamagePerUseThe field for theitemDamagePerUserecord component. -
CODEC
-
STREAM_CODEC
public static final StreamCodec<RegistryFriendlyByteBuf, BlockTransformer.BlockTransformData> STREAM_CODEC
-
-
Constructor Details
-
BlockTransformData
public BlockTransformData(Holder<BlockStateProvider> blockStateProvider, Holder<SoundEvent> sound, BlockTransformer.TransformParticle particle, List<Direction> disallowedFaces, Optional<ResourceKey<LootTable>> loot, BlockTransformer.DropStrategy dropStrategy, boolean updateFromNeighbors, BlockTransformer.TransformType transformType, boolean consumeOnUse, int itemDamagePerUse) Creates an instance of aBlockTransformDatarecord class.- Parameters:
blockStateProvider- the value for theblockStateProviderrecord componentsound- the value for thesoundrecord componentparticle- the value for theparticlerecord componentdisallowedFaces- the value for thedisallowedFacesrecord componentloot- the value for thelootrecord componentdropStrategy- the value for thedropStrategyrecord componentupdateFromNeighbors- the value for theupdateFromNeighborsrecord componenttransformType- the value for thetransformTyperecord componentconsumeOnUse- the value for theconsumeOnUserecord componentitemDamagePerUse- the value for theitemDamagePerUserecord component
-
-
Method Details
-
builder
public static BlockTransformer.BlockTransformData.Builder builder(Holder<BlockStateProvider> targetStateProvider) -
builder
public static BlockTransformer.BlockTransformData.Builder builder(BlockStateProvider targetStateProvider) -
builder
public static BlockTransformer.BlockTransformData.Builder builder(BlockPredicate predicate, Block block) -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
blockStateProvider
Returns the value of theblockStateProviderrecord component.- Returns:
- the value of the
blockStateProviderrecord component
-
sound
Returns the value of thesoundrecord component.- Returns:
- the value of the
soundrecord component
-
particle
Returns the value of theparticlerecord component.- Returns:
- the value of the
particlerecord component
-
disallowedFaces
-
loot
Returns the value of thelootrecord component.- Returns:
- the value of the
lootrecord component
-
dropStrategy
Returns the value of thedropStrategyrecord component.- Returns:
- the value of the
dropStrategyrecord component
-
updateFromNeighbors
public boolean updateFromNeighbors()Returns the value of theupdateFromNeighborsrecord component.- Returns:
- the value of the
updateFromNeighborsrecord component
-
transformType
Returns the value of thetransformTyperecord component.- Returns:
- the value of the
transformTyperecord component
-
consumeOnUse
public boolean consumeOnUse()Returns the value of theconsumeOnUserecord component.- Returns:
- the value of the
consumeOnUserecord component
-
itemDamagePerUse
public int itemDamagePerUse()Returns the value of theitemDamagePerUserecord component.- Returns:
- the value of the
itemDamagePerUserecord component
-