More improvements
This commit is contained in:
@@ -286,22 +286,6 @@ public class TileController extends TileBase implements IEnergyReceiver, INetwor
|
|||||||
craftingTasksToCancel.add(task);
|
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() {
|
public List<CraftingPattern> getPatterns() {
|
||||||
return patterns;
|
return patterns;
|
||||||
}
|
}
|
||||||
|
@@ -265,14 +265,17 @@ public class TileInterface extends TileMachine implements ICompareConfig, ISided
|
|||||||
public IInventory getDroppedInventory() {
|
public IInventory getDroppedInventory() {
|
||||||
InventorySimple dummy = new InventorySimple(null, 9 + 9 + 4);
|
InventorySimple dummy = new InventorySimple(null, 9 + 9 + 4);
|
||||||
|
|
||||||
|
// Importing slots
|
||||||
for (int i = 0; i < 9; ++i) {
|
for (int i = 0; i < 9; ++i) {
|
||||||
dummy.setInventorySlotContents(i, inventory.getStackInSlot(i));
|
dummy.setInventorySlotContents(i, inventory.getStackInSlot(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Exporting slots
|
||||||
for (int i = 0; i < 9; ++i) {
|
for (int i = 0; i < 9; ++i) {
|
||||||
dummy.setInventorySlotContents(9 + i, inventory.getStackInSlot(18 + i));
|
dummy.setInventorySlotContents(9 + i, inventory.getStackInSlot(18 + i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Upgrade slots
|
||||||
for (int i = 0; i < 4; ++i) {
|
for (int i = 0; i < 4; ++i) {
|
||||||
dummy.setInventorySlotContents(18 + i, upgradesInventory.getStackInSlot(i));
|
dummy.setInventorySlotContents(18 + i, upgradesInventory.getStackInSlot(i));
|
||||||
}
|
}
|
||||||
|
@@ -357,6 +357,8 @@ public class TileGrid extends TileMachine implements IGrid {
|
|||||||
public IInventory getDroppedInventory() {
|
public IInventory getDroppedInventory() {
|
||||||
if (getType() == EnumGridType.CRAFTING) {
|
if (getType() == EnumGridType.CRAFTING) {
|
||||||
return craftingInventory;
|
return craftingInventory;
|
||||||
|
} else if (getType() == EnumGridType.PATTERN) {
|
||||||
|
return patternsInventory;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@@ -167,6 +167,7 @@ public class TileSolderer extends TileMachine implements IInventory, ISidedInven
|
|||||||
if (progress > duration) {
|
if (progress > duration) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (int) ((float) progress / (float) duration * (float) i);
|
return (int) ((float) progress / (float) duration * (float) i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user