• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

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

V.S. Plugin mod for extra Crafting events


Commit MetaInfo

Revision6d7b5f4d841a1c87642fffc2ea315647748d2979 (tree)
Time2021-12-29 10:57:42
Authormelchior <melchior@user...>
Commitermelchior

Log Message

Using alternative to MergeTree

Change Summary

Incremental Difference

--- a/KraftHoox/KraftHooxSys.cs
+++ b/KraftHoox/KraftHooxSys.cs
@@ -27,7 +27,7 @@ namespace KraftHoox
2727 {
2828 private Dictionary<string, CollectableChanging> actionsTable;
2929 private ICoreServerAPI ServerAPI;
30- private Dictionary<BlockPos, Dictionary<int, TreeAttribute>> slotAttribHolder;
30+ private Dictionary<BlockPos, Dictionary<int, TreeAttribute>> slotAttribHolder;//TODO: CLEAN UP!
3131
3232
3333 /// <summary>
@@ -81,11 +81,10 @@ namespace KraftHoox
8181 int slotNumber = resultSlot.Inventory.GetSlotId(resultSlot);
8282 #if DEBUG
8383 Mod.Logger.VerboseDebug("({0}) Storing attr.: [{1}] #{2} @[{3}] by '{4}'", origin.Code, resultSlot.Itemstack.Collectible.Code, slotNumber, here, craftMethod);
84- #endif
85-
8684 foreach (var attr in resultSlot.Itemstack.Attributes) {
8785 Mod.Logger.VerboseDebug("{0} = {1}", attr.Key, attr.Value.ToString( ));
8886 }
87+ #endif
8988
9089 if (slotAttribHolder.ContainsKey(here))
9190 {
@@ -106,15 +105,18 @@ namespace KraftHoox
106105 {
107106 var oldAttribs = slotAttribHolder[here][slotNumber];
108107 #if DEBUG
109- Mod.Logger.VerboseDebug("From ({0}); Apply on '{1}' Slot #{2} @[{3}] by {4}; {5}x Attribs ", origin.Code, resultSlot.Itemstack.Collectible.Code, slotNumber, here, craftMethod, oldAttribs.Count);
110- #endif
111-
108+ Mod.Logger.VerboseDebug("From ({0}); Apply on '{1}' Slot #{2} @[{3}] : {4}x Attribs ", origin.Code, resultSlot.Itemstack.Collectible.Code, slotNumber, here, oldAttribs.Count);
112109 foreach (var attr in oldAttribs) {
113- Mod.Logger.VerboseDebug("{0} = {1}", attr.Key, attr.Value.ToString( ));
110+ Mod.Logger.VerboseDebug("{0} = {1}", attr.Key, attr.Value.ToString( ));
114111 }
112+ #endif
115113
116114 if (resultSlot.Itemstack.Attributes == null) { resultSlot.Itemstack.Attributes = new TreeAttribute( ); }
117- resultSlot.Itemstack.Attributes.MergeTree(oldAttribs);
115+ foreach (var attr in oldAttribs) {
116+ (resultSlot.Itemstack.Attributes as TreeAttribute).SetAttribute(attr.Key, attr.Value);
117+ }
118+ //resultSlot.Itemstack.Attributes.MergeTree(oldAttribs);
119+ resultSlot.MarkDirty( );
118120 slotAttribHolder[here].Remove(slotNumber);
119121 }
120122 }
--- a/KraftHoox/modinfo.json
+++ b/KraftHoox/modinfo.json
@@ -3,7 +3,7 @@
33 "modid": "krafthoox",
44 "name": "Krafting H00x",
55 "authors": ["Melchior"],
6- "description": "Crafting events utility Library",
6+ "description": "Crafting events (barrel / pit-kilns), utility Library",
77 "version": "0.1.0",
88 "side":"Server",
99 "requiredOnClient": false,