Avoid assigning new object?
This commit is contained in:
@@ -74,14 +74,13 @@ public class ItemModule extends BlockModule{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Item take(){
|
public Item take(){
|
||||||
Item took = first();
|
if(first() == null) return null;
|
||||||
|
|
||||||
if(took != null){
|
int id = first().id;
|
||||||
items[first().id]--;
|
items[id]--;
|
||||||
total--;
|
total--;
|
||||||
}
|
|
||||||
|
|
||||||
return took;
|
return content.item(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int get(Item item){
|
public int get(Item item){
|
||||||
|
|||||||
Reference in New Issue
Block a user