From 4a7774fe5a7b7dfb93fe87c258c5919310535f1d Mon Sep 17 00:00:00 2001 From: Matthew Peng <54301439+MEEPofFaith@users.noreply.github.com> Date: Mon, 15 Nov 2021 06:27:22 -0800 Subject: [PATCH 1/5] Dynamic resupply check (#6338) --- core/src/mindustry/entities/comp/BuildingComp.java | 4 ++++ core/src/mindustry/type/ammo/ItemAmmoType.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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); From f87cd9c643f82525132de9f9cb3908d6ef3a43b8 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 16 Nov 2021 23:36:13 -0500 Subject: [PATCH 2/5] Do not make formatting PRs. --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ee066f3db8..272e61ff80 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 occurences 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 From fd1678dbc9c61ad71c4008566c3f910e65916368 Mon Sep 17 00:00:00 2001 From: hortiSquash <45213805+hortiSquash@users.noreply.github.com> Date: Wed, 17 Nov 2021 15:35:36 +0100 Subject: [PATCH 3/5] Unloading into plast belts - bug fix (#6347) * hortiloaders hotfix randomness Improved the unloaders' balance with multiple blocks having the same load * deterministic lets go Co-Authored-By: citrusMarmelade <20476281+citrusMarmelade@users.noreply.github.com> * update contributors forgot to add them since they helped a lot for the previous commits/PRs * unloader - fix cant load Co-authored-by: citrusMarmelade <20476281+citrusMarmelade@users.noreply.github.com> --- .../world/blocks/storage/Unloader.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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; From 51626b6233b0034ad307426624ab1e6ecbeb7430 Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 17 Nov 2021 09:41:18 -0500 Subject: [PATCH 4/5] spelling --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 272e61ff80..ea0a1f6872 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,7 @@ If you are interested in adding a large mechanic/feature or changing large amoun 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 occurences 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. +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 From 731fd2900a461d0c56ff110bdd0f2ed34120875f Mon Sep 17 00:00:00 2001 From: devlaq <75433319+devlaq@users.noreply.github.com> Date: Fri, 19 Nov 2021 08:28:52 +0900 Subject: [PATCH 5/5] Update servers_v6.json (#6348) --- servers_v6.json | 4 ++++ 1 file changed, 4 insertions(+) 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"] } ]