Jump to content

Stack Logic


Chill Roleplay

Recommended Posts

I just wanted to start a discussion about stack sizes in plugins. Your experiences as a Dev or a server owner. What is right and what is wrong? Maybye we can all compile the holy grail of how it should be handled.

My opinion is that if your going to add stack logic of any kind to your plugin you should have a way for the server to turn that function off via config. Once thing I noticed about @imthenewguy's plugins is that every one of them that has a stack option also has the option to turn that logic off.

Not every server is going to have the same stack sizes and use the same stack plugins so when you make an option that does not work for everyone you are limiting your potential.

I have spoken with a couple of developers and things they suggested

Dev #1's Suggestions

Item creations. ( Dont mess with a vanilla items creation )

Giving the items.. ( respect giving items for server stacks only )

you need to properly control all  aspects of stack logic if you are going to add this function ( canstack, onsplit, dropped, etc )

The design of the plugin should minimize / eliminate the need to control such logic to begin with. (To many plugins don't even need to control stack logic )

Dev #2 Suggestions

Having the option to register items for a stack plugin to ignore

Only control the stacking/splitting of items unique to your plugin

Have the option for the hooks to unsub when the server runs a stacking plugin.

 

 

 

Link to comment
Share on other sites

  • 3 weeks later...

OnItemStacked

Called after an item has been stacked

No return behavior

void OnItemStacked(Item destinationItem, Item sourceItem, ItemContainer destinationContainer) { Puts("OnItemStacked works!");

Link to comment
Share on other sites

CanCombineDroppedItem

Called when an item is dropped on another item

Returning a non-null value overwrites command arguments

object CanCombineDroppedItem(DroppedItem item, DroppedItem targetItem) { Puts("CanCombineDroppedItem works!"); return null; }

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
1.4m

Downloads

Total number of downloads.

6.7k

Customers

Total customers served.

99.2k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.