Added support for processing patterns with big stacksizes, fixes #219
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
**Features**
|
**Features**
|
||||||
- Added config option to set the base energy usage of the Controller (default is 0)
|
- Added config option to set the base energy usage of the Controller (default is 0)
|
||||||
- Added Grid Filter item to filter items in any Grid
|
- Added Grid Filter item to filter items in any Grid
|
||||||
|
- Added support for processing patterns with big stacksizes
|
||||||
- Changed Relay recipe to use redstone torch instead of Basic Processor
|
- Changed Relay recipe to use redstone torch instead of Basic Processor
|
||||||
|
|
||||||
### 0.8.12
|
### 0.8.12
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class ContainerProcessingPatternEncoder extends ContainerBase {
|
|||||||
int y = 20;
|
int y = 20;
|
||||||
|
|
||||||
for (int i = 0; i < 9 * 2; ++i) {
|
for (int i = 0; i < 9 * 2; ++i) {
|
||||||
addSlotToContainer(new SlotSpecimen(processingPatternEncoder.getConfiguration(), i, x, y));
|
addSlotToContainer(new SlotSpecimen(processingPatternEncoder.getConfiguration(), i, x, y, SlotSpecimen.SPECIMEN_SIZE));
|
||||||
|
|
||||||
x += 18;
|
x += 18;
|
||||||
|
|
||||||
|
|||||||
@@ -75,11 +75,11 @@ public class TileCrafter extends TileNode implements ICraftingPatternContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(NBTTagCompound nbt) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(nbt);
|
super.read(tag);
|
||||||
|
|
||||||
readItems(patterns, 0, nbt);
|
readItems(patterns, 0, tag);
|
||||||
readItems(upgrades, 1, nbt);
|
readItems(upgrades, 1, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -99,19 +99,19 @@ public class TileDestructor extends TileNode implements ICompareConfig, IModeCon
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(NBTTagCompound nbt) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(nbt);
|
super.read(tag);
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_COMPARE)) {
|
if (tag.hasKey(NBT_COMPARE)) {
|
||||||
compare = nbt.getInteger(NBT_COMPARE);
|
compare = tag.getInteger(NBT_COMPARE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_MODE)) {
|
if (tag.hasKey(NBT_MODE)) {
|
||||||
mode = nbt.getInteger(NBT_MODE);
|
mode = tag.getInteger(NBT_MODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
readItems(filters, 0, nbt);
|
readItems(filters, 0, tag);
|
||||||
readItems(upgrades, 1, nbt);
|
readItems(upgrades, 1, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -133,22 +133,22 @@ public class TileDetector extends TileNode implements ICompareConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(NBTTagCompound nbt) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(nbt);
|
super.read(tag);
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_COMPARE)) {
|
if (tag.hasKey(NBT_COMPARE)) {
|
||||||
compare = nbt.getInteger(NBT_COMPARE);
|
compare = tag.getInteger(NBT_COMPARE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_MODE)) {
|
if (tag.hasKey(NBT_MODE)) {
|
||||||
mode = nbt.getInteger(NBT_MODE);
|
mode = tag.getInteger(NBT_MODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_AMOUNT)) {
|
if (tag.hasKey(NBT_AMOUNT)) {
|
||||||
amount = nbt.getInteger(NBT_AMOUNT);
|
amount = tag.getInteger(NBT_AMOUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
readItems(filter, 0, nbt);
|
readItems(filter, 0, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -153,22 +153,22 @@ public class TileDiskDrive extends TileNode implements IStorageProvider, IStorag
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(NBTTagCompound nbt) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(nbt);
|
super.read(tag);
|
||||||
|
|
||||||
readItems(disks, 0, nbt);
|
readItems(disks, 0, tag);
|
||||||
readItems(filters, 1, nbt);
|
readItems(filters, 1, tag);
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_PRIORITY)) {
|
if (tag.hasKey(NBT_PRIORITY)) {
|
||||||
priority = nbt.getInteger(NBT_PRIORITY);
|
priority = tag.getInteger(NBT_PRIORITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_COMPARE)) {
|
if (tag.hasKey(NBT_COMPARE)) {
|
||||||
compare = nbt.getInteger(NBT_COMPARE);
|
compare = tag.getInteger(NBT_COMPARE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_MODE)) {
|
if (tag.hasKey(NBT_MODE)) {
|
||||||
mode = nbt.getInteger(NBT_MODE);
|
mode = tag.getInteger(NBT_MODE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,17 +76,17 @@ public class TileExporter extends TileNode implements ICompareConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(NBTTagCompound nbt) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(nbt);
|
super.read(tag);
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_COMPARE)) {
|
if (tag.hasKey(NBT_COMPARE)) {
|
||||||
compare = nbt.getInteger(NBT_COMPARE);
|
compare = tag.getInteger(NBT_COMPARE);
|
||||||
}
|
}
|
||||||
|
|
||||||
readItems(filters, 0, nbt);
|
readItems(filters, 0, tag);
|
||||||
readItems(upgrades, 1, nbt);
|
readItems(upgrades, 1, tag);
|
||||||
|
|
||||||
scheduler.read(nbt);
|
scheduler.read(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -93,19 +93,19 @@ public class TileImporter extends TileNode implements ICompareConfig, IModeConfi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(NBTTagCompound nbt) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(nbt);
|
super.read(tag);
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_COMPARE)) {
|
if (tag.hasKey(NBT_COMPARE)) {
|
||||||
compare = nbt.getInteger(NBT_COMPARE);
|
compare = tag.getInteger(NBT_COMPARE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_MODE)) {
|
if (tag.hasKey(NBT_MODE)) {
|
||||||
mode = nbt.getInteger(NBT_MODE);
|
mode = tag.getInteger(NBT_MODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
readItems(filters, 0, nbt);
|
readItems(filters, 0, tag);
|
||||||
readItems(upgrades, 1, nbt);
|
readItems(upgrades, 1, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -104,16 +104,16 @@ public class TileInterface extends TileNode implements ICompareConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(NBTTagCompound nbt) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(nbt);
|
super.read(tag);
|
||||||
|
|
||||||
readItems(importItems, 0, nbt);
|
readItems(importItems, 0, tag);
|
||||||
readItems(exportSpecimenItems, 1, nbt);
|
readItems(exportSpecimenItems, 1, tag);
|
||||||
readItems(exportItems, 2, nbt);
|
readItems(exportItems, 2, tag);
|
||||||
readItems(upgrades, 3, nbt);
|
readItems(upgrades, 3, tag);
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_COMPARE)) {
|
if (tag.hasKey(NBT_COMPARE)) {
|
||||||
compare = nbt.getInteger(NBT_COMPARE);
|
compare = tag.getInteger(NBT_COMPARE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -126,11 +126,11 @@ public abstract class TileNode extends TileBase implements INetworkNode, ISynchr
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(NBTTagCompound nbt) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(nbt);
|
super.read(tag);
|
||||||
|
|
||||||
if (nbt.hasKey(RedstoneMode.NBT)) {
|
if (tag.hasKey(RedstoneMode.NBT)) {
|
||||||
redstoneMode = RedstoneMode.getById(nbt.getInteger(RedstoneMode.NBT));
|
redstoneMode = RedstoneMode.getById(tag.getInteger(RedstoneMode.NBT));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import net.minecraft.util.EnumFacing;
|
|||||||
import net.minecraftforge.common.capabilities.Capability;
|
import net.minecraftforge.common.capabilities.Capability;
|
||||||
import net.minecraftforge.items.CapabilityItemHandler;
|
import net.minecraftforge.items.CapabilityItemHandler;
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
|
import net.minecraftforge.items.ItemHandlerHelper;
|
||||||
import refinedstorage.RefinedStorageItems;
|
import refinedstorage.RefinedStorageItems;
|
||||||
import refinedstorage.inventory.ItemHandlerBasic;
|
import refinedstorage.inventory.ItemHandlerBasic;
|
||||||
import refinedstorage.inventory.ItemValidatorBasic;
|
import refinedstorage.inventory.ItemValidatorBasic;
|
||||||
@@ -26,11 +27,11 @@ public class TileProcessingPatternEncoder extends TileBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(NBTTagCompound nbt) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(nbt);
|
super.read(tag);
|
||||||
|
|
||||||
readItems(patterns, 0, nbt);
|
readItems(patterns, 0, tag);
|
||||||
readItems(configuration, 1, nbt);
|
readItems(configuration, 1, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onCreatePattern() {
|
public void onCreatePattern() {
|
||||||
@@ -41,10 +42,12 @@ public class TileProcessingPatternEncoder extends TileBase {
|
|||||||
|
|
||||||
for (int i = 0; i < 18; ++i) {
|
for (int i = 0; i < 18; ++i) {
|
||||||
if (configuration.getStackInSlot(i) != null) {
|
if (configuration.getStackInSlot(i) != null) {
|
||||||
if (i >= 9) {
|
for (int j = 0; j < configuration.getStackInSlot(i).stackSize; ++j) {
|
||||||
ItemPattern.addOutput(pattern, configuration.getStackInSlot(i));
|
if (i >= 9) {
|
||||||
} else {
|
ItemPattern.addOutput(pattern, ItemHandlerHelper.copyStackWithSize(configuration.getStackInSlot(i), 1));
|
||||||
ItemPattern.addInput(pattern, configuration.getStackInSlot(i));
|
} else {
|
||||||
|
ItemPattern.addInput(pattern, ItemHandlerHelper.copyStackWithSize(configuration.getStackInSlot(i), 1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,20 +107,20 @@ public class TileSolderer extends TileNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(NBTTagCompound nbt) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(nbt);
|
super.read(tag);
|
||||||
|
|
||||||
readItems(items, 0, nbt);
|
readItems(items, 0, tag);
|
||||||
readItems(upgrades, 1, nbt);
|
readItems(upgrades, 1, tag);
|
||||||
|
|
||||||
recipe = RefinedStorageAPI.SOLDERER_REGISTRY.getRecipe(items);
|
recipe = RefinedStorageAPI.SOLDERER_REGISTRY.getRecipe(items);
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_WORKING)) {
|
if (tag.hasKey(NBT_WORKING)) {
|
||||||
working = nbt.getBoolean(NBT_WORKING);
|
working = tag.getBoolean(NBT_WORKING);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_PROGRESS)) {
|
if (tag.hasKey(NBT_PROGRESS)) {
|
||||||
progress = nbt.getInteger(NBT_PROGRESS);
|
progress = tag.getInteger(NBT_PROGRESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -104,25 +104,25 @@ public class TileStorage extends TileNode implements IStorageProvider, IStorageG
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(NBTTagCompound nbt) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(nbt);
|
super.read(tag);
|
||||||
|
|
||||||
readItems(filters, 0, nbt);
|
readItems(filters, 0, tag);
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_PRIORITY)) {
|
if (tag.hasKey(NBT_PRIORITY)) {
|
||||||
priority = nbt.getInteger(NBT_PRIORITY);
|
priority = tag.getInteger(NBT_PRIORITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_STORAGE)) {
|
if (tag.hasKey(NBT_STORAGE)) {
|
||||||
storageTag = nbt.getCompoundTag(NBT_STORAGE);
|
storageTag = tag.getCompoundTag(NBT_STORAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_COMPARE)) {
|
if (tag.hasKey(NBT_COMPARE)) {
|
||||||
compare = nbt.getInteger(NBT_COMPARE);
|
compare = tag.getInteger(NBT_COMPARE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_MODE)) {
|
if (tag.hasKey(NBT_MODE)) {
|
||||||
mode = nbt.getInteger(NBT_MODE);
|
mode = tag.getInteger(NBT_MODE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,10 +27,10 @@ public class TileWirelessTransmitter extends TileNode implements IWirelessTransm
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(NBTTagCompound nbt) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(nbt);
|
super.read(tag);
|
||||||
|
|
||||||
readItems(upgrades, 0, nbt);
|
readItems(upgrades, 0, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -115,21 +115,21 @@ public class TileExternalStorage extends TileNode implements IStorageProvider, I
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(NBTTagCompound nbt) {
|
public void read(NBTTagCompound tag) {
|
||||||
super.read(nbt);
|
super.read(tag);
|
||||||
|
|
||||||
readItems(filters, 0, nbt);
|
readItems(filters, 0, tag);
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_PRIORITY)) {
|
if (tag.hasKey(NBT_PRIORITY)) {
|
||||||
priority = nbt.getInteger(NBT_PRIORITY);
|
priority = tag.getInteger(NBT_PRIORITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_COMPARE)) {
|
if (tag.hasKey(NBT_COMPARE)) {
|
||||||
compare = nbt.getInteger(NBT_COMPARE);
|
compare = tag.getInteger(NBT_COMPARE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nbt.hasKey(NBT_MODE)) {
|
if (tag.hasKey(NBT_MODE)) {
|
||||||
mode = nbt.getInteger(NBT_MODE);
|
mode = tag.getInteger(NBT_MODE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user