Added inverted sorter
BIN
core/assets-raw/sprites/blocks/distribution/inverted-sorter.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
@ -845,6 +845,7 @@ block.junction.name = Junction
|
|||||||
block.router.name = Router
|
block.router.name = Router
|
||||||
block.distributor.name = Distributor
|
block.distributor.name = Distributor
|
||||||
block.sorter.name = Sorter
|
block.sorter.name = Sorter
|
||||||
|
block.inverted-sorter.name = Inverted Sorter
|
||||||
block.message.name = Message
|
block.message.name = Message
|
||||||
block.overflow-gate.name = Overflow Gate
|
block.overflow-gate.name = Overflow Gate
|
||||||
block.silicon-smelter.name = Silicon Smelter
|
block.silicon-smelter.name = Silicon Smelter
|
||||||
@ -1066,6 +1067,7 @@ block.junction.description = Acts as a bridge for two crossing conveyor belts. U
|
|||||||
block.bridge-conveyor.description = Advanced item transport block. Allows transporting items over up to 3 tiles of any terrain or building.
|
block.bridge-conveyor.description = Advanced item transport block. Allows transporting items over up to 3 tiles of any terrain or building.
|
||||||
block.phase-conveyor.description = Advanced item transport block. Uses power to teleport items to a connected phase conveyor over several tiles.
|
block.phase-conveyor.description = Advanced item transport block. Uses power to teleport items to a connected phase conveyor over several tiles.
|
||||||
block.sorter.description = Sorts items. If an item matches the selection, it is allowed to pass. Otherwise, the item is outputted to the left and right.
|
block.sorter.description = Sorts items. If an item matches the selection, it is allowed to pass. Otherwise, the item is outputted to the left and right.
|
||||||
|
block.inverted-sorter.descriptions = Processes items like a standard sorter, but outputs selected items to the sides instead.
|
||||||
block.router.description = Accepts items, then outputs them to up to 3 other directions equally. Useful for splitting the materials from one source to multiple targets.\n\n[scarlet]Never use next to production inputs, as they will get clogged by output.[]
|
block.router.description = Accepts items, then outputs them to up to 3 other directions equally. Useful for splitting the materials from one source to multiple targets.\n\n[scarlet]Never use next to production inputs, as they will get clogged by output.[]
|
||||||
block.distributor.description = An advanced router. Splits items to up to 7 other directions equally.
|
block.distributor.description = An advanced router. Splits items to up to 7 other directions equally.
|
||||||
block.overflow-gate.description = A combination splitter and router. Only outputs to the left and right if the front path is blocked.
|
block.overflow-gate.description = A combination splitter and router. Only outputs to the left and right if the front path is blocked.
|
||||||
|
Before Width: | Height: | Size: 725 B After Width: | Height: | Size: 727 B |
Before Width: | Height: | Size: 712 KiB After Width: | Height: | Size: 712 KiB |
Before Width: | Height: | Size: 259 KiB After Width: | Height: | Size: 259 KiB |
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 893 KiB |
Before Width: | Height: | Size: 892 KiB After Width: | Height: | Size: 134 KiB |
@ -58,7 +58,7 @@ public class Blocks implements ContentList{
|
|||||||
phaseWall, phaseWallLarge, surgeWall, surgeWallLarge, mender, mendProjector, overdriveProjector, forceProjector, shockMine,
|
phaseWall, phaseWallLarge, surgeWall, surgeWallLarge, mender, mendProjector, overdriveProjector, forceProjector, shockMine,
|
||||||
|
|
||||||
//transport
|
//transport
|
||||||
conveyor, titaniumConveyor, armoredConveyor, distributor, junction, itemBridge, phaseConveyor, sorter, router, overflowGate, massDriver,
|
conveyor, titaniumConveyor, armoredConveyor, distributor, junction, itemBridge, phaseConveyor, sorter, invertedSorter, router, overflowGate, massDriver,
|
||||||
|
|
||||||
//liquids
|
//liquids
|
||||||
mechanicalPump, rotaryPump, thermalPump, conduit, pulseConduit, liquidRouter, liquidTank, liquidJunction, bridgeConduit, phaseConduit,
|
mechanicalPump, rotaryPump, thermalPump, conduit, pulseConduit, liquidRouter, liquidTank, liquidJunction, bridgeConduit, phaseConduit,
|
||||||
@ -935,7 +935,11 @@ public class Blocks implements ContentList{
|
|||||||
|
|
||||||
sorter = new Sorter("sorter"){{
|
sorter = new Sorter("sorter"){{
|
||||||
requirements(Category.distribution, ItemStack.with(Items.lead, 2, Items.copper, 2));
|
requirements(Category.distribution, ItemStack.with(Items.lead, 2, Items.copper, 2));
|
||||||
|
}};
|
||||||
|
|
||||||
|
invertedSorter = new Sorter("inverted-sorter"){{
|
||||||
|
requirements(Category.distribution, ItemStack.with(Items.lead, 2, Items.copper, 2));
|
||||||
|
invert = true;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
router = new Router("router"){{
|
router = new Router("router"){{
|
||||||
|
@ -31,6 +31,7 @@ public class TechTree implements ContentList{
|
|||||||
|
|
||||||
node(distributor);
|
node(distributor);
|
||||||
node(sorter, () -> {
|
node(sorter, () -> {
|
||||||
|
node(invertedSorter);
|
||||||
node(message);
|
node(message);
|
||||||
node(overflowGate);
|
node(overflowGate);
|
||||||
});
|
});
|
||||||
|
@ -17,6 +17,7 @@ import static io.anuke.mindustry.Vars.content;
|
|||||||
|
|
||||||
public class Sorter extends Block{
|
public class Sorter extends Block{
|
||||||
private static Item lastItem;
|
private static Item lastItem;
|
||||||
|
protected boolean invert;
|
||||||
|
|
||||||
public Sorter(String name){
|
public Sorter(String name){
|
||||||
super(name);
|
super(name);
|
||||||
@ -40,16 +41,6 @@ public class Sorter extends Block{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
@Remote(targets = Loc.both, called = Loc.both, forward = true)
|
|
||||||
public static void setSorterItem(Player player, Tile tile, Item item){
|
|
||||||
if(!Units.canInteract(player, tile)) return;
|
|
||||||
SorterEntity entity = tile.entity();
|
|
||||||
if(entity != null){
|
|
||||||
entity.sortItem = item;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void configured(Tile tile, Player player, int value){
|
public void configured(Tile tile, Player player, int value){
|
||||||
tile.<SorterEntity>entity().sortItem = content.item(value);
|
tile.<SorterEntity>entity().sortItem = content.item(value);
|
||||||
@ -92,7 +83,7 @@ public class Sorter extends Block{
|
|||||||
if(dir == -1) return null;
|
if(dir == -1) return null;
|
||||||
Tile to;
|
Tile to;
|
||||||
|
|
||||||
if(item == entity.sortItem){
|
if((item == entity.sortItem) != invert){
|
||||||
//prevent 3-chains
|
//prevent 3-chains
|
||||||
if(isSame(dest, source) && isSame(dest, dest.getNearby(dir))){
|
if(isSame(dest, source) && isSame(dest, dest.getNearby(dir))){
|
||||||
return null;
|
return null;
|
||||||
@ -115,12 +106,10 @@ public class Sorter extends Block{
|
|||||||
}else{
|
}else{
|
||||||
if(dest.rotation() == 0){
|
if(dest.rotation() == 0){
|
||||||
to = a;
|
to = a;
|
||||||
if(flip)
|
if(flip) dest.rotation((byte)1);
|
||||||
dest.rotation((byte)1);
|
|
||||||
}else{
|
}else{
|
||||||
to = b;
|
to = b;
|
||||||
if(flip)
|
if(flip) dest.rotation((byte)0);
|
||||||
dest.rotation((byte)0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|