Search in sources :

Example 1 with StructureSettings

use of com.nukkitx.protocol.bedrock.data.structure.StructureSettings in project Protocol by CloudburstMC.

the class StructureBlockUpdateSerializer_v361 method readEditorData.

protected StructureEditorData readEditorData(ByteBuf buffer, BedrockPacketHelper helper) {
    String name = helper.readString(buffer);
    String dataField = helper.readString(buffer);
    boolean includingPlayers = buffer.readBoolean();
    boolean boundingBoxVisible = buffer.readBoolean();
    StructureBlockType type = StructureBlockType.from(VarInts.readInt(buffer));
    StructureSettings settings = helper.readStructureSettings(buffer);
    return new StructureEditorData(name, dataField, includingPlayers, boundingBoxVisible, type, settings, StructureRedstoneSaveMode.SAVES_TO_DISK);
}
Also used : StructureEditorData(com.nukkitx.protocol.bedrock.data.structure.StructureEditorData) StructureSettings(com.nukkitx.protocol.bedrock.data.structure.StructureSettings) StructureBlockType(com.nukkitx.protocol.bedrock.data.structure.StructureBlockType)

Example 2 with StructureSettings

use of com.nukkitx.protocol.bedrock.data.structure.StructureSettings in project Protocol by CloudburstMC.

the class BedrockPacketHelper_v440 method readStructureSettings.

@Override
public StructureSettings readStructureSettings(ByteBuf buffer) {
    String paletteName = this.readString(buffer);
    boolean ignoringEntities = buffer.readBoolean();
    boolean ignoringBlocks = buffer.readBoolean();
    Vector3i size = this.readBlockPosition(buffer);
    Vector3i offset = this.readBlockPosition(buffer);
    long lastEditedByEntityId = VarInts.readLong(buffer);
    StructureRotation rotation = StructureRotation.from(buffer.readByte());
    StructureMirror mirror = StructureMirror.from(buffer.readByte());
    StructureAnimationMode animationMode = StructureAnimationMode.from(buffer.readUnsignedByte());
    float animationSeconds = buffer.readFloatLE();
    float integrityValue = buffer.readFloatLE();
    int integritySeed = buffer.readIntLE();
    Vector3f pivot = this.readVector3f(buffer);
    return new StructureSettings(paletteName, ignoringEntities, ignoringBlocks, size, offset, lastEditedByEntityId, rotation, mirror, animationMode, animationSeconds, integrityValue, integritySeed, pivot);
}
Also used : StructureRotation(com.nukkitx.protocol.bedrock.data.structure.StructureRotation) Vector3f(com.nukkitx.math.vector.Vector3f) Vector3i(com.nukkitx.math.vector.Vector3i) StructureSettings(com.nukkitx.protocol.bedrock.data.structure.StructureSettings) StructureMirror(com.nukkitx.protocol.bedrock.data.structure.StructureMirror) StructureAnimationMode(com.nukkitx.protocol.bedrock.data.structure.StructureAnimationMode)

Example 3 with StructureSettings

use of com.nukkitx.protocol.bedrock.data.structure.StructureSettings in project Protocol by CloudburstMC.

the class BedrockPacketHelper_v388 method readStructureSettings.

@Override
public StructureSettings readStructureSettings(ByteBuf buffer) {
    String paletteName = this.readString(buffer);
    boolean ignoringEntities = buffer.readBoolean();
    boolean ignoringBlocks = buffer.readBoolean();
    Vector3i size = this.readBlockPosition(buffer);
    Vector3i offset = this.readBlockPosition(buffer);
    long lastEditedByEntityId = VarInts.readLong(buffer);
    StructureRotation rotation = StructureRotation.from(buffer.readByte());
    StructureMirror mirror = StructureMirror.from(buffer.readByte());
    float integrityValue = buffer.readFloatLE();
    int integritySeed = buffer.readIntLE();
    Vector3f pivot = this.readVector3f(buffer);
    return new StructureSettings(paletteName, ignoringEntities, ignoringBlocks, size, offset, lastEditedByEntityId, rotation, mirror, StructureAnimationMode.NONE, 0, integrityValue, integritySeed, pivot);
}
Also used : StructureRotation(com.nukkitx.protocol.bedrock.data.structure.StructureRotation) Vector3f(com.nukkitx.math.vector.Vector3f) Vector3i(com.nukkitx.math.vector.Vector3i) StructureSettings(com.nukkitx.protocol.bedrock.data.structure.StructureSettings) StructureMirror(com.nukkitx.protocol.bedrock.data.structure.StructureMirror)

