-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d9df32
commit 116eb92
Showing
15 changed files
with
52 additions
and
7 deletions.
There are no files selected for viewing
Binary file added
BIN
+376 Bytes
assets/sprites/blocks/distribution/distribution/logistics-merger.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 modified
BIN
-46 Bytes
(77%)
assets/sprites/blocks/distribution/distribution/logistics-overlay-0.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 modified
BIN
-59 Bytes
(73%)
assets/sprites/blocks/distribution/distribution/logistics-overlay-1.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 modified
BIN
-43 Bytes
(80%)
assets/sprites/blocks/distribution/distribution/logistics-overlay-2.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 modified
BIN
-22 Bytes
(91%)
assets/sprites/blocks/distribution/distribution/logistics-overlay-3.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
BIN
+172 Bytes
assets/sprites/blocks/distribution/distribution/logistics-overlay-4.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
BIN
+217 Bytes
assets/sprites/blocks/distribution/distribution/logistics-overlay-5.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 modified
BIN
-11 Bytes
(99%)
assets/sprites/blocks/distribution/distribution/logistics-upper.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 not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/newhorizon/expand/block/distribution/transport/AdaptDirectionMerger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package newhorizon.expand.block.distribution.transport; | ||
|
||
import arc.util.Nullable; | ||
import mindustry.gen.Building; | ||
import mindustry.type.Item; | ||
import mindustry.world.Edges; | ||
|
||
public class AdaptDirectionMerger extends AdaptDirectionalRouter{ | ||
public AdaptDirectionMerger(String name, AdaptConveyor conveyorBlock) { | ||
super(name, conveyorBlock); | ||
} | ||
|
||
public class AdaptDirectionalMergerBuild extends AdaptDirectionalRouterBuild{ | ||
|
||
public void draw() { | ||
LogisticsBlock.draw(this, cBlock, upperIndex, 4, sortItem); | ||
} | ||
|
||
@Nullable | ||
public Building target(){ | ||
if(front().team == team && front().acceptItem(this, current)){ | ||
return front(); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
@Override | ||
public boolean acceptItem(Building source, Item item){ | ||
return current == null && items.total() == 0 && (item == sortItem || sortItem == null) && | ||
(Edges.getFacingEdge(source.tile(), tile).relativeTo(tile) != (rotation + 2) % 4); | ||
} | ||
|
||
@Override | ||
public int removeStack(Item item, int amount){ | ||
int removed = super.removeStack(item, amount); | ||
if(item == current) current = null; | ||
return removed; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters