示例#1
0
        public override void readFromNbt(NbtCompound tag)
        {
            base.readFromNbt(tag);

            this.setTile(
                Block.getBlockFromId(tag.Get <NbtInt>("blockId").Value),
                tag.Get <NbtInt>("meta").Value);

            tag.TryGet <NbtCompound>("blockNbt", out this.blockNbt);
            this.startPos = NbtHelper.readDirectBlockPos(tag, "start");
        }
示例#2
0
        public override void readFromNbt(NbtCompound tag)
        {
            this.shaftOrgin = NbtHelper.readDirectBlockPos(tag, "orgin");

            foreach (NbtCompound compound in tag.Get <NbtList>("pieces"))
            {
                byte      id = compound.Get <NbtByte>("id").ByteValue;
                PieceBase p  = this.getPieceFromId(id, compound);

                if (p != null)
                {
                    p.shaft = this;
                    p.calculateBounds();
                    this.pieces.Add(p);
                }
            }
        }
示例#3
0
 public PieceHallway(NbtCompound tag) : base(tag)
 {
     this.end      = NbtHelper.readDirectBlockPos(tag, "end");
     this.pointing = Direction.all[tag.Get <NbtInt>("pointing").IntValue];
     this.is3High  = tag.Get <NbtByte>("3High").Value == 1;
 }
示例#4
0
 /// <summary>
 /// Constrcutor when loading a piece from the save.
 /// </summary>
 public PieceBase(NbtCompound tag)
 {
     this.orgin = NbtHelper.readDirectBlockPos(tag, "orgin");
 }
示例#5
0
 public ScheduledTick(NbtCompound tag)
 {
     this.timeUntil = tag.Get <NbtFloat>("timeUntil").Value;
     this.pos       = NbtHelper.readDirectBlockPos(tag, "pos");
 }