Example 4 with StructureSettings

use of com.nukkitx.protocol.bedrock.data.structure.StructureSettings in project Protocol by CloudburstMC.

the class StructureBlockUpdateSerializer_v388 method readEditorData.

@Override
protected StructureEditorData readEditorData(ByteBuf buffer, BedrockPacketHelper helper) {
    String name = helper.readString(buffer);
    String dataField = helper.readString(buffer);
    boolean includingPlayers = buffer.readBoolean();
    boolean boundingBoxVisible = buffer.readBoolean();
    StructureBlockType type = StructureBlockType.from(VarInts.readInt(buffer));
    StructureSettings settings = helper.readStructureSettings(buffer);
    StructureRedstoneSaveMode redstoneSaveMode = StructureRedstoneSaveMode.from(VarInts.readInt(buffer));
    return new StructureEditorData(name, dataField, includingPlayers, boundingBoxVisible, type, settings, redstoneSaveMode);
}
Also used : StructureRedstoneSaveMode(com.nukkitx.protocol.bedrock.data.structure.StructureRedstoneSaveMode) StructureEditorData(com.nukkitx.protocol.bedrock.data.structure.StructureEditorData) StructureSettings(com.nukkitx.protocol.bedrock.data.structure.StructureSettings) StructureBlockType(com.nukkitx.protocol.bedrock.data.structure.StructureBlockType)

Example 5 with StructureSettings

use of com.nukkitx.protocol.bedrock.data.structure.StructureSettings in project Protocol by CloudburstMC.

the class BedrockPacketHelper_v361 method readStructureSettings.

@Override
public StructureSettings readStructureSettings(ByteBuf buffer) {
    String paletteName = this.readString(buffer);
    boolean ignoringEntities = buffer.readBoolean();
    boolean ignoringBlocks = buffer.readBoolean();
    Vector3i size = this.readBlockPosition(buffer);
    Vector3i offset = this.readBlockPosition(buffer);
    long lastEditedByEntityId = VarInts.readLong(buffer);
    StructureRotation rotation = StructureRotation.from(buffer.readByte());
    StructureMirror mirror = StructureMirror.from(buffer.readByte());
    float integrityValue = buffer.readFloatLE();
    int integritySeed = buffer.readIntLE();
    return new StructureSettings(paletteName, ignoringEntities, ignoringBlocks, size, offset, lastEditedByEntityId, rotation, mirror, StructureAnimationMode.NONE, 0, integrityValue, integritySeed, Vector3f.ZERO);
}
Also used : StructureRotation(com.nukkitx.protocol.bedrock.data.structure.StructureRotation) Vector3i(com.nukkitx.math.vector.Vector3i) StructureSettings(com.nukkitx.protocol.bedrock.data.structure.StructureSettings) StructureMirror(com.nukkitx.protocol.bedrock.data.structure.StructureMirror)

Aggregations

StructureSettings (com.nukkitx.protocol.bedrock.data.structure.StructureSettings)5 Vector3i (com.nukkitx.math.vector.Vector3i)3 StructureMirror (com.nukkitx.protocol.bedrock.data.structure.StructureMirror)3 StructureRotation (com.nukkitx.protocol.bedrock.data.structure.StructureRotation)3 Vector3f (com.nukkitx.math.vector.Vector3f)2 StructureBlockType (com.nukkitx.protocol.bedrock.data.structure.StructureBlockType)2 StructureEditorData (com.nukkitx.protocol.bedrock.data.structure.StructureEditorData)2 StructureAnimationMode (com.nukkitx.protocol.bedrock.data.structure.StructureAnimationMode)1 StructureRedstoneSaveMode (com.nukkitx.protocol.bedrock.data.structure.StructureRedstoneSaveMode)1