Bug Fix on Manipulator Stack injection into chests
Manipulator was stacking up items more than there max stack size Also i Change the .gitignore too support the fact i use the textures in the src folder for my eclipse to function. I would have use the include bat but it failed to function I Also added a simple boolean in TileEntityAssemblyNetwork to test everything without having a power supply attacked to the blocks.
This commit is contained in:
parent
45f6a4fde4
commit
27c4b3b197
3 changed files with 11 additions and 5 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,7 +1,11 @@
|
|||
*.bat
|
||||
*.sh
|
||||
*.db
|
||||
*.exe
|
||||
/*/
|
||||
/src/minecraft/assemblyline/textures
|
||||
/src/minecraft/assemblyline/language
|
||||
/src/minecraft/assemblyline/conveyor.ogg
|
||||
LICENSE.txt
|
||||
CHANGELOG
|
||||
|
||||
|
|
|
@ -23,7 +23,8 @@ public abstract class TileEntityAssemblyNetwork extends TileEntityElectricityRec
|
|||
* The amount of watts received.
|
||||
*/
|
||||
public double wattsReceived = 0;
|
||||
|
||||
|
||||
public boolean debugMode = false;
|
||||
/**
|
||||
* The range in which power can be transfered.
|
||||
*/
|
||||
|
@ -31,7 +32,7 @@ public abstract class TileEntityAssemblyNetwork extends TileEntityElectricityRec
|
|||
|
||||
public boolean isRunning()
|
||||
{
|
||||
return this.powerTransferRange > 0 || this.wattsReceived > this.getRequest().getWatts();
|
||||
return debugMode || this.powerTransferRange > 0 || this.wattsReceived > this.getRequest().getWatts();
|
||||
}
|
||||
|
||||
public void updatePowerTransferRange()
|
||||
|
|
|
@ -305,7 +305,7 @@ public class TileEntityManipulator extends TileEntityFilterable implements IRota
|
|||
if (inventory.getSizeInventory() > slotIndex)
|
||||
{
|
||||
ItemStack stackInInventory = inventory.getStackInSlot(slotIndex);
|
||||
|
||||
|
||||
if (stackInInventory == null)
|
||||
{
|
||||
inventory.setInventorySlotContents(slotIndex, itemStack);
|
||||
|
@ -313,9 +313,10 @@ public class TileEntityManipulator extends TileEntityFilterable implements IRota
|
|||
return null;
|
||||
}
|
||||
else if (stackInInventory.isItemEqual(itemStack) && stackInInventory.isStackable())
|
||||
{
|
||||
{
|
||||
stackInInventory = stackInInventory.copy();
|
||||
int rejectedAmount = Math.max((stackInInventory.stackSize + itemStack.stackSize) - inventory.getInventoryStackLimit(), 0);
|
||||
int stackLim = Math.min(inventory.getInventoryStackLimit(), itemStack.getMaxStackSize());
|
||||
int rejectedAmount = Math.max((stackInInventory.stackSize + itemStack.stackSize) - stackLim , 0);
|
||||
stackInInventory.stackSize = Math.min(Math.max((stackInInventory.stackSize + itemStack.stackSize - rejectedAmount), 0), inventory.getInventoryStackLimit());
|
||||
itemStack.stackSize = rejectedAmount;
|
||||
inventory.setInventorySlotContents(slotIndex, stackInInventory);
|
||||
|
|
Loading…
Reference in a new issue