コード例 #1
0
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);

            tree.SetBool("squeezezd", squeezed);
            tree.SetInt("state", (int)state);
        }
コード例 #2
0
 public override void ToTreeAttributes(ITreeAttribute tree)
 {
     base.ToTreeAttributes(tree);
     tree.SetBytes("voxels", serializeVoxels());
     tree.SetInt("selectedRecipeNumber", selectedRecipeNumber);
     tree.SetItemstack("baseMaterial", BaseMaterial);
 }
コード例 #3
0
 public override void ToTreeAttributes(ITreeAttribute tree)
 {
     base.ToTreeAttributes(tree);
     tree.SetFloat("remainingSeconds", remainingSeconds);
     tree.SetInt("lit", lit ? 1 : 0);
     tree.SetString("ignitedByPlayerUid", ignitedByPlayerUid);
 }
コード例 #4
0
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);

            tree.SetInt("color", color);
            tree.SetString("text", text);
        }
コード例 #5
0
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);

            tree.SetBool("canTele", canTeleport);
            tree.SetInt("repairState", repairState);
            tree.SetBool("findNextChunk", findNextChunk);
            tree.SetBool("activated", activated);

            if (tpLocation != null)
            {
                tree.SetInt("teleX", tpLocation.X);
                tree.SetInt("teleY", tpLocation.Y);
                tree.SetInt("teleZ", tpLocation.Z);
            }
        }
コード例 #6
0
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);

            tree.SetItemstack("contents", contents);
            tree.SetInt("units", units);
        }
コード例 #7
0
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);

            tree.SetItemstack("contents", metalContent);
            tree.SetInt("fillLevel", fillLevel);
        }
コード例 #8
0
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);
            ITreeAttribute invtree = new TreeAttribute();

            Inventory.ToTreeAttributes(invtree);
            tree["inventory"] = invtree;

            tree.SetFloat("inputGrindTime", inputGrindTime);
            tree.SetInt("nowOutputFace", nowOutputFace);
            List <int> vals = new List <int>();

            foreach (var val in playersGrinding)
            {
                IPlayer plr = Api.World.PlayerByUid(val.Key);
                if (plr == null)
                {
                    continue;
                }
                vals.Add(plr.ClientId);
            }


            tree["clientIdsGrinding"] = new IntArrayAttribute(vals.ToArray());
        }
コード例 #9
0
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);

            tree.SetInt("quantityServings", QuantityServings);
            tree.SetString("recipeCode", RecipeCode == null ? "" : RecipeCode);
        }
コード例 #10
0
 public override void ToTreeAttributes(ITreeAttribute tree)
 {
     base.ToTreeAttributes(tree);
     tree.SetFloat("remainingBurnDuration", remainingBurnDuration);
     tree.SetFloat("startDuration", startDuration);
     tree.SetInt("fromFacing", fromFacing.Index);
 }
コード例 #11
0
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);

            tree.SetLong("networkid", NetworkId);
            tree.SetInt("turnDirFromFacing", turnDirFromFacing.Index);
        }
コード例 #12
0
ファイル: BECompass.cs プロジェクト: chriswa/vsmod-Compass
 public override void ToTreeAttributes(ITreeAttribute tree)
 {
     base.ToTreeAttributes(tree);
     tree.SetBool(BlockCompass.ATTR_BOOL_CRAFTED, this.IsCrafted);
     tree.SetString(BlockCompass.ATTR_STR_CRAFTED_BY_PLAYER_UID, this.CraftedByPlayerUID);
     if (this.TargetPos != null)
     {
         tree.SetInt(BlockCompass.ATTR_INT_TARGET_POS_X, this.TargetPos.X);
         tree.SetInt(BlockCompass.ATTR_INT_TARGET_POS_Y, this.TargetPos.Y);
         tree.SetInt(BlockCompass.ATTR_INT_TARGET_POS_Z, this.TargetPos.Z);
     }
     if (this.AngleRad != null)
     {
         tree.SetFloat("AngleRad", (float)this.AngleRad);
     }
 }
コード例 #13
0
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);

            tree.SetInt("blockid", block.BlockId);
            tree.SetBytes("voxels", serializeVoxels());
        }
コード例 #14
0
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);

            tree.SetInt("capacitor", Capacitor);
            tree.SetBool("isOn", isOn);
        }
コード例 #15
0
 public override void ToTreeAttributes(ITreeAttribute tree)
 {
     base.ToTreeAttributes(tree);
     tree.SetInt("color", color);
     tree.SetString("text", text);
     tree.SetFloat("meshAngle", MeshAngleRad);
 }
コード例 #16
0
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);

            tree.SetInt("currentBuildStage", currentBuildStage);
            tree.SetBool("lit", Lit);
            tree.SetDouble("burnUntil", BurningUntilTotalHours);
        }
コード例 #17
0
ファイル: BEForge.cs プロジェクト: bitcynth/vssurvivalmod
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);

            tree.SetItemstack("contents", contents);
            tree.SetFloat("fuelLevel", fuelLevel);
            tree.SetInt("burning", burning ? 1 : 0);
        }
