-
Notifications
You must be signed in to change notification settings - Fork 71
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
magnet work behavior not as expected. #238
Comments
I'm not aware of this bug but if you make a PR I would accept it. Your expected behavior aligns with what I would expect here. Keep in mind that of course, the item must be within the configured magnet distance to the barrel. So if it is "out of range" of the second barrel, it will not enter that barrel. |
Thanks for your reply. I'm confused by some of the code, In if (inventory.getItem(0) != null && inventory.getItem(1) != null) {
if (inventory.getItem(0).getType() == itemStack.getType()
&& inventory.getItem(0)
.getMaxStackSize() >= (inventory.getItem(0).getAmount() + itemStack.getAmount())) {
// ItemStack fits on Slot 0
} else if (inventory.getItem(1).getType() == itemStack.getType()
&& inventory.getItem(1)
.getMaxStackSize() >= (inventory.getItem(1).getAmount() + itemStack.getAmount())) {
// ItemStack fits on Slot 1
} else {
return null;
}
} why returning null instead of empty may? what is the sepcial meaning? And if source slot has 2 iron ore, fuel slot has some coal. Player Drop iron ore * 64 on the ground. this will ignore and return null. But I think iron ores can stack deposit into source slot. I'm a little confused about this part of the code, what's the special meaning of null? please help me, thanks!
|
Another thing I don't understand is about /lwc mode droptransfer feature. In file if (remaining == null || remaining.size() > 0) {
lwc.sendLocale(player, "lwc.dropxfer.chestfull");
event.getEvent().setCancelled(true);
} is clearly not told how many remaining items to return to the player, but it can be returned correctly.
|
The feature works as intended. I'm not sure why you need to modify it if it's working correctly. |
I mean the I'm just trying to figure it out so that I can modify it without unexpected problems. |
Mod 2.4.0 explicitly says it only works on game 1.20.6-1.21.x but you're on 1.20.4. |
It updated it two days ago (API version), In theory, in the new version, it is not possible to work as expected. You might as well test it. Maybe in the update two days ago, the author forgot to change the version number. It still 2.4.0. |
Other bugs about the magnet feature
|
- magnet flag can turn on, on non-container block. - magnet feature behavior is incorrect with mult container. - magnet feature behavior is incorrect with furnace-like. - droptransfer feature can bind with non-container block. - droptransfer feature cleared item when bind a non-container block. - droptransfer feature can nested shulker box.
A pull request is created. |
LWC Version (/lwc admin version):
Server version (/version):
Short five word summary of issue:
magnet work behavior not as expected.
Detailed description of problem:
Dropped items for multiple nearby containers with the magnet flag turned on always try to deposit into one of them, even if that container is full and the others are empty.
To reproduce this.
/cmagnet on
to turn on magnet flag for this 2 blocks.This doesn't match my expected behaviour, so should this be a bug or is it a deliberate?
I'm trying to modify this part of the code, but I'm having some problems.Would you mind helping me if it's not too much trouble?
My English is not very good, some sentences may be problematic, I use translation software, forgive me!
Thanks!
The text was updated successfully, but these errors were encountered: