ArchmageInc / RealStore

A Minecraft Bukkit plugin to setup stores based on item backed currency
2 stars 2 forks source link

Unable to purchase as expected. Is the conversion off? #16

Open monkeyhustle opened 12 years ago

monkeyhustle commented 12 years ago

OP/Admin set up a coffer and store. Store contained slimeballs with price set to 1 gold ingot (9 nuggets).

stores: x965x68x-468: world: world player: tfenderson default-price: 1 prices: 341-0: 9

Test #1: With 9 nuggets in inventory, a non-op player tried to purchase a slimeball. The plug-in stated that he didn't have enough money.

Test #2: With 1 gold bar in inventory, a non-op player tried to purchase a slimeball. The plug-in stated that he didn't have enough money.

Test #3: With 8 nuggets and 1 gold bar in inventory, a non-op player tried to purchase a slimeball. The plug-in stated "You purchased 1 slimeball for 9 gold nuggets" and then the player had had 9 gold nuggets and a slimeball in inventory.

If the currency conversion is 9 gold nuggets to 1 gold bar, shouldn't Test #1 and #2 work? For Test #3, shouldn't the buyer have 1 slimeball and 8 nuggets in inventory following the transaction?

ArchmageInc commented 12 years ago

I believe this is a problem with the cursor currency. Because of a bug in Bukkit when this plugin was released (which is now resolved) the system cannot count the currency that is on the cursor. 9 nuggets in the inventory, I am assuming one of them was used to perform the purchase. With 1 gold bar in the inventory, I am assuming the bar was used to perform the purchase. For the third test, yes, this is troublesome for a few reasons.

1) It should have taken nine nuggets, instead, it only took 8. 2) If it left 9 nuggets, they should have been 'colored up' to one gold bar.

My main question is what was on the cursor when these purchases took place? I will investigate and see where this breakdown happened.

monkeyhustle commented 12 years ago

I also noticed when I logged back in with my OP/Admin account that the coffer was empty even though successful transactions occurred.

I'll update to 0.1.2 tonight, retest, and open a separate ticket if this issue still exists.