• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

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

Révision5dd86de17b17a8fecc3f42580b0c0525fb4f42a6 (tree)
l'heure2020-08-27 05:40:57
Auteurmelchior <melchior@user...>
Commitermelchior

Message de Log

Working: Tempering, Timing for Carburization

Change Summary

Modification

--- a/ElementalTools/Block/PackCarburization.cs
+++ b/ElementalTools/Block/PackCarburization.cs
@@ -58,7 +58,7 @@ namespace ElementalTools
5858 //Seconds
5959 get
6060 {
61- if (this.Attributes[steelTransitionTempKey].Exists) { return this.Attributes[steelTransitionTempKey].AsFloat( ); }
61+ if (this.Attributes[steelTransitionTimeKey].Exists) { return this.Attributes[steelTransitionTimeKey].AsFloat( ); }
6262
6363 return 38f;
6464 }
@@ -185,7 +185,9 @@ namespace ElementalTools
185185 public override float GetMeltingDuration(IWorldAccessor world, ISlotProvider cookingSlotsProvider, ItemSlot inputSlot)
186186 {//TimeSpan - would have been far better a return type
187187 var extraCookTime = GetExtraCookTime(inputSlot.Itemstack);
188-
188+ #if DEBUG
189+ api.World.Logger.VerboseDebug("GetMeltingDuration::{0}", (SteelTransitionTime + extraCookTime));
190+ #endif
189191 return SteelTransitionTime + extraCookTime;
190192 }
191193
@@ -283,16 +285,17 @@ namespace ElementalTools
283285 outputSlot.Itemstack = outputStack.Clone();
284286
285287 temperature = Math.Min(temperature, maxInnerTemperature);
286- contentStack.Collectible.SetTemperature(world, contentStack, temperature);//TODO: Temperature clamping inside contents of stack...
288+ contentStack.Collectible.SetTemperature(world, contentStack, temperature);
287289
288290 ItemStack[ ] transmutedItems = new ItemStack[ ] { contentStack.Clone( ) };
289291 transmutedItems.First( ).StackSize = 1;//There can be only 1, per pack
290292 SetContents(outputSlot.Itemstack, transmutedItems);
291-
293+ outputSlot.Itemstack.Collectible.SetTemperature(world, outputSlot.Itemstack, temperature);
294+
292295 inputSlot.Itemstack = null;
293296
294297 #if DEBUG
295- world.Logger.VerboseDebug("Contents of pack: {0}", contentStack);
298+ world.Logger.VerboseDebug("Contents of pack: {0} @{1}C", contentStack,temperature);
296299 world.Logger.VerboseDebug("Finished: 'DoSmelt' " );
297300 #endif
298301 }
--- a/ElementalTools/General/IAmSteel.cs
+++ b/ElementalTools/General/IAmSteel.cs
@@ -79,17 +79,18 @@ namespace ElementalTools
7979 }
8080
8181 /// <summary>
82- /// The metals crystal state; changed only by tempering/quenching/annealing
82+ /// The metals crystal state; changed only by normalizing/quenching/annealing
8383 /// </summary>
8484 /// <remarks>
85- /// Reduces wear - with a penalty of random catastrophic failure...
85+ /// Reduces wear - with a penalty of random catastrophic failure...Metal's "Temper'
8686 /// </remarks>
8787 public enum HardnessState : byte
8888 {
8989 Soft = 0,
90- Medium = 1,
91- Hard = 2,
92- Brittle = 3,
90+ Mild = 1,
91+ Medium = 2,
92+ Hard = 3,
93+ Brittle = 4,
9394 }
9495
9596 }
--- a/ElementalTools/Items/SteeIWrapItem.cs
+++ b/ElementalTools/Items/SteeIWrapItem.cs
@@ -297,13 +297,13 @@ namespace ElementalTools
297297 /// <param name="entityItem">Entity item.</param>
298298 public override void OnGroundIdle(EntityItem entityItem)
299299 {
300-
301- if (entityItem.Swimming || entityItem.FeetInLiquid) {
300+ if (api.Side.IsServer() && (entityItem.Swimming || entityItem.FeetInLiquid)) {
301+
302302 if (!this.Hardenable) return;
303303
304304 float temperature = entityItem.Itemstack.Collectible.GetTemperature(api.World, entityItem.Itemstack);
305305 //Track first moment in liquid;
306- this.SetTimestamp(entityItem);//BUG: NOT WORKING!?
306+ this.SetTimestamp(entityItem);//Clear on pickup or...?
307307
308308 //Above 900C - What should happen in this range; different phase of iron?
309309
@@ -326,7 +326,7 @@ namespace ElementalTools
326326 entityItem.Itemstack.Collectible.SetTemperature(api.World, entityItem.Itemstack, temperature - 17, false);
327327
328328 #if DEBUG
329- api.World.Logger.VerboseDebug("Quench process: {0}S elapsed @{1}C", elapsedTime.TotalSeconds, temperature);
329+ api.World.Logger.VerboseDebug("Quench process: {0}S elapsed @{1}C H:{2} ~ QU#{3}", elapsedTime.TotalSeconds, temperature, this.Hardness(entityItem.Itemstack), quenchUnits );
330330 #endif
331331 }
332332 }
@@ -773,16 +773,17 @@ namespace ElementalTools
773773
774774 internal void SetTimestamp(EntityItem entityItem)
775775 {
776- if (!entityItem.Itemstack.TempAttributes.HasAttribute(_timestampKey)) {
777- entityItem.Itemstack.TempAttributes.SetLong(_timestampKey, entityItem.itemSpawnedMilliseconds);
776+
777+ if (!entityItem.Attributes.HasAttribute(_timestampKey)) {
778+ entityItem.Attributes.SetLong(_timestampKey, DateTime.Now.Ticks);
778779 }
779780 }
780781
781782 internal TimeSpan GetTimestampElapsed(EntityItem entityItem)
782783 {
783- if (entityItem.Itemstack.TempAttributes.HasAttribute(_timestampKey)) {
784- var ts = TimeSpan.FromMilliseconds(entityItem.Itemstack.TempAttributes.GetLong(_timestampKey));
785- return ts.Subtract(TimeSpan.FromMilliseconds(entityItem.itemSpawnedMilliseconds)).Negate();
784+ if (entityItem.Attributes.HasAttribute(_timestampKey)) {
785+ var ts = TimeSpan.FromTicks(entityItem.Attributes.GetLong(_timestampKey));
786+ return ts.Subtract(TimeSpan.FromTicks(DateTime.Now.Ticks)).Negate();
786787 }
787788 return TimeSpan.Zero;
788789 }
--- a/ElementalTools/assets/fma/recipes/grid/metallurgy/pack_carburization.json
+++ b/ElementalTools/assets/fma/recipes/grid/metallurgy/pack_carburization.json
@@ -42,7 +42,7 @@
4242 height: 3,
4343 attributes: {
4444 outputOverride: "cleaver-blister_steel",
45- extraCookTime:10,
45+ extraCookTime:1,
4646 },
4747 output: { type: "block", code: "pack_carburization-unfired" }
4848 },
@@ -89,7 +89,7 @@
8989 height: 3,
9090 attributes: {
9191 outputOverride: "pickaxehead-blister_steel",
92- extraCookTime:25,
92+ extraCookTime:2,
9393 },
9494 output: { type: "block", code: "pack_carburization-unfired" }
9595 },
@@ -145,7 +145,7 @@
145145 height: 3,
146146 attributes: {
147147 outputOverride: "prospectingpickhead-blister_steel",
148- extraCookTime:15,
148+ extraCookTime:10,
149149 },
150150 output: { type: "block", code: "pack_carburization-unfired" }
151151 },
@@ -161,7 +161,7 @@
161161 height: 3,
162162 attributes: {
163163 outputOverride: "sawblade-blister_steel",
164- extraCookTime:25,
164+ extraCookTime:20,
165165 },
166166 output: { type: "block", code: "pack_carburization-unfired" }
167167 },
@@ -177,7 +177,7 @@
177177 height: 3,
178178 attributes: {
179179 outputOverride: "scythehead-blister_steel",
180- extraCookTime:20,
180+ extraCookTime:25,
181181 },
182182 output: { type: "block", code: "pack_carburization-unfired" }
183183 },
@@ -225,7 +225,7 @@ ingredientPattern: "CCC KXK CCC",
225225 height: 3,
226226 attributes: {
227227 outputOverride: "axehead-blister_steel",
228- extraCookTime:25,
228+ extraCookTime:20,
229229 },
230230 output: { type: "block", code: "pack_carburization-unfired" }
231231 }