diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index b0840df97e..2160e2156c 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -4647,6 +4647,8 @@ public class UnitTypes{ useUnitCap = false; killable = false; physics = false; + internal = true; + internalGenerateSprites = true; flyingLayer = Layer.flyingUnit - 1f; drag = 0.33f; diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index 5ac6b778b2..4b4b90593d 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -1843,7 +1843,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, } public boolean canPickup(){ - return block.canPickup; + return block.allowedInPayloads; } /** Called right before this building is picked up. */ diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index 5f073c64dd..84d636d42d 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -67,6 +67,8 @@ public class Block extends UnlockableContent implements Senseable{ public boolean acceptsItems = false; /** If true, this block won't be affected by the onlyDepositCore rule. */ public boolean alwaysAllowDeposit = false; + /** If false, this block cannot be placed in payloads. */ + public boolean allowedInPayloads = true; /** Cooldown, in seconds, applied to player item depositing when any item is deposited to this block. Overrides the itemDepositCooldown if non-negative. */ public float depositCooldown = -1f; /** If true, all item capacities of this block are separate instead of pooled as one number. */ @@ -172,7 +174,8 @@ public class Block extends UnlockableContent implements Senseable{ public boolean updateInUnits = true; /** if true, this block updates in payloads in units regardless of the experimental game rule */ public boolean alwaysUpdateInUnits = false; - /** if true, this block can be picked up in payloads */ + /** @deprecated use allowedInPayloads instead */ + @Deprecated public boolean canPickup = true; /** if false, only incinerable liquids are dropped when deconstructing; otherwise, all liquids are dropped. */ public boolean deconstructDropAllLiquid = false; diff --git a/core/src/mindustry/world/blocks/defense/BaseShield.java b/core/src/mindustry/world/blocks/defense/BaseShield.java index e279f7b7e2..dd45463fcc 100644 --- a/core/src/mindustry/world/blocks/defense/BaseShield.java +++ b/core/src/mindustry/world/blocks/defense/BaseShield.java @@ -62,7 +62,7 @@ public class BaseShield extends Block{ hasPower = true; update = solid = true; rebuildable = false; - canPickup = true; + allowedInPayloads = false; } @Override diff --git a/core/src/mindustry/world/blocks/defense/TargetDummy.java b/core/src/mindustry/world/blocks/defense/TargetDummy.java index 171fddb561..e707aebf8d 100644 --- a/core/src/mindustry/world/blocks/defense/TargetDummy.java +++ b/core/src/mindustry/world/blocks/defense/TargetDummy.java @@ -38,6 +38,7 @@ public class TargetDummy extends Block{ configurable = logicConfigurable = true; underBullets = true; targetable = false; + allowedInPayloads = false; saveConfig = true; @@ -90,6 +91,11 @@ public class TargetDummy extends Block{ public float unitArmor; public Team unitTeam = Team.derelict; + @Override + public boolean canPickup(){ + return false; + } + @Override public void created(){ if(unitTeam == Team.derelict) unitTeam = team; diff --git a/core/src/mindustry/world/blocks/payloads/PayloadSource.java b/core/src/mindustry/world/blocks/payloads/PayloadSource.java index 3456152c4d..ede71dd09c 100644 --- a/core/src/mindustry/world/blocks/payloads/PayloadSource.java +++ b/core/src/mindustry/world/blocks/payloads/PayloadSource.java @@ -17,7 +17,6 @@ import mindustry.io.*; import mindustry.type.*; import mindustry.world.*; import mindustry.world.blocks.*; -import mindustry.world.blocks.storage.*; import static mindustry.Vars.*; @@ -87,7 +86,7 @@ public class PayloadSource extends PayloadBlock{ } public boolean canProduce(Block b){ - return !b.removed && b.isVisible() && b.size < size && !(b instanceof CoreBlock) && !state.rules.isBanned(b) && b.environmentBuildable(); + return !b.removed && b.isVisible() && b.size < size && b.allowedInPayloads && !state.rules.isBanned(b) && b.environmentBuildable(); } public boolean canProduce(UnitType t){ diff --git a/core/src/mindustry/world/blocks/storage/CoreBlock.java b/core/src/mindustry/world/blocks/storage/CoreBlock.java index 0c726491e4..57b8ffcd2d 100644 --- a/core/src/mindustry/world/blocks/storage/CoreBlock.java +++ b/core/src/mindustry/world/blocks/storage/CoreBlock.java @@ -83,6 +83,7 @@ public class CoreBlock extends StorageBlock{ envEnabled |= Env.space; drawCached = false; drawDynamic = true; + allowedInPayloads = false; //support everything replaceable = false; @@ -673,12 +674,6 @@ public class CoreBlock extends StorageBlock{ } } - @Override - public boolean canPickup(){ - //cores can never be picked up - return false; - } - @Override public void onDestroyed(){ if(state.rules.coreCapture){