Just curious if there is a possibility that the plugin might effect the way scrap tea works, Ive noticed players are using a tea and are not getting extra scrap.
Appreciate the help
Scrap tea affecting pickup amount from barrelsFixed
Im having the same issue :( If you found a fix let me know as I really like this plugin
Hi, Yes I can confirm this is an issue. The problem arises because barrels have a set inventory when they are spawned so whichever play breaks them gets the same loot anyone else would from that barrel. Because of this, for scrap teas to give extra scrap, on a break of the barrel, if the player that breaks it has tea buff it will spawn extra scrap. You will also hear that shoop noise when the same entities combine into one. Because we hook into the barrel on damage, before damage is counted and before the break happens we collect the barrel contents into the players inventory. When the break does happen, because there is no scrap dropped, the scrap tea buff doesn't happen.
I may or might not be able to rectify this. leave it with me and I'll see what I can do.
Merged post
OK looking into this further there is something I can do to improve the plugin to work better with scrap tea modifiers (buffs). However, it won't be perfect.
By default barrels hold 2 scrap.
Basic - 100% +2 scrap = 4 scrap rewarded
Advanced - 225% + 4 or 5 scrap = 6 or 7 scrap rewarded
Advanced - 350% + 7 scrap = 9 scrap rewarded
The problem arises with the pesky advanced tea. The game code is clever as it rounds down the awarded scrap but saves the fraction of scrap not paid so that when you next get a fractional payout it adds to it. If that goes over a whole number you get the extra scrap. I don't know if I can replicate this or hook into this behaviour. I don't have the tools to reverse engineer the code. The best I can do is just run the Math.round() function on the calculation which will always result in 6 scrap being awarded per barrel when using advanced tea. My implementation then works with plugins that modify the starting barrel scrap or the modifier values of the teas. Just won't be clever to save the fractional amounts.
I think there may be some methods on the player object where you can save fractional amounts of an item for the rest of the game to use, such as recycling. If anyone knows about it or what methods I can use then please share.
Merged post
Actually found the way the game does the half scrap and have replicated it in my plugin. Will push a new version shortly