From 3e4cf9b93f5d32282acb01d378da7409abff5c47 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Mon, 3 Jul 2017 21:51:17 +0100 Subject: [PATCH] Fix server kicking client when using the saw mill, closes #1182 #releaseBuild --- build.gradle | 2 +- .../tiles/multiblock/TileIndustrialSawmill.java | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index c874aa0be..0ab34136f 100644 --- a/build.gradle +++ b/build.gradle @@ -75,7 +75,7 @@ configurations { compile.extendsFrom shade } -version = "2.6.5" +version = "2.6.6" def ENV = System.getenv() if (ENV.BUILD_NUMBER) { diff --git a/src/main/java/techreborn/tiles/multiblock/TileIndustrialSawmill.java b/src/main/java/techreborn/tiles/multiblock/TileIndustrialSawmill.java index 00eb76512..488a59c52 100644 --- a/src/main/java/techreborn/tiles/multiblock/TileIndustrialSawmill.java +++ b/src/main/java/techreborn/tiles/multiblock/TileIndustrialSawmill.java @@ -73,7 +73,7 @@ public class TileIndustrialSawmill extends TilePowerAcceptor public void update() { super.update(); - if (this.getMutliBlock()) { + if (this.getMutliBlock() && !world.isRemote) { final ItemStack wood = this.inventory.getStackInSlot(0); if (this.tickTime == 0) { if (!wood.isEmpty()) { @@ -83,7 +83,6 @@ public class TileIndustrialSawmill extends TilePowerAcceptor Object woodRecipeObj = sawmillRecipe.getInputs().get(0); if (isValidForRecipe(sawmillRecipe)) { this.useEnergy(sawmillRecipe.euPerTick); - this.syncWithAll(); this.tickTime = 1; smRecipe = sawmillRecipe; } @@ -276,10 +275,18 @@ public class TileIndustrialSawmill extends TilePowerAcceptor return this.inventory; } + public int getTickTime() { + return tickTime; + } + + public void setTickTime(int tickTime) { + this.tickTime = tickTime; + } + @Override public BuiltContainer createContainer(final EntityPlayer player) { return new ContainerBuilder("industrialsawmill").player(player.inventory).inventory(8, 84).hotbar(8, 142) .addInventory().tile(this).slot(0, 32, 26).slot(1, 32, 44).outputSlot(2, 84, 35).outputSlot(3, 102, 35) - .outputSlot(4, 120, 35).syncEnergyValue().addInventory().create(); + .outputSlot(4, 120, 35).syncEnergyValue().syncIntegerValue(this::getTickTime, this::setTickTime).addInventory().create(); } }