Fixed exporter crafting upgrades taking priority over other tasks, should fix #198
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
# Refined Storage Changelog
|
||||
|
||||
### 0.8.11
|
||||
**Bugfixes**
|
||||
- Fixed minor dupe bug with JEI transferring
|
||||
- Fixed exporter crafting upgrades taking priority over other tasks
|
||||
|
||||
### 0.8.10
|
||||
**Bugfixes**
|
||||
- Fixed not being able to get some items out of Grid
|
||||
|
||||
@@ -2,6 +2,7 @@ package refinedstorage.apiimpl.autocrafting;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import refinedstorage.RefinedStorageUtils;
|
||||
import refinedstorage.api.autocrafting.ICraftingPattern;
|
||||
import refinedstorage.api.network.INetworkMaster;
|
||||
@@ -9,8 +10,13 @@ import refinedstorage.api.network.INetworkMaster;
|
||||
public class CraftingTaskScheduler {
|
||||
private static final String NBT_SCHEDULED = "CraftingTaskScheduled";
|
||||
|
||||
private TileEntity tile;
|
||||
private ItemStack scheduledItem;
|
||||
|
||||
public CraftingTaskScheduler(TileEntity tile) {
|
||||
this.tile = tile;
|
||||
}
|
||||
|
||||
public boolean canSchedule(int compare, ItemStack item) {
|
||||
return scheduledItem == null || !RefinedStorageUtils.compareStack(scheduledItem, item, compare);
|
||||
}
|
||||
@@ -21,12 +27,16 @@ public class CraftingTaskScheduler {
|
||||
if (pattern != null) {
|
||||
scheduledItem = item;
|
||||
|
||||
network.addCraftingTask(network.createCraftingTask(pattern));
|
||||
network.addCraftingTaskAsLast(network.createCraftingTask(pattern));
|
||||
|
||||
tile.markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
public void resetSchedule() {
|
||||
this.scheduledItem = null;
|
||||
scheduledItem = null;
|
||||
|
||||
tile.markDirty();
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
|
||||
@@ -46,7 +46,7 @@ public class TileConstructor extends TileNode implements ICompareConfig {
|
||||
private int compare = 0;
|
||||
private IBlockState block;
|
||||
|
||||
private CraftingTaskScheduler scheduler = new CraftingTaskScheduler();
|
||||
private CraftingTaskScheduler scheduler = new CraftingTaskScheduler(this);
|
||||
|
||||
@Override
|
||||
public int getEnergyUsage() {
|
||||
|
||||
@@ -33,7 +33,7 @@ public class TileExporter extends TileNode implements ICompareConfig {
|
||||
|
||||
private int compare = 0;
|
||||
|
||||
private CraftingTaskScheduler scheduler = new CraftingTaskScheduler();
|
||||
private CraftingTaskScheduler scheduler = new CraftingTaskScheduler(this);
|
||||
|
||||
@Override
|
||||
public int getEnergyUsage() {
|
||||
|
||||
Reference in New Issue
Block a user