This commit is contained in:
Anuken
2020-11-12 09:41:49 -05:00
parent b1b84fe380
commit e847a74a25
4 changed files with 15 additions and 2 deletions

View File

@@ -295,7 +295,6 @@ public class UnitTypes implements ContentList{
backColor = Pal.heal;
frontColor = Color.white;
}};
shootSound = Sounds.pew;
}});
}};

View File

@@ -71,6 +71,8 @@ public class Unloader extends Block{
other.items.remove(item, 1);
}
other.itemTaken(item);
}else if(sortItem == null){
other.items.failTake();
}
}
}

View File

@@ -224,6 +224,18 @@ public class ItemModule extends BlockModule{
takeRotation = item.id + 1;
}
public void failTake(){
for(int i = 1; i < items.length; i++){
int index = (i + takeRotation);
if(index >= items.length) index -= items.length;
if(items[index] > 0){
takeRotation += i;
takeRotation %= items.length;
return;
}
}
}
public int get(int id){
return items[id];
}