Implemented various suggestions

- Pathfinding weighs walls more
- C disables all HUD
- Unloader doesn't store items
- Some bugfixes
This commit is contained in:
Anuken
2020-05-07 21:37:41 -04:00
parent 2ca7f553bb
commit 2b9d618bd2
16 changed files with 78 additions and 54 deletions

View File

@@ -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];
}