Record Class MachineEnvironment
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.machine.MachineEnvironment
- Record Components:
skyVisible- whether the block above has a clear view of the skydaytime- whether it is day in the machine's worldraining- whether it rains or snows at the machineskyLight- sky light level at the block above (0 to 15)
public record MachineEnvironment(boolean skyVisible, boolean daytime, boolean raining, int skyLight)
extends Record
What a machine's block sees of the world (E3), read on the owner thread: e.g. for solar panels.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MachineEnvironmentNo world (headless, unloaded): no sky, night, dry. -
Constructor Summary
ConstructorsConstructorDescriptionMachineEnvironment(boolean skyVisible, boolean daytime, boolean raining, int skyLight) Creates an instance of aMachineEnvironmentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleandaytime()Returns the value of thedaytimerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanraining()Returns the value of therainingrecord component.intskyLight()Returns the value of theskyLightrecord component.booleanReturns the value of theskyVisiblerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NONE
No world (headless, unloaded): no sky, night, dry.
-
-
Constructor Details
-
MachineEnvironment
public MachineEnvironment(boolean skyVisible, boolean daytime, boolean raining, int skyLight) Creates an instance of aMachineEnvironmentrecord class.- Parameters:
skyVisible- the value for theskyVisiblerecord componentdaytime- the value for thedaytimerecord componentraining- the value for therainingrecord componentskyLight- the value for theskyLightrecord 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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
skyVisible
public boolean skyVisible()Returns the value of theskyVisiblerecord component.- Returns:
- the value of the
skyVisiblerecord component
-
daytime
-
raining
-
skyLight
-