From 85767d49467931d768572e096bc93c17d48af068 Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 2 Aug 2019 23:48:39 -0400 Subject: [PATCH] Improved drill item selection --- .../src/io/anuke/mindustry/world/blocks/production/Drill.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/io/anuke/mindustry/world/blocks/production/Drill.java b/core/src/io/anuke/mindustry/world/blocks/production/Drill.java index 089eb784c7..e28ca954b2 100644 --- a/core/src/io/anuke/mindustry/world/blocks/production/Drill.java +++ b/core/src/io/anuke/mindustry/world/blocks/production/Drill.java @@ -211,8 +211,10 @@ public class Drill extends Block{ } itemArray.sort((item1, item2) -> { - int type = Boolean.compare(item1.type == ItemType.material, item2.type == ItemType.material); + int type = Boolean.compare(item1 != Items.sand, item2 != Items.sand); if(type != 0) return type; + int amounts = Integer.compare(oreCount.get(item1, 0), oreCount.get(item2, 0)); + if(amounts != 0) return amounts; return Integer.compare(item1.id, item2.id); });