Record Class Block
java.lang.Object
java.lang.Record
com.zenith.mc.block.Block
- All Implemented Interfaces:
RegistryData
public record Block(int id, String name, int minStateId, int maxStateId, int mapColorId, BlockOffsetType offsetType, float maxHorizontalOffset, float maxVerticalOffset, boolean solidBlock, float destroySpeed, boolean requiresCorrectToolForDrops, EnumSet<BlockTags> blockTags, float friction, float speedFactor, float jumpFactor, boolean fallingBlock, PushReaction pushReaction, @Nullable BlockEntityType blockEntityType)
extends Record
implements RegistryData
-
Constructor Summary
ConstructorsConstructorDescriptionBlock(int id, String name, int minStateId, int maxStateId, int mapColorId, BlockOffsetType offsetType, float maxHorizontalOffset, float maxVerticalOffset, boolean solidBlock, float destroySpeed, boolean requiresCorrectToolForDrops, EnumSet<BlockTags> blockTags, float friction, float speedFactor, float jumpFactor, boolean fallingBlock, PushReaction pushReaction, @Nullable BlockEntityType blockEntityType) Creates an instance of aBlockrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable BlockEntityTypeReturns the value of theblockEntityTyperecord component.Returns the value of theblockTagsrecord component.floatReturns the value of thedestroySpeedrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of thefallingBlockrecord component.floatfriction()Returns the value of thefrictionrecord component.final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.booleanisAir()floatReturns the value of thejumpFactorrecord component.intReturns the value of themapColorIdrecord component.floatReturns the value of themaxHorizontalOffsetrecord component.intReturns the value of themaxStateIdrecord component.floatReturns the value of themaxVerticalOffsetrecord component.intReturns the value of theminStateIdrecord component.name()Returns the value of thenamerecord component.Returns the value of theoffsetTyperecord component.Returns the value of thepushReactionrecord component.booleanbooleanReturns the value of therequiresCorrectToolForDropsrecord component.booleanReturns the value of thesolidBlockrecord component.floatReturns the value of thespeedFactorrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
Block
public Block(int id, String name, int minStateId, int maxStateId, int mapColorId, BlockOffsetType offsetType, float maxHorizontalOffset, float maxVerticalOffset, boolean solidBlock, float destroySpeed, boolean requiresCorrectToolForDrops, EnumSet<BlockTags> blockTags, float friction, float speedFactor, float jumpFactor, boolean fallingBlock, PushReaction pushReaction, @Nullable BlockEntityType blockEntityType) Creates an instance of aBlockrecord class.- Parameters:
id- the value for theidrecord componentname- the value for thenamerecord componentminStateId- the value for theminStateIdrecord componentmaxStateId- the value for themaxStateIdrecord componentmapColorId- the value for themapColorIdrecord componentoffsetType- the value for theoffsetTyperecord componentmaxHorizontalOffset- the value for themaxHorizontalOffsetrecord componentmaxVerticalOffset- the value for themaxVerticalOffsetrecord componentsolidBlock- the value for thesolidBlockrecord componentdestroySpeed- the value for thedestroySpeedrecord componentrequiresCorrectToolForDrops- the value for therequiresCorrectToolForDropsrecord componentblockTags- the value for theblockTagsrecord componentfriction- the value for thefrictionrecord componentspeedFactor- the value for thespeedFactorrecord componentjumpFactor- the value for thejumpFactorrecord componentfallingBlock- the value for thefallingBlockrecord componentpushReaction- the value for thepushReactionrecord componentblockEntityType- the value for theblockEntityTyperecord component
-
-
Method Details
-
toString
-
isAir
public boolean isAir() -
replaceable
public boolean replaceable() -
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. -
id
public int id()Returns the value of theidrecord component.- Specified by:
idin interfaceRegistryData- Returns:
- the value of the
idrecord component
-
name
Returns the value of thenamerecord component.- Specified by:
namein interfaceRegistryData- Returns:
- the value of the
namerecord component
-
minStateId
public int minStateId()Returns the value of theminStateIdrecord component.- Returns:
- the value of the
minStateIdrecord component
-
maxStateId
public int maxStateId()Returns the value of themaxStateIdrecord component.- Returns:
- the value of the
maxStateIdrecord component
-
mapColorId
public int mapColorId()Returns the value of themapColorIdrecord component.- Returns:
- the value of the
mapColorIdrecord component
-
offsetType
Returns the value of theoffsetTyperecord component.- Returns:
- the value of the
offsetTyperecord component
-
maxHorizontalOffset
public float maxHorizontalOffset()Returns the value of themaxHorizontalOffsetrecord component.- Returns:
- the value of the
maxHorizontalOffsetrecord component
-
maxVerticalOffset
public float maxVerticalOffset()Returns the value of themaxVerticalOffsetrecord component.- Returns:
- the value of the
maxVerticalOffsetrecord component
-
solidBlock
public boolean solidBlock()Returns the value of thesolidBlockrecord component.- Returns:
- the value of the
solidBlockrecord component
-
destroySpeed
public float destroySpeed()Returns the value of thedestroySpeedrecord component.- Returns:
- the value of the
destroySpeedrecord component
-
requiresCorrectToolForDrops
public boolean requiresCorrectToolForDrops()Returns the value of therequiresCorrectToolForDropsrecord component.- Returns:
- the value of the
requiresCorrectToolForDropsrecord component
-
blockTags
-
friction
public float friction()Returns the value of thefrictionrecord component.- Returns:
- the value of the
frictionrecord component
-
speedFactor
public float speedFactor()Returns the value of thespeedFactorrecord component.- Returns:
- the value of the
speedFactorrecord component
-
jumpFactor
public float jumpFactor()Returns the value of thejumpFactorrecord component.- Returns:
- the value of the
jumpFactorrecord component
-
fallingBlock
public boolean fallingBlock()Returns the value of thefallingBlockrecord component.- Returns:
- the value of the
fallingBlockrecord component
-
pushReaction
Returns the value of thepushReactionrecord component.- Returns:
- the value of the
pushReactionrecord component
-
blockEntityType
Returns the value of theblockEntityTyperecord component.- Returns:
- the value of the
blockEntityTyperecord component
-