Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anuken
2021-10-26 09:52:07 -04:00
7 changed files with 14 additions and 7 deletions

View File

@@ -155,7 +155,7 @@ public class Weapon implements Cloneable{
Draw.rect(outlineRegion, Draw.rect(outlineRegion,
wx, wy, wx, wy,
outlineRegion.width * Draw.scl * -Mathf.sign(flipSprite), outlineRegion.width * Draw.scl * -Mathf.sign(flipSprite),
region.height * Draw.scl, outlineRegion.height * Draw.scl,
weaponRotation); weaponRotation);
} }
} }

View File

@@ -265,6 +265,8 @@ public class Block extends UnlockableContent{
public boolean quickRotate = true; public boolean quickRotate = true;
/** Main subclass. Non-anonymous. */ /** Main subclass. Non-anonymous. */
public @Nullable Class<?> subclass; public @Nullable Class<?> subclass;
/** Determines if this block gets a higher unloader priority. */
public boolean highUnloadPriority = false;
public float selectScroll; //scroll position for certain blocks public float selectScroll; //scroll position for certain blocks
public Prov<Building> buildType = null; //initialized later public Prov<Building> buildType = null; //initialized later

View File

@@ -42,6 +42,7 @@ public class StackConveyor extends Block implements Autotiler{
hasItems = true; hasItems = true;
itemCapacity = 10; itemCapacity = 10;
conveyorPlacement = true; conveyorPlacement = true;
highUnloadPriority = true;
ambientSound = Sounds.conveyor; ambientSound = Sounds.conveyor;
ambientSoundVolume = 0.004f; ambientSoundVolume = 0.004f;

View File

@@ -25,6 +25,7 @@ public class StorageBlock extends Block{
flags = EnumSet.of(BlockFlag.storage); flags = EnumSet.of(BlockFlag.storage);
allowResupply = true; allowResupply = true;
envEnabled = Env.any; envEnabled = Env.any;
highUnloadPriority = true;
} }
@Override @Override

View File

@@ -11,7 +11,6 @@ import mindustry.gen.*;
import mindustry.type.*; import mindustry.type.*;
import mindustry.world.*; import mindustry.world.*;
import mindustry.world.blocks.*; import mindustry.world.blocks.*;
import mindustry.world.blocks.distribution.*;
import mindustry.world.meta.*; import mindustry.world.meta.*;
import static mindustry.Vars.*; import static mindustry.Vars.*;
@@ -139,7 +138,7 @@ public class Unloader extends Block{
//sort so it gives full priority to blocks that can give but not receive (stackConveyors and Storage), and then by load //sort so it gives full priority to blocks that can give but not receive (stackConveyors and Storage), and then by load
possibleBlocks.sort(Structs.comps( possibleBlocks.sort(Structs.comps(
Structs.comparingBool(e -> e.building.block instanceof StorageBlock || e.building.block instanceof StackConveyor), Structs.comparingBool(e -> e.building.block.highUnloadPriority),
Structs.comparingFloat(e -> e.loadFactor) Structs.comparingFloat(e -> e.loadFactor)
)); ));
@@ -163,7 +162,7 @@ public class Unloader extends Block{
} }
//trade the items //trade the items
if(dumpingFrom != null && dumpingTo != null && dumpingFrom.loadFactor != dumpingTo.loadFactor){ if(dumpingFrom != null && dumpingTo != null && (dumpingFrom.loadFactor != dumpingTo.loadFactor || dumpingFrom.building.block.highUnloadPriority)){
dumpingTo.building.handleItem(this, item); dumpingTo.building.handleItem(this, item);
dumpingFrom.building.removeStack(item, 1); dumpingFrom.building.removeStack(item, 1);
any = true; any = true;

View File

@@ -4,8 +4,8 @@
"address": ["185.104.248.61", "easyplay.su"] "address": ["185.104.248.61", "easyplay.su"]
}, },
{ {
"name": "SMokeOfAnarchy.duckdns.org", "name": "SkaarjDustry",
"address": ["smokeofanarchy.duckdns.org:6853"] "address": ["skaarjproject.duckdns.org"]
}, },
{ {
"name": "{AA}", "name": "{AA}",

View File

@@ -59,6 +59,10 @@
"name": "Phoenix Network", "name": "Phoenix Network",
"address": ["172.104.253.198"] "address": ["172.104.253.198"]
}, },
{
"name": "Xpdustry",
"address": ["xpdustry.fr:7000"]
},
{ {
"name": "Pandorum", "name": "Pandorum",
"address": ["pandorum.su:5018", "pandorum.su:5019", "pandorum.su:5020"] "address": ["pandorum.su:5018", "pandorum.su:5019", "pandorum.su:5020"]