This commit is contained in:
Modmuss50 2015-11-18 19:41:37 +00:00
parent 0f09088813
commit 806cf757a5
2 changed files with 23 additions and 26 deletions

View file

@ -79,7 +79,7 @@ public class ContainerRollingMachine extends RebornContainer {
if (this.currentItemBurnTime != tile.runTime) {
crafting.sendProgressBarUpdate(this, 0, tile.runTime);
}
if (this.burnTime != tile.tickTime) {
if (this.burnTime != tile.tickTime || tile.tickTime == -1) {
crafting.sendProgressBarUpdate(this, 1, tile.tickTime);
}
if (this.energy != (int) tile.getEnergy()) {
@ -100,6 +100,9 @@ public class ContainerRollingMachine extends RebornContainer {
this.energy = value;
}
this.tile.runTime = this.currentItemBurnTime;
if(this.burnTime == -1){
this.burnTime = 0;
}
this.tile.tickTime = this.burnTime;
this.tile.setEnergy(this.energy);
}

View file

@ -34,26 +34,21 @@ public class TileRollingMachine extends TilePowerAcceptor implements IWrenchable
public double getMaxPower() {
return 100000;
}
public void charge(int slot)
{
if(getStackInSlot(slot) != null)
{
if(getStackInSlot(slot).getItem() instanceof IElectricItem)
{
if(getEnergy() != getMaxPower())
{
ItemStack stack = inventory.getStackInSlot(slot);
double MaxCharge = ((IElectricItem) stack.getItem()).getMaxCharge(stack);
double CurrentCharge = ElectricItem.manager.getCharge(stack);
if (CurrentCharge != 0)
{
ElectricItem.manager.discharge(stack, 5, 4, false, false, false);
addEnergy(5);
}
}
}
}
public void charge(int slot) {
if (getStackInSlot(slot) != null) {
if (getStackInSlot(slot).getItem() instanceof IElectricItem) {
if (getEnergy() != getMaxPower()) {
ItemStack stack = inventory.getStackInSlot(slot);
double MaxCharge = ((IElectricItem) stack.getItem()).getMaxCharge(stack);
double CurrentCharge = ElectricItem.manager.getCharge(stack);
if (CurrentCharge != 0) {
ElectricItem.manager.discharge(stack, 5, 4, false, false, false);
addEnergy(5);
}
}
}
}
}
@Override
@ -98,14 +93,13 @@ public class TileRollingMachine extends TilePowerAcceptor implements IWrenchable
craftMatrix, worldObj);
if (currentRecipe != null && canMake()) {
if (tickTime >= runTime) {
currentRecipe = RollingMachineRecipe.instance
.findMatchingRecipe(craftMatrix, worldObj);
currentRecipe = RollingMachineRecipe.instance.findMatchingRecipe(craftMatrix, worldObj);
if (currentRecipe != null) {
boolean hasCrafted = false;
if (inventory.getStackInSlot(0) == null) {
inventory
.setInventorySlotContents(0, currentRecipe);
tickTime = 0;
tickTime = -1;
hasCrafted = true;
} else {
if (inventory.getStackInSlot(0).stackSize
@ -115,7 +109,7 @@ public class TileRollingMachine extends TilePowerAcceptor implements IWrenchable
stack.stackSize = stack.stackSize
+ currentRecipe.stackSize;
inventory.setInventorySlotContents(0, stack);
tickTime = 0;
tickTime = -1;
hasCrafted = true;
}
}
@ -135,7 +129,7 @@ public class TileRollingMachine extends TilePowerAcceptor implements IWrenchable
}
}
if (currentRecipe == null) {
tickTime = 0;
tickTime = -1;
}
} else {
currentRecipe = RollingMachineRecipe.instance.findMatchingRecipe(