Skip to content

Add a helper function to get worldedit positions #2816

@IntegratedQuantum

Description

@IntegratedQuantum

Currently this code needs to be in every command that edits the selection:

const pos1 = source.worldEditData.selectionPosition1 orelse {
	return source.sendMessage("#ff0000Position 1 is not set.", .{});
};
const pos2 = source.worldEditData.selectionPosition2 orelse {
	return source.sendMessage("#ff0000Position 2 is not set.", .{});
};

const posStart: Vec3i = @min(pos1, pos2);
const posEnd: Vec3i = @max(pos1, pos2);

extracted from #2797

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributor friendlythis issue is limited in scope and/or knowledge of Cubyz internals, good for newcomersrefactorshuffle code around

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions