Exemple #1
0
        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);
 }
Exemple #3
0
 public override bool CanReceiveDrop(IEnumerable <INode> nodes) => nodes.All(x => x is NbtTagNode) && NbtNodeOperations.CanReceiveDrop(File.RootTag, nodes.Filter(x => x.GetNbtTag()));
Exemple #4
0
        public override IEnumerable <INode> Paste(IDataObject data)
        {
            var tags = NbtNodeOperations.Paste(File.RootTag, data);

            return(NodeChildren(tags));
        }
Exemple #5
0
 public override void Sort() => NbtNodeOperations.Sort(File.RootTag);
Exemple #6
0
        public override void ReceiveDrop(IEnumerable <INode> nodes, int index)
        {
            var tags = nodes.Filter(x => x.GetNbtTag());

            NbtNodeOperations.ReceiveDrop(File.RootTag, tags, index);
        }
Exemple #7
0
 public override void Sort() => NbtNodeOperations.Sort(Tag);
Exemple #8
0
 public override DataObject Copy() => NbtNodeOperations.Copy(Tag);
Exemple #9
0
 public override DataObject Copy() => NbtNodeOperations.Copy(AccessChunkData());
Exemple #10
0
        public override void ReceiveDrop(IEnumerable <INode> nodes, int index)
        {
            var tags = nodes.Filter(x => x.GetNbtTag());

            NbtNodeOperations.ReceiveDrop(AccessChunkData(), tags, index);
        }
Exemple #11
0
        public override IEnumerable <INode> Paste(IDataObject data)
        {
            var tags = NbtNodeOperations.Paste(AccessChunkData(), data);

            return(NodeChildren(tags));
        }
Exemple #12
0
 public override void Sort() => NbtNodeOperations.Sort(AccessChunkData());