mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 16:58:34 +01:00
Only add things to smart item laser relay whitelist when they aren't on it yet
This commit is contained in:
parent
a26db02ebe
commit
1b40bd3568
2 changed files with 23 additions and 32 deletions
|
@ -233,17 +233,6 @@ public class TileEntityLaserRelayItemWhitelist extends TileEntityLaserRelayItem
|
||||||
int slotStart = output ? 12 : 0;
|
int slotStart = output ? 12 : 0;
|
||||||
int slotStop = slotStart+12;
|
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();
|
List<IItemHandler> handlers = this.getAllHandlersAround();
|
||||||
for(IItemHandler handler : handlers){
|
for(IItemHandler handler : handlers){
|
||||||
for(int i = 0; i < handler.getSlots(); i++){
|
for(int i = 0; i < handler.getSlots(); i++){
|
||||||
|
@ -252,32 +241,34 @@ public class TileEntityLaserRelayItemWhitelist extends TileEntityLaserRelayItem
|
||||||
ItemStack copy = stack.copy();
|
ItemStack copy = stack.copy();
|
||||||
copy.stackSize = 1;
|
copy.stackSize = 1;
|
||||||
|
|
||||||
for(int k = slotStart; k < slotStop; k++){
|
if(!checkFilter(copy, true, this.slots, slotStart, slotStop)){
|
||||||
if(this.slots[k] != null){
|
for(int k = slotStart; k < slotStop; k++){
|
||||||
if(this.slots[k].getItem() instanceof ItemFilter){
|
if(this.slots[k] != null){
|
||||||
ItemStack[] filterSlots = new ItemStack[ContainerFilter.SLOT_AMOUNT];
|
if(this.slots[k].getItem() instanceof ItemFilter){
|
||||||
ItemDrill.loadSlotsFromNBT(filterSlots, this.slots[k]);
|
ItemStack[] filterSlots = new ItemStack[ContainerFilter.SLOT_AMOUNT];
|
||||||
|
ItemDrill.loadSlotsFromNBT(filterSlots, this.slots[k]);
|
||||||
|
|
||||||
boolean did = false;
|
boolean did = false;
|
||||||
if(filterSlots != null && filterSlots.length > 0){
|
if(filterSlots != null && filterSlots.length > 0){
|
||||||
for(int j = 0; j < filterSlots.length; j++){
|
for(int j = 0; j < filterSlots.length; j++){
|
||||||
if(filterSlots[j] == null || filterSlots[j].stackSize <= 0){
|
if(filterSlots[j] == null || filterSlots[j].stackSize <= 0){
|
||||||
filterSlots[j] = copy;
|
filterSlots[j] = copy;
|
||||||
did = true;
|
did = true;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(did){
|
if(did){
|
||||||
ItemDrill.writeSlotsToNBT(filterSlots, this.slots[k]);
|
ItemDrill.writeSlotsToNBT(filterSlots, this.slots[k]);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
else{
|
||||||
else{
|
this.slots[k] = copy;
|
||||||
this.slots[k] = copy;
|
break;
|
||||||
break;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -543,7 +543,7 @@ info.actuallyadditions.gui.coffee=Coffee
|
||||||
info.actuallyadditions.gui.ok=Ok
|
info.actuallyadditions.gui.ok=Ok
|
||||||
info.actuallyadditions.gui.the=the
|
info.actuallyadditions.gui.the=the
|
||||||
info.actuallyadditions.gui.smart=Smart Whitelist
|
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.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.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.
|
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.
|
||||||
|
|
Loading…
Reference in a new issue