Record Class BedRule
java.lang.Object
java.lang.Record
net.minestom.server.world.attribute.BedRule
public record BedRule(BedRule.Rule canSleep, BedRule.Rule canSetSpawn, boolean explodes, @Nullable Component errorMessage)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBedRule(BedRule.Rule canSleep, BedRule.Rule canSetSpawn, boolean explodes, @Nullable Component errorMessage) Creates an instance of aBedRulerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecanSetSpawnrecord component.canSleep()Returns the value of thecanSleeprecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theerrorMessagerecord component.booleanexplodes()Returns the value of theexplodesrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CAN_SLEEP_WHEN_DARK
The default vanilla overworld bed behavior. -
EXPLODES
THe default vanilla nether/end bed behavior. -
CODEC
-
-
Constructor Details
-
BedRule
public BedRule(BedRule.Rule canSleep, BedRule.Rule canSetSpawn, boolean explodes, @Nullable @Nullable Component errorMessage) Creates an instance of aBedRulerecord class.- Parameters:
canSleep- the value for thecanSleeprecord componentcanSetSpawn- the value for thecanSetSpawnrecord componentexplodes- the value for theexplodesrecord componenterrorMessage- the value for theerrorMessagerecord component
-
-
Method Details
-
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. -
canSleep
Returns the value of thecanSleeprecord component.- Returns:
- the value of the
canSleeprecord component
-
canSetSpawn
Returns the value of thecanSetSpawnrecord component.- Returns:
- the value of the
canSetSpawnrecord component
-
explodes
public boolean explodes()Returns the value of theexplodesrecord component.- Returns:
- the value of the
explodesrecord component
-
errorMessage
-