Only add things to smart item laser relay whitelist when they aren't on it yet

This commit is contained in:
Ellpeck 2016-06-10 17:53:11 +02:00
parent a26db02ebe
commit 1b40bd3568
2 changed files with 23 additions and 32 deletions

View file

@ -233,17 +233,6 @@ public class TileEntityLaserRelayItemWhitelist extends TileEntityLaserRelayItem
int slotStart = output ? 12 : 0;
int slotStop = slotStart+12;
for(int i = slotStart; i < slotStop; i++){
if(this.slots[i] != null){
if(this.slots[i].getItem() instanceof ItemFilter){
ItemDrill.writeSlotsToNBT(new ItemStack[ContainerFilter.SLOT_AMOUNT], this.slots[i]);
}
else{
this.slots[i] = null;
}
}
}
List<IItemHandler> handlers = this.getAllHandlersAround();
for(IItemHandler handler : handlers){
for(int i = 0; i < handler.getSlots(); i++){
@ -252,6 +241,7 @@ public class TileEntityLaserRelayItemWhitelist extends TileEntityLaserRelayItem
ItemStack copy = stack.copy();
copy.stackSize = 1;
if(!checkFilter(copy, true, this.slots, slotStart, slotStop)){
for(int k = slotStart; k < slotStop; k++){
if(this.slots[k] != null){
if(this.slots[k].getItem() instanceof ItemFilter){
@ -284,6 +274,7 @@ public class TileEntityLaserRelayItemWhitelist extends TileEntityLaserRelayItem
}
}
}
}
@Override
public void updateEntity(){

View file

@ -543,7 +543,7 @@ info.actuallyadditions.gui.coffee=Coffee
info.actuallyadditions.gui.ok=Ok
info.actuallyadditions.gui.the=the
info.actuallyadditions.gui.smart=Smart Whitelist
info.actuallyadditions.gui.smartInfo=When pressing this, all items from inventories adjacent to this relay will be added to this part of the white- or blacklist. Adding Item Filters to the list before will cause them to also be filled. Caution: Non-Item Filters previously added to the list will be removed and Item Filters will be cleared!
info.actuallyadditions.gui.smartInfo=When pressing this, all items from inventories adjacent to this relay will be added to this part of the white- or blacklist. Adding Item Filters to the list before will cause them to also be filled.
info.actuallyadditions.inputter.info.1=This is the first Slot in the connected Inventory to <p> at.
info.actuallyadditions.inputter.info.2=This is the slot after the last Slot in the connected Inventory to <p> at. What that means: If you, for example, write 2 in the field to the left and 5 in this one, it will <p> at Slot 2, 3, and 4.
info.actuallyadditions.inputter.whitelistInfo=When pressing this, this side's whitelist mode will be changed. To let all items through, an empty blacklist can be used, to let no items through, an empty whitelist can be used. To configure certain items, place them or configured Item Filters in the slots.