You can now re-insert a Pattern in the pattern output slot in the Pattern Grid to modify an existing pattern
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
### 1.5.22
|
||||
- Added oredict, blocking, processing, ore inputs access to OpenComputers API (raoulvdberge)
|
||||
- The Crafter can now only store 1 stack size pattern per slot (raoulvdberge)
|
||||
- You can now re-insert a Pattern in the pattern output slot in the Pattern Grid to modify an existing pattern (raoulvdberge)
|
||||
- Fixed not being able to use JEI R and U keys on Grid with tabs (raoulvdberge)
|
||||
|
||||
### 1.5.21
|
||||
|
@@ -39,7 +39,6 @@ import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import net.minecraftforge.items.wrapper.CombinedInvWrapper;
|
||||
import net.minecraftforge.items.wrapper.InvWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -74,10 +73,20 @@ public class NetworkNodeGrid extends NetworkNode implements IGrid {
|
||||
private ItemHandlerBase matrixProcessing = new ItemHandlerBase(9 * 2, new ItemHandlerListenerNetworkNode(this));
|
||||
|
||||
private ItemHandlerBase patterns = new ItemHandlerBase(2, new ItemHandlerListenerNetworkNode(this), new ItemValidatorBasic(RSItems.PATTERN)) {
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) {
|
||||
return slot == 0 ? super.insertItem(slot, stack, simulate) : stack;
|
||||
protected void onContentsChanged(int slot) {
|
||||
super.onContentsChanged(slot);
|
||||
|
||||
if (slot == 1 && !processingPattern && !getStackInSlot(slot).isEmpty()) {
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
matrix.setInventorySlotContents(i, StackUtils.nullToEmpty(ItemPattern.getSlot(getStackInSlot(slot), i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlotLimit(int slot) {
|
||||
return slot == 1 ? 1 : super.getSlotLimit(slot);
|
||||
}
|
||||
};
|
||||
private List<IFilter> filters = new ArrayList<>();
|
||||
|
@@ -61,7 +61,7 @@ public class ContainerGrid extends ContainerBase {
|
||||
|
||||
if (grid.getType() == GridType.PATTERN) {
|
||||
addSlotToContainer(new SlotItemHandler(((NetworkNodeGrid) grid).getPatterns(), 0, 172, headerAndSlots + 4));
|
||||
addSlotToContainer(new SlotOutput(((NetworkNodeGrid) grid).getPatterns(), 1, 172, headerAndSlots + 40));
|
||||
addSlotToContainer(new SlotItemHandler(((NetworkNodeGrid) grid).getPatterns(), 1, 172, headerAndSlots + 40));
|
||||
}
|
||||
|
||||
if (grid instanceof IPortableGrid) {
|
||||
|
@@ -88,6 +88,7 @@ public class ItemPattern extends ItemBase implements ICraftingPatternProvider {
|
||||
pattern.getTagCompound().setTag(String.format(NBT_SLOT, slot), stack.serializeNBT());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static ItemStack getSlot(ItemStack pattern, int slot) {
|
||||
String id = String.format(NBT_SLOT, slot);
|
||||
|
||||
|
Reference in New Issue
Block a user