From 7c0391a039b5899dff9d5665edbccf4fbd9f96cf Mon Sep 17 00:00:00 2001 From: RomTheG <9473656+WouayNote@users.noreply.github.com> Date: Fri, 20 Oct 2023 23:20:20 +0200 Subject: [PATCH 1/8] Vanilla defaults update 2023-10-20 --- vanilla-defaults.json | 105 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 95 insertions(+), 10 deletions(-) diff --git a/vanilla-defaults.json b/vanilla-defaults.json index 202ce86..74e10f0 100644 --- a/vanilla-defaults.json +++ b/vanilla-defaults.json @@ -18,6 +18,7 @@ "ammo.rocket.hv": 3, "ammo.rocket.mlrs": 6, "ammo.rocket.sam": 1000, + "ammo.rocket.seeker": 4, "ammo.rocket.smoke": 3, "ammo.shotgun": 64, "ammo.shotgun.fire": 64, @@ -31,9 +32,11 @@ "arrow.fire": 64, "arrow.hv": 64, "arrow.wooden": 64, + "attackhelicopter": 1, "attire.banditguard": 1, "attire.bunny.onesie": 1, "attire.bunnyears": 1, + "attire.egg.suit": 1, "attire.hide.boots": 1, "attire.hide.helterneck": 1, "attire.hide.pants": 1, @@ -71,6 +74,8 @@ "blood": 1000, "blue.berry": 20, "blueberries": 20, + "bluedogtags": 5000, + "blueidtag": 5000, "blueprintbase": 1000, "bone.armor.suit": 1, "bone.club": 1, @@ -117,13 +122,15 @@ "ceilinglight": 10, "chainsaw": 1, "chair": 5, + "chair.icethrone": 5, "charcoal": 1000, "chicken.burned": 20, "chicken.cooked": 20, "chicken.raw": 20, "chicken.spoiled": 20, "chineselantern": 1, - "chocholate": 10, + "chocolate": 10, + "clantable": 1, "clatter.helmet": 1, "clone.black.berry": 50, "clone.blue.berry": 50, @@ -141,6 +148,8 @@ "coffin.storage": 1, "composter": 1, "computerstation": 1, + "concretehatchet": 1, + "concretepickaxe": 1, "connected.speaker": 5, "corn": 20, "crankshaft1": 5, @@ -159,10 +168,14 @@ "discoball": 5, "discofloor": 5, "discofloor.largetiles": 5, + "diverhatchet": 1, + "diverpickaxe": 1, + "divertorch": 1, "diving.fins": 1, "diving.mask": 1, "diving.tank": 1, "diving.wetsuit": 1, + "dogtagneutral": 5000, "door.closer": 1, "door.double.hinged.metal": 1, "door.double.hinged.toptier": 1, @@ -195,6 +208,7 @@ "electric.doorcontroller": 5, "electric.flasherlight": 5, "electric.fuelgenerator.small": 1, + "electric.furnace": 1, "electric.generator.small": 1, "electric.hbhfsensor": 1, "electric.heater": 5, @@ -264,7 +278,7 @@ "floor.triangle.ladder.hatch": 1, "fluid.combiner": 5, "fluid.splitter": 5, - "fluid.switch": 1, + "fluid.switch": 5, "fogmachine": 1, "frankensteins.monster.01.head": 1, "frankensteins.monster.01.legs": 1, @@ -298,18 +312,28 @@ "ghostsheet": 1, "giantcandycanedecor": 1, "giantlollipops": 1, + "gingerbreadsuit": 1, "gloweyes": 1, "glue": 10, "granolabar": 10, "gravestone": 1, + "grayidtag": 5000, "green.berry": 20, + "greenidtag": 5000, "grenade.beancan": 5, "grenade.f1": 5, + "grenade.flashbang": 5, + "grenade.molotov": 5, "grenade.smoke": 3, "grub": 20, "gun.water": 1, "gunpowder": 1000, + "gunrack.horizontal": 10, + "gunrack_stand": 10, + "gunrack_tall.horizontal": 10, + "gunrack_wide.horizontal": 10, "guntrap": 1, + "hab.armor": 1, "habrepair": 1, "halloween.candy": 1000, "halloween.lootbag.large": 10, @@ -328,13 +352,20 @@ "hat.gas.mask": 1, "hat.miner": 1, "hat.oxmask": 1, + "hat.rabbitmask": 1, "hat.ratmask": 1, + "hat.tigermask": 1, "hat.wolf": 1, "hatchet": 1, "hazmatsuit": 1, + "hazmatsuit.arcticsuit": 1, + "hazmatsuit.diver": 1, + "hazmatsuit.lumberjack": 1, "hazmatsuit.nomadsuit": 1, "hazmatsuit.spacesuit": 1, "hazmatsuit_scientist": 1, + "hazmatsuit_scientist_arctic": 1, + "hazmatsuit_scientist_nvgm": 1, "hazmatsuit_scientist_peacekeeper": 1, "healingtea": 10, "healingtea.advanced": 10, @@ -343,11 +374,15 @@ "heavy.plate.jacket": 1, "heavy.plate.pants": 1, "hitchtroughcombo": 1, + "hmlmg": 1, "hobobarrel": 1, + "homingmissile.launcher": 1, "hoodie": 1, "horse.armor.roadsign": 1, "horse.armor.wood": 1, "horse.saddle": 1, + "horse.saddle.double": 1, + "horse.saddle.single": 1, "horse.saddlebag": 1, "horse.shoes.advanced": 1, "horse.shoes.basic": 1, @@ -356,12 +391,16 @@ "horsemeat.cooked": 20, "horsemeat.raw": 20, "hosetool": 1, - "hq.metal.ore": 1000, + "hq.metal.ore": 100, "humanmeat.burned": 20, "humanmeat.cooked": 20, "humanmeat.raw": 20, "humanmeat.spoiled": 20, "icepick.salvaged": 1, + "industrial.combiner": 5, + "industrial.conveyor": 5, + "industrial.crafter": 5, + "industrial.splitter": 5, "industrial.wall.light": 10, "industrial.wall.light.green": 10, "industrial.wall.light.red": 10, @@ -393,11 +432,15 @@ "lock.code": 10, "lock.key": 10, "locker": 1, + "locomotive": 1, "longsword": 1, "lowgradefuel": 500, "lumberjack hoodie": 1, + "lumberjack.hatchet": 1, + "lumberjack.pickaxe": 1, "lunar.firecrackers": 5, "mace": 1, + "mace.baseballbat": 1, "machete": 1, "mailbox": 1, "map": 1, @@ -411,9 +454,12 @@ "meat.pork.cooked": 20, "megaphone": 1, "metal.facemask": 1, + "metal.facemask.hockey": 1, + "metal.facemask.icemask": 1, "metal.fragments": 1000, "metal.ore": 1000, "metal.plate.torso": 1, + "metal.plate.torso.icevest": 1, "metal.refined": 100, "metalblade": 20, "metalpipe": 20, @@ -433,6 +479,7 @@ "newyeargong": 1, "nightvisiongoggles": 1, "note": 1, + "orangeidtag": 5000, "oretea": 10, "oretea.advanced": 10, "oretea.pure": 10, @@ -441,6 +488,8 @@ "pants": 1, "pants.shorts": 1, "paper": 1000, + "parachute": 1, + "parachute.deployed": 1, "partyhat": 1, "photo": 1, "photoframe.landscape": 1, @@ -448,9 +497,12 @@ "photoframe.portrait": 1, "piano": 1, "pickaxe": 1, + "pinkidtag": 5000, + "pipetool": 1, "pistol.eoka": 1, "pistol.m92": 1, "pistol.nailgun": 1, + "pistol.prototype17": 1, "pistol.python": 1, "pistol.revolver": 1, "pistol.semiauto": 1, @@ -464,10 +516,12 @@ "plantfiber": 1000, "pookie.bear": 1, "potato": 20, - "powered.water.purifier": 1, + "powered.water.purifier": 3, "propanetank": 5, + "ptz.cctv.camera": 5, "pumpkin": 20, "pumpkinbasket": 1, + "purpleidtag": 5000, "radiationremovetea": 10, "radiationremovetea.advanced": 10, "radiationremovetea.pure": 10, @@ -475,11 +529,16 @@ "radiationresisttea.advanced": 10, "radiationresisttea.pure": 10, "red.berry": 20, + "reddogtags": 5000, + "redidtag": 5000, "research.table": 1, "researchpaper": 1000, "rf.detonator": 1, "rf_pager": 1, + "rhib": 1, "rifle.ak": 1, + "rifle.ak.diver": 1, + "rifle.ak.ice": 1, "rifle.bolt": 1, "rifle.l96": 1, "rifle.lr300": 1, @@ -494,6 +553,7 @@ "rock": 1, "rocket.launcher": 1, "rope": 50, + "rowboat": 1, "rug": 1, "rug.bear": 1, "rustige_egg_a": 1, @@ -501,6 +561,7 @@ "rustige_egg_c": 1, "rustige_egg_d": 1, "rustige_egg_e": 1, + "rustige_egg_f": 1, "salvaged.cleaver": 1, "salvaged.sword": 1, "samsite": 1, @@ -542,6 +603,7 @@ "shutter.metal.embrasure.b": 20, "shutter.wood.a": 20, "sickle": 1, + "sign.egg.suit": 5, "sign.hanging": 5, "sign.hanging.banner.large": 5, "sign.hanging.ornate": 5, @@ -560,10 +622,10 @@ "sign.post.single": 5, "sign.post.town": 5, "sign.post.town.roof": 5, - "sign.wooden.huge": 5, - "sign.wooden.large": 5, - "sign.wooden.medium": 5, - "sign.wooden.small": 5, + "sign.wooden.huge": 1, + "sign.wooden.large": 1, + "sign.wooden.medium": 1, + "sign.wooden.small": 1, "skull": 1, "skull.human": 1, "skull.trophy": 1, @@ -576,6 +638,11 @@ "skullspikes": 1, "skullspikes.candles": 1, "skullspikes.pumpkin": 1, + "skylantern": 20, + "skylantern.skylantern.green": 20, + "skylantern.skylantern.orange": 20, + "skylantern.skylantern.purple": 20, + "skylantern.skylantern.red": 20, "sled": 1, "sled.xmas": 1, "sleepingbag": 1, @@ -592,6 +659,8 @@ "snowballgun": 1, "snowmachine": 1, "snowman": 5, + "snowmobile": 1, + "snowmobiletomaha": 1, "sofa": 2, "sofa.pattern": 2, "soundlight": 5, @@ -606,6 +675,8 @@ "spikes.floor": 10, "spinner.wheel": 1, "spookyspeaker": 1, + "spraycan": 1, + "spraycandecal": 10, "stash.small": 5, "sticks": 100, "stocking.large": 1, @@ -614,7 +685,9 @@ "stonehatchet": 1, "stones": 1000, "storage.monitor": 1, + "storageadaptor": 5, "strobelight": 1, + "submarine.torpedo.rising": 100, "submarine.torpedo.straight": 100, "submarineduo": 1, "submarinesolo": 1, @@ -627,6 +700,7 @@ "sunglasses03black": 1, "sunglasses03chrome": 1, "sunglasses03gold": 1, + "supertea": 1, "supply.signal": 1, "surveycharge": 10, "syringe.medical": 2, @@ -642,10 +716,13 @@ "tool.instant_camera": 1, "toolgun": 1, "torch": 1, + "torch.torch.skull": 1, "trap.bear": 3, "trap.landmine": 5, + "trophy": 1, "tshirt": 1, "tshirt.long": 1, + "tugboat": 1, "tunalight": 1, "twitch.headset": 1, "twitchsunglasses": 1, @@ -671,6 +748,7 @@ "vehicle.chassis.4mod": 1, "vehicle.module": 1, "vending.machine": 1, + "wagon": 1, "wall.external.high": 10, "wall.external.high.ice": 10, "wall.external.high.stone": 10, @@ -684,6 +762,7 @@ "wall.frame.shopfront.metal": 1, "wall.graveyard.fence": 10, "wall.ice.wall": 10, + "wall.window.bars.brickskin": 10, "wall.window.bars.metal": 10, "wall.window.bars.toptier": 10, "wall.window.bars.wood": 10, @@ -696,8 +775,10 @@ "water.purifier": 1, "water.salt": 2147483647, "waterjug": 1, - "waterpump": 1, + "waterpump": 3, "weapon.mod.8x.scope": 1, + "weapon.mod.burstmodule": 1, + "weapon.mod.extendedmags": 1, "weapon.mod.flashlight": 1, "weapon.mod.holosight": 1, "weapon.mod.lasersight": 1, @@ -706,7 +787,10 @@ "weapon.mod.silencer": 1, "weapon.mod.simplesight": 1, "weapon.mod.small.scope": 1, + "weaponrack.doublelight": 1, + "weaponrack.light": 1, "white.berry": 20, + "whiteidtag": 5000, "wiretool": 1, "wolfmeat.burned": 20, "wolfmeat.cooked": 20, @@ -746,5 +830,6 @@ "xmas.window.garland": 10, "xmasdoorwreath": 1, "xylophone": 1, - "yellow.berry": 20 + "yellow.berry": 20, + "yellowidtag": 5000 } \ No newline at end of file From 7a721f79d6f036513ccdac13e1f4552925f26bf6 Mon Sep 17 00:00:00 2001 From: RomTheG <9473656+WouayNote@users.noreply.github.com> Date: Sat, 21 Oct 2023 00:49:55 +0200 Subject: [PATCH 2/8] Upload of 4.1.2 - Minicopter class name fix --- StackSizeController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/StackSizeController.cs b/StackSizeController.cs index 2bfd0ab..5676cf3 100644 --- a/StackSizeController.cs +++ b/StackSizeController.cs @@ -10,7 +10,7 @@ namespace Oxide.Plugins { - [Info("Stack Size Controller", "AnExiledDev", "4.1.1")] + [Info("Stack Size Controller", "AnExiledDev/patched by chrome", "4.1.2")] [Description("Allows configuration of most items max stack size.")] class StackSizeController : CovalencePlugin { @@ -266,7 +266,7 @@ private string GetMessage(string key, string playerId) // Credit to WhiteThunder- https://github.com/AnExiledDev/StackSizeController/pull/7 // Fix initial fuel amount for vendor-spawned helis since they use 20% of max stack size of low grade. - private void OnEntitySpawned(MiniCopter heli) + private void OnEntitySpawned(Minicopter heli) { // Ignore if a known plugin is loaded that adjusts heli fuel. if (AirFuel != null || GetToDaChoppa != null || VehicleVendorOptions != null) From 6bf97d6a892addbad40ab05cefcc18166c4baeab Mon Sep 17 00:00:00 2001 From: RomTheG <9473656+WouayNote@users.noreply.github.com> Date: Sat, 21 Oct 2023 02:36:39 +0200 Subject: [PATCH 3/8] Enhance performances with Dictionary.TryGetValue --- StackSizeController.cs | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/StackSizeController.cs b/StackSizeController.cs index 5676cf3..053ed4e 100644 --- a/StackSizeController.cs +++ b/StackSizeController.cs @@ -521,8 +521,8 @@ private void SetVanillaDefaults(int code, string response) private int GetVanillaStackSize(ItemDefinition itemDefinition) { - return _vanillaDefaults.ContainsKey(itemDefinition.shortname) - ? _vanillaDefaults[itemDefinition.shortname] + return _vanillaDefaults.TryGetValue(itemDefinition.shortname, out int vanillaStackSize) + ? vanillaStackSize : itemDefinition.stackable; } @@ -540,32 +540,28 @@ private int GetStackSize(ItemDefinition itemDefinition) return GetVanillaStackSize(itemDefinition); } - int stackable = GetVanillaStackSize(itemDefinition); - - // Individual Limit set by shortname - if (_config.IndividualItemStackSize.ContainsKey(itemDefinition.shortname)) + // Individual Limit + if (!_config.IndividualItemStackSize.TryGetValue(itemDefinition.shortname, out int stackable)) { - stackable = _config.IndividualItemStackSize[itemDefinition.shortname]; + stackable = GetVanillaStackSize(itemDefinition); } // Individual Multiplier set by shortname - if (_config.IndividualItemStackMultipliers.ContainsKey(itemDefinition.shortname)) + if (_config.IndividualItemStackMultipliers.TryGetValue(itemDefinition.shortname, out float stackMultiplierOfShortName)) { - return Mathf.RoundToInt(stackable * _config.IndividualItemStackMultipliers[itemDefinition.shortname]); + return Mathf.RoundToInt(stackable * stackMultiplierOfShortName); } // Individual Multiplier set by item id - if (_config.IndividualItemStackMultipliers.ContainsKey(itemDefinition.itemid.ToString())) + if (_config.IndividualItemStackMultipliers.TryGetValue(itemDefinition.itemid.ToString(), out float stackMultiplierOfId)) { - return Mathf.RoundToInt(stackable * _config.IndividualItemStackMultipliers[itemDefinition.itemid.ToString()]); + return Mathf.RoundToInt(stackable * stackMultiplierOfId); } // Category stack multiplier defined - if (_config.CategoryStackMultipliers.ContainsKey(itemDefinition.category.ToString()) && - _config.CategoryStackMultipliers[itemDefinition.category.ToString()] > 1.0f) + if (_config.CategoryStackMultipliers.TryGetValue(itemDefinition.category.ToString(), out float categoryStackMultiplier) && categoryStackMultiplier > 1.0f) { - return Mathf.RoundToInt( - stackable * _config.CategoryStackMultipliers[itemDefinition.category.ToString()]); + return Mathf.RoundToInt(stackable * categoryStackMultiplier); } return Mathf.RoundToInt(stackable * _config.GlobalStackMultiplier); From 1d2c350f7fe5b42a1358d64fe4782e1d556c0668 Mon Sep 17 00:00:00 2001 From: RomTheG <9473656+WouayNote@users.noreply.github.com> Date: Sat, 21 Oct 2023 05:22:38 +0200 Subject: [PATCH 4/8] Enhance OnMaxStackable performance with a cache --- StackSizeController.cs | 65 ++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 25 deletions(-) diff --git a/StackSizeController.cs b/StackSizeController.cs index 053ed4e..1d2c7e1 100644 --- a/StackSizeController.cs +++ b/StackSizeController.cs @@ -21,6 +21,7 @@ class StackSizeController : CovalencePlugin private Configuration _config; private Dictionary _vanillaDefaults; + private Dictionary _computedStackSizesByItemId = new Dictionary(); private readonly List _ignoreList = new List { @@ -535,41 +536,51 @@ private int GetStackSize(ItemDefinition itemDefinition) { try { - if (_ignoreList.Contains(itemDefinition.shortname)) - { - return GetVanillaStackSize(itemDefinition); - } - - // Individual Limit - if (!_config.IndividualItemStackSize.TryGetValue(itemDefinition.shortname, out int stackable)) + // Cached Stack Size + if (this._computedStackSizesByItemId.TryGetValue(itemDefinition.itemid, out int stackSize)) { - stackable = GetVanillaStackSize(itemDefinition); + return stackSize; } - - // Individual Multiplier set by shortname - if (_config.IndividualItemStackMultipliers.TryGetValue(itemDefinition.shortname, out float stackMultiplierOfShortName)) - { - return Mathf.RoundToInt(stackable * stackMultiplierOfShortName); - } - - // Individual Multiplier set by item id - if (_config.IndividualItemStackMultipliers.TryGetValue(itemDefinition.itemid.ToString(), out float stackMultiplierOfId)) + // Ignored Items + if (_ignoreList.Contains(itemDefinition.shortname)) { - return Mathf.RoundToInt(stackable * stackMultiplierOfId); + stackSize = GetVanillaStackSize(itemDefinition); } - - // Category stack multiplier defined - if (_config.CategoryStackMultipliers.TryGetValue(itemDefinition.category.ToString(), out float categoryStackMultiplier) && categoryStackMultiplier > 1.0f) + else { - return Mathf.RoundToInt(stackable * categoryStackMultiplier); + // Individual Limit + if (!_config.IndividualItemStackSize.TryGetValue(itemDefinition.shortname, out int stackable)) + { + stackable = GetVanillaStackSize(itemDefinition); + } + // Individual Multiplier set by shortname + if (_config.IndividualItemStackMultipliers.TryGetValue(itemDefinition.shortname, out float stackMultiplierOfShortName)) + { + stackSize = Mathf.RoundToInt(stackable * stackMultiplierOfShortName); + } + // Individual Multiplier set by item id + else if (_config.IndividualItemStackMultipliers.TryGetValue(itemDefinition.itemid.ToString(), out float stackMultiplierOfId)) + { + stackSize = Mathf.RoundToInt(stackable * stackMultiplierOfId); + } + // Category stack multiplier defined + else if (_config.CategoryStackMultipliers.TryGetValue(itemDefinition.category.ToString(), out float stackMultiplierOfCategory) && stackMultiplierOfCategory > 1.0f) + { + stackSize = Mathf.RoundToInt(stackable * stackMultiplierOfCategory); + } + // Global stack multiplier + else + { + stackSize = Mathf.RoundToInt(stackable * _config.GlobalStackMultiplier); + } } - - return Mathf.RoundToInt(stackable * _config.GlobalStackMultiplier); + // Cache Computed Stack Size + this._computedStackSizesByItemId.Add(itemDefinition.itemid, stackSize); + return stackSize; } catch (Exception ex) { LogError("Exception encountered during GetStackSize. Item: " + itemDefinition.shortname + " Ex:" + ex.ToString()); - return GetVanillaStackSize(itemDefinition); } } @@ -592,6 +603,8 @@ private void SetStackSizes() itemDefinition.stackable = Mathf.Clamp(GetStackSize(itemDefinition), 1, int.MaxValue); } + // Invalidate Stack Size Cache + _computedStackSizesByItemId.Clear(); } private void RevertStackSizes() @@ -612,6 +625,8 @@ private void RevertStackSizes() itemDefinition.stackable = Mathf.Clamp(GetVanillaStackSize(itemDefinition), 1, int.MaxValue); } + // Invalidate Stack Size Cache + _computedStackSizesByItemId.Clear(); } #endregion From fb72190215900001d2a1fb59b05d3474a0a48435 Mon Sep 17 00:00:00 2001 From: RomTheG <9473656+WouayNote@users.noreply.github.com> Date: Sat, 21 Oct 2023 05:31:23 +0200 Subject: [PATCH 5/8] Fix ItemSearchCommand KeyNotFoundException --- StackSizeController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/StackSizeController.cs b/StackSizeController.cs index 1d2c7e1..33a5074 100644 --- a/StackSizeController.cs +++ b/StackSizeController.cs @@ -392,8 +392,7 @@ private void ItemSearchCommand(IPlayer player, string command, string[] args) { if (args.Length != 1) { - player.Reply( - string.Format(GetMessage("NotEnoughArguments", player.Id), 1)); + player.Reply(string.Format(GetMessage("NotEnoughArguments", player.Id), 1)); } List itemDefinitions = ItemManager.itemList.Where(itemDefinition => @@ -408,8 +407,9 @@ private void ItemSearchCommand(IPlayer player, string command, string[] args) foreach (ItemDefinition itemDefinition in itemDefinitions) { + int vanillaStackSize = _vanillaDefaults.TryGetValue(itemDefinition.shortname, out vanillaStackSize) ? vanillaStackSize : itemDefinition.stackable; output.AddRow(itemDefinition.itemid.ToString(), itemDefinition.shortname, - itemDefinition.category.ToString(), _vanillaDefaults[itemDefinition.shortname].ToString("N0"), + itemDefinition.category.ToString(), vanillaStackSize.ToString("N0"), Mathf.Clamp(GetStackSize(itemDefinition), 0, int.MaxValue).ToString("N0")); } From baa096a4c88303df21af0222100f49203a876bc9 Mon Sep 17 00:00:00 2001 From: RomTheG <9473656+WouayNote@users.noreply.github.com> Date: Sat, 21 Oct 2023 05:37:17 +0200 Subject: [PATCH 6/8] Fix ListCategoryItemsCommand KeyNotFoundException --- StackSizeController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/StackSizeController.cs b/StackSizeController.cs index 33a5074..2db52e4 100644 --- a/StackSizeController.cs +++ b/StackSizeController.cs @@ -444,8 +444,9 @@ private void ListCategoryItemsCommand(IPlayer player, string command, string[] a foreach (ItemDefinition itemDefinition in ItemManager.GetItemDefinitions() .Where(itemDefinition => itemDefinition.category == itemCategory)) { + int vanillaStackSize = _vanillaDefaults.TryGetValue(itemDefinition.shortname, out vanillaStackSize) ? vanillaStackSize : itemDefinition.stackable; output.AddRow(itemDefinition.itemid.ToString(), itemDefinition.shortname, - itemDefinition.category.ToString(), _vanillaDefaults[itemDefinition.shortname].ToString("N0"), + itemDefinition.category.ToString(), vanillaStackSize.ToString("N0"), Mathf.Clamp(GetStackSize(itemDefinition), 0, int.MaxValue).ToString("N0"), _config.CategoryStackMultipliers[itemDefinition.category.ToString()].ToString()); } From 808987a8f00b1d87640242c1db6953201f77b7af Mon Sep 17 00:00:00 2001 From: RomTheG <9473656+RomTheG@users.noreply.github.com> Date: Tue, 24 Oct 2023 23:26:37 +0200 Subject: [PATCH 7/8] Vanilla defaults update 2023-10-24 --- vanilla-defaults.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vanilla-defaults.json b/vanilla-defaults.json index 74e10f0..7f8c465 100644 --- a/vanilla-defaults.json +++ b/vanilla-defaults.json @@ -185,6 +185,8 @@ "door.hinged.toptier": 1, "door.hinged.wood": 1, "door.key": 1, + "draculacape": 1, + "draculamask": 1, "dragondoorknocker": 1, "drone": 1, "dropbox": 5, @@ -729,6 +731,7 @@ "valve1": 15, "valve2": 15, "valve3": 15, + "vampire.stake": 1, "vehicle.1mod.cockpit": 1, "vehicle.1mod.cockpit.armored": 1, "vehicle.1mod.cockpit.with.engine": 1, From dcf88f7e9acd8591726a7f6a7603259c25c5585d Mon Sep 17 00:00:00 2001 From: RomTheG <9473656+RomTheG@users.noreply.github.com> Date: Wed, 25 Oct 2023 02:05:41 +0200 Subject: [PATCH 8/8] Vanilla default url change + release number update --- StackSizeController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/StackSizeController.cs b/StackSizeController.cs index 2db52e4..7cedc1d 100644 --- a/StackSizeController.cs +++ b/StackSizeController.cs @@ -10,14 +10,14 @@ namespace Oxide.Plugins { - [Info("Stack Size Controller", "AnExiledDev/patched by chrome", "4.1.2")] + [Info("Stack Size Controller", "AnExiledDev/optimized by WouayNote", "4.1.3")] [Description("Allows configuration of most items max stack size.")] class StackSizeController : CovalencePlugin { [PluginReference] Plugin AirFuel, GetToDaChoppa, VehicleVendorOptions; - private const string _vanillaDefaultsUri = "https://raw.githubusercontent.com/AnExiledDev/StackSizeController/master/vanilla-defaults.json"; + private const string _vanillaDefaultsUri = "https://raw.githubusercontent.com/WouayNote/StackSizeController/master/vanilla-defaults.json"; private Configuration _config; private Dictionary _vanillaDefaults;