• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

First Machine Age's Mods (Combined repo.)


Commit MetaInfo

修订版60a5b52bbc09c342feb172e2e2d6b019e60b3f04 (tree)
时间2020-07-05 12:22:57
作者melchior <melchior@user...>
Commitermelchior

Log Message

W.I.P. More Work.

更改概述

差异

--- a/ElementalTools/Block/PackCarburization.cs
+++ b/ElementalTools/Block/PackCarburization.cs
@@ -22,7 +22,7 @@ namespace ElementalTools
2222 //Recipie Options #1: Charcoal & Bonemeal & Blue-clay
2323 //Recipie Options #2: Leather & Fat & Blue-clay
2424
25- //Heat to 'Red' hot for ~ 60 minutes (equive to ??? game cook time ??? )
25+ //Heat to 'Red' hot for ~ 30-60 minutes (equive to ??? game cook time ??? )
2626
2727 internal PackCarburizationEntity Entity(BlockPos here)
2828 {
@@ -73,13 +73,13 @@ namespace ElementalTools
7373 select inputSlot).Single();
7474 //Category: survival/itemtypes/toolhead/
7575 //Variant(s): metal, material
76- //tool-heads, plates, scale, lamellae, chainmail
76+ //tool-stock, tool-heads, plates, scale, lamellae, chainmail
7777 //NOT: Ingots, Whole Anvils, big Gears, chunky large things....this ain't mass-production...
7878
7979 //outputSlot.Itemstack.Attributes = ironThingSlot.Itemstack.Attributes.Clone( );
8080
81- ItemStack[] outputItemStacks=null;
82- SetContents(outputSlot.Itemstack, outputItemStacks );
81+ ItemStack[ ] encapsulatedItems = new ItemStack[ ] { ironThingSlot.Itemstack.Clone( ) };//More than 1 or Quantity *#
82+ SetContents(outputSlot.Itemstack, encapsulatedItems );
8383
8484
8585 }
@@ -119,15 +119,21 @@ namespace ElementalTools
119119
120120 public override void GetHeldItemInfo(ItemSlot inSlot, StringBuilder dsc, IWorldAccessor world, bool withDebugInfo)
121121 {
122- //Add tooltip indicating contents...temperature, elapsed heat time, ect...
123-
122+ //Add tooltip indicating contents...temperature, elapsed heat time, ect...
123+ float temp = GetTemperature(world, inSlot.Itemstack);
124+ if (temp > 20) {
125+ dsc.AppendLine(Lang.Get("Temperature: {0:F1}°C", temp));
124126 }
125127
126- public override string GetPlacedBlockInfo(IWorldAccessor world, BlockPos pos, IPlayer forPlayer)
128+ var stuffedInside = GetContents(world, inSlot.Itemstack);
129+ if (stuffedInside != null)
127130 {
128- //Add tooltip indicating contents...temperature, elapsed heat time, ect...
129-
130- return String.Empty;
131+ foreach (var thing in stuffedInside) {
132+ dsc.AppendFormat("{1} \u00d7 {0}\n", thing.GetName( ),thing.StackSize);
133+ }
134+
135+ }
136+
131137 }
132138
133139
@@ -166,7 +172,7 @@ namespace ElementalTools
166172 public override void DoSmelt(IWorldAccessor world, ISlotProvider cookingSlotsProvider, ItemSlot inputSlot, ItemSlot outputSlot)
167173 {
168174 //base.DoSmelt(world, cookingSlotsProvider, inputSlot, outputSlot);
169- //Remap metal type of contained item...
175+ //Remap metal type of contained item...Iron beccomes Austentic 'steel' - Quenching is ITEM SPECIFIC!
170176 //Change own 'type' to "fired"...
171177
172178 //ItemStack smeltedStack = CombustibleProps.SmeltedStack.ResolvedItemstack.Clone(); //transform - to 'fired' pack
@@ -185,9 +191,12 @@ namespace ElementalTools
185191 IWorldAccessor world = entityItem.World;
186192 if (world.Side.IsClient()) return;
187193
188- if (entityItem.Swimming && world.Rand.NextDouble( ) < 0.01)
194+ if ((entityItem.Swimming || entityItem.FeetInLiquid) )
189195 {
190- //Something happens...
196+ //Something happens...in liquid phase water
197+ var blockHere = world.BlockAccessor.GetBlock(entityItem.Pos.AsBlockPos);
198+
199+ //RESEARCH: Block to EntityItem transition - need to customize or attach event handlers there !
191200
192201 }
193202 }
--- a/ElementalTools/BlockEntities/PackCarburizationEntity.cs
+++ b/ElementalTools/BlockEntities/PackCarburizationEntity.cs
@@ -1,6 +1,7 @@
11 using System;
2-
2+using System.Text;
33 using Vintagestory.API.Common;
4+using Vintagestory.API.Config;
45 using Vintagestory.GameContent;
56
67 namespace ElementalTools
@@ -29,6 +30,8 @@ namespace ElementalTools
2930 get { return base.Block as PackCarburization; }
3031 }
3132
33+ public float Temperature { get; private set; }
34+
3235
3336 public PackCarburizationEntity( )
3437 {
@@ -49,11 +52,13 @@ namespace ElementalTools
4952 if (slot.Itemstack == null) continue;
5053
5154 AssetLocation objCode = slot.Itemstack.Collectible.Code;
52- float ownTemp = 5f;//this.Block.GetTemperature
53- slot.Itemstack.Collectible.SetTemperature(this.Api.World, slot.Itemstack, ownTemp, true);
55+
56+ slot.Itemstack.Collectible.SetTemperature(this.Api.World, slot.Itemstack, Temperature, true);
57+
58+ if (Temperature > this.Block.SteelTransitionTemp) {
59+ //Convert here or on 'DoSmelt' ?
60+ //Which is really mostly about the clay container...not quenching to make it Martensite
5461
55- if (ownTemp > this.Block.SteelTransitionTemp) {
56- //Convert here or on 'DoSmelt' ?
5762 }
5863
5964 }
@@ -63,12 +68,15 @@ namespace ElementalTools
6368 }
6469
6570 //Duplicated?
66- public override void GetBlockInfo(IPlayer forPlayer, System.Text.StringBuilder dsc)
71+ public override void GetBlockInfo(IPlayer forPlayer, StringBuilder dsc)
6772 {
68- //base.GetBlockInfo(forPlayer, dsc);
73+
74+ if (Temperature > 20) {
75+ dsc.AppendLine(Lang.Get("Temperature: {0:F1}°C", Temperature));
76+ }
6977
7078 /*
71- * Contents: 1x Iron/Steel Chisel, Drill-bit, files, ect...
79+ * Contents: 1x Iron/Steel Chisel, Drill-bit (unsharpened rod), files, ect...
7280 */
7381 dsc.Append("Contents: ");
7482
@@ -76,11 +84,16 @@ namespace ElementalTools
7684 dsc.Append("Nothing.\n");
7785 }
7886 else {
79- ItemStack stack = internalInventory[0].Itemstack;
80- dsc.AppendFormat("{0}\u2715 {1}\n", stack.StackSize, stack.GetName( ));
87+
88+ foreach (var thing in internalInventory) {
89+ dsc.AppendFormat("{1} \u00d7 {0}\n", thing.Itemstack.GetName( ), thing.StackSize);
90+ }
8191 }
8292
8393 }
94+
95+ //OnBlockPlaced -- Perform base call!
96+
8497 }
8598 }
8699
--- a/ElementalTools/assets/fma/blocktypes/metallurgy/pack_carburization.json
+++ b/ElementalTools/assets/fma/blocktypes/metallurgy/pack_carburization.json
@@ -8,7 +8,7 @@
88 handbook: {
99
1010 },
11- SteelTransitionTemp:745,
11+ SteelTransitionTemp:750,
1212 SteelTransitionTime:200,
1313 },
1414 variantgroups: [