Paper icon indicating copy to clipboard operation
Paper copied to clipboard

feat: Add Multiply total operation

Open DaRacci opened this issue 3 years ago • 8 comments

This allows the use of proper multiplication values, as none of the pre-existing bukkit enums properly convey the way to do this. And as exampled by me, The multiply_scalar_1 operation is frankly quite dumb, why add 1 to the users pre-existing input its just asking for unwanted pain while trying to figure out why the players health it 36 and not 18.

DaRacci avatar May 28 '22 13:05 DaRacci

Why don't you just substract 1 to the value in your attribute modifier ? 😅

tomcraft avatar May 28 '22 14:05 tomcraft

I am currently, but the fact that it took me 4 hours of messing with operations, asking the paper dev channel and it seeming like no one really knows to just say subtract 1 from it, then finally finding my answer by looking at the source code where its actually handled. I think this means in reality that having a better defined operation like multiply total makes sense as you can see that, understand it and role with it.

DaRacci avatar May 28 '22 14:05 DaRacci

fromId needs patching to cater for the offset; I probs just wouldn't place them in there, and just add an if block inside of the else block for those special cased IDs

electronicboy avatar Sep 29 '22 12:09 electronicboy

fromId needs patching to cater for the offset; I probs just wouldn't place them in there, and just add an if block inside of the else block for those special cased IDs

Should this be like just an if (id == 103) or like what?

DaRacci avatar Oct 01 '22 04:10 DaRacci

Should this be like just an if (id == 103) or like what?

Yup

electronicboy avatar Oct 01 '22 06:10 electronicboy

Should this be like just an if (id == 103) or like what?

Yup

Should it be removed from the OPERATIONS array aswell?

DaRacci avatar Oct 01 '22 09:10 DaRacci

I would imagine so, as it's gonna create an oddity when you can lookup a value with two different IDs

electronicboy avatar Oct 01 '22 09:10 electronicboy

Ima bit iffy on this myself as this is an entirely new attribute type that we need to upkeep… all for just not subtracting 1? This feels like with documentation this can be fixed?

Owen1212055 avatar Nov 18 '22 03:11 Owen1212055

Thank you for your contribution, however, as specified above, it’s really better to improve the documentation here instead of adding our own new type entirely.

This would require up keeping as this introduces a new type entirely. And in general, not even clients will know how to handle this special type.

Closing.

Owen1212055 avatar Mar 05 '23 17:03 Owen1212055