CanStackItem Conflicting Plugins: StackModifier True | Skinner FalseNot An Issue

Calling hook CanStackItem resulted in a conflict between the following plugins: StackModifier - True (Boolean), Skinner (False (Boolean))

That means, Plugin A returned True and Plugin B Returned False on the same CanStackItem call. Which results in a conflict error.

Tell that dev to add support for mine then. ( Direct Send this thread URL I just gave them the patch code ) 
Mine is the stacking controller plugin he shouldn't be using that hook if mine is detected he should un-sub.

[PluginReference] private Plugin StackModifier;

private void Init()
{
    Unsubscribe(nameof(CanStackItem));
}

private void OnServerInitialized()
{
    if (StackModifier == null)
        Subscribe(nameof(CanStackItem));
}

private void OnPluginLoaded(Plugin name)
{
    if (StackModifier != null && name.Name == StackModifier.Name)
        Unsubscribe(nameof(CanStackItem));
}

private void OnPluginUnloaded(Plugin name)
{
    if (StackModifier != null && name.Name == StackModifier.Name)
        Subscribe(nameof(CanStackItem));
}​

What about edge cases where they are needing to control stack for custom skinned items pretending to be something else.  Where they need to force it to be one item for example.

 

In which they still need to be subcribed but ignore non custom items.

Every single edge case like that can be ignored cuss there are better ways to code to not have to do that. 
Name 1 plugin that cannot & I'll re-write it just to prove my point. 

Devs need to stop trying to take easy ways out & code properly 

8SecSleeper

What about edge cases where they are needing to control stack for custom skinned items pretending to be something else.  Where they need to force it to be one item for example.

 

In which they still need to be subcribed but ignore non custom items.

There's a long list of plugins on this site that does it. 

First example is SkinShop for skin packs.

That Skin Shop plugin has been bugged since day 1 of launch. 

Also, there is no reason for him to use the hooks for stacking unless A stack plugin is not detected such as StackModifier.

If you want a compatibility patch just say so I'll submit one on his plugin page.

8SecSleeper

There's a long list of plugins on this site that does it. 

First example is SkinShop for skin packs.



Merged post

@8SecSleeper

For the record, I've already patched the following plugins that aren't mine to work with mine, do I get paid for it? no...

CustomMagazine, DefendableHomes, XMagicDust, DrugBusiness, OreBonus, CoinSearch, radiation ore and coins.. 
Locked automatically