diff --git a/CHANGELOG.md b/CHANGELOG.md index c059607f9..f5f41fe75 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Refined Storage Changelog +### 1.5.6 +- Removed Processing Pattern Encoder, that functionality is now available in the Pattern Grid (raoulvdberge) + ### 1.5.5 - Updated Forge to 2363 (raoulvdberge) diff --git a/src/main/java/com/raoulvdberge/refinedstorage/RSBlocks.java b/src/main/java/com/raoulvdberge/refinedstorage/RSBlocks.java index 92b319f96..8760fcab1 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/RSBlocks.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/RSBlocks.java @@ -21,7 +21,6 @@ public final class RSBlocks { public static final BlockCraftingMonitor CRAFTING_MONITOR = new BlockCraftingMonitor(); public static final BlockWirelessTransmitter WIRELESS_TRANSMITTER = new BlockWirelessTransmitter(); public static final BlockCrafter CRAFTER = new BlockCrafter(); - public static final BlockProcessingPatternEncoder PROCESSING_PATTERN_ENCODER = new BlockProcessingPatternEncoder(); public static final BlockNetworkTransmitter NETWORK_TRANSMITTER = new BlockNetworkTransmitter(); public static final BlockNetworkReceiver NETWORK_RECEIVER = new BlockNetworkReceiver(); public static final BlockFluidInterface FLUID_INTERFACE = new BlockFluidInterface(); diff --git a/src/main/java/com/raoulvdberge/refinedstorage/RSGui.java b/src/main/java/com/raoulvdberge/refinedstorage/RSGui.java index 2fcceca62..db74cba92 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/RSGui.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/RSGui.java @@ -17,16 +17,15 @@ public final class RSGui { public static final int CRAFTING_MONITOR = 13; public static final int WIRELESS_TRANSMITTER = 14; public static final int CRAFTER = 15; - public static final int PROCESSING_PATTERN_ENCODER = 16; - public static final int FILTER = 17; - public static final int NETWORK_TRANSMITTER = 18; - public static final int FLUID_INTERFACE = 19; - public static final int EXTERNAL_STORAGE = 20; - public static final int FLUID_STORAGE = 21; - public static final int DISK_MANIPULATOR = 22; - public static final int WIRELESS_CRAFTING_MONITOR = 23; - public static final int READER_WRITER = 24; - public static final int SECURITY_MANAGER = 25; - public static final int STORAGE_MONITOR = 26; - public static final int PORTABLE_GRID = 27; + public static final int FILTER = 16; + public static final int NETWORK_TRANSMITTER = 17; + public static final int FLUID_INTERFACE = 18; + public static final int EXTERNAL_STORAGE = 19; + public static final int FLUID_STORAGE = 20; + public static final int DISK_MANIPULATOR = 21; + public static final int WIRELESS_CRAFTING_MONITOR = 22; + public static final int READER_WRITER = 23; + public static final int SECURITY_MANAGER = 24; + public static final int STORAGE_MONITOR = 25; + public static final int PORTABLE_GRID = 26; } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeGrid.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeGrid.java index 63f08562d..e6282cc18 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeGrid.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeGrid.java @@ -9,6 +9,7 @@ import com.raoulvdberge.refinedstorage.api.util.IComparer; import com.raoulvdberge.refinedstorage.apiimpl.API; import com.raoulvdberge.refinedstorage.block.BlockGrid; import com.raoulvdberge.refinedstorage.block.GridType; +import com.raoulvdberge.refinedstorage.container.ContainerGrid; import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBase; import com.raoulvdberge.refinedstorage.inventory.ItemHandlerFilter; import com.raoulvdberge.refinedstorage.inventory.ItemHandlerListenerNetworkNode; @@ -48,6 +49,8 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid { public static final String NBT_OREDICT_PATTERN = "OredictPattern"; public static final String NBT_TAB_SELECTED = "TabSelected"; public static final String NBT_SIZE = "Size"; + public static final String NBT_PROCESSING_PATTERN = "ProcessingPattern"; + public static final String NBT_BLOCKING_PATTERN = "BlockingPattern"; public static final int SORTING_DIRECTION_ASCENDING = 0; public static final int SORTING_DIRECTION_DESCENDING = 1; @@ -83,6 +86,7 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid { }; private InventoryCrafting matrix = new InventoryCrafting(craftingContainer, 3, 3); private InventoryCraftResult result = new InventoryCraftResult(); + private ItemHandlerBase matrixProcessing = new ItemHandlerBase(9 * 2, new ItemHandlerListenerNetworkNode(this)); private ItemHandlerBase patterns = new ItemHandlerBase(2, new ItemHandlerListenerNetworkNode(this), new ItemValidatorBasic(RSItems.PATTERN)); private List filters = new ArrayList<>(); @@ -100,6 +104,8 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid { private int tabSelected = -1; private boolean oredictPattern = false; + private boolean processingPattern = false; + private boolean blockingPattern = false; public NetworkNodeGrid(World world, BlockPos pos) { super(world, pos); @@ -153,6 +159,22 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid { this.oredictPattern = oredictPattern; } + public boolean isProcessingPattern() { + return world.isRemote ? TileGrid.PROCESSING_PATTERN.getValue() : processingPattern; + } + + public void setProcessingPattern(boolean processingPattern) { + this.processingPattern = processingPattern; + } + + public boolean isBlockingPattern() { + return blockingPattern; + } + + public void setBlockingPattern(boolean blockingPattern) { + this.blockingPattern = blockingPattern; + } + public GridType getType() { if (type == null && world.getBlockState(pos).getBlock() == RSBlocks.GRID) { type = (GridType) world.getBlockState(pos).getValue(BlockGrid.TYPE); @@ -205,6 +227,10 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid { return result; } + public ItemHandlerBase getProcessingMatrix() { + return matrixProcessing; + } + @Override public void onCraftingMatrixChanged() { result.setInventorySlotContents(0, CraftingManager.findMatchingResult(matrix, world)); @@ -296,6 +322,20 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid { } } + public void onPatternMatrixClear() { + for (int i = 0; i < matrixProcessing.getSlots(); ++i) { + matrixProcessing.setStackInSlot(i, ItemStack.EMPTY); + } + + for (int i = 0; i < matrix.getSizeInventory(); ++i) { + matrix.setInventorySlotContents(i, ItemStack.EMPTY); + } + + world.getMinecraftServer().getPlayerList().getPlayers().stream() + .filter(player -> player.openContainer instanceof ContainerGrid && ((ContainerGrid) player.openContainer).getTile() != null && ((ContainerGrid) player.openContainer).getTile().getPos().equals(pos)) + .forEach(player -> player.openContainer.detectAndSendChanges()); + } + @Override public void onClosed(EntityPlayer player) { // NO OP @@ -372,13 +412,29 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid { ItemStack pattern = new ItemStack(RSItems.PATTERN); + if (processingPattern) { + ItemPattern.setBlocking(pattern, blockingPattern); + } + ItemPattern.setOredict(pattern, oredictPattern); - for (int i = 0; i < 9; ++i) { - ItemStack ingredient = matrix.getStackInSlot(i); + if (processingPattern) { + for (int i = 0; i < 18; ++i) { + if (!matrixProcessing.getStackInSlot(i).isEmpty()) { + if (i >= 9) { + ItemPattern.addOutput(pattern, matrixProcessing.getStackInSlot(i)); + } else { + ItemPattern.setSlot(pattern, i, matrixProcessing.getStackInSlot(i)); + } + } + } + } else { + for (int i = 0; i < 9; ++i) { + ItemStack ingredient = matrix.getStackInSlot(i); - if (!ingredient.isEmpty()) { - ItemPattern.setSlot(pattern, i, ingredient); + if (!ingredient.isEmpty()) { + ItemPattern.setSlot(pattern, i, ingredient); + } } } @@ -387,7 +443,30 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid { } public boolean canCreatePattern() { - return !result.getStackInSlot(0).isEmpty() && patterns.getStackInSlot(1).isEmpty() && !patterns.getStackInSlot(0).isEmpty(); + if (patterns.getStackInSlot(0).isEmpty() || !patterns.getStackInSlot(1).isEmpty()) { + return false; + } + + if (isProcessingPattern()) { + int inputsFilled = 0; + int outputsFilled = 0; + + for (int i = 0; i < 9; ++i) { + if (!matrixProcessing.getStackInSlot(i).isEmpty()) { + inputsFilled++; + } + } + + for (int i = 9; i < 18; ++i) { + if (!matrixProcessing.getStackInSlot(i).isEmpty()) { + outputsFilled++; + } + } + + return inputsFilled > 0 && outputsFilled > 0; + } else { + return !result.getStackInSlot(0).isEmpty(); + } } @Override @@ -467,6 +546,7 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid { RSUtils.readItemsLegacy(matrix, 0, tag); RSUtils.readItems(patterns, 1, tag); RSUtils.readItems(filter, 2, tag); + RSUtils.readItems(matrixProcessing, 3, tag); if (tag.hasKey(NBT_TAB_SELECTED)) { tabSelected = tag.getInteger(NBT_TAB_SELECTED); @@ -485,6 +565,7 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid { RSUtils.writeItemsLegacy(matrix, 0, tag); RSUtils.writeItems(patterns, 1, tag); RSUtils.writeItems(filter, 2, tag); + RSUtils.writeItems(matrixProcessing, 3, tag); tag.setInteger(NBT_TAB_SELECTED, tabSelected); @@ -502,6 +583,8 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid { tag.setInteger(NBT_SIZE, size); tag.setBoolean(NBT_OREDICT_PATTERN, oredictPattern); + tag.setBoolean(NBT_PROCESSING_PATTERN, processingPattern); + tag.setBoolean(NBT_BLOCKING_PATTERN, blockingPattern); return tag; } @@ -533,6 +616,14 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid { if (tag.hasKey(NBT_OREDICT_PATTERN)) { oredictPattern = tag.getBoolean(NBT_OREDICT_PATTERN); } + + if (tag.hasKey(NBT_PROCESSING_PATTERN)) { + processingPattern = tag.getBoolean(NBT_PROCESSING_PATTERN); + } + + if (tag.hasKey(NBT_BLOCKING_PATTERN)) { + blockingPattern = tag.getBoolean(NBT_BLOCKING_PATTERN); + } } @Override diff --git a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockProcessingPatternEncoder.java b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockProcessingPatternEncoder.java deleted file mode 100755 index 1e967b76d..000000000 --- a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockProcessingPatternEncoder.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.raoulvdberge.refinedstorage.block; - -import com.raoulvdberge.refinedstorage.RS; -import com.raoulvdberge.refinedstorage.RSGui; -import com.raoulvdberge.refinedstorage.tile.TileProcessingPatternEncoder; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.resources.I18n; -import net.minecraft.client.util.ITooltipFlag; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumHand; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.text.TextFormatting; -import net.minecraft.world.World; - -import javax.annotation.Nullable; -import java.util.List; - -public class BlockProcessingPatternEncoder extends BlockBase { - public BlockProcessingPatternEncoder() { - super("processing_pattern_encoder"); - } - - @Override - public void addInformation(ItemStack stack, @Nullable World world, List tooltip, ITooltipFlag flag) { - super.addInformation(stack, world, tooltip, flag); - - tooltip.add(I18n.format("block.refinedstorage:processing_pattern_encoder.tooltip.0")); - tooltip.add(I18n.format("block.refinedstorage:processing_pattern_encoder.tooltip.1", TextFormatting.WHITE + I18n.format("block.refinedstorage:grid.2.name") + TextFormatting.GRAY)); - } - - @Override - public boolean hasTileEntity(IBlockState state) { - return true; - } - - @Override - public TileEntity createTileEntity(World world, IBlockState state) { - return new TileProcessingPatternEncoder(); - } - - @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { - if (!world.isRemote) { - player.openGui(RS.INSTANCE, RSGui.PROCESSING_PATTERN_ENCODER, world, pos.getX(), pos.getY(), pos.getZ()); - } - - return true; - } - - @Override - @Nullable - public Direction getDirection() { - return null; - } -} diff --git a/src/main/java/com/raoulvdberge/refinedstorage/container/ContainerGrid.java b/src/main/java/com/raoulvdberge/refinedstorage/container/ContainerGrid.java index bd5032996..203fe8b9d 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/container/ContainerGrid.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/container/ContainerGrid.java @@ -60,8 +60,8 @@ public class ContainerGrid extends ContainerBase { } if (grid.getType() == GridType.PATTERN) { - addSlotToContainer(new SlotItemHandler(((NetworkNodeGrid) grid).getPatterns(), 0, 152, headerAndSlots + 4)); - addSlotToContainer(new SlotOutput(((NetworkNodeGrid) grid).getPatterns(), 1, 152, headerAndSlots + 40)); + addSlotToContainer(new SlotItemHandler(((NetworkNodeGrid) grid).getPatterns(), 0, 172, headerAndSlots + 4)); + addSlotToContainer(new SlotOutput(((NetworkNodeGrid) grid).getPatterns(), 1, 172, headerAndSlots + 40)); } if (grid instanceof IPortableGrid) { @@ -87,21 +87,44 @@ public class ContainerGrid extends ContainerBase { addSlotToContainer(craftingResultSlot = new SlotGridCraftingResult(this, getPlayer(), grid, 0, 130 + 4, headerAndSlots + 22)); } else if (grid.getType() == GridType.PATTERN) { - int x = 8; - int y = headerAndSlots + 4; + if (((NetworkNodeGrid) grid).isProcessingPattern()) { + int ox = 8; + int x = ox; + int y = headerAndSlots + 4; - for (int i = 0; i < 9; ++i) { - addSlotToContainer(new SlotFilterLegacy(grid.getCraftingMatrix(), i, x, y)); + for (int i = 0; i < 9 * 2; ++i) { + addSlotToContainer(new SlotFilter(((NetworkNodeGrid) grid).getProcessingMatrix(), i, x, y, SlotFilter.FILTER_ALLOW_SIZE)); - x += 18; + x += 18; - if ((i + 1) % 3 == 0) { - y += 18; - x = 8; + if ((i + 1) % 3 == 0) { + if (i == 8) { + ox = 98; + x = ox; + y = headerAndSlots + 4; + } else { + x = ox; + y += 18; + } + } } - } + } else { + int x = 26; + int y = headerAndSlots + 4; - addSlotToContainer(patternResultSlot = new SlotDisabled(grid.getCraftingResult(), 0, 112 + 4, headerAndSlots + 22)); + for (int i = 0; i < 9; ++i) { + addSlotToContainer(new SlotFilterLegacy(grid.getCraftingMatrix(), i, x, y)); + + x += 18; + + if ((i + 1) % 3 == 0) { + y += 18; + x = 26; + } + } + + addSlotToContainer(patternResultSlot = new SlotDisabled(grid.getCraftingResult(), 0, 134, headerAndSlots + 22)); + } } } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/container/ContainerProcessingPatternEncoder.java b/src/main/java/com/raoulvdberge/refinedstorage/container/ContainerProcessingPatternEncoder.java deleted file mode 100755 index 0ef22e6d7..000000000 --- a/src/main/java/com/raoulvdberge/refinedstorage/container/ContainerProcessingPatternEncoder.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.raoulvdberge.refinedstorage.container; - -import com.raoulvdberge.refinedstorage.container.slot.SlotFilter; -import com.raoulvdberge.refinedstorage.container.slot.SlotOutput; -import com.raoulvdberge.refinedstorage.tile.TileProcessingPatternEncoder; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraftforge.items.SlotItemHandler; - -import java.util.Collection; - -public class ContainerProcessingPatternEncoder extends ContainerBase { - public ContainerProcessingPatternEncoder(TileProcessingPatternEncoder encoder, EntityPlayer player) { - super(encoder, player); - - addSlotToContainer(new SlotItemHandler(encoder.getPatterns(), 0, 152, 18)); - addSlotToContainer(new SlotOutput(encoder.getPatterns(), 1, 152, 58)); - - int ox = 8; - int x = ox; - int y = 20; - - for (int i = 0; i < 9 * 2; ++i) { - addSlotToContainer(new SlotFilter(encoder.getConfiguration(), i, x, y, SlotFilter.FILTER_ALLOW_SIZE)); - - x += 18; - - if ((i + 1) % 3 == 0) { - if (i == 8) { - ox = 90; - x = ox; - y = 20; - } else { - x = ox; - y += 18; - } - } - } - - addPlayerInventory(8, 101); - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer player, int index) { - ItemStack stack = ItemStack.EMPTY; - - Slot slot = getSlot(index); - - if (!(slot instanceof SlotFilter) && slot.getHasStack()) { - stack = slot.getStack(); - - if (index < 2) { - if (!mergeItemStack(stack, 2 + 18, inventorySlots.size(), false)) { - return ItemStack.EMPTY; - } - } else if (!mergeItemStack(stack, 0, 1, false)) { - return ItemStack.EMPTY; - } - - if (stack.getCount() == 0) { - slot.putStack(ItemStack.EMPTY); - } else { - slot.onSlotChanged(); - } - } - - return stack; - } - - public void clearInputsAndOutputs() { - for (int i = 2; i < 2 + (9 * 2); ++i) { - getSlot(i).putStack(ItemStack.EMPTY); - getSlot(i).onSlotChanged(); - } - } - - public void setInputs(Collection stacks) { - setSlots(stacks, 2, 2 + 9); - } - - public void setOutputs(Collection stacks) { - setSlots(stacks, 2 + 9, 2 + 9 * 2); - } - - private void setSlots(Collection stacks, int begin, int end) { - for (ItemStack stack : stacks) { - for (int i = begin; i < end; ++i) { - Slot slot = getSlot(i); - - if (!slot.getHasStack() && slot.isItemValid(stack)) { - slot.putStack(stack); - slot.onSlotChanged(); - - break; - } - } - } - } -} \ No newline at end of file diff --git a/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiHandler.java b/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiHandler.java index 60018f81f..b73105b61 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiHandler.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiHandler.java @@ -62,8 +62,6 @@ public class GuiHandler implements IGuiHandler { return new ContainerWirelessTransmitter((TileWirelessTransmitter) tile, player); case RSGui.CRAFTER: return new ContainerCrafter((TileCrafter) tile, player); - case RSGui.PROCESSING_PATTERN_ENCODER: - return new ContainerProcessingPatternEncoder((TileProcessingPatternEncoder) tile, player); case RSGui.NETWORK_TRANSMITTER: return new ContainerNetworkTransmitter((TileNetworkTransmitter) tile, player); case RSGui.FLUID_INTERFACE: @@ -139,8 +137,6 @@ public class GuiHandler implements IGuiHandler { return new GuiWirelessTransmitter((ContainerWirelessTransmitter) getContainer(ID, player, tile)); case RSGui.CRAFTER: return new GuiCrafter((ContainerCrafter) getContainer(ID, player, tile)); - case RSGui.PROCESSING_PATTERN_ENCODER: - return new GuiProcessingPatternEncoder((ContainerProcessingPatternEncoder) getContainer(ID, player, tile), (TileProcessingPatternEncoder) tile); case RSGui.FILTER: return new GuiFilter(getFilterContainer(player, x)); case RSGui.NETWORK_TRANSMITTER: diff --git a/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiProcessingPatternEncoder.java b/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiProcessingPatternEncoder.java deleted file mode 100755 index 7a9afdb21..000000000 --- a/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiProcessingPatternEncoder.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.raoulvdberge.refinedstorage.gui; - -import com.raoulvdberge.refinedstorage.RS; -import com.raoulvdberge.refinedstorage.container.ContainerProcessingPatternEncoder; -import com.raoulvdberge.refinedstorage.network.MessageGridPatternCreate; -import com.raoulvdberge.refinedstorage.network.MessageProcessingPatternEncoderClear; -import com.raoulvdberge.refinedstorage.tile.TileProcessingPatternEncoder; -import com.raoulvdberge.refinedstorage.tile.data.TileDataManager; -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.resources.I18n; -import net.minecraft.init.SoundEvents; -import net.minecraftforge.fml.client.config.GuiCheckBox; - -import java.io.IOException; - -public class GuiProcessingPatternEncoder extends GuiBase { - private TileProcessingPatternEncoder encoder; - - private GuiCheckBox oredictPattern; - private GuiCheckBox blockingPattern; - - public GuiProcessingPatternEncoder(ContainerProcessingPatternEncoder container, TileProcessingPatternEncoder encoder) { - super(container, 176, 183); - - this.encoder = encoder; - } - - @Override - public void init(int x, int y) { - oredictPattern = addCheckBox(x + 7, y + 76, I18n.format("misc.refinedstorage:oredict"), TileProcessingPatternEncoder.OREDICT_PATTERN.getValue()); - blockingPattern = addCheckBox(x + 60, y + 76, I18n.format("misc.refinedstorage:blocking"), TileProcessingPatternEncoder.BLOCKING_TASK_PATTERN.getValue()); - } - - @Override - public void update(int x, int y) { - } - - private boolean isOverCreatePattern(int mouseX, int mouseY) { - return inBounds(152, 38, 16, 16, mouseX, mouseY) && encoder.canCreatePattern(); - } - - private boolean isOverClear(int mouseX, int mouseY) { - return inBounds(80, 19, 7, 7, mouseX, mouseY); - } - - @Override - public void drawBackground(int x, int y, int mouseX, int mouseY) { - bindTexture("gui/processing_pattern_encoder.png"); - - drawTexture(x, y, 0, 0, screenWidth, screenHeight); - - int ty = 0; - - if (isOverCreatePattern(mouseX - guiLeft, mouseY - guiTop)) { - ty = 1; - } - - if (!encoder.canCreatePattern()) { - ty = 2; - } - - drawTexture(x + 152, y + 38, 178, ty * 16, 16, 16); - } - - @Override - public void drawForeground(int mouseX, int mouseY) { - drawString(7, 7, t("gui.refinedstorage:processing_pattern_encoder")); - drawString(7, 90, t("container.inventory")); - - if (isOverCreatePattern(mouseX, mouseY)) { - drawTooltip(mouseX, mouseY, t("gui.refinedstorage:processing_pattern_encoder.pattern_create")); - } - - if (isOverClear(mouseX, mouseY)) { - drawTooltip(mouseX, mouseY, t("misc.refinedstorage:clear")); - } - } - - @Override - protected void actionPerformed(GuiButton button) throws IOException { - super.actionPerformed(button); - - if (button == oredictPattern) { - TileDataManager.setParameter(TileProcessingPatternEncoder.OREDICT_PATTERN, oredictPattern.isChecked()); - } else if (button == blockingPattern) { - TileDataManager.setParameter(TileProcessingPatternEncoder.BLOCKING_TASK_PATTERN, blockingPattern.isChecked()); - } - } - - @Override - protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { - super.mouseClicked(mouseX, mouseY, mouseButton); - - if (isOverCreatePattern(mouseX - guiLeft, mouseY - guiTop)) { - RS.INSTANCE.network.sendToServer(new MessageGridPatternCreate(encoder.getPos().getX(), encoder.getPos().getY(), encoder.getPos().getZ())); - - mc.getSoundHandler().playSound(PositionedSoundRecord.getMasterRecord(SoundEvents.UI_BUTTON_CLICK, 1.0F)); - } else if (isOverClear(mouseX - guiLeft, mouseY - guiTop)) { - RS.INSTANCE.network.sendToServer(new MessageProcessingPatternEncoderClear(encoder)); - - mc.getSoundHandler().playSound(PositionedSoundRecord.getMasterRecord(SoundEvents.UI_BUTTON_CLICK, 1.0F)); - } - } - - public void updateOredictPattern(boolean checked) { - if (oredictPattern != null) { - oredictPattern.setIsChecked(checked); - } - } - - public void updateBlockingPattern(boolean checked) { - if (blockingPattern != null) { - blockingPattern.setIsChecked(checked); - } - } -} \ No newline at end of file diff --git a/src/main/java/com/raoulvdberge/refinedstorage/gui/grid/GuiGrid.java b/src/main/java/com/raoulvdberge/refinedstorage/gui/grid/GuiGrid.java index b44269cc9..3102a8467 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/gui/grid/GuiGrid.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/gui/grid/GuiGrid.java @@ -66,7 +66,10 @@ public class GuiGrid extends GuiBase implements IGridDisplay { private boolean wasConnected; private GuiTextField searchField; + private GuiCheckBox oredictPattern; + private GuiCheckBox processingPattern; + private GuiCheckBox blockingPattern; private IGrid grid; @@ -144,7 +147,12 @@ public class GuiGrid extends GuiBase implements IGridDisplay { } if (grid.getType() == GridType.PATTERN) { - oredictPattern = addCheckBox(x + 64, y + getTabDelta() + getHeader() + (getVisibleRows() * 18) + 46, t("misc.refinedstorage:oredict"), TileGrid.OREDICT_PATTERN.getValue()); + processingPattern = addCheckBox(x + 7, y + getTabDelta() + getHeader() + (getVisibleRows() * 18) + 60, t("misc.refinedstorage:processing"), TileGrid.PROCESSING_PATTERN.getValue()); + oredictPattern = addCheckBox(processingPattern.x + processingPattern.width + 5, y + getTabDelta() + getHeader() + (getVisibleRows() * 18) + 60, t("misc.refinedstorage:oredict"), TileGrid.OREDICT_PATTERN.getValue()); + + if (((NetworkNodeGrid) grid).isProcessingPattern()) { + blockingPattern = addCheckBox(oredictPattern.x + oredictPattern.width + 5, y + getTabDelta() + getHeader() + (getVisibleRows() * 18) + 60, t("misc.refinedstorage:blocking"), TileGrid.BLOCKING_PATTERN.getValue()); + } } if (grid.getType() != GridType.FLUID && grid.getViewType() != -1) { @@ -250,7 +258,13 @@ public class GuiGrid extends GuiBase implements IGridDisplay { @Override public int getFooter() { - return (grid.getType() == GridType.CRAFTING || grid.getType() == GridType.PATTERN) ? 156 : 99; + if (grid.getType() == GridType.CRAFTING) { + return 156; + } else if (grid.getType() == GridType.PATTERN) { + return 169; + } else { + return 99; + } } @Override @@ -259,8 +273,10 @@ public class GuiGrid extends GuiBase implements IGridDisplay { if (grid.getType() == GridType.NORMAL || grid.getType() == GridType.FLUID) { yp += 16; - } else if (grid.getType() == GridType.CRAFTING || grid.getType() == GridType.PATTERN) { + } else if (grid.getType() == GridType.CRAFTING) { yp += 73; + } else if (grid.getType() == GridType.PATTERN) { + yp += 86; } return yp; @@ -308,14 +324,18 @@ public class GuiGrid extends GuiBase implements IGridDisplay { case CRAFTING: return inBounds(82, y, 7, 7, mouseX, mouseY); case PATTERN: - return inBounds(64, y, 7, 7, mouseX, mouseY); + if (TileGrid.PROCESSING_PATTERN.getValue()) { + return inBounds(154, y, 7, 7, mouseX, mouseY); + } + + return inBounds(82, y, 7, 7, mouseX, mouseY); default: return false; } } private boolean isOverCreatePattern(int mouseX, int mouseY) { - return grid.getType() == GridType.PATTERN && inBounds(152, getTabDelta() + getHeader() + (getVisibleRows() * 18) + 22, 16, 16, mouseX, mouseY) && ((NetworkNodeGrid) grid).canCreatePattern(); + return grid.getType() == GridType.PATTERN && inBounds(172, getTabDelta() + getHeader() + (getVisibleRows() * 18) + 22, 16, 16, mouseX, mouseY) && ((NetworkNodeGrid) grid).canCreatePattern(); } private int getTabDelta() { @@ -379,7 +399,7 @@ public class GuiGrid extends GuiBase implements IGridDisplay { if (grid.getType() == GridType.CRAFTING) { bindTexture("gui/crafting_grid.png"); } else if (grid.getType() == GridType.PATTERN) { - bindTexture("gui/pattern_grid.png"); + bindTexture("gui/pattern_grid" + (((NetworkNodeGrid) grid).isProcessingPattern() ? "_processing" : "") + ".png"); } else if (grid instanceof IPortableGrid) { bindTexture("gui/portable_grid.png"); } else { @@ -421,7 +441,7 @@ public class GuiGrid extends GuiBase implements IGridDisplay { ty = 2; } - drawTexture(x + 152, y + getTabDelta() + getHeader() + (getVisibleRows() * 18) + 22, 240, ty * 16, 16, 16); + drawTexture(x + 172, y + getTabDelta() + getHeader() + (getVisibleRows() * 18) + 22, 240, ty * 16, 16, 16); } if (searchField != null) { @@ -504,6 +524,10 @@ public class GuiGrid extends GuiBase implements IGridDisplay { if (button == oredictPattern) { TileDataManager.setParameter(TileGrid.OREDICT_PATTERN, oredictPattern.isChecked()); + } else if (button == blockingPattern) { + TileDataManager.setParameter(TileGrid.BLOCKING_PATTERN, blockingPattern.isChecked()); + } else if (button == processingPattern) { + TileDataManager.setParameter(TileGrid.PROCESSING_PATTERN, processingPattern.isChecked()); } } @@ -539,7 +563,7 @@ public class GuiGrid extends GuiBase implements IGridDisplay { RS.INSTANCE.network.sendToServer(new MessageGridPatternCreate(gridPos.getX(), gridPos.getY(), gridPos.getZ())); } else if (grid.isActive()) { if (clickedClear) { - RS.INSTANCE.network.sendToServer(new MessageGridCraftingClear()); + RS.INSTANCE.network.sendToServer(new MessageGridClear()); } ItemStack held = ((ContainerGrid) this.inventorySlots).getPlayer().inventory.getItemStack(); @@ -680,4 +704,10 @@ public class GuiGrid extends GuiBase implements IGridDisplay { oredictPattern.setIsChecked(checked); } } + + public void updateBlockingPattern(boolean checked) { + if (blockingPattern != null) { + blockingPattern.setIsChecked(checked); + } + } } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/integration/jei/RSJEIPlugin.java b/src/main/java/com/raoulvdberge/refinedstorage/integration/jei/RSJEIPlugin.java index cd2c057f0..070c94b8b 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/integration/jei/RSJEIPlugin.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/integration/jei/RSJEIPlugin.java @@ -20,8 +20,7 @@ public class RSJEIPlugin implements IModPlugin { public void register(IModRegistry registry) { INSTANCE = this; - registry.getRecipeTransferRegistry().addUniversalRecipeTransferHandler(new RecipeTransferHandlerPattern()); - registry.getRecipeTransferRegistry().addRecipeTransferHandler(new RecipeTransferHandlerGrid(), "minecraft.crafting"); + registry.getRecipeTransferRegistry().addUniversalRecipeTransferHandler(new RecipeTransferHandlerGrid()); registry.getRecipeTransferRegistry().addRecipeTransferHandler(ContainerSolderer.class, RecipeCategorySolderer.ID, 0, 3, 8, 36); registry.handleRecipes(RecipeWrapperSolderer.class, recipe -> recipe, RecipeCategorySolderer.ID); diff --git a/src/main/java/com/raoulvdberge/refinedstorage/integration/jei/RecipeTransferHandlerGrid.java b/src/main/java/com/raoulvdberge/refinedstorage/integration/jei/RecipeTransferHandlerGrid.java index 51bb2d31e..005e99bb6 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/integration/jei/RecipeTransferHandlerGrid.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/integration/jei/RecipeTransferHandlerGrid.java @@ -1,8 +1,12 @@ package com.raoulvdberge.refinedstorage.integration.jei; import com.raoulvdberge.refinedstorage.RS; +import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeGrid; +import com.raoulvdberge.refinedstorage.block.GridType; import com.raoulvdberge.refinedstorage.container.ContainerGrid; -import com.raoulvdberge.refinedstorage.network.MessageGridCraftingTransfer; +import com.raoulvdberge.refinedstorage.network.MessageGridProcessingTransfer; +import com.raoulvdberge.refinedstorage.network.MessageGridTransfer; +import com.raoulvdberge.refinedstorage.tile.grid.IGrid; import mezz.jei.api.gui.IGuiIngredient; import mezz.jei.api.gui.IRecipeLayout; import mezz.jei.api.recipe.transfer.IRecipeTransferError; @@ -15,12 +19,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import java.util.LinkedList; import java.util.List; import java.util.Map; -/** - * @link https://github.com/zerofall/EZStorage/blob/master/src/main/java/com/zerofall/ezstorage/jei/RecipeTransferHandler.java - */ public class RecipeTransferHandlerGrid implements IRecipeTransferHandler { @Override public Class getContainerClass() { @@ -30,35 +32,55 @@ public class RecipeTransferHandlerGrid implements IRecipeTransferHandler { @Override public IRecipeTransferError transferRecipe(Container container, IRecipeLayout recipeLayout, EntityPlayer player, boolean maxTransfer, boolean doTransfer) { if (doTransfer) { - Map> inputs = recipeLayout.getItemStacks().getGuiIngredients(); + IGrid grid = ((ContainerGrid) container).getGrid(); - NBTTagCompound recipe = new NBTTagCompound(); + if (grid.getType() == GridType.PATTERN && ((NetworkNodeGrid) grid).isProcessingPattern()) { + List inputs = new LinkedList<>(); + List outputs = new LinkedList<>(); - for (Slot slot : container.inventorySlots) { - if (slot.inventory instanceof InventoryCrafting) { - IGuiIngredient ingredient = inputs.get(slot.getSlotIndex() + 1); - - if (ingredient != null) { - List possibleItems = ingredient.getAllIngredients(); - - NBTTagList tags = new NBTTagList(); - - for (int i = 0; i < possibleItems.size(); ++i) { - if (i >= 5) { - break; // Max 5 possible items to avoid reaching max network packet size - } - - NBTTagCompound tag = new NBTTagCompound(); - possibleItems.get(i).writeToNBT(tag); - tags.appendTag(tag); + for (IGuiIngredient guiIngredient : recipeLayout.getItemStacks().getGuiIngredients().values()) { + if (guiIngredient != null && guiIngredient.getDisplayedIngredient() != null) { + ItemStack ingredient = guiIngredient.getDisplayedIngredient().copy(); + if (guiIngredient.isInput()) { + inputs.add(ingredient); + } else { + outputs.add(ingredient); } - - recipe.setTag("#" + slot.getSlotIndex(), tags); } } - } - RS.INSTANCE.network.sendToServer(new MessageGridCraftingTransfer(recipe)); + RS.INSTANCE.network.sendToServer(new MessageGridProcessingTransfer(inputs, outputs)); + } else { + Map> inputs = recipeLayout.getItemStacks().getGuiIngredients(); + + NBTTagCompound recipe = new NBTTagCompound(); + + for (Slot slot : container.inventorySlots) { + if (slot.inventory instanceof InventoryCrafting) { + IGuiIngredient ingredient = inputs.get(slot.getSlotIndex() + 1); + + if (ingredient != null) { + List possibleItems = ingredient.getAllIngredients(); + + NBTTagList tags = new NBTTagList(); + + for (int i = 0; i < possibleItems.size(); ++i) { + if (i >= 5) { + break; // Max 5 possible items to avoid reaching max network packet size + } + + NBTTagCompound tag = new NBTTagCompound(); + possibleItems.get(i).writeToNBT(tag); + tags.appendTag(tag); + } + + recipe.setTag("#" + slot.getSlotIndex(), tags); + } + } + } + + RS.INSTANCE.network.sendToServer(new MessageGridTransfer(recipe)); + } } return null; diff --git a/src/main/java/com/raoulvdberge/refinedstorage/integration/jei/RecipeTransferHandlerPattern.java b/src/main/java/com/raoulvdberge/refinedstorage/integration/jei/RecipeTransferHandlerPattern.java deleted file mode 100755 index c805c0263..000000000 --- a/src/main/java/com/raoulvdberge/refinedstorage/integration/jei/RecipeTransferHandlerPattern.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.raoulvdberge.refinedstorage.integration.jei; - -import com.raoulvdberge.refinedstorage.RS; -import com.raoulvdberge.refinedstorage.container.ContainerProcessingPatternEncoder; -import com.raoulvdberge.refinedstorage.network.MessageProcessingPatternEncoderTransfer; -import mezz.jei.api.gui.IGuiIngredient; -import mezz.jei.api.gui.IRecipeLayout; -import mezz.jei.api.recipe.transfer.IRecipeTransferError; -import mezz.jei.api.recipe.transfer.IRecipeTransferHandler; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -import javax.annotation.Nullable; -import java.util.LinkedList; -import java.util.List; - -public class RecipeTransferHandlerPattern implements IRecipeTransferHandler { - @Override - public Class getContainerClass() { - return ContainerProcessingPatternEncoder.class; - } - - @Nullable - @Override - public IRecipeTransferError transferRecipe(ContainerProcessingPatternEncoder container, IRecipeLayout recipeLayout, EntityPlayer player, boolean maxTransfer, boolean doTransfer) { - if (doTransfer) { - List inputs = new LinkedList<>(); - List outputs = new LinkedList<>(); - - for (IGuiIngredient guiIngredient : recipeLayout.getItemStacks().getGuiIngredients().values()) { - if (guiIngredient != null && guiIngredient.getDisplayedIngredient() != null) { - ItemStack ingredient = guiIngredient.getDisplayedIngredient().copy(); - if (guiIngredient.isInput()) { - inputs.add(ingredient); - } else { - outputs.add(ingredient); - } - } - } - - RS.INSTANCE.network.sendToServer(new MessageProcessingPatternEncoderTransfer(inputs, outputs)); - } - - return null; - } -} diff --git a/src/main/java/com/raoulvdberge/refinedstorage/network/MessageGridCraftingClear.java b/src/main/java/com/raoulvdberge/refinedstorage/network/MessageGridClear.java old mode 100755 new mode 100644 similarity index 80% rename from src/main/java/com/raoulvdberge/refinedstorage/network/MessageGridCraftingClear.java rename to src/main/java/com/raoulvdberge/refinedstorage/network/MessageGridClear.java index cc8a89989..f6245e7c9 --- a/src/main/java/com/raoulvdberge/refinedstorage/network/MessageGridCraftingClear.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/network/MessageGridClear.java @@ -2,6 +2,7 @@ package com.raoulvdberge.refinedstorage.network; import com.raoulvdberge.refinedstorage.RSUtils; import com.raoulvdberge.refinedstorage.api.network.security.Permission; +import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeGrid; import com.raoulvdberge.refinedstorage.block.GridType; import com.raoulvdberge.refinedstorage.container.ContainerGrid; import com.raoulvdberge.refinedstorage.tile.grid.IGrid; @@ -12,8 +13,8 @@ import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; -public class MessageGridCraftingClear extends MessageHandlerPlayerToServer implements IMessage { - public MessageGridCraftingClear() { +public class MessageGridClear extends MessageHandlerPlayerToServer implements IMessage { + public MessageGridClear() { } @Override @@ -27,7 +28,7 @@ public class MessageGridCraftingClear extends MessageHandlerPlayerToServer implements IMessage { + private Collection inputs; + private Collection outputs; + + public MessageGridProcessingTransfer() { + } + + public MessageGridProcessingTransfer(Collection inputs, Collection outputs) { + this.inputs = inputs; + this.outputs = outputs; + } + + @Override + public void fromBytes(ByteBuf buf) { + int size = buf.readInt(); + + this.inputs = new ArrayList<>(size); + + for (int i = 0; i < size; i++) { + this.inputs.add(RSUtils.readItemStack(buf)); + } + + size = buf.readInt(); + + this.outputs = new ArrayList<>(size); + + for (int i = 0; i < size; i++) { + this.outputs.add(RSUtils.readItemStack(buf)); + } + } + + @Override + public void toBytes(ByteBuf buf) { + buf.writeInt(inputs.size()); + + for (ItemStack stack : inputs) { + RSUtils.writeItemStack(buf, stack); + } + + buf.writeInt(outputs.size()); + + for (ItemStack stack : outputs) { + RSUtils.writeItemStack(buf, stack); + } + } + + @Override + public void handle(MessageGridProcessingTransfer message, EntityPlayerMP player) { + if (player.openContainer instanceof ContainerGrid) { + IGrid grid = ((ContainerGrid) player.openContainer).getGrid(); + + if (grid.getType() == GridType.PATTERN) { + ItemHandlerBase handler = ((NetworkNodeGrid) grid).getProcessingMatrix(); + + clearInputsAndOutputs(handler); + + setInputs(handler, message.inputs); + setOutputs(handler, message.outputs); + } + } + } + + private void clearInputsAndOutputs(ItemHandlerBase handler) { + for (int i = 0; i < 9 * 2; ++i) { + handler.setStackInSlot(i, ItemStack.EMPTY); + } + } + + private void setInputs(ItemHandlerBase handler, Collection stacks) { + setSlots(handler, stacks, 0, 9); + } + + private void setOutputs(ItemHandlerBase handler, Collection stacks) { + setSlots(handler, stacks, 9, 18); + } + + private void setSlots(ItemHandlerBase handler, Collection stacks, int begin, int end) { + for (ItemStack stack : stacks) { + handler.setStackInSlot(begin, stack); + + begin++; + + if (begin >= end) { + break; + } + } + } +} diff --git a/src/main/java/com/raoulvdberge/refinedstorage/network/MessageGridCraftingTransfer.java b/src/main/java/com/raoulvdberge/refinedstorage/network/MessageGridTransfer.java old mode 100755 new mode 100644 similarity index 84% rename from src/main/java/com/raoulvdberge/refinedstorage/network/MessageGridCraftingTransfer.java rename to src/main/java/com/raoulvdberge/refinedstorage/network/MessageGridTransfer.java index 4a2b46882..32882f9da --- a/src/main/java/com/raoulvdberge/refinedstorage/network/MessageGridCraftingTransfer.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/network/MessageGridTransfer.java @@ -12,13 +12,13 @@ import net.minecraftforge.common.util.Constants; import net.minecraftforge.fml.common.network.ByteBufUtils; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; -public class MessageGridCraftingTransfer extends MessageHandlerPlayerToServer implements IMessage { +public class MessageGridTransfer extends MessageHandlerPlayerToServer implements IMessage { private NBTTagCompound recipe; - public MessageGridCraftingTransfer() { + public MessageGridTransfer() { } - public MessageGridCraftingTransfer(NBTTagCompound recipe) { + public MessageGridTransfer(NBTTagCompound recipe) { this.recipe = recipe; } @@ -33,7 +33,7 @@ public class MessageGridCraftingTransfer extends MessageHandlerPlayerToServer implements IMessage { - private int x; - private int y; - private int z; - - public MessageProcessingPatternEncoderClear() { - } - - public MessageProcessingPatternEncoderClear(TileProcessingPatternEncoder encoder) { - this.x = encoder.getPos().getX(); - this.y = encoder.getPos().getY(); - this.z = encoder.getPos().getZ(); - } - - @Override - public void fromBytes(ByteBuf buf) { - x = buf.readInt(); - y = buf.readInt(); - z = buf.readInt(); - } - - @Override - public void toBytes(ByteBuf buf) { - buf.writeInt(x); - buf.writeInt(y); - buf.writeInt(z); - } - - @Override - public void handle(MessageProcessingPatternEncoderClear message, EntityPlayerMP player) { - TileEntity tile = player.getEntityWorld().getTileEntity(new BlockPos(message.x, message.y, message.z)); - - if (tile instanceof TileProcessingPatternEncoder) { - TileProcessingPatternEncoder encoder = (TileProcessingPatternEncoder) tile; - - for (int i = 0; i < encoder.getConfiguration().getSlots(); ++i) { - encoder.getConfiguration().setStackInSlot(i, ItemStack.EMPTY); - } - } - } -} - diff --git a/src/main/java/com/raoulvdberge/refinedstorage/network/MessageProcessingPatternEncoderTransfer.java b/src/main/java/com/raoulvdberge/refinedstorage/network/MessageProcessingPatternEncoderTransfer.java deleted file mode 100755 index 33c1c83a7..000000000 --- a/src/main/java/com/raoulvdberge/refinedstorage/network/MessageProcessingPatternEncoderTransfer.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.raoulvdberge.refinedstorage.network; - -import com.raoulvdberge.refinedstorage.RSUtils; -import com.raoulvdberge.refinedstorage.container.ContainerProcessingPatternEncoder; -import io.netty.buffer.ByteBuf; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.common.network.simpleimpl.IMessage; - -import java.util.ArrayList; -import java.util.Collection; - -public class MessageProcessingPatternEncoderTransfer extends MessageHandlerPlayerToServer implements IMessage { - private Collection inputs; - private Collection outputs; - - public MessageProcessingPatternEncoderTransfer() { - } - - public MessageProcessingPatternEncoderTransfer(Collection inputs, Collection outputs) { - this.inputs = inputs; - this.outputs = outputs; - } - - @Override - public void fromBytes(ByteBuf buf) { - int size = buf.readInt(); - - this.inputs = new ArrayList<>(size); - - for (int i = 0; i < size; i++) { - this.inputs.add(RSUtils.readItemStack(buf)); - } - - size = buf.readInt(); - - this.outputs = new ArrayList<>(size); - - for (int i = 0; i < size; i++) { - this.outputs.add(RSUtils.readItemStack(buf)); - } - } - - @Override - public void toBytes(ByteBuf buf) { - buf.writeInt(inputs.size()); - - for (ItemStack stack : inputs) { - RSUtils.writeItemStack(buf, stack); - } - - buf.writeInt(outputs.size()); - - for (ItemStack stack : outputs) { - RSUtils.writeItemStack(buf, stack); - } - } - - @Override - public void handle(MessageProcessingPatternEncoderTransfer message, EntityPlayerMP player) { - if (player.openContainer instanceof ContainerProcessingPatternEncoder) { - ContainerProcessingPatternEncoder encoder = (ContainerProcessingPatternEncoder) player.openContainer; - - encoder.clearInputsAndOutputs(); - - encoder.setInputs(message.inputs); - encoder.setOutputs(message.outputs); - } - } -} diff --git a/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyClient.java b/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyClient.java index fd24375c3..d5c56d321 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyClient.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyClient.java @@ -217,7 +217,6 @@ public class ProxyClient extends ProxyCommon { ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.WIRELESS_TRANSMITTER), 0, new ModelResourceLocation("refinedstorage:wireless_transmitter", "inventory")); ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.CRAFTING_MONITOR), 0, new ModelResourceLocation("refinedstorage:crafting_monitor", "inventory")); ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.CRAFTER), 0, new ModelResourceLocation("refinedstorage:crafter", "connected=false,direction=north")); - ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.PROCESSING_PATTERN_ENCODER), 0, new ModelResourceLocation("refinedstorage:processing_pattern_encoder", "inventory")); ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.NETWORK_TRANSMITTER), 0, new ModelResourceLocation("refinedstorage:network_transmitter", "inventory")); ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.NETWORK_RECEIVER), 0, new ModelResourceLocation("refinedstorage:network_receiver", "inventory")); ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.STORAGE), ItemStorageType.TYPE_1K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=1k")); @@ -235,6 +234,7 @@ public class ProxyClient extends ProxyCommon { ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.QUARTZ_ENRICHED_IRON), 0, new ModelResourceLocation("refinedstorage:quartz_enriched_iron_block", "inventory")); ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.STORAGE_MONITOR), 0, new ModelResourceLocation("refinedstorage:storage_monitor", "connected=false,direction=north")); + // Disk Drive ModelLoaderRegistry.registerLoader(new ICustomModelLoader() { @Override public boolean accepts(ResourceLocation modelLocation) { @@ -251,6 +251,7 @@ public class ProxyClient extends ProxyCommon { } }); + // Disk Manipulator ModelLoaderRegistry.registerLoader(new ICustomModelLoader() { @Override public boolean accepts(ResourceLocation modelLocation) { diff --git a/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyCommon.java b/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyCommon.java index 465245988..e114d9371 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyCommon.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyCommon.java @@ -97,8 +97,8 @@ public class ProxyCommon { RS.INSTANCE.network.registerMessage(MessageTileDataParameterUpdate.class, MessageTileDataParameterUpdate.class, id++, Side.SERVER); RS.INSTANCE.network.registerMessage(MessageGridItemInsertHeld.class, MessageGridItemInsertHeld.class, id++, Side.SERVER); RS.INSTANCE.network.registerMessage(MessageGridItemPull.class, MessageGridItemPull.class, id++, Side.SERVER); - RS.INSTANCE.network.registerMessage(MessageGridCraftingClear.class, MessageGridCraftingClear.class, id++, Side.SERVER); - RS.INSTANCE.network.registerMessage(MessageGridCraftingTransfer.class, MessageGridCraftingTransfer.class, id++, Side.SERVER); + RS.INSTANCE.network.registerMessage(MessageGridClear.class, MessageGridClear.class, id++, Side.SERVER); + RS.INSTANCE.network.registerMessage(MessageGridTransfer.class, MessageGridTransfer.class, id++, Side.SERVER); RS.INSTANCE.network.registerMessage(MessageGridSettingsUpdate.class, MessageGridSettingsUpdate.class, id++, Side.SERVER); RS.INSTANCE.network.registerMessage(MessageGridCraftingStart.class, MessageGridCraftingStart.class, id++, Side.SERVER); RS.INSTANCE.network.registerMessage(MessageGridPatternCreate.class, MessageGridPatternCreate.class, id++, Side.SERVER); @@ -110,12 +110,11 @@ public class ProxyCommon { RS.INSTANCE.network.registerMessage(MessageGridFluidDelta.class, MessageGridFluidDelta.class, id++, Side.CLIENT); RS.INSTANCE.network.registerMessage(MessageGridFluidPull.class, MessageGridFluidPull.class, id++, Side.SERVER); RS.INSTANCE.network.registerMessage(MessageGridFluidInsertHeld.class, MessageGridFluidInsertHeld.class, id++, Side.SERVER); - RS.INSTANCE.network.registerMessage(MessageProcessingPatternEncoderClear.class, MessageProcessingPatternEncoderClear.class, id++, Side.SERVER); RS.INSTANCE.network.registerMessage(MessageFilterUpdate.class, MessageFilterUpdate.class, id++, Side.SERVER); RS.INSTANCE.network.registerMessage(MessageGridCraftingPreview.class, MessageGridCraftingPreview.class, id++, Side.SERVER); RS.INSTANCE.network.registerMessage(MessageGridCraftingPreviewResponse.class, MessageGridCraftingPreviewResponse.class, id++, Side.CLIENT); RS.INSTANCE.network.registerMessage(MessageGridCraftingStartResponse.class, MessageGridCraftingStartResponse.class, id++, Side.CLIENT); - RS.INSTANCE.network.registerMessage(MessageProcessingPatternEncoderTransfer.class, MessageProcessingPatternEncoderTransfer.class, id++, Side.SERVER); + RS.INSTANCE.network.registerMessage(MessageGridProcessingTransfer.class, MessageGridProcessingTransfer.class, id++, Side.SERVER); RS.INSTANCE.network.registerMessage(MessageReaderWriterUpdate.class, MessageReaderWriterUpdate.class, id++, Side.CLIENT); RS.INSTANCE.network.registerMessage(MessageReaderWriterChannelAdd.class, MessageReaderWriterChannelAdd.class, id++, Side.SERVER); RS.INSTANCE.network.registerMessage(MessageReaderWriterChannelRemove.class, MessageReaderWriterChannelRemove.class, id++, Side.SERVER); @@ -144,7 +143,6 @@ public class ProxyCommon { registerTile(TileCraftingMonitor.class, "crafting_monitor"); registerTile(TileWirelessTransmitter.class, "wireless_transmitter"); registerTile(TileCrafter.class, "crafter"); - registerTile(TileProcessingPatternEncoder.class, "processing_pattern_encoder"); registerTile(TileCable.class, "cable"); registerTile(TileNetworkReceiver.class, "network_receiver"); registerTile(TileNetworkTransmitter.class, "network_transmitter"); @@ -164,7 +162,6 @@ public class ProxyCommon { registerBlock(RSBlocks.STORAGE_MONITOR); registerBlock(RSBlocks.SECURITY_MANAGER); registerBlock(RSBlocks.CRAFTER); - registerBlock(RSBlocks.PROCESSING_PATTERN_ENCODER); registerBlock(RSBlocks.DISK_DRIVE); registerBlock(RSBlocks.STORAGE); registerBlock(RSBlocks.FLUID_STORAGE); @@ -320,8 +317,21 @@ public class ProxyCommon { @SubscribeEvent public void fixItemMappings(RegistryEvent.MissingMappings e) { for (RegistryEvent.MissingMappings.Mapping missing : e.getMappings()) { - if (missing.key.getResourceDomain().equals(RS.ID) && missing.key.getResourcePath().equals("grid_filter")) { - missing.remap(RSItems.FILTER); + if (missing.key.getResourceDomain().equals(RS.ID)) { + if (missing.key.getResourcePath().equals("grid_filter")) { + missing.remap(RSItems.FILTER); + } else if (missing.key.getResourcePath().equals("processing_pattern_encoder")) { + missing.ignore(); + } + } + } + } + + @SubscribeEvent + public void fixBlockMappings(RegistryEvent.MissingMappings e) { + for (RegistryEvent.MissingMappings.Mapping missing : e.getMappings()) { + if (missing.key.getResourceDomain().equals(RS.ID) && missing.key.getResourcePath().equals("processing_pattern_encoder")) { + missing.ignore(); } } } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/tile/TileProcessingPatternEncoder.java b/src/main/java/com/raoulvdberge/refinedstorage/tile/TileProcessingPatternEncoder.java deleted file mode 100755 index 85d563145..000000000 --- a/src/main/java/com/raoulvdberge/refinedstorage/tile/TileProcessingPatternEncoder.java +++ /dev/null @@ -1,172 +0,0 @@ -package com.raoulvdberge.refinedstorage.tile; - -import com.raoulvdberge.refinedstorage.RSItems; -import com.raoulvdberge.refinedstorage.RSUtils; -import com.raoulvdberge.refinedstorage.gui.GuiProcessingPatternEncoder; -import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBase; -import com.raoulvdberge.refinedstorage.inventory.ItemHandlerListenerTile; -import com.raoulvdberge.refinedstorage.inventory.ItemValidatorBasic; -import com.raoulvdberge.refinedstorage.item.ItemPattern; -import com.raoulvdberge.refinedstorage.tile.data.ITileDataConsumer; -import com.raoulvdberge.refinedstorage.tile.data.ITileDataProducer; -import com.raoulvdberge.refinedstorage.tile.data.TileDataParameter; -import net.minecraft.client.Minecraft; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.datasync.DataSerializers; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.items.CapabilityItemHandler; -import net.minecraftforge.items.IItemHandler; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -public class TileProcessingPatternEncoder extends TileBase { - private static final String NBT_OREDICT_PATTERN = "OredictPattern"; - private static final String NBT_BLOCKING_PATTERN = "BlockingPattern"; - - public static final TileDataParameter OREDICT_PATTERN = new TileDataParameter<>(DataSerializers.BOOLEAN, false, new ITileDataProducer() { - @Override - public Boolean getValue(TileProcessingPatternEncoder tile) { - return tile.oredictPattern; - } - }, new ITileDataConsumer() { - @Override - public void setValue(TileProcessingPatternEncoder tile, Boolean value) { - tile.oredictPattern = value; - - tile.markDirty(); - } - }, parameter -> { - if (Minecraft.getMinecraft().currentScreen instanceof GuiProcessingPatternEncoder) { - ((GuiProcessingPatternEncoder) Minecraft.getMinecraft().currentScreen).updateOredictPattern(parameter.getValue()); - } - }); - - public static final TileDataParameter BLOCKING_TASK_PATTERN = new TileDataParameter<>(DataSerializers.BOOLEAN, false, new ITileDataProducer() { - @Override - public Boolean getValue(TileProcessingPatternEncoder tile) { - return tile.blockingTask; - } - }, new ITileDataConsumer() { - @Override - public void setValue(TileProcessingPatternEncoder tile, Boolean value) { - tile.blockingTask = value; - - tile.markDirty(); - } - }, parameter -> { - if (Minecraft.getMinecraft().currentScreen instanceof GuiProcessingPatternEncoder) { - ((GuiProcessingPatternEncoder) Minecraft.getMinecraft().currentScreen).updateBlockingPattern(parameter.getValue()); - } - }); - - private ItemHandlerBase patterns = new ItemHandlerBase(2, new ItemHandlerListenerTile(this), new ItemValidatorBasic(RSItems.PATTERN)); - private ItemHandlerBase configuration = new ItemHandlerBase(9 * 2, new ItemHandlerListenerTile(this)); - - private boolean oredictPattern; - private boolean blockingTask = false; - - public TileProcessingPatternEncoder() { - dataManager.addWatchedParameter(OREDICT_PATTERN); - dataManager.addWatchedParameter(BLOCKING_TASK_PATTERN); - } - - @Override - public NBTTagCompound write(NBTTagCompound tag) { - super.write(tag); - - RSUtils.writeItems(patterns, 0, tag); - RSUtils.writeItems(configuration, 1, tag); - - tag.setBoolean(NBT_OREDICT_PATTERN, oredictPattern); - tag.setBoolean(NBT_BLOCKING_PATTERN, blockingTask); - - return tag; - } - - @Override - public void read(NBTTagCompound tag) { - super.read(tag); - - RSUtils.readItems(patterns, 0, tag); - RSUtils.readItems(configuration, 1, tag); - - if (tag.hasKey(NBT_OREDICT_PATTERN)) { - oredictPattern = tag.getBoolean(NBT_OREDICT_PATTERN); - } - - if (tag.hasKey(NBT_BLOCKING_PATTERN)) { - blockingTask = tag.getBoolean(NBT_BLOCKING_PATTERN); - } - } - - public void onCreatePattern() { - if (canCreatePattern()) { - ItemStack pattern = new ItemStack(RSItems.PATTERN); - - ItemPattern.setOredict(pattern, oredictPattern); - ItemPattern.setBlocking(pattern, blockingTask); - - for (int i = 0; i < 18; ++i) { - if (!configuration.getStackInSlot(i).isEmpty()) { - if (i >= 9) { - ItemPattern.addOutput(pattern, configuration.getStackInSlot(i)); - } else { - ItemPattern.setSlot(pattern, i, configuration.getStackInSlot(i)); - } - } - } - - patterns.extractItem(0, 1, false); - patterns.setStackInSlot(1, pattern); - } - } - - public boolean canCreatePattern() { - int inputsFilled = 0, outputsFilled = 0; - - for (int i = 0; i < 9; ++i) { - if (!configuration.getStackInSlot(i).isEmpty()) { - inputsFilled++; - } - } - - for (int i = 9; i < 18; ++i) { - if (!configuration.getStackInSlot(i).isEmpty()) { - outputsFilled++; - } - } - - return inputsFilled > 0 && outputsFilled > 0 && !patterns.getStackInSlot(0).isEmpty() && patterns.getStackInSlot(1).isEmpty(); - } - - public ItemHandlerBase getPatterns() { - return patterns; - } - - public ItemHandlerBase getConfiguration() { - return configuration; - } - - @Override - @Nullable - public IItemHandler getDrops() { - return patterns; - } - - @Override - public T getCapability(@Nonnull Capability capability, @Nullable EnumFacing facing) { - if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { - return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(patterns); - } - - return super.getCapability(capability, facing); - } - - @Override - public boolean hasCapability(@Nonnull Capability capability, @Nullable EnumFacing facing) { - return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY || super.hasCapability(capability, facing); - } -} diff --git a/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/TileGrid.java b/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/TileGrid.java index 5b35f1dbc..f6d23e73f 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/TileGrid.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/tile/grid/TileGrid.java @@ -1,6 +1,7 @@ package com.raoulvdberge.refinedstorage.tile.grid; import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeGrid; +import com.raoulvdberge.refinedstorage.container.ContainerGrid; import com.raoulvdberge.refinedstorage.gui.grid.GuiGrid; import com.raoulvdberge.refinedstorage.tile.TileNode; import com.raoulvdberge.refinedstorage.tile.data.ITileDataConsumer; @@ -131,6 +132,50 @@ public class TileGrid extends TileNode { } }); + public static final TileDataParameter PROCESSING_PATTERN = new TileDataParameter<>(DataSerializers.BOOLEAN, false, new ITileDataProducer() { + @Override + public Boolean getValue(TileGrid tile) { + return tile.getNode().isProcessingPattern(); + } + }, new ITileDataConsumer() { + @Override + public void setValue(TileGrid tile, Boolean value) { + tile.getNode().setProcessingPattern(value); + tile.getNode().markDirty(); + + tile.getNode().onPatternMatrixClear(); + + tile.world.getMinecraftServer().getPlayerList().getPlayers().stream() + .filter(player -> player.openContainer instanceof ContainerGrid && ((ContainerGrid) player.openContainer).getTile() != null && ((ContainerGrid) player.openContainer).getTile().getPos().equals(tile.getPos())) + .forEach(player -> { + ((ContainerGrid) player.openContainer).initSlots(); + + player.openContainer.detectAndSendChanges(); + }); + } + }, parameter -> { + if (Minecraft.getMinecraft().currentScreen != null) { + Minecraft.getMinecraft().currentScreen.initGui(); + } + }); + + public static final TileDataParameter BLOCKING_PATTERN = new TileDataParameter<>(DataSerializers.BOOLEAN, false, new ITileDataProducer() { + @Override + public Boolean getValue(TileGrid tile) { + return tile.getNode().isBlockingPattern(); + } + }, new ITileDataConsumer() { + @Override + public void setValue(TileGrid tile, Boolean value) { + tile.getNode().setBlockingPattern(value); + tile.getNode().markDirty(); + } + }, parameter -> { + if (Minecraft.getMinecraft().currentScreen instanceof GuiGrid) { + ((GuiGrid) Minecraft.getMinecraft().currentScreen).updateBlockingPattern(parameter.getValue()); + } + }); + public TileGrid() { dataManager.addWatchedParameter(VIEW_TYPE); dataManager.addWatchedParameter(SORTING_DIRECTION); @@ -139,6 +184,8 @@ public class TileGrid extends TileNode { dataManager.addWatchedParameter(SIZE); dataManager.addWatchedParameter(TAB_SELECTED); dataManager.addWatchedParameter(OREDICT_PATTERN); + dataManager.addWatchedParameter(PROCESSING_PATTERN); + dataManager.addWatchedParameter(BLOCKING_PATTERN); } @Override diff --git a/src/main/resources/assets/refinedstorage/blockstates/processing_pattern_encoder.json b/src/main/resources/assets/refinedstorage/blockstates/processing_pattern_encoder.json deleted file mode 100755 index 64c04521f..000000000 --- a/src/main/resources/assets/refinedstorage/blockstates/processing_pattern_encoder.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "forge_marker": 1, - "defaults": { - "model": "cube", - "textures": { - "particle": "refinedstorage:blocks/processing_pattern_encoder", - "down": "refinedstorage:blocks/side", - "up": "refinedstorage:blocks/processing_pattern_encoder", - "north": "refinedstorage:blocks/processing_pattern_encoder_side", - "east": "refinedstorage:blocks/processing_pattern_encoder_side", - "south": "refinedstorage:blocks/processing_pattern_encoder_side", - "west": "refinedstorage:blocks/processing_pattern_encoder_side" - } - }, - "variants": { - "inventory": [ - { - "transform": "forge:default-block" - } - ], - "normal": { - "model": "cube" - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/refinedstorage/lang/en_us.lang b/src/main/resources/assets/refinedstorage/lang/en_us.lang index 5c53da484..d02e2a62a 100755 --- a/src/main/resources/assets/refinedstorage/lang/en_us.lang +++ b/src/main/resources/assets/refinedstorage/lang/en_us.lang @@ -35,9 +35,6 @@ gui.refinedstorage:crafting_monitor.blocked=Blocked, waiting on other task gui.refinedstorage:wireless_transmitter=Wireless Transmitter gui.refinedstorage:wireless_transmitter.distance=%d blocks gui.refinedstorage:crafter=Crafter -gui.refinedstorage:crafter.processing=Processing -gui.refinedstorage:processing_pattern_encoder=Processing Pattern Encoder -gui.refinedstorage:processing_pattern_encoder.pattern_create=Create Pattern gui.refinedstorage:filter=Filter gui.refinedstorage:filter.compare_damage=Damage gui.refinedstorage:filter.compare_nbt=NBT @@ -107,6 +104,7 @@ misc.refinedstorage:cancel_all=Cancel All misc.refinedstorage:priority=Priority misc.refinedstorage:oredict=Oredict misc.refinedstorage:blocking=Blocking +misc.refinedstorage:processing=Processing misc.refinedstorage:reader_writer.redstone=Redstone strength: %d @@ -208,9 +206,6 @@ block.refinedstorage:crafting_monitor.name=Crafting Monitor block.refinedstorage:wireless_transmitter.name=Wireless Transmitter block.refinedstorage:wireless_transmitter.tooltip=Needs to be placed on %s. block.refinedstorage:crafter.name=Crafter -block.refinedstorage:processing_pattern_encoder.name=Processing Pattern Encoder -block.refinedstorage:processing_pattern_encoder.tooltip.0=Only used for creating processing patterns. -block.refinedstorage:processing_pattern_encoder.tooltip.1=For regular crafting pattern creation, use the %s. block.refinedstorage:network_receiver.name=Network Receiver block.refinedstorage:network_transmitter.name=Network Transmitter block.refinedstorage:fluid_interface.name=Fluid Interface diff --git a/src/main/resources/assets/refinedstorage/recipes/processing_pattern_encoder.json b/src/main/resources/assets/refinedstorage/recipes/processing_pattern_encoder.json deleted file mode 100644 index b29d099a9..000000000 --- a/src/main/resources/assets/refinedstorage/recipes/processing_pattern_encoder.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "ECE", - "PMP", - "EFE" - ], - "key": { - "E": { - "item": "refinedstorage:quartz_enriched_iron" - }, - "C": { - "type": "forge:ore_dict", - "ore": "workbench" - }, - "P": { - "item": "refinedstorage:pattern" - }, - "M": { - "item": "refinedstorage:machine_casing" - }, - "F": { - "item": "minecraft:furnace" - } - }, - "result": { - "item": "refinedstorage:processing_pattern_encoder" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/processing_pattern_encoder.png b/src/main/resources/assets/refinedstorage/textures/blocks/processing_pattern_encoder.png deleted file mode 100755 index 75523b4fb..000000000 Binary files a/src/main/resources/assets/refinedstorage/textures/blocks/processing_pattern_encoder.png and /dev/null differ diff --git a/src/main/resources/assets/refinedstorage/textures/blocks/processing_pattern_encoder_side.png b/src/main/resources/assets/refinedstorage/textures/blocks/processing_pattern_encoder_side.png deleted file mode 100755 index ebe6496e3..000000000 Binary files a/src/main/resources/assets/refinedstorage/textures/blocks/processing_pattern_encoder_side.png and /dev/null differ diff --git a/src/main/resources/assets/refinedstorage/textures/gui/pattern_grid.png b/src/main/resources/assets/refinedstorage/textures/gui/pattern_grid.png index 33f824d2f..44d1b0dcc 100755 Binary files a/src/main/resources/assets/refinedstorage/textures/gui/pattern_grid.png and b/src/main/resources/assets/refinedstorage/textures/gui/pattern_grid.png differ diff --git a/src/main/resources/assets/refinedstorage/textures/gui/pattern_grid_processing.png b/src/main/resources/assets/refinedstorage/textures/gui/pattern_grid_processing.png new file mode 100644 index 000000000..5a7f33703 Binary files /dev/null and b/src/main/resources/assets/refinedstorage/textures/gui/pattern_grid_processing.png differ