Implemented various suggestions
- Pathfinding weighs walls more - C disables all HUD - Unloader doesn't store items - Some bugfixes
This commit is contained in:
@@ -160,6 +160,25 @@ public class ItemModule extends BlockModule{
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Begins a speculative take operation. This returns the item that would be returned by #take(), but does not change state. */
|
||||
public Item beginTake(){
|
||||
for(int i = 0; i < items.length; i++){
|
||||
int index = (i + takeRotation);
|
||||
if(index >= items.length) index -= items.length;
|
||||
if(items[index] > 0){
|
||||
return content.item(index);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Finishes a take operation. Updates take state, removes the item. */
|
||||
public void endTake(Item item){
|
||||
items[item.id] --;
|
||||
total --;
|
||||
takeRotation = item.id + 1;
|
||||
}
|
||||
|
||||
public int get(int id){
|
||||
return items[id];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user