Skip to content

Commit

Permalink
Re-added tin blocks for legacy reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
Slotterleet committed Jun 29, 2024
1 parent 3fec66e commit 841de38
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 4 deletions.
Binary file added res/sprites/blocks/environment/ore-tin-deep1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/sprites/blocks/environment/ore-tin-deep2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/sprites/blocks/environment/ore-tin-deep3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/sprites/blocks/environment/ore-tin-surface1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/sprites/blocks/environment/ore-tin-surface2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/sprites/blocks/environment/ore-tin-surface3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/sprites/blocks/environment/ore-tin1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/sprites/blocks/environment/ore-tin2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/sprites/blocks/environment/ore-tin3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 16 additions & 4 deletions src/fos/content/FOSBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import fos.type.blocks.defense.*;
import fos.type.blocks.distribution.*;
import fos.type.blocks.environment.*;
import fos.type.blocks.legacy.LegacyReplaceBlock;
import fos.type.blocks.power.*;
import fos.type.blocks.production.*;
import fos.type.blocks.special.*;
Expand Down Expand Up @@ -1787,17 +1788,16 @@ public void setBars() {
purpurWater.asFloor().wall = this;
}};
alienMoss = new OverlayFloor("alien-moss");
oreZinc = new UndergroundOreBlock("ore-zinc"){{
oreZinc = new UndergroundOreBlock("ore-tin"){{
drop = zinc;
}};
oreZincSurface = new OreBlock("ore-zinc-surface"){{
oreZincSurface = new OreBlock("ore-tin-surface"){{
itemDrop = zinc;
// this is stupid - can't place this on shallow water without it.
needsSurface = false;
}};
oreZincDeep = new OreBlock("ore-zinc-deep"){{
oreZincDeep = new OreBlock("ore-tin-deep"){{
itemDrop = zinc;

}};
oreSilver = new UndergroundOreBlock("ore-silver"){{
drop = silver;
Expand Down Expand Up @@ -2075,5 +2075,17 @@ public void setBars() {
}}
);
}};

// legacy blocks, no need to reference
new LegacyReplaceBlock("tin-drill", zincDrill);
new LegacyReplaceBlock("tin-belt", zincBelt);
new LegacyReplaceBlock("tin-junction", zincJunction);
new LegacyReplaceBlock("tin-router", zincRouter);
new LegacyReplaceBlock("tin-bridge", zincBridge);
new LegacyReplaceBlock("tin-sorter", zincSorter);
new LegacyReplaceBlock("tin-wire", zincWire);
new LegacyReplaceBlock("tin-wire-pole", zincWirePole);
new LegacyReplaceBlock("tin-wall", zincWall);
new LegacyReplaceBlock("tin-wall-large", zincWallLarge);
}
}
20 changes: 20 additions & 0 deletions src/fos/type/blocks/legacy/LegacyReplaceBlock.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package fos.type.blocks.legacy;

import mindustry.world.*;
import mindustry.world.blocks.legacy.LegacyBlock;

public class LegacyReplaceBlock extends LegacyBlock {
public Block replacement;

public LegacyReplaceBlock(String name, Block replacement) {
super(name);
this.replacement = replacement;
}

@Override
public void removeSelf(Tile tile) {
// FIXME: always spawns derelict blocks with 0 rotation
int rot = tile.build == null ? 0 : tile.build.rotation;
tile.setBlock(replacement, tile.team(), rot);
}
}

0 comments on commit 841de38

Please sign in to comment.