mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-14 01:37:36 +07:00
Remove duplicate code between first & take
This commit is contained in:
@ -74,14 +74,14 @@ public class ItemModule extends BlockModule{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Item take(){
|
public Item take(){
|
||||||
for(int i = 0; i < items.length; i++){
|
Item took = first();
|
||||||
if(items[i] > 0){
|
|
||||||
items[i]--;
|
if(took != null){
|
||||||
|
items[first().id]--;
|
||||||
total--;
|
total--;
|
||||||
return content.item(i);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return null;
|
return took;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int get(Item item){
|
public int get(Item item){
|
||||||
|
Reference in New Issue
Block a user