From e847a74a25112437bc30d68db67fb51a3d1ee200 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 12 Nov 2020 09:41:49 -0500 Subject: [PATCH] Fixed #3362 --- core/src/mindustry/content/UnitTypes.java | 1 - .../src/mindustry/world/blocks/storage/Unloader.java | 2 ++ core/src/mindustry/world/modules/ItemModule.java | 12 ++++++++++++ gradle.properties | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index e3129d3ad8..0decd0539a 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -295,7 +295,6 @@ public class UnitTypes implements ContentList{ backColor = Pal.heal; frontColor = Color.white; }}; - shootSound = Sounds.pew; }}); }}; diff --git a/core/src/mindustry/world/blocks/storage/Unloader.java b/core/src/mindustry/world/blocks/storage/Unloader.java index dcc94ef099..267d9925d7 100644 --- a/core/src/mindustry/world/blocks/storage/Unloader.java +++ b/core/src/mindustry/world/blocks/storage/Unloader.java @@ -71,6 +71,8 @@ public class Unloader extends Block{ other.items.remove(item, 1); } other.itemTaken(item); + }else if(sortItem == null){ + other.items.failTake(); } } } diff --git a/core/src/mindustry/world/modules/ItemModule.java b/core/src/mindustry/world/modules/ItemModule.java index 03ff5d5bb3..0e4a3f96a1 100644 --- a/core/src/mindustry/world/modules/ItemModule.java +++ b/core/src/mindustry/world/modules/ItemModule.java @@ -224,6 +224,18 @@ public class ItemModule extends BlockModule{ takeRotation = item.id + 1; } + public void failTake(){ + for(int i = 1; i < items.length; i++){ + int index = (i + takeRotation); + if(index >= items.length) index -= items.length; + if(items[index] > 0){ + takeRotation += i; + takeRotation %= items.length; + return; + } + } + } + public int get(int id){ return items[id]; } diff --git a/gradle.properties b/gradle.properties index ee126bcf75..a61ef4409c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=a6f488d6f741b98d123113ceb26439032be0719e +archash=f7fcd4a78e01b1ad41e1bc57c25a78d12c51ec54