public override DataObject Cut() { var data1 = NbtNodeOperations.Copy(File.RootTag); var data2 = FileNodeOperations.Cut(File.Path); return(Utils.Merge(data1, data2)); }
public override IEnumerable<INode> Paste(IDataObject data) { var tags = NbtNodeOperations.ParseTags(data).OfType<NbtCompound>().ToList(); var available = Region.GetAvailableCoords(); var chunks = Enumerable.Zip(available, tags, (slot, tag) => Chunk.EmptyChunk(tag, slot.x, slot.z)).ToList(); foreach (var chunk in chunks) { Region.AddChunk(chunk); } return NodeChildren(chunks); }
public override bool CanReceiveDrop(IEnumerable <INode> nodes) => nodes.All(x => x is NbtTagNode) && NbtNodeOperations.CanReceiveDrop(File.RootTag, nodes.Filter(x => x.GetNbtTag()));
public override IEnumerable <INode> Paste(IDataObject data) { var tags = NbtNodeOperations.Paste(File.RootTag, data); return(NodeChildren(tags)); }
public override void Sort() => NbtNodeOperations.Sort(File.RootTag);
public override void ReceiveDrop(IEnumerable <INode> nodes, int index) { var tags = nodes.Filter(x => x.GetNbtTag()); NbtNodeOperations.ReceiveDrop(File.RootTag, tags, index); }
public override void Sort() => NbtNodeOperations.Sort(Tag);
public override DataObject Copy() => NbtNodeOperations.Copy(Tag);
public override DataObject Copy() => NbtNodeOperations.Copy(AccessChunkData());
public override void ReceiveDrop(IEnumerable <INode> nodes, int index) { var tags = nodes.Filter(x => x.GetNbtTag()); NbtNodeOperations.ReceiveDrop(AccessChunkData(), tags, index); }
public override IEnumerable <INode> Paste(IDataObject data) { var tags = NbtNodeOperations.Paste(AccessChunkData(), data); return(NodeChildren(tags)); }
public override void Sort() => NbtNodeOperations.Sort(AccessChunkData());