Class BlueprintPreviewData
java.lang.Object
com.ldtteam.structurize.storage.rendering.types.BlueprintPreviewData
Necessary data for blueprint preview.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor to create a new setup.BlueprintPreviewData(boolean serverSyncEnabled) Default constructor to create a new setup.BlueprintPreviewData(net.minecraft.network.FriendlyByteBuf byteBuf) Create blueprint preview data from byteBuf.BlueprintPreviewData(net.minecraft.network.FriendlyByteBuf byteBuf, boolean serverSyncEnabled) Create blueprint preview data from byteBuf. -
Method Summary
Modifier and TypeMethodDescriptionGet the current blueprint to render.floatnet.minecraft.core.BlockPosgetPos()Get the pos of the preview.Get the placement settings for this instance.booleanisEmpty()Check if this is an invalid preview data object.booleanvoidmirror()Mirror the blueprint.voidmove(net.minecraft.core.BlockPos offset) Move this preview by an offset.voidrotate(net.minecraft.world.level.block.Rotation rotation) Rotate the preview by a certain quantity.voidsetBlueprint(Blueprint blueprint) Set a blueprint that is alreayd loaded.voidsetBlueprintFuture(Future<Blueprint> blueprintFuture) Set the blueprint future.voidsetGroundOffset(int offset) set the y offset between current and original position this also actually adjusts the position -- ensure that's set firstvoidsetOverridePreviewTransparency(float overridePreviewTransparency) Overrides client config for preview transparency if already enabled, else does nothing.voidsetPos(net.minecraft.core.BlockPos pos) Set the position of the preview.voidsetRotationMirror(RotationMirror rotationMirror) Rotate/mirror the preview to given value.voidSync the changes to the server.voidwriteToBuf(net.minecraft.network.FriendlyByteBuf byteBuf) Write this preview cache to bytebuf.
-
Constructor Details
-
BlueprintPreviewData
public BlueprintPreviewData()Default constructor to create a new setup. -
BlueprintPreviewData
public BlueprintPreviewData(boolean serverSyncEnabled) Default constructor to create a new setup.- Parameters:
serverSyncEnabled- if false then wont send sync preview messages to server
-
BlueprintPreviewData
public BlueprintPreviewData(net.minecraft.network.FriendlyByteBuf byteBuf) Create blueprint preview data from byteBuf.- Parameters:
byteBuf- the buffer data.
-
BlueprintPreviewData
public BlueprintPreviewData(net.minecraft.network.FriendlyByteBuf byteBuf, boolean serverSyncEnabled) Create blueprint preview data from byteBuf.- Parameters:
byteBuf- the buffer data.serverSyncEnabled- if false then wont send sync preview messages to server
-
-
Method Details
-
writeToBuf
public void writeToBuf(net.minecraft.network.FriendlyByteBuf byteBuf) Write this preview cache to bytebuf.- Parameters:
byteBuf- the buf to write it to.
-
setBlueprintFuture
Set the blueprint future.- Parameters:
blueprintFuture- the future.
-
setGroundOffset
public void setGroundOffset(int offset) set the y offset between current and original position this also actually adjusts the position -- ensure that's set first- Parameters:
offset- the new offset
-
getBlueprint
Get the current blueprint to render.- Returns:
- the blueprint or null if not ready yet.
-
setBlueprint
Set a blueprint that is alreayd loaded.- Parameters:
blueprint- the blueprint to set.
-
mirror
public void mirror()Mirror the blueprint. -
rotate
public void rotate(net.minecraft.world.level.block.Rotation rotation) Rotate the preview by a certain quantity.- Parameters:
rotation- the rotation factor.
-
setRotationMirror
Rotate/mirror the preview to given value.- Parameters:
rotationMirror- new rot/mir for blueprint
-
syncChangesToServer
public void syncChangesToServer()Sync the changes to the server. -
move
public void move(net.minecraft.core.BlockPos offset) Move this preview by an offset.- Parameters:
offset- the offset to move it by.
-
isEmpty
public boolean isEmpty()Check if this is an invalid preview data object.- Returns:
- true if so.
-
getRotationMirror
Get the placement settings for this instance.- Returns:
- the placement settings with mirror and rotation.
-
getPos
public net.minecraft.core.BlockPos getPos()Get the pos of the preview.- Returns:
- the pos.
-
setPos
public void setPos(net.minecraft.core.BlockPos pos) Set the position of the preview.- Parameters:
pos- the pos to set.
-
getRenderKey
-
isServerSyncEnabled
public boolean isServerSyncEnabled() -
setOverridePreviewTransparency
public void setOverridePreviewTransparency(float overridePreviewTransparency) Overrides client config for preview transparency if already enabled, else does nothing.- Parameters:
overridePreviewTransparency- -1 (or any negative) for keep config, 0 = transparent to 1 = opaque
-
getOverridePreviewTransparency
public float getOverridePreviewTransparency()
-