• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得windowscocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

First Machine Age's Mods (Combined repo.)


Commit MetaInfo

Revision25abc26f8951b59c6d592168a898d484bf79e57c (tree)
Time2021-08-10 07:34:08
Authormelchior <melchior@user...>
Commitermelchior

Log Message

a Fix for incorrect Recipie validation

should resolve incorrect recipie matches
(affects only shapeless ones...?)

Change Summary

Incremental Difference

--- /dev/null
+++ b/AnvilMetalRecovery/Data/AMR_Config.cs
@@ -0,0 +1,32 @@
1+using System;
2+
3+using ProtoBuf;
4+
5+namespace AnvilMetalRecovery
6+{
7+ [ProtoContract(ImplicitFields = ImplicitFields.None)]
8+ public class AMRConfig
9+ {
10+ public AMRConfig( )
11+ {
12+ ToolFragmentRecovery = true;
13+ VoxelEquivalentValue = MetalRecoverySystem.IngotVoxelDefault;
14+ }
15+
16+ [ProtoMember(1)]
17+ public bool ToolFragmentRecovery;
18+
19+ [ProtoMember(2)]
20+ public float VoxelEquivalentValue;
21+
22+
23+ [ProtoAfterDeserialization]
24+ private void ClampRange( )
25+ {
26+ VoxelEquivalentValue = Math.Max(1f, Math.Min(VoxelEquivalentValue, MetalRecoverySystem.IngotVoxelDefault));
27+ }
28+
29+
30+ }
31+}
32+
--- a/AnvilMetalRecovery/Items/VariableMetalItem.cs
+++ b/AnvilMetalRecovery/Items/VariableMetalItem.cs
@@ -157,7 +157,7 @@ namespace AnvilMetalRecovery
157157 api.Logger.VerboseDebug("MatchesForCrafting::'{0}'", this.Code);
158158 #endif
159159
160- if (inputStack != null) {
160+ if (inputStack != null && inputStack.Class == EnumItemClass.Item && inputStack.Item.Code == this.Code) {
161161 var metalCode = MetalCode(inputStack);
162162 var metalUnits = MetalQuantity(inputStack);
163163
@@ -167,10 +167,12 @@ namespace AnvilMetalRecovery
167167 gridRecipe.Output.Quantity = ( int )(Math.Round(metalUnits * AnvilMetalRecoveryMod.CachedConfiguration.VoxelEquivalentValue) / 5);
168168 gridRecipe.Output.Code = metalBits.Code;
169169 gridRecipe.Output.Resolve(api.World, "VariableMetalItem_crafting");
170- }
170+
171+ return true;
172+ }
171173 }
172174
173- return true;
175+ return false;
174176 }
175177 }
176178 }
--- /dev/null
+++ b/AnvilMetalRecovery/assets/fma/recipes/grid/variableMetal_smash.json
@@ -0,0 +1,11 @@
1+{
2+ ingredientPattern: "C I",
3+ recipeGroup: 1,
4+ ingredients: {
5+ "C": { type: "item", code: "game:chisel-*", isTool: true, toolDurabilityCost: 5},
6+ "I": { type: "item", code: "metal_fragments", name: "metal" }
7+ },
8+ width: 1,
9+ height: 2,
10+ output: { type: "item", code: "game:metalbit-copper", quantity: 0 }
11+}
\ No newline at end of file
--- a/AnvilMetalRecovery/modinfo.json
+++ b/AnvilMetalRecovery/modinfo.json
@@ -4,7 +4,7 @@
44 "description" : "Get back lost scrap and smithing discards. Plus more.",
55 "authors": ["Melchior"],
66 "ModID":"metalrecovery",
7- "version": "0.1.13",
7+ "version": "0.1.14",
88 "dependencies": {
99 "game": "1.15.3",
1010 "survival": ""