Fix client visual glitch with worktable

This commit is contained in:
mezz committed 2017-07-29 00:52:48 -07:00
1 parent f50e7281c5
commit 694cd8103a
2 files changed
+8 -3

No files matched your search

@@ -34,7 +34,7 @@ import forestry.core.utils.InventoryUtil;
import forestry.factory.inventory.InventoryCraftingForestry;
public final class MemorizedRecipe implements INbtWritable, INbtReadable, IStreamable {
private final InventoryCraftingForestry craftMatrix = new InventoryCraftingForestry();
private InventoryCraftingForestry craftMatrix = new InventoryCraftingForestry();
private List<IRecipe> recipes = NonNullList.create();
private int selectedRecipe;
private long lastUsed;
@@ -57,6 +57,10 @@ public final class MemorizedRecipe implements INbtWritable, INbtReadable, IStrea
return craftMatrix;
}
public void setCraftMatrix(InventoryCraftingForestry craftMatrix) {
this.craftMatrix = craftMatrix;
}
public void validate(World world) {
recipes = RecipeUtil.findMatchingRecipes(craftMatrix, world);
if (selectedRecipe > recipes.size()) {
@@ -164,10 +164,11 @@ public class TileWorktable extends TileBase implements ICrafterWorktable {
return false;
}
if (!simulate && !world.isRemote)
if (!simulate)
{
// update crafting display to match the ingredients that were actually used
setCraftingDisplay(crafting);
currentRecipe.setCraftMatrix(crafting);
setCurrentRecipe(currentRecipe);
}
return true;