Bug Inventory?


Bug Inventory ?



Yes its a bug. Because a chest inventory is a Grid inventory you can actually use a function for setting slots that dont require you to query every slot.

int x = 0;
int y = 0;
ItemStack stack;
GridInventory inventory = (GridInventory) chest.getInventory();
inventory.set(x, y, stack);

That should fix the bug your having and neaten your code

Grid inventory = https://github.com/SpongePowered/SpongeAPI/blob/stable-7/src/main/java/org/spongepowered/api/item/inventory/type/GridInventory.java


Le bug sera résolu quand ?

Google trad:
The bug will be solved when?

J’ai l’impression de pas avoir le bug avec ce code:
Google trad:
I have the impression of not having the bug with this code:

                                int i = 0;
                                for(Inventory inventory : chest.getInventory().slots()) {
                                    if(inventorySav.containsKey(i)) {


I am not a developer for sponge, im just a developer of plugins that run on sponge.

If you want the bug fixed then report it to Sponges github issues page