mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-20 20:12:19 +00:00
Fix #1441 Centrifuge preview slot should show item being centrifuged, not its result
This commit is contained in:
1 parent
2d25754731
commit
64f64f2b5c
2 files changed
+10
-14
No files matched your search
@@ -118,12 +118,11 @@ public class TileCentrifuge extends TilePowered implements ISocketable, ISidedIn
|
||||
@Override
|
||||
public boolean workCycle() {
|
||||
if (tryAddPending()) {
|
||||
setCurrentPreviewItem();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!pendingProducts.isEmpty()) {
|
||||
setCurrentPreviewItem();
|
||||
craftPreviewInventory.setInventorySlotContents(0, null);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -134,10 +133,13 @@ public class TileCentrifuge extends TilePowered implements ISocketable, ISidedIn
|
||||
// We are done, add products to queue
|
||||
Collection<ItemStack> products = currentRecipe.getProducts(worldObj.rand);
|
||||
pendingProducts.addAll(products);
|
||||
|
||||
getInternalInventory().decrStackSize(InventoryCentrifuge.SLOT_RESOURCE, 1);
|
||||
|
||||
setCurrentPreviewItem();
|
||||
//Add Item to preview slot.
|
||||
ItemStack previewStack = getInternalInventory().getStackInSlot(InventoryCentrifuge.SLOT_RESOURCE).copy();
|
||||
previewStack.stackSize=1;
|
||||
craftPreviewInventory.setInventorySlotContents(0, previewStack);
|
||||
|
||||
getInternalInventory().decrStackSize(InventoryCentrifuge.SLOT_RESOURCE, 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -166,6 +168,9 @@ public class TileCentrifuge extends TilePowered implements ISocketable, ISidedIn
|
||||
|
||||
if (added) {
|
||||
pendingProducts.pop();
|
||||
if(pendingProducts.isEmpty()){
|
||||
craftPreviewInventory.setInventorySlotContents(0, null);
|
||||
}
|
||||
}
|
||||
|
||||
getErrorLogic().setCondition(!added, EnumErrorCode.NO_SPACE_INVENTORY);
|
||||
@@ -265,14 +270,6 @@ public class TileCentrifuge extends TilePowered implements ISocketable, ISidedIn
|
||||
public IInventory getCraftPreviewInventory() {
|
||||
return craftPreviewInventory;
|
||||
}
|
||||
|
||||
private void setCurrentPreviewItem(){
|
||||
if(!pendingProducts.isEmpty()){
|
||||
craftPreviewInventory.setInventorySlotContents(0, pendingProducts.peek());
|
||||
}else{
|
||||
craftPreviewInventory.setInventorySlotContents(0, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleItemStackForDisplay(ItemStack itemStack) {
|
||||
|
||||
@@ -39,7 +39,6 @@ import forestry.api.core.IStateMapperRegister;
|
||||
import forestry.api.lepidopterology.ButterflyManager;
|
||||
import forestry.api.lepidopterology.EnumFlutterType;
|
||||
import forestry.api.lepidopterology.IButterfly;
|
||||
import forestry.core.blocks.IMachineProperties;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.tiles.TileUtil;
|
||||
import forestry.lepidopterology.blocks.property.PropertyCocoon;
|
||||
|
||||
Reference in new issue
Block a user