Improved replacement system

This commit is contained in:
Anuken
2020-10-02 11:14:18 -04:00
parent 138434d029
commit a3224b7082
13 changed files with 123 additions and 14 deletions

View File

@@ -180,6 +180,7 @@ public class ItemModule extends BlockModule{
return total > 0;
}
@Nullable
public Item first(){
for(int i = 0; i < items.length; i++){
if(items[i] > 0){
@@ -189,6 +190,7 @@ public class ItemModule extends BlockModule{
return null;
}
@Nullable
public Item take(){
for(int i = 0; i < items.length; i++){
int index = (i + takeRotation);
@@ -204,6 +206,7 @@ public class ItemModule extends BlockModule{
}
/** Begins a speculative take operation. This returns the item that would be returned by #take(), but does not change state. */
@Nullable
public Item beginTake(){
for(int i = 0; i < items.length; i++){
int index = (i + takeRotation);