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

View file

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