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
Modifier and TypeFieldDescriptionprivate final BlockStateProvider
The field for theblockState
record component.static final com.mojang.serialization.MapCodec
<ReplaceDisk> private final LevelBasedValue
The field for theheight
record component.private final Vec3i
The field for theoffset
record component.private final Optional
<BlockPredicate> The field for thepredicate
record component.private final LevelBasedValue
The field for theradius
record component.The field for thetriggerGameEvent
record component. -
Constructor Summary
ConstructorDescriptionReplaceDisk
(LevelBasedValue radius, LevelBasedValue height, Vec3i offset, Optional<BlockPredicate> predicate, BlockStateProvider blockState, Optional<Holder<GameEvent>> triggerGameEvent) Creates an instance of aReplaceDisk
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(ServerLevel p_353045_, int p_353076_, EnchantedItemInUse p_353050_, Entity p_353038_, Vec3 p_353044_) Returns the value of theblockState
record component.com.mojang.serialization.MapCodec
<ReplaceDisk> codec()
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.height()
Returns the value of theheight
record component.offset()
Returns the value of theoffset
record component.Returns the value of thepredicate
record component.radius()
Returns the value of theradius
record component.final String
toString()
Returns a string representation of this record class.Returns the value of thetriggerGameEvent
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.item.enchantment.effects.EnchantmentEntityEffect
onChangedBlock
Methods inherited from interface net.minecraft.world.item.enchantment.effects.EnchantmentLocationBasedEffect
onDeactivated
-
Field Details
-
radius
The field for theradius
record component. -
height
The field for theheight
record component. -
offset
The field for theoffset
record component. -
predicate
The field for thepredicate
record component. -
blockState
The field for theblockState
record component. -
triggerGameEvent
The field for thetriggerGameEvent
record 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 aReplaceDisk
record class.- Parameters:
radius
- the value for theradius
record componentheight
- the value for theheight
record componentoffset
- the value for theoffset
record componentpredicate
- the value for thepredicate
record componentblockState
- the value for theblockState
record componenttriggerGameEvent
- the value for thetriggerGameEvent
record component
-
-
Method Details
-
apply
public void apply(ServerLevel p_353045_, int p_353076_, EnchantedItemInUse p_353050_, Entity p_353038_, Vec3 p_353044_) - Specified by:
apply
in interfaceEnchantmentEntityEffect
-
codec
- Specified by:
codec
in interfaceEnchantmentEntityEffect
- Specified by:
codec
in 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 theradius
record component.- Returns:
- the value of the
radius
record component
-
height
Returns the value of theheight
record component.- Returns:
- the value of the
height
record component
-
offset
Returns the value of theoffset
record component.- Returns:
- the value of the
offset
record component
-
predicate
Returns the value of thepredicate
record component.- Returns:
- the value of the
predicate
record component
-
blockState
Returns the value of theblockState
record component.- Returns:
- the value of the
blockState
record component
-
triggerGameEvent
Returns the value of thetriggerGameEvent
record component.- Returns:
- the value of the
triggerGameEvent
record component
-