From f2dd5ba11374bf6e76c046ba11cc4ff4bb6b8c1f Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 22 Oct 2020 09:11:48 -0400 Subject: [PATCH] Fixed #3062 / Fixed #3064 --- core/src/mindustry/content/Blocks.java | 2 ++ core/src/mindustry/world/blocks/distribution/Conveyor.java | 2 +- core/src/mindustry/world/blocks/distribution/MassDriver.java | 4 ++++ core/src/mindustry/world/blocks/storage/StorageBlock.java | 1 + core/src/mindustry/world/meta/BlockFlag.java | 2 ++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index a25ed674fa..ad024618ab 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -1364,12 +1364,14 @@ public class Blocks implements ContentList{ requirements(Category.effect, with(Items.titanium, 250, Items.thorium, 125)); size = 3; itemCapacity = 1000; + flags = EnumSet.of(BlockFlag.storage); }}; container = new StorageBlock("container"){{ requirements(Category.effect, with(Items.titanium, 100)); size = 2; itemCapacity = 300; + flags = EnumSet.of(BlockFlag.storage); }}; unloader = new Unloader("unloader"){{ diff --git a/core/src/mindustry/world/blocks/distribution/Conveyor.java b/core/src/mindustry/world/blocks/distribution/Conveyor.java index 9ad1f01bea..79dbbde0c8 100644 --- a/core/src/mindustry/world/blocks/distribution/Conveyor.java +++ b/core/src/mindustry/world/blocks/distribution/Conveyor.java @@ -67,7 +67,7 @@ public class Conveyor extends Block implements Autotiler{ @Override public boolean blends(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock){ - return (otherblock.outputsItems() || lookingAt(tile, rotation, otherx, othery, otherblock)) + return (otherblock.outputsItems() || (lookingAt(tile, rotation, otherx, othery, otherblock) && otherblock.hasItems)) && lookingAtEither(tile, rotation, otherx, othery, otherrot, otherblock); } diff --git a/core/src/mindustry/world/blocks/distribution/MassDriver.java b/core/src/mindustry/world/blocks/distribution/MassDriver.java index 1776ed7522..9191e7dfe1 100644 --- a/core/src/mindustry/world/blocks/distribution/MassDriver.java +++ b/core/src/mindustry/world/blocks/distribution/MassDriver.java @@ -105,6 +105,10 @@ public class MassDriver extends Block{ Building link = world.build(this.link); boolean hasLink = linkValid(); + if(hasLink){ + this.link = link.pos(); + } + //reload regardless of state if(reload > 0f){ reload = Mathf.clamp(reload - edelta() / reloadTime); diff --git a/core/src/mindustry/world/blocks/storage/StorageBlock.java b/core/src/mindustry/world/blocks/storage/StorageBlock.java index 32b3713350..b7581b4dfb 100644 --- a/core/src/mindustry/world/blocks/storage/StorageBlock.java +++ b/core/src/mindustry/world/blocks/storage/StorageBlock.java @@ -11,6 +11,7 @@ import mindustry.world.blocks.storage.CoreBlock.*; import mindustry.world.meta.*; public class StorageBlock extends Block{ + public StorageBlock(String name){ super(name); hasItems = true; diff --git a/core/src/mindustry/world/meta/BlockFlag.java b/core/src/mindustry/world/meta/BlockFlag.java index a3fe674e37..ca4ded3db3 100644 --- a/core/src/mindustry/world/meta/BlockFlag.java +++ b/core/src/mindustry/world/meta/BlockFlag.java @@ -4,6 +4,8 @@ package mindustry.world.meta; public enum BlockFlag{ /** Enemy core; primary target for all units. */ core, + /** Vault/container/etc */ + storage, /** Something that generates power. */ generator, /** Any turret. */