More improvements

This commit is contained in:
Raoul Van den Berge
2016-05-09 21:44:57 +02:00
parent 012a2c19dd
commit 920a1212e1
4 changed files with 6 additions and 16 deletions

View File

@@ -286,22 +286,6 @@ public class TileController extends TileBase implements IEnergyReceiver, INetwor
craftingTasksToCancel.add(task);
}
public int getCraftingTaskCount(CraftingPattern pattern, int flags) {
int amount = 0;
for (int i = 0; i < craftingTasks.size(); ++i) {
if (craftingTasks.get(i).getPattern().comparePattern(worldObj, pattern, flags)) {
amount++;
}
}
return amount;
}
public boolean hasCraftingTask(CraftingPattern pattern, int flags) {
return getCraftingTaskCount(pattern, flags) > 0;
}
public List<CraftingPattern> getPatterns() {
return patterns;
}

View File

@@ -265,14 +265,17 @@ public class TileInterface extends TileMachine implements ICompareConfig, ISided
public IInventory getDroppedInventory() {
InventorySimple dummy = new InventorySimple(null, 9 + 9 + 4);
// Importing slots
for (int i = 0; i < 9; ++i) {
dummy.setInventorySlotContents(i, inventory.getStackInSlot(i));
}
// Exporting slots
for (int i = 0; i < 9; ++i) {
dummy.setInventorySlotContents(9 + i, inventory.getStackInSlot(18 + i));
}
// Upgrade slots
for (int i = 0; i < 4; ++i) {
dummy.setInventorySlotContents(18 + i, upgradesInventory.getStackInSlot(i));
}

View File

@@ -357,6 +357,8 @@ public class TileGrid extends TileMachine implements IGrid {
public IInventory getDroppedInventory() {
if (getType() == EnumGridType.CRAFTING) {
return craftingInventory;
} else if (getType() == EnumGridType.PATTERN) {
return patternsInventory;
}
return null;

View File

@@ -167,6 +167,7 @@ public class TileSolderer extends TileMachine implements IInventory, ISidedInven
if (progress > duration) {
return i;
}
return (int) ((float) progress / (float) duration * (float) i);
}