Record Class FluidWalkerEffect

java.lang.Object
java.lang.Record
johnsmith.enchantmentcore.api.enchantment.effect.FluidWalkerEffect
Record Components:
allowedFluids - The HolderSet of fluids treated as solid surfaces when approached from above.
speedRetention - The LevelBasedValue movement speed multiplier while walking on matching fluids.
All Implemented Interfaces:
FluidWalkerDefinition

public record FluidWalkerEffect(net.minecraft.core.HolderSet<net.minecraft.world.level.material.Fluid> allowedFluids, net.minecraft.world.item.enchantment.LevelBasedValue speedRetention) extends Record implements FluidWalkerDefinition
Standard record implementation of FluidWalkerDefinition enabling entities to stand and walk atop specified fluid blocks without modifying world block states.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    JSON field key for the set of walkable fluids.
    static final com.mojang.serialization.Codec<FluidWalkerEffect>
    Codec for serializing and deserializing FluidWalkerEffect instances from JSON.
    static final String
    Registry path identifier for this effect component.
    Supplies the JSON property keys holding LevelBasedValue definitions for data transformation.
    static final String
    JSON field key for the surface movement speed multiplier.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FluidWalkerEffect(net.minecraft.core.HolderSet<net.minecraft.world.level.material.Fluid> allowedFluids, net.minecraft.world.item.enchantment.LevelBasedValue speedRetention)
    Creates an instance of a FluidWalkerEffect record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.core.HolderSet<net.minecraft.world.level.material.Fluid>
    Returns the value of the allowedFluids record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    net.minecraft.world.item.enchantment.LevelBasedValue
    Returns the value of the speedRetention record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • ALLOWED_FLUIDS

      public static final String ALLOWED_FLUIDS
      JSON field key for the set of walkable fluids.
      See Also:
    • SPEED_RETENTION

      public static final String SPEED_RETENTION
      JSON field key for the surface movement speed multiplier.
      See Also:
    • KEY

      public static final String KEY
      Registry path identifier for this effect component.
      See Also:
    • KEY_PROVIDER

      public static final LevelBasedKeyProvider KEY_PROVIDER
      Supplies the JSON property keys holding LevelBasedValue definitions for data transformation.
    • CODEC

      public static final com.mojang.serialization.Codec<FluidWalkerEffect> CODEC
      Codec for serializing and deserializing FluidWalkerEffect instances from JSON.
  • Constructor Details

    • FluidWalkerEffect

      public FluidWalkerEffect(net.minecraft.core.HolderSet<net.minecraft.world.level.material.Fluid> allowedFluids, net.minecraft.world.item.enchantment.LevelBasedValue speedRetention)
      Creates an instance of a FluidWalkerEffect record class.
      Parameters:
      allowedFluids - the value for the allowedFluids record component
      speedRetention - the value for the speedRetention record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • allowedFluids

      public net.minecraft.core.HolderSet<net.minecraft.world.level.material.Fluid> allowedFluids()
      Returns the value of the allowedFluids record component.
      Specified by:
      allowedFluids in interface FluidWalkerDefinition
      Returns:
      the value of the allowedFluids record component
    • speedRetention

      public net.minecraft.world.item.enchantment.LevelBasedValue speedRetention()
      Returns the value of the speedRetention record component.
      Specified by:
      speedRetention in interface FluidWalkerDefinition
      Returns:
      the value of the speedRetention record component