Couple issues with skinned and stacked itemsBug

@CanopySheep

Just did a test, and looks like there is a pretty big issue with StackSizeControler now. Easy to reproduce

Issue 1) Grabbed 5 hoodies, skinned them to any skin and stack, works fine. then you go to split them.... took 2 away now those custom skinned ones lost there names and just say Hoodie now. 

Issue 2) After splitting the above stack. Now the 2 taken away show 2x, the remaining 3... umm 2 just disappeared completely leaving just 1 skinned hoodie left.

I can already hear the players now complaining about losing items...

Not sure if it is a CustomSkinStackFix Plugin issue or StackSizeController issue. OR Both.

Replying to bring to front so I can confirm if still an issue.
Do you use SkinBox on your servers?

The reason I ask is because I had this same issue, but for me StackSizeController was not the issue, that worked fine. I used SkinBox on my server which caused a conflict with the CustomSkinStackFix plugin which both use the "OnItemSplit" hook.

Check your RCON console output for a conflict error message like:

11/20 12:31:58 | Calling hook OnItemSplit resulted in a conflict between the following plugins: SkinBox - Item.supply.signalx1.32017437 (Item), CustomSkinsStacksFix (Item.supply.signalx1.32017439 (Item))

The result was an error which caused as the OP described, one item dissapears and the split item lost its custom name and reverted to the default name.

I was able to fix this by adding my own code to SkinBox to unsubscribe from the OnItemSplit hook when using CustomSkinStackFix. I did it this way because the CustomSkinStackFix plugin handles custom skin items way better than SkinBox does, retaining their custom names most importantly.

If this will help you guys too feel free to let me know and I can show you, its only a few lines of code.
You want to let @k1lly0u you know about this as he is the dev for SkinBox.

Yep still confirm this is happening. 

Submitted patch. Keep your eyes open for the next update. 

y3Ru6KJZLt5akCi.png

Aye, my latest GUIShop update (now supports multi-currency with skins/names) really needs you to please either push an update yourself as soon as possible or

accept the patch I submitted to fix skin id issues/custom item names OnItemSplit hook

I really don't want to fork this on my own GitHub.

That isn't an acceptable fix for me, and if I remember correctly during testing it still happened. I've re-arranged things and set a few variables, like you did, but had limited time to test. If you like you can try this version: https://raw.githubusercontent.com/AnExiledDev/StackSizeController/pookins_test/StackSizeController.cs(Don't run with CustomSkinStackFix, compatibility can't and won't be added; don't add to a live server incase there are unintended side effects)

Here I added another patch/toggle option for issues relating to wearing stacked armor/wearable items.

Idk I use guishop to test all the skins and it seems fine in my results, not sure how you are still having the issue/able to reproduce..?

I personally haven't had complaints from my beta testers about it. It would be nice to know how you are able to reproduce the issue still relating to skinned items/item names. 

You cannot use oranges skin fix with this.

StackSizeController patches

Update, if you use Killyous latest re-write of skinbox it will cause issues with this plugin (he also tried to patch it himself)

So people that use skinbox and are on the latest versions need to either comment out that hook or go back a few updates before his rewrite edition I guess.  

I am still on a modified version SkinBox", "FuJiCuRa", "1.16.6" which is unaffected. 

In his skinbox he tries to prevent item loss when moving a skinned stack onto another skinned item. which is where some of the issues happen/conflict. 

Technically he shouldn't need to do any of that if stacksizecontroller handled it correctly which means he should be able to update his plugin with the removed redundant code. 



Merged post

Misticos free skins plugin also is calling this onitemsplit hook which is another piece of the puzzle for some users that plugin will need to have a toggle or support added to detect stacksizecontroller and disable his custom fix as well.. it seems

So make sure you unload that plugin prior to testing again.

As I mentioned before, I use StackSizeController 2.0.4 and SkinBox (latest) together without any issues after modifying. To make custom skinned items split correctly and without issue, I simply replaced the OnItemSplit code in SkinBox with the code from Oranges CustomSkinStackFix plugin, then unloaded that now redundant plugin. I also added the CanStackItem code from Oranges plugin into SkinBox. It works flawlessly, handling the custom skinned items perfectly, no loss of item, no loss of skin or custom name. It works for me, but ideally it would be great if it was handled by StackSizeController going forward so I don't have to fudge it myself every time there is an update.

If you download my patch linked above ^ @ZEODE and comment out the SkinBox hook for OnItemSplit it should work fine. I guess you'd also have to remove or comment out the other code you added CanStackItem as well

If you wanna add me on discord I can show you it working on mine. Khan#8615

The latest version of Skinbox is supposed to be tied with his other paid plugin called stacks extended is why. 



Merged post

Alrighty, I have reworked and added new code this is like perfection here. 3.2.3 updated