public bool SaveSelectionToClipboard(User pUser) { var vectors = GetSortedVectors(); if (vectors == null) { return(false); } mUserClipboardPosition = pUser.Player.Position.Round; mClipboard.Clear(); for (int x = vectors.Lower.X; x != vectors.Higher.X; x = (x + 1) % Shared.Voxel.World.VoxelSize.X) { for (int y = vectors.Lower.Y; y < vectors.Higher.Y; y++) { for (int z = vectors.Lower.Z; z != vectors.Higher.Z; z = (z + 1) % Shared.Voxel.World.VoxelSize.Z) { var pos = new Vector3i(x, y, z); //pos - mUserClipboardPosition: "Spitze minus Anfang" mClipboard.Add(WorldEditBlock.CreateNew(Eco.World.World.GetBlock(pos), pos - mUserClipboardPosition, pos)); } } } return(true); }
public void AddBlockChangedEntry(Block pBlock, Vector3i pPosition, Vector3i?pSourcePosition = null) { pSourcePosition = pSourcePosition ?? pPosition; mLastCommandBlocks.Push(WorldEditBlock.CreateNew(pBlock, pPosition, pSourcePosition)); }