diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ee066f3db8..ea0a1f6872 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,6 +15,8 @@ If you are submitting a new block, make sure it has a name and description, and If you are interested in adding a large mechanic/feature or changing large amounts of code, first contact me (Anuken) via [Discord](https://discord.gg/mindustry) (preferred method) or via e-mail (*anukendev@gmail.com*). For most changes, this should not be necessary. I just want to know if you're doing something big so I can offer advice and/or make sure you're not wasting your time on it. +### Do not make formatting PRs. +Yes, there are occurrences of trailing spaces, extra newlines, empty indents, and other tiny errors. No, I don't want to merge, view, or get notified by your 1-line PR fixing it. If you're implementing a PR with modification of *actual code*, feel free to fix formatting in the general vicinity of your changes, but please don't waste everyone's time with pointless changes. ## Style Guidelines diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index 26dc1284e1..b300c01499 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -434,6 +434,10 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, return block.unloadable; } + public boolean canResupply(){ + return block.allowResupply; + } + public boolean payloadCheck(int conveyorRotation){ return block.rotate && (rotation + 2) % 4 == conveyorRotation; } diff --git a/core/src/mindustry/type/ammo/ItemAmmoType.java b/core/src/mindustry/type/ammo/ItemAmmoType.java index 6263209e75..dfa7871525 100644 --- a/core/src/mindustry/type/ammo/ItemAmmoType.java +++ b/core/src/mindustry/type/ammo/ItemAmmoType.java @@ -46,7 +46,7 @@ public class ItemAmmoType implements AmmoType{ float range = unit.hitSize + this.range; - Building build = Units.closestBuilding(unit.team, unit.x, unit.y, range, u -> u.block.allowResupply && u.items.has(item)); + Building build = Units.closestBuilding(unit.team, unit.x, unit.y, range, u -> u.canResupply() && u.items.has(item)); if(build != null){ Fx.itemTransfer.at(build.x, build.y, ammoPerItem / 2f, item.color, unit); diff --git a/core/src/mindustry/world/blocks/storage/Unloader.java b/core/src/mindustry/world/blocks/storage/Unloader.java index bf70385092..206d732efa 100644 --- a/core/src/mindustry/world/blocks/storage/Unloader.java +++ b/core/src/mindustry/world/blocks/storage/Unloader.java @@ -143,12 +143,18 @@ 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, and then by last use - possibleBlocks.sort(Structs.comps( - Structs.comparingBool(e -> e.building.block.highUnloadPriority), + possibleBlocks.sort( Structs.comps( - Structs.comparingFloat(e -> e.loadFactor), - Structs.comparingInt(e -> -lastUsed[e.index]) - ))); + Structs.comps( + Structs.comparingBool(e -> e.building.block.highUnloadPriority && !e.canLoad), + Structs.comparingBool(e -> e.canUnload && !e.canLoad) + ), + Structs.comps( + Structs.comparingFloat(e -> e.loadFactor), + Structs.comparingInt(e -> -lastUsed[e.index]) + ) + ) + ); ContainerStat dumpingFrom = null; ContainerStat dumpingTo = null; @@ -175,7 +181,7 @@ public class Unloader extends Block{ } //trade the items - if(dumpingFrom != null && dumpingTo != null && (dumpingFrom.loadFactor != dumpingTo.loadFactor || dumpingFrom.building.block.highUnloadPriority)){ + if(dumpingFrom != null && dumpingTo != null && (dumpingFrom.loadFactor != dumpingTo.loadFactor || !dumpingFrom.canLoad)){ dumpingTo.building.handleItem(this, item); dumpingFrom.building.removeStack(item, 1); lastUsed[dumpingFrom.index] = 0; diff --git a/servers_v6.json b/servers_v6.json index e2d74ea16b..c489682235 100644 --- a/servers_v6.json +++ b/servers_v6.json @@ -122,5 +122,9 @@ { "name": "Conservatory", "address": ["143.198.71.232"] + }, + { + "name": "Shard", + "address": ["shard.mcv.kr"] } ]