Grid filter change: max 9 items per grid filter, but 4 slots in grid instead

This commit is contained in:
Raoul Van den Berge
2016-08-02 23:00:43 +02:00
parent 1e286447c7
commit 2d725cf4ab
11 changed files with 27 additions and 29 deletions

View File

@@ -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() {

View File

@@ -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;

View File

@@ -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"));
}
}

View File

@@ -9,7 +9,7 @@ public class ItemHandlerGridFilter extends ItemStackHandler {
private ItemStack stack;
public ItemHandlerGridFilter(ItemStack stack) {
super(9 * 3);
super(9);
this.stack = stack;

View File

@@ -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 {
}
}
}
}
}

View File

@@ -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();

View File

@@ -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());
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB