Search in sources :

Example 1 with StructureEditorData

use of com.nukkitx.protocol.bedrock.data.structure.StructureEditorData 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 StructureEditorData

use of com.nukkitx.protocol.bedrock.data.structure.StructureEditorData 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)

Aggregations

StructureBlockType (com.nukkitx.protocol.bedrock.data.structure.StructureBlockType)2 StructureEditorData (com.nukkitx.protocol.bedrock.data.structure.StructureEditorData)2 StructureSettings (com.nukkitx.protocol.bedrock.data.structure.StructureSettings)2 StructureRedstoneSaveMode (com.nukkitx.protocol.bedrock.data.structure.StructureRedstoneSaveMode)1