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