Fix some tiles update on clientside
This commit is contained in:
parent
0c4895efa4
commit
25e683b2e9
4 changed files with 55 additions and 46 deletions
|
@ -39,11 +39,13 @@ public class TileCompressor extends TilePowerAcceptor
|
|||
|
||||
@Override
|
||||
public void update() {
|
||||
if (!this.world.isRemote) {
|
||||
super.update();
|
||||
this.crafter.updateEntity();
|
||||
this.upgradeHandler.tick();
|
||||
this.charge(3);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(final EntityPlayer entityPlayer, final EnumFacing side) {
|
||||
|
|
|
@ -40,7 +40,9 @@ public class TileElectricFurnace extends TilePowerAcceptor
|
|||
|
||||
@Override
|
||||
public void update() {
|
||||
if (!this.world.isRemote) {
|
||||
super.update();
|
||||
|
||||
final boolean burning = this.isBurning();
|
||||
boolean updateInventory = false;
|
||||
if (this.isBurning() && this.canSmelt()) {
|
||||
|
@ -66,6 +68,7 @@ public class TileElectricFurnace extends TilePowerAcceptor
|
|||
this.markDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void cookItems() {
|
||||
if (this.canSmelt()) {
|
||||
|
@ -87,7 +90,7 @@ public class TileElectricFurnace extends TilePowerAcceptor
|
|||
public boolean canSmelt() {
|
||||
if (this.getStackInSlot(this.input1) == ItemStack.EMPTY) {
|
||||
return false;
|
||||
} else {
|
||||
}
|
||||
final ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(this.getStackInSlot(this.input1));
|
||||
if (itemstack == ItemStack.EMPTY)
|
||||
return false;
|
||||
|
@ -98,7 +101,6 @@ public class TileElectricFurnace extends TilePowerAcceptor
|
|||
final int result = this.getStackInSlot(this.output).getCount() + itemstack.getCount();
|
||||
return result <= this.getInventoryStackLimit() && result <= itemstack.getMaxStackSize();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isBurning() {
|
||||
return this.getEnergy() > this.cost;
|
||||
|
@ -153,7 +155,8 @@ public class TileElectricFurnace extends TilePowerAcceptor
|
|||
// ISidedInventory
|
||||
@Override
|
||||
public int[] getSlotsForFace(final EnumFacing side) {
|
||||
return side == EnumFacing.DOWN ? TileElectricFurnace.SLOTS_BOTTOM : side == EnumFacing.UP ? TileElectricFurnace.SLOTS_TOP : TileElectricFurnace.SLOTS_SIDES;
|
||||
return side == EnumFacing.DOWN ? TileElectricFurnace.SLOTS_BOTTOM
|
||||
: side == EnumFacing.UP ? TileElectricFurnace.SLOTS_TOP : TileElectricFurnace.SLOTS_SIDES;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -42,11 +42,13 @@ implements IWrenchable, IInventoryProvider, IRecipeCrafterProvider, IContainerPr
|
|||
|
||||
@Override
|
||||
public void update() {
|
||||
if (!this.world.isRemote) {
|
||||
super.update();
|
||||
this.crafter.updateEntity();
|
||||
this.upgradeHandler.tick();
|
||||
this.charge(3);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(final EntityPlayer entityPlayer, final EnumFacing side) {
|
||||
|
|
|
@ -43,12 +43,14 @@ implements IWrenchable, IInventoryProvider, IRecipeCrafterProvider, IContainerPr
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
public void update() {
|
||||
if (!this.world.isRemote) {
|
||||
super.update();
|
||||
this.upgradeHandler.tick();
|
||||
//charge(3); TODO
|
||||
this.charge(3);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(final EntityPlayer entityPlayer, final EnumFacing side) {
|
||||
|
|
Loading…
Reference in a new issue