Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Remove shop stock when insufficient inventory slots #486

Closed
MrPranklez opened this issue Oct 15, 2022 · 5 comments
Closed

[BUG] Remove shop stock when insufficient inventory slots #486

MrPranklez opened this issue Oct 15, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@MrPranklez
Copy link

Description

When somebody buys let's say 5 stacks of dirt from a shop, but only have 2 inventory slots, the following things happen;

  • The player buying items will not lose any balance for the items that were bought
  • The player selling items will not get any balance for the items sold
  • The stock of the store drops (so items do get removed from the store and items will be given to the player buying items for the amount of free slots they have)

Steps to reproduce

  1. Set up a shop
  2. Fill your inventory so you only have a limited amount of slots available
  3. Buy an amount of items so your inventory will overflow
  4. The result will be as described as above

Expected Behaviour

QS cancels the buy event when not enough inventory slots are available, I didn't manage to find a setting in the config to adjust this either.

Screenshots

none

/qs paste URL

https://ghost-chu.github.io/quickshop-hikari-paste-viewer/?remote=https%3A%2F%2Fbytebin.lucko.me%2Fl6dF8F9fDI

Additional Context

No response

@Ghost-chu Ghost-chu added the bug Something isn't working label Oct 16, 2022
@Ghost-chu
Copy link
Owner

It seems is a oversized itemstack configuration bug, on default configuration that I can't reproduce that.

Oversized ItemStack feature need another 3rd-party to impl it, but I didn't see you have similar plugin installed on the server.

That mean you shouldn't set the custom-stacksize in config.yml

# This option allows you to set custom item max stacksizes.
# If nothing matches, then all items (*) will be used.
# * means all items.
# Examples:
#
# custom-item-stacksize:
# - "*:128"
# - STONE:128
#
custom-item-stacksize:
- '*:640'

In settings, you force QuickShop-Hikari process every item as 640x items per stack max, try set it back default:

custom-item-stacksize: []

@MrPranklez
Copy link
Author

MrPranklez commented Oct 16, 2022

is there then a way to still allow players to sell 2 stacks for 1 $? because if I would change it then the limit would be 64 or am I mistaken?

[Update] I changed the setting, reloaded and everything, but the same issue still occurs.

Players see this issue and it claims for everything to have been rolled back, however, the seller still lost all the stacks of items and didn't receive a payment
https://i.imgur.com/VZhF9CU.png

Would there be some way to allow players to change the /qs size above 64 without having to change the max-stack-size in config.yml?

@Ghost-chu
Copy link
Owner

is there then a way to still allow players to sell 2 stacks for 1 $? because if I would change it then the limit would be 64 or am I mistaken?

[Update] I changed the setting, reloaded and everything, but the same issue still occurs.

Players see this issue and it claims for everything to have been rolled back, however, the seller still lost all the stacks of items and didn't receive a payment https://i.imgur.com/VZhF9CU.png

Would there be some way to allow players to change the above 64 without having to change the max-stack-size in ?/qs size``config.yml

Players see this issue and it claims for everything to have been rolled back, however, the seller still lost all the stacks of items and didn't receive a payment

This is a protection logic for internal error fallback, It doesn't cover all error scenarios, so it may doesn't work sometimes, (I have tried patch it in recent commits).

is there then a way to still allow players to sell 2 stacks for 1 $? because if I would change it then the limit would be 64 or am I mistaken?

I have pushed a commit for that, but please note: QuickShop-Hikari not designed for process item more than one, even stacks feature is extended, so more than one stacks totally experimental and use at your own risk.
You can download it here (once it finished build): https://ci.codemc.io/job/Ghost-chu/job/QuickShop-Hikari-SNAPSHOT/956/

Backup before install it.

@Ghost-chu
Copy link
Owner

image
After a simple test, i think new config key should works like what you want.

@Ghost-chu
Copy link
Owner

Snipaste_2022-10-17_21-42-33
Snipaste_2022-10-17_21-42-41
This bug should be fixed now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants