First Machine Age's Mods (Combined repo.)
修订版 | 60a5b52bbc09c342feb172e2e2d6b019e60b3f04 (tree) |
---|---|
时间 | 2020-07-05 12:22:57 |
作者 | melchior <melchior@user...> |
Commiter | melchior |
W.I.P. More Work.
@@ -22,7 +22,7 @@ namespace ElementalTools | ||
22 | 22 | //Recipie Options #1: Charcoal & Bonemeal & Blue-clay |
23 | 23 | //Recipie Options #2: Leather & Fat & Blue-clay |
24 | 24 | |
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 ??? ) | |
26 | 26 | |
27 | 27 | internal PackCarburizationEntity Entity(BlockPos here) |
28 | 28 | { |
@@ -73,13 +73,13 @@ namespace ElementalTools | ||
73 | 73 | select inputSlot).Single(); |
74 | 74 | //Category: survival/itemtypes/toolhead/ |
75 | 75 | //Variant(s): metal, material |
76 | - //tool-heads, plates, scale, lamellae, chainmail | |
76 | + //tool-stock, tool-heads, plates, scale, lamellae, chainmail | |
77 | 77 | //NOT: Ingots, Whole Anvils, big Gears, chunky large things....this ain't mass-production... |
78 | 78 | |
79 | 79 | //outputSlot.Itemstack.Attributes = ironThingSlot.Itemstack.Attributes.Clone( ); |
80 | 80 | |
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 ); | |
83 | 83 | |
84 | 84 | |
85 | 85 | } |
@@ -119,15 +119,21 @@ namespace ElementalTools | ||
119 | 119 | |
120 | 120 | public override void GetHeldItemInfo(ItemSlot inSlot, StringBuilder dsc, IWorldAccessor world, bool withDebugInfo) |
121 | 121 | { |
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)); | |
124 | 126 | } |
125 | 127 | |
126 | - public override string GetPlacedBlockInfo(IWorldAccessor world, BlockPos pos, IPlayer forPlayer) | |
128 | + var stuffedInside = GetContents(world, inSlot.Itemstack); | |
129 | + if (stuffedInside != null) | |
127 | 130 | { |
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 | + | |
131 | 137 | } |
132 | 138 | |
133 | 139 |
@@ -166,7 +172,7 @@ namespace ElementalTools | ||
166 | 172 | public override void DoSmelt(IWorldAccessor world, ISlotProvider cookingSlotsProvider, ItemSlot inputSlot, ItemSlot outputSlot) |
167 | 173 | { |
168 | 174 | //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! | |
170 | 176 | //Change own 'type' to "fired"... |
171 | 177 | |
172 | 178 | //ItemStack smeltedStack = CombustibleProps.SmeltedStack.ResolvedItemstack.Clone(); //transform - to 'fired' pack |
@@ -185,9 +191,12 @@ namespace ElementalTools | ||
185 | 191 | IWorldAccessor world = entityItem.World; |
186 | 192 | if (world.Side.IsClient()) return; |
187 | 193 | |
188 | - if (entityItem.Swimming && world.Rand.NextDouble( ) < 0.01) | |
194 | + if ((entityItem.Swimming || entityItem.FeetInLiquid) ) | |
189 | 195 | { |
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 ! | |
191 | 200 | |
192 | 201 | } |
193 | 202 | } |
@@ -1,6 +1,7 @@ | ||
1 | 1 | using System; |
2 | - | |
2 | +using System.Text; | |
3 | 3 | using Vintagestory.API.Common; |
4 | +using Vintagestory.API.Config; | |
4 | 5 | using Vintagestory.GameContent; |
5 | 6 | |
6 | 7 | namespace ElementalTools |
@@ -29,6 +30,8 @@ namespace ElementalTools | ||
29 | 30 | get { return base.Block as PackCarburization; } |
30 | 31 | } |
31 | 32 | |
33 | + public float Temperature { get; private set; } | |
34 | + | |
32 | 35 | |
33 | 36 | public PackCarburizationEntity( ) |
34 | 37 | { |
@@ -49,11 +52,13 @@ namespace ElementalTools | ||
49 | 52 | if (slot.Itemstack == null) continue; |
50 | 53 | |
51 | 54 | 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 | |
54 | 61 | |
55 | - if (ownTemp > this.Block.SteelTransitionTemp) { | |
56 | - //Convert here or on 'DoSmelt' ? | |
57 | 62 | } |
58 | 63 | |
59 | 64 | } |
@@ -63,12 +68,15 @@ namespace ElementalTools | ||
63 | 68 | } |
64 | 69 | |
65 | 70 | //Duplicated? |
66 | - public override void GetBlockInfo(IPlayer forPlayer, System.Text.StringBuilder dsc) | |
71 | + public override void GetBlockInfo(IPlayer forPlayer, StringBuilder dsc) | |
67 | 72 | { |
68 | - //base.GetBlockInfo(forPlayer, dsc); | |
73 | + | |
74 | + if (Temperature > 20) { | |
75 | + dsc.AppendLine(Lang.Get("Temperature: {0:F1}°C", Temperature)); | |
76 | + } | |
69 | 77 | |
70 | 78 | /* |
71 | - * Contents: 1x Iron/Steel Chisel, Drill-bit, files, ect... | |
79 | + * Contents: 1x Iron/Steel Chisel, Drill-bit (unsharpened rod), files, ect... | |
72 | 80 | */ |
73 | 81 | dsc.Append("Contents: "); |
74 | 82 |
@@ -76,11 +84,16 @@ namespace ElementalTools | ||
76 | 84 | dsc.Append("Nothing.\n"); |
77 | 85 | } |
78 | 86 | 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 | + } | |
81 | 91 | } |
82 | 92 | |
83 | 93 | } |
94 | + | |
95 | + //OnBlockPlaced -- Perform base call! | |
96 | + | |
84 | 97 | } |
85 | 98 | } |
86 | 99 |
@@ -8,7 +8,7 @@ | ||
8 | 8 | handbook: { |
9 | 9 | |
10 | 10 | }, |
11 | - SteelTransitionTemp:745, | |
11 | + SteelTransitionTemp:750, | |
12 | 12 | SteelTransitionTime:200, |
13 | 13 | }, |
14 | 14 | variantgroups: [ |