Grid filter change: max 9 items per grid filter, but 4 slots in grid instead
@@ -60,7 +60,9 @@ public class ContainerGrid extends ContainerBase {
|
||||
addSlotToContainer(new SlotOutput(((TileGrid) grid).getPatterns(), 1, 152, 132));
|
||||
}
|
||||
|
||||
addSlotToContainer(new SlotItemHandler(grid.getFilter(), 0, 204, 6));
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
addSlotToContainer(new SlotItemHandler(grid.getFilter(), i, 204, 6 + (18 * i)));
|
||||
}
|
||||
}
|
||||
|
||||
public IGrid getGrid() {
|
||||
|
||||
@@ -14,21 +14,11 @@ public class ContainerGridFilter extends ContainerBase {
|
||||
|
||||
this.filter = new ItemHandlerGridFilter(stack);
|
||||
|
||||
int x = 8;
|
||||
int y = 20;
|
||||
|
||||
for (int i = 0; i < 9 * 3; ++i) {
|
||||
addSlotToContainer(new SlotSpecimen(filter, i, x, y));
|
||||
|
||||
if ((i + 1) % 9 == 0) {
|
||||
y += 18;
|
||||
x = 8;
|
||||
} else {
|
||||
x += 18;
|
||||
}
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
addSlotToContainer(new SlotSpecimen(filter, i, 8 + (i * 18), 20));
|
||||
}
|
||||
|
||||
addPlayerInventory(8, 91);
|
||||
addPlayerInventory(8, 61);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -40,8 +30,8 @@ public class ContainerGridFilter extends ContainerBase {
|
||||
if (slot != null && slot.getHasStack()) {
|
||||
stack = slot.getStack();
|
||||
|
||||
if (index > (9 * 3) - 1) {
|
||||
return mergeItemStackToSpecimen(stack, 0, 9 * 3);
|
||||
if (index > 9 - 1) {
|
||||
return mergeItemStackToSpecimen(stack, 0, 9);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -4,7 +4,7 @@ import refinedstorage.container.ContainerGridFilter;
|
||||
|
||||
public class GuiGridFilter extends GuiBase {
|
||||
public GuiGridFilter(ContainerGridFilter container) {
|
||||
super(container, 176, 183);
|
||||
super(container, 176, 148);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -25,6 +25,6 @@ public class GuiGridFilter extends GuiBase {
|
||||
@Override
|
||||
public void drawForeground(int mouseX, int mouseY) {
|
||||
drawString(7, 7, t("gui.refinedstorage:grid_filter"));
|
||||
drawString(7, 79, t("container.inventory"));
|
||||
drawString(7, 55, t("container.inventory"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ public class ItemHandlerGridFilter extends ItemStackHandler {
|
||||
private ItemStack stack;
|
||||
|
||||
public ItemHandlerGridFilter(ItemStack stack) {
|
||||
super(9 * 3);
|
||||
super(9);
|
||||
|
||||
this.stack = stack;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ public class ItemHandlerGridFilterInGrid extends ItemHandlerBasic {
|
||||
private List<ItemStack> filteredItems;
|
||||
|
||||
public ItemHandlerGridFilterInGrid(List<ItemStack> filteredItems) {
|
||||
super(1, new ItemValidatorBasic(RefinedStorageItems.GRID_FILTER));
|
||||
super(4, new ItemValidatorBasic(RefinedStorageItems.GRID_FILTER));
|
||||
|
||||
this.filteredItems = filteredItems;
|
||||
}
|
||||
@@ -20,7 +20,8 @@ public class ItemHandlerGridFilterInGrid extends ItemHandlerBasic {
|
||||
|
||||
filteredItems.clear();
|
||||
|
||||
ItemStack stack = getStackInSlot(slot);
|
||||
for (int i = 0; i < getSlots(); ++i) {
|
||||
ItemStack stack = getStackInSlot(i);
|
||||
|
||||
if (stack != null) {
|
||||
ItemHandlerGridFilter items = new ItemHandlerGridFilter(stack);
|
||||
@@ -32,4 +33,5 @@ public class ItemHandlerGridFilterInGrid extends ItemHandlerBasic {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,10 +163,12 @@ public abstract class TileBase extends TileEntity implements ITickable {
|
||||
|
||||
ItemStack stack = ItemStack.loadItemStackFromNBT(tagList.getCompoundTagAt(i));
|
||||
|
||||
if (slot >= 0 && slot < handler.getSlots()) {
|
||||
handler.insertItem(slot, stack, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void writeItemsLegacy(IInventory inventory, int id, NBTTagCompound nbt) {
|
||||
NBTTagList tagList = new NBTTagList();
|
||||
|
||||
@@ -45,7 +45,7 @@ public class WirelessGrid implements IGrid {
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
TileBase.writeItems(this, 0, stack.getTagCompound());
|
||||
TileBase.writeItems(this, slot, stack.getTagCompound());
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -64,7 +64,9 @@ public class WirelessGrid implements IGrid {
|
||||
this.searchBoxMode = ItemWirelessGrid.getSearchBoxMode(stack);
|
||||
|
||||
if (stack.hasTagCompound()) {
|
||||
TileBase.readItems(filter, 0, stack.getTagCompound());
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
TileBase.readItems(filter, i, stack.getTagCompound());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.7 KiB |