Record Class ReplaceDisk
java.lang.Object
java.lang.Record
net.minecraft.world.item.enchantment.effects.ReplaceDisk
- All Implemented Interfaces:
EnchantmentEntityEffect,EnchantmentLocationBasedEffect
public record ReplaceDisk(LevelBasedValue radius, LevelBasedValue height, Vec3i offset, Optional<BlockPredicate> predicate, BlockStateProvider blockState, Optional<Holder<GameEvent>> triggerGameEvent)
extends Record
implements EnchantmentEntityEffect
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BlockStateProviderThe field for theblockStaterecord component.static final com.mojang.serialization.MapCodec<ReplaceDisk> private final LevelBasedValueThe field for theheightrecord component.private final Vec3iThe field for theoffsetrecord component.private final Optional<BlockPredicate> The field for thepredicaterecord component.private final LevelBasedValueThe field for theradiusrecord component.The field for thetriggerGameEventrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionReplaceDisk(LevelBasedValue radius, LevelBasedValue height, Vec3i offset, Optional<BlockPredicate> predicate, BlockStateProvider blockState, Optional<Holder<GameEvent>> triggerGameEvent) Creates an instance of aReplaceDiskrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(ServerLevel pLevel, int pEnchantmentLevel, EnchantedItemInUse pItem, Entity pEntity, Vec3 pOrigin) Returns the value of theblockStaterecord component.com.mojang.serialization.MapCodec<ReplaceDisk> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.height()Returns the value of theheightrecord component.offset()Returns the value of theoffsetrecord component.Returns the value of thepredicaterecord component.radius()Returns the value of theradiusrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetriggerGameEventrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.item.enchantment.effects.EnchantmentEntityEffect
onChangedBlockMethods inherited from interface net.minecraft.world.item.enchantment.effects.EnchantmentLocationBasedEffect
onDeactivated
-
Field Details
-
radius
The field for theradiusrecord component. -
height
The field for theheightrecord component. -
offset
The field for theoffsetrecord component. -
predicate
The field for thepredicaterecord component. -
blockState
The field for theblockStaterecord component. -
triggerGameEvent
The field for thetriggerGameEventrecord component. -
CODEC
-
-
Constructor Details
-
ReplaceDisk
public ReplaceDisk(LevelBasedValue radius, LevelBasedValue height, Vec3i offset, Optional<BlockPredicate> predicate, BlockStateProvider blockState, Optional<Holder<GameEvent>> triggerGameEvent) Creates an instance of aReplaceDiskrecord class.- Parameters:
radius- the value for theradiusrecord componentheight- the value for theheightrecord componentoffset- the value for theoffsetrecord componentpredicate- the value for thepredicaterecord componentblockState- the value for theblockStaterecord componenttriggerGameEvent- the value for thetriggerGameEventrecord component
-
-
Method Details
-
apply
public void apply(ServerLevel pLevel, int pEnchantmentLevel, EnchantedItemInUse pItem, Entity pEntity, Vec3 pOrigin) - Specified by:
applyin interfaceEnchantmentEntityEffect
-
codec
- Specified by:
codecin interfaceEnchantmentEntityEffect- Specified by:
codecin interfaceEnchantmentLocationBasedEffect
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
radius
Returns the value of theradiusrecord component.- Returns:
- the value of the
radiusrecord component
-
height
Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-
offset
Returns the value of theoffsetrecord component.- Returns:
- the value of the
offsetrecord component
-
predicate
Returns the value of thepredicaterecord component.- Returns:
- the value of the
predicaterecord component
-
blockState
Returns the value of theblockStaterecord component.- Returns:
- the value of the
blockStaterecord component
-
triggerGameEvent
Returns the value of thetriggerGameEventrecord component.- Returns:
- the value of the
triggerGameEventrecord component
-