コード例 #18
0
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);

            tree.SetLong("networkid", NetworkId);
            tree.SetInt("turnDirFromFacing", propagationDir.Index);
            tree.SetFloat("g", gearedRatio);
        }
コード例 #19
0
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);

            tree.SetInt("firepitConstructionStage", firepitStage);
            tree.SetDouble("lastTickTotalHours", lastTickTotalHours);
            tree.SetFloat("fuelHours", fuelHours);
        }
コード例 #20
0
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);

            tree.SetDouble("totalHoursTillGrowth", totalHoursTillGrowth);
            tree.SetInt("growthStage", (int)stage);
            tree.SetBool("plantedFromSeed", plantedFromSeed);
        }
コード例 #21
0
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);

            if (ownBlock != null)
            {
                tree.SetInt("forBlockId", ownBlock.BlockId);
            }
        }
コード例 #22
0
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);

            tree.SetDouble("transitionHoursLeft", transitionHoursLeft);
            tree.SetDouble("lastCheckAtTotalDays", lastCheckAtTotalDays);

            tree.SetInt("roomness", roomness);
        }
コード例 #23
0
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);

            bloomeryInv.ToTreeAttributes(tree);
            tree.SetInt("burning", burning ? 1 : 0);
            tree.SetDouble("burningUntilTotalDays", burningUntilTotalDays);
            tree.SetDouble("burningStartTotalDays", burningStartTotalDays);
        }
コード例 #24
0
ファイル: BESignPost.cs プロジェクト: curquhart/vssurvivalmod
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);
            tree.SetInt("color", color);

            for (int i = 0; i < 8; i++)
            {
                tree.SetString("text" + i, textByCardinalDirection[i]);
            }
        }
コード例 #25
0
        public void WriteToTreeAttribute(ITreeAttribute tree)
        {
            tree.SetLong("networkId", networkId);
            tree.SetFloat("totalAvailableTorque", totalAvailableTorque);
            tree.SetFloat("totalResistance", networkResistance);
            tree.SetFloat("speed", speed);
            tree.SetFloat("angle", angle);

            tree.SetInt("rot", (int)TurnDir);
        }
コード例 #26
0
ファイル: SpadeItem.cs プロジェクト: McJty/FancyTools
        private void PlaceFarmland(ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, ITreeAttribute treeAttributes)
        {
            int      id  = slot.Itemstack.Attributes.GetInt("farmId");
            BlockPos pos = blockSel.Position.AddCopy(blockSel.Face);

            byEntity.World.BlockAccessor.SetBlock(id, pos);
            BlockEntity blockEntity = byEntity.World.BlockAccessor.GetBlockEntity(pos);

            if (blockEntity is BlockEntityFarmland)
            {
                treeAttributes.SetInt("posx", pos.X);
                treeAttributes.SetInt("posy", pos.Y);
                treeAttributes.SetInt("posz", pos.Z);
                blockEntity.FromTreeAttributes(treeAttributes, byEntity.World);
                blockEntity.MarkDirty();
            }
            slot.Itemstack.Attributes.RemoveAttribute("farmland");
            slot.Itemstack.Attributes.RemoveAttribute("farmId");
        }
コード例 #27
0
 public override void ToTreeAttributes(ITreeAttribute tree)
 {
     tree.SetInt("ExchangesCount", Exchanges.Count);
     for (int i = 0; i < Exchanges.Count; i++)
     {
         string strI = "Exchanges" + i + "Input", strO = "Exchanges" + i + "Output";
         tree.SetItemstack(strI, Exchanges[i].Input);
         tree.SetItemstack(strO, Exchanges[i].Output);
     }
     base.ToTreeAttributes(tree);
 }
コード例 #28
0
ファイル: ChiselPlus.cs プロジェクト: Novocain1/ChiselPlus
        public static void Prefix(BlockEntityChisel __instance, ref ITreeAttribute tree)
        {
            ChiselPlusPropertyAccessor accessor = new ChiselPlusPropertyAccessor(__instance.Api);

            var store = accessor.Properties[__instance.Pos];

            tree.SetInt("chiselplusmesh", (int)store.Mesh);
            tree.SetFloat("chiselplusRotX", store.Rotation.X);
            tree.SetFloat("chiselplusRotY", store.Rotation.Y);
            tree.SetFloat("chiselplusRotZ", store.Rotation.Z);
        }
コード例 #29
0
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);
            tree.SetDouble("finishedAfterTotalHours", finishedAfterTotalHours);
            tree.SetInt("state", state);

            if (startedByPlayerUid != null)
            {
                tree.SetString("startedByPlayerUid", startedByPlayerUid);
            }
        }
コード例 #30
0
        public override void ToTreeAttributes(ITreeAttribute tree)
        {
            base.ToTreeAttributes(tree);

            tree.SetBool("receivesHeat", receivesHeat);
            tree.SetDouble("totalHoursLastUpdate", totalHoursLastUpdate);
            tree.SetDouble("progress", progress);
            tree.SetBool("processComplete", processComplete);
            tree.SetBool("structureComplete", structureComplete);
            tree.SetInt("tempStoneCoffin", tempStoneCoffin);
        }