Record Class ReactorLayer
java.lang.Object
java.lang.Record
net.darkhax.retroreactors.common.data.reactor.ReactorLayer
- Record Components:
palette- The palette to pull from when generating the layer.radius- The radius of the layer. Must be between 0 and 32. Layers with 0 radius are skipped. Defaults to 1.height- The height of the layer. Must be between 0 and 64. Layers with 0 height are skipped. Defaults to 1.fill- Should the layer be filled, if false only the outline will be generated.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionReactorLayer(String palette, int radius, int height, boolean fill) Creates an instance of aReactorLayerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.booleanfill()Returns the value of thefillrecord component.final inthashCode()Returns a hash code value for this object.intheight()Returns the value of theheightrecord component.booleanisObstructed(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos centerPos, int towerStartY) Checks if the layer would be obstructed and prevents the layer from generating.palette()Returns the value of thepaletterecord component.voidplace(net.minecraft.server.level.ServerLevel level, net.minecraft.util.random.WeightedList<net.minecraft.world.level.block.state.BlockState> palette, net.minecraft.core.BlockPos centerPos) Places the layer into the world.intradius()Returns the value of theradiusrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
Method Details
-
place
public void place(net.minecraft.server.level.ServerLevel level, net.minecraft.util.random.WeightedList<net.minecraft.world.level.block.state.BlockState> palette, net.minecraft.core.BlockPos centerPos) Places the layer into the world.- Parameters:
level- The server level to place the blocks in.palette- A weighted pool of blocks that can be selected from when generating these layers.centerPos- The center of the layer, adjusted to the expected height.
-
isObstructed
public boolean isObstructed(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos centerPos, int towerStartY) Checks if the layer would be obstructed and prevents the layer from generating.- Parameters:
level- The level the tower is generating in.centerPos- The center of the layer.towerStartY- The y level offset of the layer.- Returns:
- If the layer is obstructed.
-
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. -
palette
-
radius
-
height
-
fill
-