Engineer's Decor

Engineer's Decor

19M Downloads

factory hopper duping items

pmytilin1984 opened this issue ยท 7 comments

commented

i can reliably dupe charcoal, possibly other items, version 1.1.18 (playing on enigmatica 6 expert)
2022-07-29 20-01-45.webm
)

commented

Hi, pmy, thanks for the hint - Let me take a look at this. Cheers,-

commented
commented

Made some tests, I may need to take Sveid onboard for help, it looks like compat issue between the two mods. I can't reproduce the problem e.g. with a minecart.

commented

Insertion Code:

// Entity insertion check
if(ih == null) ih = inventory_entity_handler(facing_pos);
if(ih == null) { delay_timer_ = TICK_INTERVAL+2; return false; } // no reason to recalculate this all the time if there is nowhere to insert.
// Handler insertion
{
ItemStack insert_stack = current_stack.copy();
if(insert_stack.getCount() > transfer_count_) insert_stack.setCount(transfer_count_);
final int initial_insert_stack_size = insert_stack.getCount();
if((ih == null) || ih.getSlots() <= 0) return false;
// First stack comletion insert run.
for(int i=0; i<ih.getSlots(); ++i) {
final ItemStack target_stack = ih.getStackInSlot(i);
if(Inventories.areItemStacksDifferent(target_stack, insert_stack)) continue;
insert_stack = ih.insertItem(i, insert_stack.copy(), false);
if(insert_stack.isEmpty()) break;
}
// First-available insert run.
if(!insert_stack.isEmpty()) {
for(int i=0; i<ih.getSlots(); ++i) {
insert_stack = ih.insertItem(i, insert_stack.copy(), false);
if(insert_stack.isEmpty()) break;
}
}
final int num_inserted = initial_insert_stack_size-insert_stack.getCount();
if(num_inserted > 0) {
current_stack.shrink(num_inserted);
stacks_.set(current_slot_index_, current_stack);
}
if(!insert_stack.isEmpty()) current_slot_index_ = next_slot(current_slot_index_);
return (num_inserted > 0);
}
}

commented

Alright, sorted out, engineersdecor-1.16.5-forge-1.1.19 is in the approval process on Curse. Cheers,-