Fixed not being able to start autocrafting, fixes #714
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
# Refined Storage Changelog
|
# Refined Storage Changelog
|
||||||
|
|
||||||
|
### 1.3.3
|
||||||
|
- Updated Forge to 2188 (raoulvdberge)
|
||||||
|
- Fixed not being able to start a crafting task (raoulvdberge)
|
||||||
|
|
||||||
### 1.3.2
|
### 1.3.2
|
||||||
- Fixed being able to exceed max stack size while shift clicking (raoulvdberge)
|
- Fixed being able to exceed max stack size while shift clicking (raoulvdberge)
|
||||||
- Fixed Wrench clearing NBT data when reset causing problems with Morph O Tool (raoulvdberge)
|
- Fixed Wrench clearing NBT data when reset causing problems with Morph O Tool (raoulvdberge)
|
||||||
|
|||||||
@@ -84,8 +84,9 @@ public final class RSUtils {
|
|||||||
buf.writeInt(Item.getIdFromItem(stack.getItem()));
|
buf.writeInt(Item.getIdFromItem(stack.getItem()));
|
||||||
buf.writeInt(stack.getCount());
|
buf.writeInt(stack.getCount());
|
||||||
buf.writeInt(stack.getItemDamage());
|
buf.writeInt(stack.getItemDamage());
|
||||||
|
ByteBufUtils.writeTag(buf, stack.getItem().getNBTShareTag(stack));
|
||||||
|
|
||||||
if (network != null) {
|
if (network != null) {
|
||||||
ByteBufUtils.writeTag(buf, stack.getItem().getNBTShareTag(stack));
|
|
||||||
buf.writeInt(API.instance().getItemStackHashCode(stack));
|
buf.writeInt(API.instance().getItemStackHashCode(stack));
|
||||||
buf.writeBoolean(network.hasPattern(stack));
|
buf.writeBoolean(network.hasPattern(stack));
|
||||||
buf.writeBoolean(displayCraftText);
|
buf.writeBoolean(displayCraftText);
|
||||||
|
|||||||
@@ -2,10 +2,12 @@ package com.raoulvdberge.refinedstorage.apiimpl.network.grid;
|
|||||||
|
|
||||||
import com.raoulvdberge.refinedstorage.RS;
|
import com.raoulvdberge.refinedstorage.RS;
|
||||||
import com.raoulvdberge.refinedstorage.RSUtils;
|
import com.raoulvdberge.refinedstorage.RSUtils;
|
||||||
|
import com.raoulvdberge.refinedstorage.api.autocrafting.ICraftingPattern;
|
||||||
import com.raoulvdberge.refinedstorage.api.autocrafting.task.ICraftingTask;
|
import com.raoulvdberge.refinedstorage.api.autocrafting.task.ICraftingTask;
|
||||||
import com.raoulvdberge.refinedstorage.api.network.INetworkMaster;
|
import com.raoulvdberge.refinedstorage.api.network.INetworkMaster;
|
||||||
import com.raoulvdberge.refinedstorage.api.network.grid.IItemGridHandler;
|
import com.raoulvdberge.refinedstorage.api.network.grid.IItemGridHandler;
|
||||||
import com.raoulvdberge.refinedstorage.api.network.item.INetworkItem;
|
import com.raoulvdberge.refinedstorage.api.network.item.INetworkItem;
|
||||||
|
import com.raoulvdberge.refinedstorage.api.util.IStackList;
|
||||||
import com.raoulvdberge.refinedstorage.apiimpl.API;
|
import com.raoulvdberge.refinedstorage.apiimpl.API;
|
||||||
import com.raoulvdberge.refinedstorage.apiimpl.autocrafting.task.CraftingTask;
|
import com.raoulvdberge.refinedstorage.apiimpl.autocrafting.task.CraftingTask;
|
||||||
import com.raoulvdberge.refinedstorage.apiimpl.network.item.NetworkItemWirelessCraftingMonitor;
|
import com.raoulvdberge.refinedstorage.apiimpl.network.item.NetworkItemWirelessCraftingMonitor;
|
||||||
@@ -142,7 +144,18 @@ public class ItemGridHandler implements IItemGridHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCraftingPreviewRequested(EntityPlayerMP player, int hash, int quantity) {
|
public void onCraftingPreviewRequested(EntityPlayerMP player, int hash, int quantity) {
|
||||||
ItemStack stack = network.getItemStorageCache().getList().get(hash);
|
IStackList<ItemStack> cache = network.getItemStorageCache().getList().copy();
|
||||||
|
|
||||||
|
// Since patterns aren't in the cache by default anymore, we add them here manually again
|
||||||
|
for (ICraftingPattern pattern : network.getPatterns()) {
|
||||||
|
for (ItemStack output : pattern.getOutputs()) {
|
||||||
|
if (output != null) {
|
||||||
|
cache.add(output);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemStack stack = cache.get(hash);
|
||||||
|
|
||||||
if (stack != null) {
|
if (stack != null) {
|
||||||
Thread calculationThread = new Thread(() -> {
|
Thread calculationThread = new Thread(() -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user