From e331712585bdbcbaba046d13be2b51dc17439e1f Mon Sep 17 00:00:00 2001 From: Raoul Van den Berge Date: Fri, 24 Jun 2016 20:01:24 +0200 Subject: [PATCH] 0.7.18 in one commit. --- CHANGELOG.md | 5 +++++ build.gradle | 2 +- src/main/java/refinedstorage/RefinedStorage.java | 2 +- src/main/java/refinedstorage/block/BlockCable.java | 4 ++-- src/main/java/refinedstorage/tile/TileSlave.java | 8 +++----- src/main/resources/mcmod.info | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d535e622f..5271d1881 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Refined Storage Changelog +### 0.7.18 +**Bugfixes** +- Fixed cables sending updates when not needed +- Fixed cables not connecting to foreign machines that implement the API + ### 0.7.17 **Bugfixes** - Fixed getting wrong items back in grid diff --git a/build.gradle b/build.gradle index d587f542f..54187ccbe 100755 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ buildscript { } apply plugin: 'net.minecraftforge.gradle.forge' -version = "0.7.17" +version = "0.7.18" group = "refinedstorage" archivesBaseName = "refinedstorage" diff --git a/src/main/java/refinedstorage/RefinedStorage.java b/src/main/java/refinedstorage/RefinedStorage.java index df43040ea..63b348859 100755 --- a/src/main/java/refinedstorage/RefinedStorage.java +++ b/src/main/java/refinedstorage/RefinedStorage.java @@ -19,7 +19,7 @@ import refinedstorage.proxy.CommonProxy; @Mod(modid = RefinedStorage.ID, version = RefinedStorage.VERSION) public final class RefinedStorage { public static final String ID = "refinedstorage"; - public static final String VERSION = "0.7.17"; + public static final String VERSION = "0.7.18"; public static final SimpleNetworkWrapper NETWORK = NetworkRegistry.INSTANCE.newSimpleChannel(ID); diff --git a/src/main/java/refinedstorage/block/BlockCable.java b/src/main/java/refinedstorage/block/BlockCable.java index e8b58c412..4c26800c1 100755 --- a/src/main/java/refinedstorage/block/BlockCable.java +++ b/src/main/java/refinedstorage/block/BlockCable.java @@ -10,8 +10,8 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import refinedstorage.RefinedStorageBlocks; +import refinedstorage.api.RefinedStorageCapabilities; import refinedstorage.tile.TileCable; -import refinedstorage.tile.TileSlave; public class BlockCable extends BlockSlave { public static final AxisAlignedBB CABLE_AABB = new AxisAlignedBB(4 * (1F / 16F), 4 * (1F / 16F), 4 * (1F / 16F), 1 - 4 * (1F / 16F), 1 - 4 * (1F / 16F), 1 - 4 * (1F / 16F)); @@ -57,7 +57,7 @@ public class BlockCable extends BlockSlave { } public static boolean hasConnectionWith(IBlockAccess world, BlockPos pos) { - return world.getBlockState(pos).getBlock() == RefinedStorageBlocks.CONTROLLER || world.getTileEntity(pos) instanceof TileSlave; + return world.getBlockState(pos).getBlock() == RefinedStorageBlocks.CONTROLLER || (world.getTileEntity(pos) != null && world.getTileEntity(pos).hasCapability(RefinedStorageCapabilities.NETWORK_SLAVE_CAPABILITY, null)); } @Override diff --git a/src/main/java/refinedstorage/tile/TileSlave.java b/src/main/java/refinedstorage/tile/TileSlave.java index 749bca0de..37ae190c6 100755 --- a/src/main/java/refinedstorage/tile/TileSlave.java +++ b/src/main/java/refinedstorage/tile/TileSlave.java @@ -52,7 +52,7 @@ public abstract class TileSlave extends TileBase implements INetworkSlave, ISync updateSlave(); } - if (active != isActive()) { + if (active != isActive() && canSendConnectivityUpdate()) { RefinedStorageUtils.updateBlock(worldObj, pos); active = isActive(); @@ -68,9 +68,7 @@ public abstract class TileSlave extends TileBase implements INetworkSlave, ISync this.network = network; this.connected = true; - if (!(this instanceof TileCable)) { - this.network.addSlave(this); - } + this.network.addSlave(this); world.notifyNeighborsOfStateChange(pos, getBlockType()); @@ -235,6 +233,6 @@ public abstract class TileSlave extends TileBase implements INetworkSlave, ISync @Override public boolean equals(Object other) { - return other instanceof TileSlave && ((TileSlave) other).getPos().equals(pos); + return other instanceof TileSlave && ((TileSlave) other).getPosition().equals(getPosition()); } } diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index f17c3a1cf..4902fb64b 100755 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "refinedstorage", "name": "Refined Storage", "description": "A Minecraft mod all about storage.", - "version": "0.7.17", + "version": "0.7.18", "mcversion": "1.9.4", "url": "", "updateUrl": "",