Record Class Upgrade
java.lang.Object
java.lang.Record
com.blamejared.ironsmelters.component.Upgrade
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUpgrade(Optional<SmelterType> from, SmelterType to, boolean keepData) Creates an instance of aUpgraderecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.from()Returns the value of thefromrecord component.final inthashCode()Returns a hash code value for this object.booleankeepData()Returns the value of thekeepDatarecord component.booleanmatches(net.minecraft.world.level.block.state.BlockState state) to()Returns the value of thetorecord component.final StringtoString()Returns a string representation of this record class.booleanupgrade(net.minecraft.server.level.ServerLevel level, net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.core.BlockPos pos)
-
Field Details
-
PREDICATE
-
CODEC
-
-
Constructor Details
-
Upgrade
Creates an instance of aUpgraderecord class.- Parameters:
from- the value for thefromrecord componentto- the value for thetorecord componentkeepData- the value for thekeepDatarecord component
-
-
Method Details
-
matches
public boolean matches(net.minecraft.world.level.block.state.BlockState state) -
upgrade
public boolean upgrade(net.minecraft.server.level.ServerLevel level, net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.core.BlockPos pos) -
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. -
from
Returns the value of thefromrecord component.- Returns:
- the value of the
fromrecord component
-
to
Returns the value of thetorecord component.- Returns:
- the value of the
torecord component
-
keepData
public boolean keepData()Returns the value of thekeepDatarecord component.- Returns:
- the value of the
keepDatarecord component
-