worth/sell blocks does entire inventory instead of just blocks
goosewoman opened this issue ยท 9 comments
It's an exact copy of inventory
I was able to reproduce this issue on the following:
[01:08:10 INFO]: Server version: 1.16.4-R0.1-SNAPSHOT git-Paper-337 (MC: 1.16.4)
[01:08:10 INFO]: EssentialsX version: 2.19.0-dev+27-c4ca0e5
[01:08:10 INFO]: LuckPerms version: 5.2.63
[01:08:10 INFO]: Vault version: 1.7.3-b131
with this sample worth.yml file, and the following inventory:
Both /sell all
and /sell blocks
have the same result - all items disappear from the inventory.
I'm not able to reproduce this issue with the following steps:
/i beef
/i dirt
/sell blocks
It sells the dirt, but keeps the beef. Seems to be working as intended.
Can you please provide completely fill out the issue template and provide an example of what doesn't work?
beef isn't sellable to the server by default in the worth.yml. So that might explain why it worked fine for you in that situation.
Anyway, read this code and tell me if it should work or not:
else if (args[0].equalsIgnoreCase("inventory") || args[0].equalsIgnoreCase("invent") || args[0].equalsIgnoreCase("all")) {
for (final ItemStack stack : user.getBase().getInventory().getContents()) {
if (stack == null || stack.getType() == Material.AIR) {
continue;
}
is.add(stack.clone());
}
} else if (args[0].equalsIgnoreCase("blocks")) {
for (final ItemStack stack : user.getBase().getInventory().getContents()) {
if (stack == null || stack.getType() == Material.AIR) {
continue;
}
is.add(stack.clone());
}
}
"blocks" is identical to "all"
Please create a new issue if you feel like filling out the issue template properly. I have already asked you once, and you've ignored me. This means providing your server and essentials version, as well as logs and relevant files (in this case worth.yml) so that we can reproduce your problem on our side. Not doing that is a waste of our time, as is extremely evident here.
Look, I'm not gonna waste my own time on something you can literally see right there. I've explained where the bug is, what it is, and I even provided a PR to fix it.
I've done my part, I didn't need to report this bug. I didn't need to provide a PR. I don't even use this part of Essentials because I've written my own plugin to replace and extend the functionality of this part of Essentials. So honestly I have zero reason to care, but I reported it anyway. I'm not gonna write out a complete fucking report for something this obvious. That's a waste of everyone's time.
You can either take your head out of your ass and read the code or be a stickler for the rules and keep the bug in. Your choice.
@kukelekuuk You may have found a valid bug, but you did not report it correctly. Filling out the template allows us to replicate and confirm your bug far quicker and more accurately, which would have avoided this situation. Behavioural hypotheses might be convenient, but in a codebase as complex as EssentialsX they are not a replacement for proper bug replication steps.
As for your abrasive language, take it elsewhere.
This wasn't a problem with the original Essentials team. That's all I'm saying. Have fun with unfixed bugs I guess.
Feel free to upstream your changes to Essentials (which, should I add, had considerably worse project management and is the reason for so many hacks and issues that EssentialsX has had to deal with for the past 5 years).