mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-04-27 16:00:51 -07:00
Remove duplicate code between first & take
This commit is contained in:
parent
89d143af8f
commit
61197fe974
1 changed files with 7 additions and 7 deletions
|
|
@ -74,14 +74,14 @@ public class ItemModule extends BlockModule{
|
|||
}
|
||||
|
||||
public Item take(){
|
||||
for(int i = 0; i < items.length; i++){
|
||||
if(items[i] > 0){
|
||||
items[i]--;
|
||||
total--;
|
||||
return content.item(i);
|
||||
}
|
||||
Item took = first();
|
||||
|
||||
if(took != null){
|
||||
items[first().id]--;
|
||||
total--;
|
||||
}
|
||||
return null;
|
||||
|
||||
return took;
|
||||
}
|
||||
|
||||
public int get(Item item){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue